/// <summary> /// 更新 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnUpdate_Click(object sender, RoutedEventArgs e) { List <SOWHUpdateInfoVM> selectList = GetCheckStockList(this.dgQueryResult.ItemsSource as List <SOWHUpdateInfoVM>); if (selectList != null) { List <SOWHUpdateInfo> soWHUpdateInfoList = new List <SOWHUpdateInfo>(); foreach (var item in selectList) { item.CompanyCode = CPApplication.Current.CompanyCode; soWHUpdateInfoList.Add(item.ConvertVM <SOWHUpdateInfoVM, SOWHUpdateInfo>()); } SOQueryFacade soQueryFacade = new SOQueryFacade(this); soQueryFacade.QuerySOInfo(Convert.ToInt32(soWHUpdateInfoList[0].SOSysNo), vm => { soView = vm; //只有处于审核状态的订单才可以修改 if (soView == null || soView.BaseInfoVM.Status != (int)SOStatus.Origin) { this.Window.Alert(ResSO.Msg_SOUpdate_WarningSOAuditOutStock); return; } #region 更新操作 try { bool result = false; SOFacade soFacade = new SOFacade(this); soFacade.WHUpdateStock(soWHUpdateInfoList[0], (obj, args) => { if (args.FaultsHandle()) { return; } result = (Boolean)args.Result; if (result) { m_WHUpdateQueryView.SOSysNo = SOSysNo.ToString(); this.Window.Alert(ResSO.Info_WHUpdate_UpdateSucceed); this.dgQueryResult.Bind(); } else { this.Window.Alert(ResSO.Info_WHUpdate_UpdateFail); } }); } catch (BusinessException be) { this.Window.Alert(be.ErrorDescription); } #endregion }); } }
void HoldSO_Loaded(object sender, RoutedEventArgs e) { soFacade = new SOFacade(Page); soFacade.QueryPayFlow(SoSysNo, vm => { gridInfo.DataContext = vm; }); }
void SOProcesser_Loaded(object sender, RoutedEventArgs e) { CommonDataFacade = new CommonDataFacade(Page); SOInternalMemoFacade = new Facades.SOInternalMemoFacade(Page); SOQueryFacade = new SOQueryFacade(Page); SOFacade = new SOFacade(Page); LoadPage(); }
private void dataGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { SOFacade facade = new SOFacade(CPApplication.Current.CurrentPage); facade.QueryBackOrderItem(m_soSysNo, (obj, args) => { if (args.FaultsHandle()) { return; } dataGrid.TotalCount = args.Result.TotalCount; dataGrid.ItemsSource = args.Result.Rows; }); }
/// <summary> /// 查询订单所有信息 /// </summary> /// <param name="soSysNo"></param> /// <param name="callback"></param> public void QuerySOInfo(int soSysNo, Action <SOVM> callback) { restClient.Query <SOInfo>(string.Format("/SOService/SOInfo/Query/{0}", soSysNo), (obj, args) => { if (!args.FaultsHandle() && callback != null) { SOVM vm = null; if (args.Result != null) { vm = SOFacade.ConvertTOSOVMFromSOInfo(args.Result); } callback(vm); } }); }
private void IniPageData() { CommonDataFacade = new CommonDataFacade(this); PageView = new SOQueryView(); PageView.QueryInfo.SOSysNo = SOSysNo; PageView.QueryInfo.CompanyCode = CPApplication.Current.CompanyCode; SOQueryFacade = new SOQueryFacade(this); SOFacade = new SOFacade(this); ExportSOQueryInfo = new SOQueryVM(); CommonDataFacade.GetStockList(true, (sender, e) => { PageView.QueryInfo.StockList = e.Result; }); CommonDataFacade.GetAllSystemUser(CPApplication.Current.CompanyCode, (obj, args) => { List <ECCentral.BizEntity.Common.UserInfo> userList = new List <BizEntity.Common.UserInfo>(); userList.Add(new BizEntity.Common.UserInfo { SysNo = null, UserDisplayName = ECCentral.BizEntity.Enum.Resources.ResCommonEnum.Enum_All }); if (!args.FaultsHandle() && args.Result != null) { userList.AddRange(args.Result); } cmbOutStockUser.ItemsSource = userList; }); CommonDataFacade.GetCustomerServiceList(CPApplication.Current.CompanyCode, (r) => { List <ECCentral.BizEntity.Common.UserInfo> userList = new List <BizEntity.Common.UserInfo>(); userList.Add(new BizEntity.Common.UserInfo { SysNo = null, UserDisplayName = ECCentral.BizEntity.Enum.Resources.ResCommonEnum.Enum_All }); if (r != null) { userList.AddRange(r); } cmbAuditUser.ItemsSource = userList; }); CodeNamePairHelper.GetList(ConstValue.DomainName_SO , new string[] { ConstValue.Key_FPStatus, ConstValue.Key_KFCType } , CodeNamePairAppendItemType.All, (sender, e) => { if (e.Result != null) { PageView.QueryInfo.FPStatusList = e.Result[ConstValue.Key_FPStatus]; PageView.QueryInfo.KFCTypeList = e.Result[ConstValue.Key_KFCType]; } }); CodeNamePairHelper.GetList(ConstValue.DomainName_Common, ConstValue.Key_TimeRange, CodeNamePairAppendItemType.Custom_All, (sender, e) => { PageView.QueryInfo.TimeRangeList = e.Result; }); CommonDataFacade.GetWebChannelList(true, (sender, e) => { cmbThirdPlatform.ItemsSource = e.Result; }); spConditions.DataContext = PageView.QueryInfo; dataGridSO.DataContext = PageView; if (!string.IsNullOrEmpty(PageView.QueryInfo.SOSysNo)) { if (Regex.IsMatch(PageView.QueryInfo.SOSysNo, @"^\d+([, \.]+\d+)*$")) { btnSearch_Click(null, null); } } }
void HoldSO_Loaded(object sender, RoutedEventArgs e) { SOFacade = new SOFacade(Page); }
/// <summary> /// 发送订单拦截邮件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSendSOInterceptEmail_Click(object sender, RoutedEventArgs e) { SOInterceptInfoVM orderEmailInfoVM = new SOInterceptInfoVM(); SOInterceptInfoVM financeEmailInfoVM = new SOInterceptInfoVM(); orderEmailInfoVM.EmailAddress = this.txtEmailAddresse.Text; orderEmailInfoVM.CCEmailAddress = this.txtCCEmailAddress.Text; financeEmailInfoVM.FinanceEmailAddress = this.txtFinanceEmailAddress.Text; financeEmailInfoVM.FinanceCCEmailAddress = this.txtFinanceCCEmailAddress.Text; if (CurrentSOVM.InvoiceInfoVM.IsVAT == true) { if (string.IsNullOrEmpty(orderEmailInfoVM.EmailAddress) || string.IsNullOrEmpty(orderEmailInfoVM.CCEmailAddress) || string.IsNullOrEmpty(financeEmailInfoVM.FinanceEmailAddress) || string.IsNullOrEmpty(financeEmailInfoVM.FinanceCCEmailAddress) ) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResSOIntercept.Info_SaveSOIntercept_Input_Error, MessageType.Error); } else { ValidationManager.Validate(this.gdOrderEmailInfo); if (orderEmailInfoVM.HasValidationErrors && orderEmailInfoVM.ValidationErrors.Count > 0) { return; } ValidationManager.Validate(this.gdFinanceEmailInfo); if (financeEmailInfoVM.HasValidationErrors && financeEmailInfoVM.ValidationErrors.Count > 0) { return; } SOInterceptInfoVM soInterceptInfoVM = new SOInterceptInfoVM(); soInterceptInfoVM.EmailAddress = orderEmailInfoVM.EmailAddress; soInterceptInfoVM.CCEmailAddress = orderEmailInfoVM.CCEmailAddress; soInterceptInfoVM.FinanceEmailAddress = financeEmailInfoVM.FinanceEmailAddress; soInterceptInfoVM.FinanceCCEmailAddress = financeEmailInfoVM.FinanceCCEmailAddress; CurrentSOVM.SOInterceptInfoVMList.Add(soInterceptInfoVM); #region 发送订单拦截邮件 SendEmailReq reqSOOrderIntercep = new SendEmailReq(); reqSOOrderIntercep.soInfo = SOFacade.ConvertTOSOInfoFromSOVM(CurrentSOVM); reqSOOrderIntercep.Language = CPApplication.Current.LanguageCode; new SOInterceptFacade().SendSOOrderInterceptEmail(reqSOOrderIntercep, (obj, args) => { if (!args.FaultsHandle()) { CloseDialog(new ResultEventArgs { DialogResult = DialogResultType.OK, }); } }); #endregion #region 发送增票拦截邮件 SendEmailReq reqSOFinanceIntercep = new SendEmailReq(); reqSOFinanceIntercep.soInfo = SOFacade.ConvertTOSOInfoFromSOVM(CurrentSOVM); reqSOFinanceIntercep.Language = CPApplication.Current.LanguageCode; new SOInterceptFacade().SendSOFinanceInterceptEmail(reqSOFinanceIntercep, (obj, args) => { if (!args.FaultsHandle()) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResSOIntercept.Info_SendEmail_Sucessful, MessageType.Information); CloseDialog(new ResultEventArgs { DialogResult = DialogResultType.OK, }); } }); #endregion } } else { if (string.IsNullOrEmpty(orderEmailInfoVM.EmailAddress) || string.IsNullOrEmpty(orderEmailInfoVM.CCEmailAddress)) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResSOIntercept.Info_SaveSOIntercept_Input_Error, MessageType.Error); } else { ValidationManager.Validate(this.gdOrderEmailInfo); if (orderEmailInfoVM.HasValidationErrors && orderEmailInfoVM.ValidationErrors.Count > 0) { return; } SOInterceptInfoVM soInterceptInfoVM = new SOInterceptInfoVM(); soInterceptInfoVM.EmailAddress = orderEmailInfoVM.EmailAddress; soInterceptInfoVM.CCEmailAddress = orderEmailInfoVM.CCEmailAddress; CurrentSOVM.SOInterceptInfoVMList.Add(soInterceptInfoVM); #region 发送订单拦截邮件 SendEmailReq reqSOOrderIntercep = new SendEmailReq(); reqSOOrderIntercep.soInfo = SOFacade.ConvertTOSOInfoFromSOVM(CurrentSOVM); reqSOOrderIntercep.Language = CPApplication.Current.LanguageCode; new SOInterceptFacade().SendSOOrderInterceptEmail(reqSOOrderIntercep, (obj, args) => { if (!args.FaultsHandle()) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResSOIntercept.Info_SendEmail_Sucessful, MessageType.Information); CloseDialog(new ResultEventArgs { DialogResult = DialogResultType.OK, }); } }); #endregion } } }
void SplitInvoice_Loaded(object sender, RoutedEventArgs e) { SOQueryFacade = new SOQueryFacade(Page); SOFacade = new SOFacade(Page); int totalQty = 0; //need reload sovm SOQueryFacade.QuerySOInfo(m_soSysNo, vm => { if (vm == null) { Window.Alert(ResSO.Info_SOIsNotExist, ResSO.Info_SOIsNotExist, MessageType.Warning, (obj, args) => { Window.Close(); }); return; } m_soVM = vm; m_soVM.ItemsVM.ForEach(soItem => { if (soItem.ProductType != SOProductType.Coupon) { if (soItem.ProductType != SOProductType.ExtendWarranty) { totalQty += soItem.Quantity.Value; } InvoiceProductVM invoiceProductVM = new InvoiceProductVM { InvoiceNo = 1, Price = soItem.Price.Value, ProductID = soItem.ProductID, ProductName = soItem.ProductName, ProductSysNo = soItem.ProductSysNo.Value, Quantity = soItem.Quantity.Value, StockSysNo = soItem.StockSysNo, InvoiceQuantity = soItem.Quantity.Value, IsExtendWarrantyItem = soItem.ProductType == SOProductType.ExtendWarranty }; string[] mpSysNo = null; if (soItem.MasterProductSysNo != null) { mpSysNo = soItem.MasterProductSysNo.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); } if (mpSysNo != null) { invoiceProductVM.MasterProductSysNo = invoiceProductVM.MasterProductSysNo ?? new List <int>(); mpSysNo.ForEach(n => { int no; if (int.TryParse(n, out no)) { invoiceProductVM.MasterProductSysNo.Add(no); } }); } PageView.OriginalProductList.Add(invoiceProductVM); } }); SOFacade.GetSOInvoiceList(m_soSysNo, PageView.OriginalProductList, (isSplited, invoiceList) => { if (isSplited) { PageView.SplitedProductList = invoiceList; btnSave.IsEnabled = false; btnCancelSplit.IsEnabled = true; } else { PageView.SplitedProductList = PageView.OriginalProductList.DeepCopy(); ECCentral.BizEntity.SO.SOStatus soStatus = m_soVM.BaseInfoVM.Status.Value; btnSave.IsEnabled = totalQty > 1 && (soStatus == ECCentral.BizEntity.SO.SOStatus.Origin || soStatus == ECCentral.BizEntity.SO.SOStatus.WaitingOutStock || soStatus == ECCentral.BizEntity.SO.SOStatus.Shipping); btnCancelSplit.IsEnabled = false; } btnGroupSort.IsEnabled = btnSave.IsEnabled; SortInvoice(); }); }); }