Beispiel #1
0
        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();
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
        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();
            }
        }
Beispiel #4
0
 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();
         }
     }
 }
Beispiel #5
0
 public CustomerEditForm(ERP_C003_Customer tempData)
 {
     InitializeComponent();
     //this.customerService = customerService;
     eRPC003CustomerBindingSource.DataSource = tempData;
 }