/// <summary> /// 添加订单拦截设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, RoutedEventArgs e) { m_SOInterceptInfoVM = gdAddSOIntercept.DataContext as SOInterceptInfoVM; if (string.IsNullOrEmpty(m_SOInterceptInfoVM.ShippingTypeID) || string.IsNullOrEmpty(m_SOInterceptInfoVM.StockSysNo) || string.IsNullOrEmpty(m_SOInterceptInfoVM.HasTrackingNumber) || string.IsNullOrEmpty(m_SOInterceptInfoVM.ShipTimeType) || string.IsNullOrEmpty(m_SOInterceptInfoVM.EmailAddress) || string.IsNullOrEmpty(m_SOInterceptInfoVM.CCEmailAddress) || string.IsNullOrEmpty(m_SOInterceptInfoVM.FinanceEmailAddress) || string.IsNullOrEmpty(m_SOInterceptInfoVM.FinanceCCEmailAddress) ) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResSOIntercept.Info_SaveSOIntercept_Input_Error, MessageType.Error); } else { ValidationManager.Validate(this.gdAddSOIntercept); if (m_SOInterceptInfoVM.HasValidationErrors && m_SOInterceptInfoVM.ValidationErrors.Count > 0) { return; } m_SOInterceptInfoVM.ShipTypeSysNo = Convert.ToInt32(m_SOInterceptInfoVM.ShippingTypeID); SOInterceptInfo req = m_SOInterceptInfoVM.ConvertVM <SOInterceptInfoVM, SOInterceptInfo>(); new SOInterceptFacade(CPApplication.Current.CurrentPage).AddSOInterceptInfo(req, (obj, args) => { if (!args.FaultsHandle()) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResSOIntercept.Info_AddSOIntercept_Success, MessageType.Information); CloseDialog(new ResultEventArgs { DialogResult = DialogResultType.OK }); } }); } }
/// <summary> /// 批量修改订单拦截设置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnBatchUpdate_Click(object sender, RoutedEventArgs e) { m_SOInterceptInfoVM = gdUpdateSOIntercept.DataContext as SOInterceptInfoVM; CurrentSOInterceptInfoVM.Sysnolist = SysNoList; if (string.IsNullOrEmpty(m_SOInterceptInfoVM.EmailAddress) || string.IsNullOrEmpty(m_SOInterceptInfoVM.CCEmailAddress) || string.IsNullOrEmpty(m_SOInterceptInfoVM.FinanceEmailAddress) || string.IsNullOrEmpty(m_SOInterceptInfoVM.FinanceCCEmailAddress) ) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResSOIntercept.Info_SaveSOIntercept_Input_Error, MessageType.Error); } else { ValidationManager.Validate(this.gdUpdateSOIntercept); if (m_SOInterceptInfoVM.HasValidationErrors && m_SOInterceptInfoVM.ValidationErrors.Count > 0) { return; } if (string.IsNullOrEmpty(CurrentSOInterceptInfoVM.Sysnolist)) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResSOIntercept.Info_SOIntercept_UpdateError_NoData, MessageType.Error); } SOInterceptInfo req = m_SOInterceptInfoVM.ConvertVM <SOInterceptInfoVM, SOInterceptInfo>(); new SOInterceptFacade().BatchUpdateSOInterceptInfo(req, (obj, args) => { if (!args.FaultsHandle()) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResSOIntercept.Info_BatchUpdateSOIntercept_Success, MessageType.Information); CloseDialog(new ResultEventArgs { DialogResult = DialogResultType.OK }); } }); } }