163 lines
4.6 KiB
C#
163 lines
4.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using EAS.Services;
|
|
using SOH.Entities;
|
|
using SOH.Data;
|
|
|
|
namespace SOH.BLL
|
|
{
|
|
[ServiceObject("诊断描述维护")]
|
|
[ServiceBind(typeof(It_kszdjg))]
|
|
public class t_kszdjg : It_kszdjg
|
|
{
|
|
|
|
public List<Entities.t_kszdjg> GetzdjgByjcxmID(int jcxmid)
|
|
{
|
|
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
return db.t_kszdjgs.Where(t => t.jcxmbm == jcxmid).OrderBy(t => t.xssx).ToList();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<Entities.t_kszdjg> GetzdjgByKs(int ksbm)
|
|
{
|
|
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
return db.t_kszdjgs.Where(t => t.ksbm == ksbm).OrderBy(t => t.xssx).ToList();
|
|
}
|
|
}
|
|
|
|
public String GetzdjgStrByKs(int jcxmbm)
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
var data = db.t_kszdjgs.Where(t => t.jcxmbm == jcxmbm).OrderBy(t => t.xssx).Select(t => new
|
|
{
|
|
jcjg = t.zdjg
|
|
});
|
|
return Newtonsoft.Json.JsonConvert.SerializeObject(data);
|
|
}
|
|
}
|
|
|
|
public Data.OperationResult Update(Entities.t_kszdjg jg)
|
|
{
|
|
OperationResult or = new OperationResult();
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
try
|
|
{
|
|
db.t_kszdjgs.OrmAccessor.Update(jg);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
or.Message = ex.ToString();
|
|
}
|
|
}
|
|
or.State = 1;
|
|
or.Message = "更新成功!";
|
|
or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(jg);
|
|
return or;
|
|
|
|
}
|
|
|
|
|
|
public OperationResult Insert(Entities.t_kszdjg jg)
|
|
{
|
|
OperationResult or = new OperationResult();
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
try
|
|
{
|
|
db.t_kszdjgs.OrmAccessor.Insert(jg);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
or.Message = ex.ToString();
|
|
}
|
|
}
|
|
or.State = 1;
|
|
or.Message = "添加成功!";
|
|
or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(jg);
|
|
return or;
|
|
}
|
|
public OperationResult Del(Entities.t_kszdjg jg)
|
|
{
|
|
OperationResult or = new OperationResult();
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
try
|
|
{
|
|
db.t_kszdjgs.OrmAccessor.Delete(jg);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
or.Message = ex.ToString();
|
|
}
|
|
}
|
|
or.State = 1;
|
|
or.Message = "删除成功!";
|
|
or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(jg);
|
|
return or;
|
|
}
|
|
|
|
|
|
public List<Entities.t_kszdjg> GetzdjgByjbbm(int jbbm)
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
return db.t_kszdjgs.Where(t => t.jbbm == jbbm).OrderBy(t => t.xssx).ToList();
|
|
}
|
|
}
|
|
|
|
public List<Entities.FamiliarDiagnose> GetzdjgByjbbmNew(int jbbm)
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
return db.FamiliarDiagnoses.Where(t => t.R1 == jbbm).ToList();
|
|
}
|
|
}
|
|
|
|
|
|
public OperationResult Updatejbbm(List<Entities.t_kszdjg> al, int jbbm)
|
|
{
|
|
OperationResult or = new OperationResult();
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
foreach (Entities.t_kszdjg d in al)
|
|
{
|
|
d.jbbm = jbbm;
|
|
db.t_kszdjgs.OrmAccessor.Update(d);
|
|
}
|
|
or.State = 1;
|
|
or.Message = "更新成功!";
|
|
}
|
|
return or;
|
|
}
|
|
|
|
public OperationResult UpdatejbbmByNewJB(List<Entities.FamiliarDiagnose> fld, int jbbm)
|
|
{
|
|
OperationResult or = new OperationResult();
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
foreach (Entities.FamiliarDiagnose d in fld)
|
|
{
|
|
d.R1 = jbbm;
|
|
db.FamiliarDiagnoses.OrmAccessor.Update(d);
|
|
}
|
|
or.State = 1;
|
|
or.Message = "更新成功!";
|
|
}
|
|
return or;
|
|
}
|
|
|
|
|
|
}
|
|
}
|