public void Create(WMS_M104_Packing_Hd WMS_M104_Packing_Hd) { WMS_M104_Packing_Hd.CreateDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; WMS_M104_Packing_Hd.CreateUser = tempUser.UserName; WMS_M104_Packing_Hd.Validate(); this.WMS_M104_Packing_HdRepository.Add(WMS_M104_Packing_Hd); this.runtimeService.Commit(); }
public void Update(WMS_M104_Packing_Hd WMS_M104_Packing_Hd) { WMS_M104_Packing_Hd.ModifyDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; WMS_M104_Packing_Hd.ModifyUser = tempUser.UserName; WMS_M104_Packing_Hd.Validate(); var existstb_Sys_Menu = this.GetById(WMS_M104_Packing_Hd.Id); this.WMS_M104_Packing_HdRepository.SetValues(WMS_M104_Packing_Hd, existstb_Sys_Menu); this.runtimeService.Commit(); }
public void Save(WMS_M104_Packing_Hd instore, List <WMS_M104_Packing_Detail> instoreDetailList) { //if (instore.BeforeAmount < instore.ActualAmount) // throw new AppException("实际入库数不能大于计划入库数"); tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; var existslotTx = this.GetById(instore.Id); if (existslotTx == null) { instore.CreateDt = DateTime.Now; instore.CreateUser = tempUser.UserName; instore.Validate(); this.WMS_M104_Packing_HdRepository.Add(instore); } else { instore.ModifyDt = DateTime.Now; instore.ModifyUser = tempUser.UserName; instore.Validate(); this.WMS_M104_Packing_HdRepository.SetValues(instore, existslotTx); } if (instoreDetailList != null) { foreach (var detail in instoreDetailList) { var existstLotTxNG = this.packingDetailRepository.GetByID(detail.Id); if (existstLotTxNG == null) { detail.Validate(); this.packingDetailRepository.Add(detail); } else { this.packingDetailRepository.SetValues(detail, existstLotTxNG); } } } this.runtimeService.Commit(); }