//检查记录的最大条数: private bool CheckMaxinumItemsCount() { int currentNumber = this.OldItemVM == null ? 0 : this.OldItemVM.Count; if (null != OldItemVM) { foreach (var item in OldItemVM) { if (item.SettleSysNo == -1) { currentNumber--; } } } foreach (var newItem in listProductsVM) { if (OldItemVM.SingleOrDefault(i => i.ConsignToAccLogInfo.LogSysNo == newItem.ConsignToAccLogInfo.LogSysNo) == null) { currentNumber++; } } if (currentNumber > 200) { CurrentWindow.Alert(string.Format(ResSettledProductsRuleQuery.InfoMsg_MaxConsignToAccCount, 200)); return(false); } else { return(true); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (_reasonList == null || _currentVM == null || _currentVM.SysNo == null) { return; } string commaSeperatedReasonIDs = ""; foreach (var item in _reasonList) { if (item.IsChecked == true) { commaSeperatedReasonIDs += "," + item.ReasonID; } } commaSeperatedReasonIDs = commaSeperatedReasonIDs.TrimEnd(','); if (commaSeperatedReasonIDs.Length == 0) { CurrentWindow.Alert(ResProductPriceCompare.Info_PleaseSelectInvalidReason); return; } var facade = new ProductPriceCompareFacade(CPApplication.Current.CurrentPage); //审核无效 facade.AuditDecline(_currentVM.SysNo.Value, commaSeperatedReasonIDs, () => { CurrentWindow.Alert(ResProductPriceCompare.Info_AuditDeclineSuccess); CloseDialog(DialogResultType.OK); }); }
private void btnConfirm_Click(object sender, RoutedEventArgs e) { //确定操作: if (ResultList.Count > 0) { List <InventoryTransferStockingVendorInfoVM> selectedList = ResultList.Where(x => x.IsChecked == true).ToList(); if (selectedList.Count <= 0) { CurrentWindow.Alert("请选择至少一个供应商!"); return; } string getSelectedVendorSysNos = string.Empty; selectedList.ForEach(x => { getSelectedVendorSysNos += string.Format("{0}|", x.VendorSysNo); }); getSelectedVendorSysNos = getSelectedVendorSysNos.TrimEnd('|'); this.Dialog.ResultArgs.Data = getSelectedVendorSysNos; this.Dialog.Close(true); } else { this.Dialog.ResultArgs.Data = null; this.Dialog.Close(true); } }
private void ucFileUploader_AllFileUploadCompleted(object sender, Basic.Controls.Uploader.AllUploadCompletedEventArgs args) { if (args.UploadInfo != null && args.UploadInfo.Count > 0 && args.UploadInfo[0].UploadResult == Basic.Controls.Uploader.SingleFileUploadStatus.Success) { string getFileIdentity = args.UploadInfo[0].ServerFilePath; this.FileIdentity = getFileIdentity; //解析上传Excel,返回List<>: serviceFacade.ConvertBasketTemplateFileToEntityList(getFileIdentity, (objs, argss) => { if (argss.FaultsHandle()) { return; } this.Dialog.ResultArgs.Data = argss.Result; //CPApplication.Current.CurrentPage.Context.Window.Alert(string.Format("导入成功{0}条,导入失败{1}条", (string)argss.Result[1].Rows[0]["successCount"], (string)argss.Result[1].Rows[0]["failedCount"])); this.Dialog.Close(true); }); } else { CurrentWindow.Alert("上传模板失败!"); return; } }
private void txtStockSysNo_KeyUp(object sender, KeyEventArgs e) { //只处理Enter事件 if (e.Key != Key.Enter) { return; } this.StockID = ""; string StockSysNoString = this.txtStockSysNo.Text.Trim(); if (string.IsNullOrEmpty(StockSysNoString)) { return; } //验证渠道库存系统编号 int StockSysNo = 0; if (!int.TryParse(StockSysNoString, out StockSysNo)) { CurrentWindow.Alert(string.Format(ResStockPicker.Tip_StockSysNoInvalid, StockSysNoString), MessageType.Warning); e.Handled = true; return; } var StockSelectedEvent = StockSelected; if (StockSelectedEvent != null) { var facade = new StockQueryFacade(CPApplication.Current.CurrentPage); facade.LoadStockBySysNo(StockSysNo, OnLoadStockBySysNo); e.Handled = true; } }
private void btnAddSettleItems_Click(object sender, RoutedEventArgs e) { //添加结算商品: int selectCount = 0; listProductsVM.ForEach(x => { if (x.IsCheckedItem) { selectCount++; } }); if (selectCount <= 0) { CurrentWindow.Alert(ResSettledProductsRuleQuery.InfoMsg_CheckProducts); return; } if (CheckMaxinumItemsCount()) { this.listProductsVM.Where(i => i.IsCheckedItem == true).ToList().ForEach(x => { x.IsCheckedItem = false; if (SettleSysNo.HasValue) { x.SettleSysNo = SettleSysNo.Value; } //添加进现有的List中(不重复添加:): ConsignSettlementItemInfoVM getExistItem = OldItemVM.SingleOrDefault(i => i.ConsignToAccLogInfo.LogSysNo == x.ConsignToAccLogInfo.LogSysNo); if (getExistItem == null) { x.IsSettleCostTextBoxReadOnly = x.SettleType == SettleType.O ? false : true; x.IsSettlePercentageTextBoxReadOnly = x.SettleType == SettleType.P ? false : true; x.SettlePercentageTextBoxVisibility = x.SettleType == SettleType.P ? Visibility.Visible : Visibility.Collapsed; //毛利: x.ConsignToAccLogInfo.RateMargin = x.ConsignToAccLogInfo.SalePrice.ToDecimal() - x.ConsignToAccLogInfo.Cost.ToDecimal(); //毛利总额 : x.ConsignToAccLogInfo.RateMarginTotal = x.ConsignToAccLogInfo.RateMargin.ToDecimal() * x.ConsignToAccLogInfo.ProductQuantity.ToInteger(); OldItemVM.Add(x); } else { if (getExistItem.SettleSysNo == -1) { getExistItem.SettleSysNo = null; getExistItem.SettlePercentage = x.SettlePercentage; getExistItem.Cost = string.IsNullOrEmpty(x.ConsignToAccLogInfo.Cost) ? (decimal?)null : x.ConsignToAccLogInfo.Cost.ToDecimal(); getExistItem.SettleRuleSysNo = x.SettleRuleSysNo; getExistItem.SettleRuleName = x.SettleRuleName; } } }); this.Dialog.ResultArgs.Data = OldItemVM; this.Dialog.ResultArgs.DialogResult = DialogResultType.OK; Dialog.Close(true); } }
private void FileUploader_AllFileUploadCompleted(object sender, Basic.Controls.Uploader.AllUploadCompletedEventArgs args) { if (args.UploadInfo[0].UploadResult == Basic.Controls.Uploader.SingleFileUploadStatus.Failed) { CurrentWindow.Alert(ResValueAddedTaxInvoiceDetail.msg_UploadFalid); return; } //上传成功,返回文件地址: CurrentValueAddedTaxVM.CertificateFileName = args.UploadInfo[0].ServerFilePath; }
private void btnSave_Click(object sender, RoutedEventArgs e) { Button button = sender as Button; if (button != null && button.Name == "btnCreate") { _isEditing = false; _currentVM.SysNo = 0; } //输入验证不通过,则直接返回 if (!ValidationManager.Validate(this)) { return; } if (this.ucPageType.PageType == null) { CurrentWindow.Alert(ResHotSaleCategory.Info_PleaseSelectPageType); return; } _currentVM.PageType = this.ucPageType.PageType.Value; if (this.lstPosition.SelectedValue == null) { CurrentWindow.Alert(ResHotSaleCategory.Info_PleaseSelectPosition); return; } _currentVM.Position = int.Parse(this.lstPosition.SelectedValue.ToString()); if (this.ucCategoeyPicker.ChooseCategory3SysNo == null) { CurrentWindow.Alert(ResHotSaleCategory.Info_PleaseSelectC3); return; } _currentVM.C3SysNo = this.ucCategoeyPicker.ChooseCategory3SysNo; var hotSaleCategoryFacade = new HotSaleCategoryFacade(CPApplication.Current.CurrentPage); if (_isEditing) { //编辑 hotSaleCategoryFacade.Update(_currentVM, this.cbUpdateSameGroupAl.IsChecked, () => { CurrentWindow.Alert(ResHotSaleCategory.Info_EditSuccess); CloseDialog(DialogResultType.OK); }); } else { //新建 hotSaleCategoryFacade.Create(_currentVM, () => { CurrentWindow.Alert(ResHotSaleCategory.Info_AddSuccess); CloseDialog(DialogResultType.OK); }); } }
private void btnUplaod_Click(object sender, RoutedEventArgs e) { if (CurrentFile != null) { Deployment.Current.Dispatcher.BeginInvoke(() => UpLoad()); } else { CurrentWindow.Alert("还未选择图片"); } }
private void FileUploader_AllFileUploadCompleted(object sender, Basic.Controls.Uploader.AllUploadCompletedEventArgs args) { if (args.UploadInfo[0].UploadResult == Basic.Controls.Uploader.SingleFileUploadStatus.Failed) { CurrentWindow.Alert(ResBatchImportCustomer.Message_UploadFailed, MessageType.Error); return; } //上传成功,解析文件 BatchVM.ImportFilePath = args.UploadInfo[0].ServerFilePath; btnImport.IsEnabled = true; }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (!ValidationManager.Validate(this.LayoutRoot)) { return; } if (string.IsNullOrEmpty(_vm.BrandSysNo)) { CurrentWindow.Alert("错误", "请选择一个品牌!", MessageType.Error); return; } if (string.IsNullOrEmpty(_vm.C3SysNo)) { CurrentWindow.Alert("错误", "请选择一个3级类别!", MessageType.Error); return; } CurrentWindow.Confirm("提示", "确定要进行保存操作吗?", (obj, args) => { if (args.DialogResult == DialogResultType.OK) { ProductRingDayInfo entity = EntityConverter <AdventProductsInfoVM, ProductRingDayInfo> .Convert(_vm); if (isAddAction) { _facade.InsertProductRingInfo(entity, (obj2, args2) => { if (args2.FaultsHandle()) { return; } CurrentWindow.Alert("提示", "创建成功!", MessageType.Information, (obj3, args3) => { this.Dialog.ResultArgs.DialogResult = DialogResultType.OK; this.Dialog.Close(true); }); }); } else { _facade.UpdateProductRingInfo(entity, (obj2, args2) => { if (args2.FaultsHandle()) { return; } CurrentWindow.Alert("提示", "保存成功!", MessageType.Information, (obj3, args3) => { this.Dialog.ResultArgs.DialogResult = DialogResultType.OK; this.Dialog.Close(true); }); }); } } }); }
private void btnDeleleAddress_Click(object sender, RoutedEventArgs e) { //删除PO收件人列表: if (null != this.lbReceiveMailAddress.SelectedItem) { this.lbReceiveMailAddress.Items.Remove(this.lbReceiveMailAddress.SelectedItem); } else { CurrentWindow.Alert(ResPurchaseOrderMaintain.InfoMsg_POMailDelete); } }
private void txtBrandSysNo_LostFocus(object sender, RoutedEventArgs e) { if (txtBrandSysNo.Text.Trim() == "") { txtBrandNameLocal.Text = ""; txtBrandSysNo.Text = ""; this.SelectedBrandSysNo = null; this.SelectedBrandName = null; return; } int getInputBrandSysNo; if (!int.TryParse(this.txtBrandSysNo.Text.Trim(), out getInputBrandSysNo)) { CurrentWindow.Alert("无效的品牌编号!"); SelectedBrandName = null; SelectedBrandSysNo = null; this.txtBrandNameLocal.Text = string.Empty; this.txtBrandSysNo.Text = string.Empty; return; } queryFilter.BrandSysNo = getInputBrandSysNo; queryFilter.PagingInfo = new ECCentral.QueryFilter.Common.PagingInfo() { PageSize = 10, PageIndex = 0 }; serviceFacade.QueryBrands(queryFilter, (obj, args) => { if (args.FaultsHandle()) { return; } var brandList = args.Result.Rows; try { this.txtBrandSysNo.Text = brandList[0]["SysNo"].ToString(); this.txtBrandNameLocal.Text = brandList[0]["BrandName_Ch"].ToString(); this.SelectedBrandSysNo = brandList[0]["SysNo"].ToString(); this.SelectedBrandName = brandList[0]["BrandName_Ch"].ToString(); } catch { CurrentWindow.Alert("无效的品牌编号!"); SelectedBrandName = null; SelectedBrandSysNo = null; this.txtBrandNameLocal.Text = string.Empty; this.txtBrandSysNo.Text = string.Empty; return; } }); }
private void btnAddCustomizeEmailAddress_Click(object sender, RoutedEventArgs e) { //添加自定义邮件地址到PO收件人列表: if (!string.IsNullOrEmpty(this.txtCustomizeEmailAddress.Text)) { if (!ValidationHelper.Validation(this.txtCustomizeEmailAddress, validationList)) { return; } string getInputCustomizedMailAddresses = this.txtCustomizeEmailAddress.Text.Trim(); List <string> targetAddMailList = new List <string>(); if (getInputCustomizedMailAddresses.IndexOf(';') != -1) { string[] mailList = getInputCustomizedMailAddresses.Split(';'); foreach (string item in mailList) { if (!string.IsNullOrEmpty(item)) { if (!targetAddMailList.Contains(item)) { targetAddMailList.Add(item); } } } } else { targetAddMailList.Add(getInputCustomizedMailAddresses); } foreach (string targetAddress in targetAddMailList) { //验证是否存在: if (null != lbReceiveMailAddress.Items && 0 < lbReceiveMailAddress.Items.Count) { foreach (var itemMail in lbReceiveMailAddress.Items) { if (itemMail.ToString() == targetAddress) { CurrentWindow.Alert(string.Format(ResPurchaseOrderMaintain.InfoMsg_POMailExistFormatString, itemMail)); return; } } } this.lbReceiveMailAddress.Items.Add(targetAddress); } } else { CurrentWindow.Alert(ResPurchaseOrderMaintain.InfoMsg_POMailInput); return; } }
/// <summary> /// 根据退款单号加载相关信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TextBox_LostFocus(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(this.txtSoSysNo.Text)) { SoSysNoList = new List <ValidationEntity>(); SoSysNoList.Add(new ValidationEntity(ValidationEnum.IsInteger, null, ResRefundAdjust.Info_SoSysNoError)); if (!ValidationHelper.Validation(this.txtSoSysNo, SoSysNoList)) { return; } maintainVM.SOSysNo = this.txtSoSysNo.Text; this.hlbtnViewDetials.Visibility = System.Windows.Visibility.Collapsed; this.Text_CashAmount.IsEnabled = true; facade.GetRefundAdjustBySoSysNo(maintainVM, (obj, args) => { if (args.FaultsHandle()) { return; } if (args.Result != null) { if (maintainVM.AdjustOrderType == RefundAdjustType.EnergySubsidy) { this.hlbtnViewDetials.Visibility = System.Windows.Visibility.Visible; this.Text_CashAmount.IsEnabled = false; } maintainVM.RequestID = args.Result.RequestID; maintainVM.CustomerID = args.Result.CustomerID; maintainVM.RequestSysNo = args.Result.RequestSysNo; maintainVM.CustomerSysNo = args.Result.CustomerSysNo; if (maintainVM.AdjustOrderType == RefundAdjustType.EnergySubsidy) { maintainVM.CashAmountShow = args.Result.CashAmt.ToString(); } } else { CurrentWindow.Alert(ResRefundAdjust.Info_RMARequestIDError); maintainVM.SOSysNo = string.Empty; maintainVM.RequestID = string.Empty; maintainVM.CustomerID = string.Empty; maintainVM.CashAmountShow = string.Empty; } }); } else { this.hlbtnViewDetials.Visibility = System.Windows.Visibility.Collapsed; this.Text_CashAmount.IsEnabled = true; maintainVM.CashAmountShow = string.Empty; } }
private void btnChooseReturnPoint_Click(object sender, RoutedEventArgs e) { ConsignSettlementEIMSInfo getSelectedItem = this.EIMSQueryResultGrid.SelectedItem as ConsignSettlementEIMSInfo; if (null == getSelectedItem) { CurrentWindow.Alert(ResConsignMaintain.InfoMsg_ChooseOneReturnPoint); return; } Dialog.ResultArgs.Data = getSelectedItem; Dialog.ResultArgs.DialogResult = DialogResultType.OK; Dialog.Close(true); }
private void btnAdd_Click(object sender, RoutedEventArgs e) { if (this.QueryResultGrid.SelectedIndex < 0 || this.QueryResultGrid.ItemsSource == null) { CurrentWindow.Alert(ResVendorInfo.Msg_SelectRole, MessageType.Error); return; } DynamicXml selectedManufacturer = this.QueryResultGrid.SelectedItem as DynamicXml; if (null != selectedManufacturer) { this.Dialog.ResultArgs.DialogResult = DialogResultType.OK; this.Dialog.ResultArgs.Data = selectedManufacturer; this.Dialog.Close(true); } }
private void OnLoadStockBySysNo(object sender, RestClientEventArgs <dynamic> args) { dynamic totalCount = args.Result.TotalCount; if (totalCount == 0) { //渠道库存系统编号不存在 CurrentWindow.Alert(string.Format(ResStockPicker.Tip_StockSysNoNotExists, this.txtStockSysNo.Text.Trim()), MessageType.Warning); } else { //渠道库存系统编号只存在一个 StockVM selectedStock = DynamicConverter <StockVM> .ConvertToVM(args.Result.Rows[0]); this.StockID = selectedStock.StockID; OnStockSelected(selectedStock); } }
private void btnAdd_Click(object sender, RoutedEventArgs e) { if (!ValidationManager.Validate(this)) { return; } if (string.IsNullOrEmpty(newVM.ProductID)) { CurrentWindow.Alert(ResPurchaseOrderNew.Msg_PurchaseProductNull); return; } #region 验证正常采购单的采购数量要大于0,负采购单的采购数量要小于0 if (currentPOType != null) { if (currentPOType == PurchaseOrderType.Normal) { if (Convert.ToInt32(newVM.PurchaseQty) < 0) { this.lblError.Text = "正常采购单的采购数量要大于0,负采购单的采购数量要小于0 !"; return; } } else if (currentPOType == PurchaseOrderType.Negative) { if (Convert.ToInt32(newVM.PurchaseQty) >= 0) { this.lblError.Text = "正常采购单的采购数量要大于0,负采购单的采购数量要小于0 !"; return; } } else { this.lblError.Text = string.Empty; } } #endregion //添加操作; this.Dialog.ResultArgs.Data = this.newVM; this.Dialog.ResultArgs.DialogResult = DialogResultType.OK; Dialog.Close(true); }
public void txtVendorSysNo_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { int getInputVendorSysNo = 0; if (string.IsNullOrWhiteSpace(this.txtVendorSysNo.Text.Trim())) { InitializeTextBox(); return; } if (!int.TryParse(this.txtVendorSysNo.Text.Trim(), out getInputVendorSysNo)) { InitializeTextBox(); CurrentWindow.Alert("无效的供应商编号!"); return; } LoadVendorInfo(getInputVendorSysNo); } }
private void txtManufacturerSysNo_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { if (string.IsNullOrEmpty(this.txtManufacturerSysNo.Text)) { SelectedManufacturerSysNo = null; this.txtManufacturerSysNo.Text = string.Empty; SelectedManufacturerName = null; this.txtManufacturerName.Text = string.Empty; return; } int manufacturerSysNo = 0; if (!int.TryParse(this.txtManufacturerSysNo.Text.Trim(), out manufacturerSysNo)) { CurrentWindow.Alert("无效的代理厂商编号!"); SelectedManufacturerSysNo = null; this.txtManufacturerSysNo.Text = string.Empty; return; } serviceFacade.QueryManufacturerBySysNo(manufacturerSysNo.ToString(), (obj, args) => { if (args.FaultsHandle()) { return; } if (null != args.Result && args.Result.SysNo.HasValue && args.Result.ManufacturerNameLocal != null) { SelectedManufacturerSysNo = manufacturerSysNo.ToString(); this.txtManufacturerName.Text = SelectedManufacturerName = args.Result.ManufacturerNameLocal.Content; } else { //CurrentWindow.Alert("未找到相关的代理厂商!"); SelectedManufacturerSysNo = null; this.txtManufacturerSysNo.Text = string.Empty; return; } }); } }
private void ucNetPayInfo_SearchOrderButtonClick(object sender, RoutedEventArgs e) { var payInfo = ucNetPayInfo.DataContext as PayInfoVM; if (payInfo != null && !string.IsNullOrEmpty(payInfo.SOSysNo)) { btnSave.IsEnabled = false; int soSysNo; if (int.TryParse(payInfo.SOSysNo, out soSysNo)) { otherDomainFacade.GetSOBaseInfo(soSysNo, so => { if (so == null) { CurrentWindow.Alert(ResUCNetPayMaintain.Message_InvalidSOSysNo); return; } if (so.Status.HasValue) { if (so.Status == SOStatus.Abandon || so.Status == SOStatus.SystemCancel || so.Status == SOStatus.Reject) { CurrentWindow.Alert(ResUCNetPayMaintain.Message_SOStatusIsAbandon); return; } } btnSave.IsEnabled = true; netpayVM.PayInfo = so.ConvertVM <SOBaseInfoVM, PayInfoVM>((s, t) => { t.PayAmt = Convert.ToString(s.ReceivableAmount ?? 0); t.PrepayAmt = s.PrepayAmount ?? 0; t.ReceivableAmt = s.ReceivableAmount ?? 0; t.SOTotalAmt = s.SOTotalAmount ?? 0; t.GiftCardPayAmt = s.GiftCardPay ?? 0; t.RelatedSOSysNo = s.SOSysNo.ToString(); }); netpayVM.PayInfo.ValidationErrors.Clear(); }); } } }
private void btnAddSelectedMail_Click(object sender, RoutedEventArgs e) { //添加选择的电子邮件: if (null != this.cmbEmailListInfo.SelectedItem) { if (null != lbReceiveMailAddress.Items && 0 < lbReceiveMailAddress.Items.Count) { foreach (var item in lbReceiveMailAddress.Items) { if (item.ToString() == this.cmbEmailListInfo.SelectedItem.ToString()) { CurrentWindow.Alert(ResPurchaseOrderMaintain.InfoMsg_POMailExist); return; } } } this.lbReceiveMailAddress.Items.Add(this.cmbEmailListInfo.SelectedItem.ToString()); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (ViewModel.PointExpiringDate == null) { this.dpPointExpiringDate.Validation("请输入有效期!"); return; } CustomerFacade facade = new CustomerFacade(CPApplication.Current.CurrentPage); facade.UpdateCustomerPointExpiringDate(ViewModel, (obj, args) => { if (args.FaultsHandle()) { return; } CurrentWindow.Alert(ResCustomerPointExpiringDate.Msg_SaveOk, MessageType.Information); this.DialogHandle.ResultArgs.DialogResult = DialogResultType.OK; this.DialogHandle.Close(); }); }
private void Button_Save_Click(object sender, RoutedEventArgs e) { if (!CreatePreCheck()) { return; } var entity = maintainVM.ConvertVM <RefundAdjustMaintainVM, RefundAdjustInfo>(); entity.CardNumber = maintainVM.CardNo; entity.CustomerSysNo = maintainVM.CustomerSysNo; entity.CompanyCode = CPApplication.Current.CompanyCode; entity.CreateUserSysNo = CPApplication.Current.LoginUser.UserSysNo; entity.RequestSysNo = maintainVM.RequestSysNo; entity.Status = RefundAdjustStatus.Initial; entity.CashAmt = Convert.ToDecimal(maintainVM.CashAmountShow); //if (maintainVM.Action == "Create") //{ //创建补偿退款单 facade.CreateRefundAdjust(entity, (obj, args) => { if (args.FaultsHandle()) { return; } CurrentWindow.Alert(ResRefundAdjust.Info_CreateSuccess); Dialog.ResultArgs.DialogResult = DialogResultType.OK; Dialog.Close(true); }); //} //else if (maintainVM.Action == "Edit") //{ // //更新补偿退款单 // facade.UpdateRefundAdjust(entity, (obj, args) => // { // if (args.FaultsHandle()) return; // CurrentWindow.Alert(ResRefundAdjust.Info_UpdateSuccess); // Dialog.ResultArgs.DialogResult = DialogResultType.OK; // Dialog.Close(true); // }); //} }
//重置数据 private void btnDataReset_Click(object sender, RoutedEventArgs e) { List <int> list = GetSelectedTransactionNumber(); if (list == null || list.Count == 0) { CurrentWindow.Alert(ResHeaderDataQuery.Msg_PleaseSelect); return; } facade.UpdateSAPStatus(list, (obj, args) => { if (args.FaultsHandle()) { return; } if (args.Result > 0) { CurrentWindow.Alert(ResHeaderDataQuery.Msg_OpreateSucess); CloseDialog(DialogResultType.OK); } }); }
private void txtBrandSysNo_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { int brandSysNo = 0; if (!int.TryParse(this.txtBrandSysNo.Text.Trim(), out brandSysNo)) { CurrentWindow.Alert("无效的品牌编号!"); this.SelectedBrandSysNo = null; this.SelectedBrandName = null; this.txtBrandSysNo.Text = string.Empty; return; } serviceFacade.QueryBrandBySysNo(brandSysNo.ToString(), (obj, args) => { if (args.FaultsHandle()) { return; } if (args.Result == null || args.Result.Manufacturer == null) { CurrentWindow.Alert("无效的品牌编号!"); this.SelectedManufacturerSysNo = string.Empty; this.SelectedManufacturerName = string.Empty; this.SelectedBrandSysNo = string.Empty; this.SelectedBrandName = string.Empty; return; } this.SelectedManufacturerSysNo = args.Result.Manufacturer.SysNo.Value.ToString(); this.SelectedManufacturerName = args.Result.Manufacturer.ManufacturerNameLocal.Content; this.SelectedBrandSysNo = args.Result.SysNo.Value.ToString(); this.SelectedBrandName = args.Result.BrandNameLocal.Content; }); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { //输入验证不通过,则直接返回 if (!ValidationManager.Validate(this.LayoutRoot)) { return; } var bannerDimensionFacade = new PageTypeFacade(CPApplication.Current.CurrentPage); if (_isEditing) { //编辑 bannerDimensionFacade.Update(_currentVM, (s, args) => { if (args.FaultsHandle()) { return; } CurrentWindow.Alert(ResPageType.Info_EditSuccess); CloseDialog(true); }); } else { //新建 bannerDimensionFacade.Create(_currentVM, (s, args) => { if (args.FaultsHandle()) { return; } CurrentWindow.Alert(ResPageType.Info_AddSuccess); CloseDialog(true); }); } }
public void LoadVendorInfo(int VendorSysNo) { if (VendorSysNo > 0) { if (CurrentPage != null) { serviceFacade = new VendorFacade(CurrentPage); } serviceFacade.GetVendorBySysNo(VendorSysNo.ToString(), (obj, args) => { if (args.FaultsHandle()) { InitializeTextBox(); return; } VendorInfo = args.Result; if (null != VendorInfo) { this.txtVendorSysNo.Text = VendorInfo.SysNo.Value.ToString(); this.txtVendorName.Text = VendorInfo.VendorBasicInfo.VendorNameLocal.ToString(); this.SelectedVendorName = this.txtVendorName.Text; this.SelectedVendorSysNo = this.txtVendorSysNo.Text; this.IsConsign = VendorInfo.VendorBasicInfo.ConsignFlag; OnVendorSelected(VendorInfo); } else { InitializeTextBox(); CurrentWindow.Alert("无效的供应商编号!"); } }); } else { InitializeTextBox(); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { //确认操作: List <string> getSelectedReceivedAddressList = new List <string>(); if (null == this.lbReceiveMailAddress.Items || 0 >= this.lbReceiveMailAddress.Items.Count) { CurrentWindow.Alert(ResPurchaseOrderMaintain.InfoMsg_POMailEmpty); return; } foreach (object item in this.lbReceiveMailAddress.Items) { getSelectedReceivedAddressList.Add(item.ToString()); } Dictionary <string, object> dict = new Dictionary <string, object>(); dict.Add("updatedVendorMailAddress", AutoMail_VendorMailAddress); dict.Add("updatedReceiveMailAddress", getSelectedReceivedAddressList); Dialog.ResultArgs.Data = dict; Dialog.ResultArgs.DialogResult = DialogResultType.OK; Dialog.Close(true); }