SGGL_JT/SUBQHSE/BLL/Customization/HSSE/Check/SafePersonWagesService.cs

73 lines
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
namespace BLL
{
public class SafePersonWagesService
{
public static Model.SUBQHSEDB db = Funs.DB;
/// <summary>
/// 添加
/// </summary>
/// <param name="model"></param>
public static void Add(Model.SafePersonWages model)
{
using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString))
{
Model.SafePersonWages newModel = new Model.SafePersonWages();
newModel.SafePersonWagesId = model.SafePersonWagesId;
newModel.SafetyOfficerCheckPersonId = model.SafetyOfficerCheckPersonId;
newModel.PayableAmount = model.PayableAmount;
newModel.PaidAmount = model.PaidAmount;
newModel.CheckDate = model.CheckDate;
newModel.CheckMan = model.CheckMan;
newModel.Remark = model.Remark;
db.SafePersonWages.InsertOnSubmit(newModel);
db.SubmitChanges();
}
}
/// <summary>
/// 修改
/// </summary>
/// <param name="model"></param>
public static void Update(Model.SafePersonWages model)
{
using (var db = new Model.SUBQHSEDB(Funs.ConnString))
{
Model.SafePersonWages newModel = db.SafePersonWages.First(e => e.SafePersonWagesId == model.SafePersonWagesId);
newModel.SafetyOfficerCheckPersonId = model.SafetyOfficerCheckPersonId;
newModel.PayableAmount = model.PayableAmount;
newModel.PaidAmount = model.PaidAmount;
newModel.CheckDate = model.CheckDate;
newModel.CheckMan = model.CheckMan;
newModel.Remark = model.Remark;
db.SubmitChanges();
}
}
/// <summary>
/// 删除
/// </summary>
/// <param name="modelId">主键ID</param>
public static void Delete(string modelId)
{
using (var db = new Model.SUBQHSEDB(Funs.ConnString))
{
Model.SafePersonWages newModel = db.SafePersonWages.First(e => e.SafePersonWagesId == modelId);
db.SafePersonWages.DeleteOnSubmit(newModel);
db.SubmitChanges();
}
}
}
}