68 lines
1.8 KiB
C#
68 lines
1.8 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(Its_khlxr))]
|
|
public class ts_khlxrBll : Its_khlxr
|
|
{
|
|
|
|
public List<Entities.ts_khlxr> GetlxrBykhbm(int khbm)
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
return db.ts_khlxrs.Where(t => t.khbm == khbm).ToList();
|
|
}
|
|
}
|
|
public List<ts_khlxr> GetlxrBylxrbm(int lxrbm)
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
return db.ts_khlxrs.Where(t => t.lxrbm == lxrbm).ToList();
|
|
}
|
|
}
|
|
|
|
public Data.OperationResult Insert(Entities.ts_khlxr lxr)
|
|
{
|
|
OperationResult or = new OperationResult();
|
|
try
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
db.ts_khlxrs.OrmAccessor.Insert(lxr);
|
|
}
|
|
|
|
or.State = 1;
|
|
or.Message = "添加成功";
|
|
//or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(lxr);
|
|
return or;
|
|
}
|
|
catch
|
|
{
|
|
or.State = 2;
|
|
or.Message = "添加失败";
|
|
return or;
|
|
}
|
|
}
|
|
|
|
public Data.OperationResult Update(Entities.ts_khlxr lxr)
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
db.ts_khlxrs.OrmAccessor.Update(lxr);
|
|
}
|
|
OperationResult or = new OperationResult();
|
|
or.State = 1;
|
|
or.Message = "修改成功";
|
|
//or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(lxr);
|
|
return or;
|
|
}
|
|
}
|
|
}
|