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(); } } }
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(); }
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(); }
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(); } }
public AreaEditForm(WMS_C102_Area tempData) { InitializeComponent(); this.wMSC102AreaBindingSource.DataSource = tempData; }