public void Create(MES_M802_Packing_Hd MES_M802_Packing_Hd) { MES_M802_Packing_Hd.CreateDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; MES_M802_Packing_Hd.CreateUser = tempUser.UserName; MES_M802_Packing_Hd.Validate(); this.MES_M802_Packing_HdRepository.Add(MES_M802_Packing_Hd); this.runtimeService.Commit(); }
public void Update(MES_M802_Packing_Hd MES_M802_Packing_Hd) { MES_M802_Packing_Hd.ModifyDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; MES_M802_Packing_Hd.ModifyUser = tempUser.UserName; MES_M802_Packing_Hd.Validate(); var existstb_Sys_Menu = this.GetById(MES_M802_Packing_Hd.Id); this.MES_M802_Packing_HdRepository.SetValues(MES_M802_Packing_Hd, existstb_Sys_Menu); this.runtimeService.Commit(); }
public void Save(MES_M802_Packing_Hd packingHd, List <MES_M802_Packing_Dtl> packingDtlLst) { packingHd.CreateDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; packingHd.CreateUser = tempUser.UserName; packingHd.CompCode = tempUser.CompCode; packingHd.Validate(); this.MES_M802_Packing_HdRepository.Add(packingHd); foreach (var packingDtl in packingDtlLst) { packingDtl.CreateDt = DateTime.Now; packingDtl.CreateUser = tempUser.UserName; packingDtl.CompCode = tempUser.CompCode; packingDtl.Validate(); this.packingDtlRepository.Add(packingDtl); } this.runtimeService.Commit(); }