70 lines
2.0 KiB
C#
70 lines
2.0 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_ddfzb))]
|
|
public class ts_ddfzbBll : Its_ddfzb
|
|
{
|
|
|
|
public IList<Entities.ts_ddfzb> GetddfzbByddbm(int ddbm)
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
return db.ts_ddfzbs.Where(t => t.ddbm == ddbm).ToList();
|
|
}
|
|
}
|
|
|
|
|
|
public Data.OperationResult Updatedd(ts_ddfzb o)
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
db.ts_ddfzbs.OrmAccessor.Update(o);
|
|
}
|
|
OperationResult or = new OperationResult();
|
|
or.State = 1;
|
|
or.Message = "修改成功";
|
|
or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(o);
|
|
return or;
|
|
}
|
|
|
|
public Data.OperationResult Insertdd(ts_ddfzb o)
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
db.ts_ddfzbs.OrmAccessor.Insert(o);
|
|
}
|
|
OperationResult or = new OperationResult();
|
|
or.State = 1;
|
|
or.Message = "添加成功";
|
|
or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(o);
|
|
return or;
|
|
}
|
|
|
|
public Data.OperationResult Deldd(ts_ddfzb o)
|
|
{
|
|
using (DbEntities db = new DbEntities())
|
|
{
|
|
db.ts_ddfzbs.OrmAccessor.Delete(o);
|
|
List<ts_ddxmb> al = db.ts_ddxmbs.Where(t => t.ddfzbm == o.ddfzbm).ToList();
|
|
foreach (ts_ddxmb d in al)
|
|
{
|
|
db.ts_ddxmbs.OrmAccessor.Delete(d);
|
|
}
|
|
}
|
|
OperationResult or = new OperationResult();
|
|
or.State = 1;
|
|
or.Message = "删除成功";
|
|
or.Tag = Newtonsoft.Json.JsonConvert.SerializeObject(o);
|
|
return or;
|
|
}
|
|
}
|
|
}
|