public void Create(ESOP_Device ESOP_Device) { ESOP_Device.CreateDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; ESOP_Device.CreateUser = tempUser.UserName; ESOP_Device.Validate(); this.ESOP_DeviceRepository.Add(ESOP_Device); this.runtimeService.Commit(); }
public void Update(ESOP_Device ESOP_Device) { ESOP_Device.ModifyDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; ESOP_Device.ModifyUser = tempUser.UserName; ESOP_Device.Validate(); var existstb_Sys_Menu = this.GetById(ESOP_Device.Id); this.ESOP_DeviceRepository.SetValues(ESOP_Device, existstb_Sys_Menu); this.runtimeService.Commit(); }
public void Save(ESOP_Device device) { tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; var existsdevice = this.GetById(device.Id); if (existsdevice == null) { device.CompCode = tempUser.CompCode; device.CreateDt = DateTime.Now; device.CreateUser = tempUser.UserName; device.Validate(); this.ESOP_DeviceRepository.Add(device); } else { device.ModifyDt = DateTime.Now; device.ModifyUser = tempUser.UserName; device.Validate(); this.ESOP_DeviceRepository.SetValues(device, existsdevice); } this.runtimeService.Commit(); }