private void btnMaintainMaliceUser_Click(object sender, RoutedEventArgs e) { if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Customer_MaintainMaliceUser)) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResCustomerBasicInfo.rightMsg_NoRight_MaintainMaliceUser); return; } CustomerBasicVM vm = this.DataContext as CustomerBasicVM; bool flag = ValidationManager.Validate(this.gridBadCustomer); string path = txtMemo.GetBindingExpression(TextBox.TextProperty).ParentBinding.Path.Path; var error = vm.ValidationErrors.FirstOrDefault(p => p.MemberNames.Contains(path)); if (error == null && vm.ValidationErrors.Count > 0) { vm.ValidationErrors.Clear(); } if (flag) { new CustomerFacade().MaintainMaliceUser(vm, (obj, args) => { if (args.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Refresh(); CPApplication.Current.CurrentPage.Context.Window.Alert(ResCustomerMaintain.Info_SaveSuccessfully); }); } }
public void CancelConfrimPhone(CustomerBasicVM vm, EventHandler <RestClientEventArgs <CustomerBasicInfo> > callback) { string relativeUrl = "/CustomerService/Customer/CancelConfirmPhone"; CustomerBasicInfo msg = vm.ConvertVM <CustomerBasicVM, CustomerBasicInfo>(); CustomerInfo customer = new CustomerInfo(); customer.BasicInfo = msg; customer.CompanyCode = CPApplication.Current.CompanyCode; restClient.Update <CustomerBasicInfo>(relativeUrl, customer, callback); }
private void btnViewRecommendedUser_Click(object sender, RoutedEventArgs e) { if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Customer_CommendInfo)) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResCustomerDetailInfo.Msg_NoRights_View); return; } CustomerBasicVM vm = this.DataContext as CustomerBasicVM; string url = string.Format(ConstValue.CustomerMaintainUrlFormat, vm.RecommendedByCustomerSysNo); CPApplication.Current.CurrentPage.Context.Window.Navigate(url, null, true); }
public void MaintainMaliceUser(CustomerBasicVM vm, EventHandler <RestClientEventArgs <CustomerInfo> > callback) { string relativeUrl = "/CustomerService/Customer/MaintainMaliceUser"; CustomerInfo msg = new CustomerInfo(); msg.SysNo = vm.CustomerSysNo; msg.IsBadCustomer = vm.IsBadCustomer; msg.OperateLog = new CustomerOperateLog(); msg.OperateLog.Memo = vm.BadCustomerMemo; msg.OperateLog.CustomerSysNo = vm.CustomerSysNo; restClient.Update <CustomerInfo>(relativeUrl, msg, callback); }
private void btnCancelConfirmPhone_Click(object sender, RoutedEventArgs e) { if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Customer_CancelConfirmPhone)) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResCustomerMaintain.rightMsg_NoRight_CancelConfirmPhone); return; } CustomerBasicVM basicVM = this.ucBasicInfo.DataContext as CustomerBasicVM; facade.CancelConfrimPhone(basicVM, (obj, args) => { if (args.FaultsHandle()) { return; } basicVM.CellPhoneConfirmed = false; this.btnCancelConfirmPhone.IsEnabled = false; this.ucDetailInfo.txt_cellphone.IsEnabled = true; Window.Alert(ResCustomerMaintain.Info_CancelConfirm); }); }
private void btnVoid_Click(object sender, RoutedEventArgs e) { if (!AuthMgr.HasFunctionPoint(AuthKeyConst.Customer_Abandon)) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResCustomerMaintain.rightMsg_NoRight_Abandon); return; } CustomerBasicVM basicVM = this.ucBasicInfo.DataContext as CustomerBasicVM; facade.VoidCustomer(basicVM, (obj, args) => { if (args.FaultsHandle()) { return; } basicVM.Status = CustomerStatus.InValid; Window.Alert(ResCustomerMaintain.Info_VoidSuccessfully); }); }