示例#1
0
        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();
        }
示例#2
0
        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();
        }
示例#3
0
        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();
        }