public void Create(ERP_C003_Customer ERP_C003_Customer) { ERP_C003_Customer.CreateDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; ERP_C003_Customer.CreateUser = tempUser.UserName; ERP_C003_Customer.CompCode = tempUser.CompCode; ERP_C003_Customer.Validate(); this.ERP_C003_CustomerRepository.Add(ERP_C003_Customer); this.runtimeService.Commit(); }
public void Update(ERP_C003_Customer ERP_C003_Customer) { ERP_C003_Customer.ModifyDt = DateTime.Now; tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User; ERP_C003_Customer.ModifyUser = tempUser.UserName; ERP_C003_Customer.Validate(); var existstb_Sys_Menu = this.GetById(ERP_C003_Customer.Id); this.ERP_C003_CustomerRepository.SetValues(ERP_C003_Customer, existstb_Sys_Menu); this.runtimeService.Commit(); }
private void OpenForm(string formText, string btnCommand) { ERP_C003_Customer temp = eRPC003CustomerBindingSource.Current as ERP_C003_Customer; CustomerEditForm edit = new CustomerEditForm(temp); edit.Text = formText; edit.Tag = btnCommand; if (edit.ShowDialog() != DialogResult.OK) { eRPC003CustomerBindingSource.CancelEdit(); InitData(); } }
public override void OnBtnCommand(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (e.Item.Caption == BtnCommandEnum.Add) { eRPC003CustomerBindingSource.AddNew(); OpenForm("客户资料新增", BtnCommandEnum.Add); } else if (e.Item.Caption == BtnCommandEnum.Edit) { OpenForm("客户资料修改", BtnCommandEnum.Edit); } else if (e.Item.Caption == BtnCommandEnum.Delete) { if (ERPHelper.Instance.MessageDel()) { ERP_C003_Customer temp = eRPC003CustomerBindingSource.Current as ERP_C003_Customer; customerService.Delete(temp.Id); //eRPC003CustomerBindingSource.RemoveCurrent(); } } }
public CustomerEditForm(ERP_C003_Customer tempData) { InitializeComponent(); //this.customerService = customerService; eRPC003CustomerBindingSource.DataSource = tempData; }