Exemplo n.º 1
0
        public void Create(DEV_D001_Device DEV_D001_Device)
        {
            DEV_D001_Device.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            DEV_D001_Device.CreateUser = tempUser.UserName;
            DEV_D001_Device.Validate();
            this.DEV_D001_DeviceRepository.Add(DEV_D001_Device);
            this.runtimeService.Commit();
        }
Exemplo n.º 2
0
        public void Update(DEV_D001_Device DEV_D001_Device)
        {
            DEV_D001_Device.ModifyDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            DEV_D001_Device.ModifyUser = tempUser.UserName;
            DEV_D001_Device.Validate();
            var existstb_Sys_Menu = this.GetById(DEV_D001_Device.Id);

            this.DEV_D001_DeviceRepository.SetValues(DEV_D001_Device, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }
Exemplo n.º 3
0
        public void Save(DEV_D001_Device device, List <DEV_D001_Device_File> devFileList, List <DEV_D001_Device_Appurten> devAppList)
        {
            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.DEV_D001_DeviceRepository.Add(device);
            }
            else
            {
                device.ModifyDt   = DateTime.Now;
                device.ModifyUser = tempUser.UserName;
                device.Validate();
                this.DEV_D001_DeviceRepository.SetValues(device, existsdevice);
            }
            if (devFileList != null)
            {
                foreach (var file in devFileList)
                {
                    var existstfile = this.devFileRepository.GetByID(file.Id);
                    if (existstfile == null)
                    {
                        file.CompCode = tempUser.CompCode;
                        this.devFileRepository.Add(file);
                    }
                    else
                    {
                        this.devFileRepository.SetValues(file, existstfile);
                    }
                }
            }
            if (devAppList != null)
            {
                foreach (var app in devAppList)
                {
                    var existstapp = this.appurtenrepository.GetByID(app.Id);
                    if (existstapp == null)
                    {
                        this.appurtenrepository.Add(app);
                    }
                    else
                    {
                        this.appurtenrepository.SetValues(app, existstapp);
                    }
                }
            }
            this.runtimeService.Commit();
        }
Exemplo n.º 4
0
        private void EditForm(string formText, string btnCommand)
        {
            DEV_D001_Device temp = dEVD001DeviceBindingSource.Current as DEV_D001_Device;
            DeviceEditForm  edit = new DeviceEditForm(temp);

            edit.Text = formText;
            edit.Tag  = btnCommand;

            if (edit.ShowDialog() != DialogResult.OK)
            {
                dEVD001DeviceBindingSource.CancelEdit();
            }
        }
Exemplo n.º 5
0
 public override void OnBtnCommand(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     // MessageBox.Show(e.Item.Caption);
     //新增
     if (e.Item.Caption == BtnCommandEnum.Add)
     {
         dEVD001DeviceBindingSource.AddNew();
         DEV_D001_Device temp = dEVD001DeviceBindingSource.Current as DEV_D001_Device;
         EditForm("产品资料新增", BtnCommandEnum.Add);
     }
     else if (e.Item.Caption == BtnCommandEnum.Edit)
     {
         EditForm("产品资料修改", BtnCommandEnum.Edit);
     }
     else if (e.Item.Caption == BtnCommandEnum.Delete)
     {
         if (ERPHelper.Instance.MessageDel())
         {
             DEV_D001_Device temp = dEVD001DeviceBindingSource.Current as DEV_D001_Device;
             devService.Delete(temp.Id);
             dEVD001DeviceBindingSource.RemoveCurrent();
         }
     }
 }
Exemplo n.º 6
0
 public DeviceEditForm(DEV_D001_Device tempData)
 {
     InitializeComponent();
     this.tempData = tempData;
 }