tijian_jichuang/Code/SOH.BLL.Host/ts_ddxmbBll.cs
2025-02-20 11:54:48 +08:00

52 lines
1.6 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EAS.Services;
using SOH.Entities;
using EAS.Data.Access;
using EAS.Data.Linq;
using SOH.Data;
namespace SOH.BLL
{
[ServiceObject("人员管理模块")]
[ServiceBind(typeof(Its_ddxmb))]
public class ts_ddxmbBll : Its_ddxmb
{
public Data.OperationResult Saveddxb(List<Entities.t_zhxm> al,int ddfzbm)
{
OperationResult or = new OperationResult();
using (DbEntities db = new DbEntities())
{
using (EAS.Data.Access.DbTransaction tan = db.DataAccessor.CreateTransaction())
{
try
{
db.ts_ddxmbs.Delete(t => t.ddfzbm == ddfzbm);
foreach (t_zhxm b in al)
{
ts_ddxmb b1 = new ts_ddxmb();
b1.ddfzbm = ddfzbm;
b1.zhbm = b.zhbm;
b1.upflag = 1;
db.ts_ddxmbs.Insert(b1);
tan.Commit();
or.Message = "分组项目设置成功!";
or.State = 1;
}
}
catch(Exception e)
{
or.Message = "设置失败!请联系管理员!" + e.Message;
or.State = 2;
}
}
return or;
}
}
}
}