コード例 #1
0
 public override void OnBtnCommand(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     // MessageBox.Show(e.Item.Caption);
     //新增
     if (e.Item.Caption == BtnCommandEnum.Add)
     {
         wMSC102AreaBindingSource.AddNew();
         WMS_C102_Area temp = wMSC102AreaBindingSource.Current as WMS_C102_Area;
         temp.State = "在用";
         EditForm("基础代号新增", BtnCommandEnum.Add);
     }
     else if (e.Item.Caption == BtnCommandEnum.Edit)
     {
         EditForm("基础代号修改", BtnCommandEnum.Edit);
     }
     else if (e.Item.Caption == BtnCommandEnum.Delete)
     {
         if (ERPHelper.Instance.MessageDel())
         {
             var temp = wMSC102AreaBindingSource.Current as WMS_C102_Area;
             areaService.Delete(temp.Id);
             wMSC102AreaBindingSource.RemoveCurrent();
         }
     }
 }
コード例 #2
0
ファイル: WMS_C102_Area.cs プロジェクト: windygu/KQERP
        public void Create(WMS_C102_Area WMS_C102_Area)
        {
            WMS_C102_Area.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            WMS_C102_Area.CreateUser = tempUser.UserName;
            WMS_C102_Area.Validate();
            this.WMS_C102_AreaRepository.Add(WMS_C102_Area);
            this.runtimeService.Commit();
        }
コード例 #3
0
ファイル: WMS_C102_Area.cs プロジェクト: windygu/KQERP
        public void Update(WMS_C102_Area WMS_C102_Area)
        {
            WMS_C102_Area.ModifyDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

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

            this.WMS_C102_AreaRepository.SetValues(WMS_C102_Area, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }
コード例 #4
0
        private void EditForm(string formText, string btnCommand)
        {
            WMS_C102_Area temp = wMSC102AreaBindingSource.Current as WMS_C102_Area;
            AreaEditForm  edit = new AreaEditForm(temp);

            edit.Text = formText;
            edit.Tag  = btnCommand;
            if (edit.ShowDialog() != DialogResult.OK)
            {
                wMSC102AreaBindingSource.CancelEdit();
            }
        }
コード例 #5
0
        public AreaEditForm(WMS_C102_Area tempData)
        {
            InitializeComponent();

            this.wMSC102AreaBindingSource.DataSource = tempData;
        }