private void ucPostPayInfo_SearchOrderButtonClick(object sender, RoutedEventArgs e) { var payInfo = ucPostPayInfo.DataContext as PayInfoVM; if (payInfo != null && !string.IsNullOrEmpty(payInfo.SOSysNo)) { btnSave.IsEnabled = false; int soSysNo; if (int.TryParse(payInfo.SOSysNo, out soSysNo)) { facade.LoadForEdit(soSysNo, result => { postpayVM = result; this.LayoutRoot.DataContext = postpayVM; var confirmedOrder = result.ConfirmedOrderList.FirstOrDefault(s => s.SOSysNo == soSysNo); btnSave.IsEnabled = (confirmedOrder.ConfirmStatus == PostIncomeConfirmStatus.Related); //计算收款单剩余金额并设置提示信息 //tblReminAmtPrompMessage.Text = string.Format("提示:收款单剩余金额为{0}元,请注意!", // ConstValue.Invoice_ToCurrencyString(result.RemainAmt)); tblReminAmtPrompMessage.Text = string.Format(ResPostPay.Msg_BillAmountIsZero, ConstValue.Invoice_ToCurrencyString(result.RemainAmt)); postpayVM.PayInfo.ValidationErrors.Clear(); }); } } }
private void dgConfirmSuccessResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { if (!string.IsNullOrEmpty(successSysNoSplitString)) { var queryVM = new SaleIncomeQueryVM(); queryVM.OrderID = successSysNoSplitString; queryVM.CreateDateFrom = null; queryVM.CreateDateTo = null; facade.Query(queryVM, e.PageSize, e.PageIndex, e.SortField, result => { this.dgConfirmSuccessResult.ItemsSource = result.ResultList; this.dgConfirmSuccessResult.TotalCount = result.TotalCount; var statistic = result.Statistic.Single(w => w.StatisticType == StatisticType.Total); string msg = string.Format(ResSaleIncomeAutoConfirm.Message_SuccessStatisticInfo , ConstValue.Invoice_ToCurrencyString(statistic.OrderAmt) , ConstValue.Invoice_ToCurrencyString(statistic.IncomeAmt) , ConstValue.Invoice_ToCurrencyString(statistic.ShipPrice) , ConstValue.Invoice_ToCurrencyString(statistic.ReturnCash) , statistic.ReturnPoint , ConstValue.Invoice_ToCurrencyString(statistic.ToleranceAmt)); this.tbSuccessInfo.Text = msg; this.tbSuccessInfo.Visibility = Visibility.Visible; }); } }
private void LoadPayItemDetailInfo() { PayItemDetailInfoReq request = new PayItemDetailInfoReq(); if (ValidQueryParam(this.Request.Param, ref request)) { this._payFacade.LoadPayDetailInfoForEdit(request, result => { this.btnNew.IsEnabled = true && AuthMgr.HasFunctionPoint(AuthKeyConst.Invoice_PayItem_InvoiceInputMaintain_Insert); _pageVM = result; this.LayoutRoot.DataContext = _pageVM; this.tbTotalInfo.Text = string.Format(ResPayItemMaintain.Message_TotalInfo, _pageVM.OrderSysNo, ConstValue.Invoice_ToCurrencyString(_pageVM.TotalAmt), ConstValue.Invoice_ToCurrencyString(_pageVM.PaidAmt)); this.tbTotalInfo.Visibility = Visibility.Visible; if (_pageVM.OrderType == PayableOrderType.POAdjust || _pageVM.OrderType == PayableOrderType.RMAPOR) { this.btnNew.IsEnabled = false; } }); } else { this.Window.Confirm(ResPayItemMaintain.Message_RecordDataError, (x => { this.Window.Close(); })); } }
public string ToStatisticText() { return(string.Format(ECCentral.Portal.UI.Invoice.Resources.ResSaleIncomeQuery.Message_StatisticInfo , this.StatisticType.ToDescription() , ConstValue.Invoice_ToCurrencyString(this.OrderAmt) , ConstValue.Invoice_ToCurrencyString(this.IncomeAmt) , ConstValue.Invoice_ToCurrencyString(this.AlreadyIncomeAmt) , ConstValue.Invoice_ToCurrencyString(this.PrepayAmt.Value) , ConstValue.Invoice_ToCurrencyString(this.ShipPrice.Value))); }
public string ToStatisticText() { return(string.Format(ResSalesStatisticsReport.Message_StatisticInfo, StatisticType.ToDescription(), ConstValue.Invoice_ToCurrencyString(ProductCost), ConstValue.Invoice_ToCurrencyString(ProductPriceAmount), ConstValue.Invoice_ToCurrencyString(PromotionDiscountAmount), ConstValue.Invoice_ToCurrencyString(ProductSaleAmount), ConstValue.Invoice_ToCurrencyString(ProductGrossMargin))); }
public string ToStatisticText() { StringBuilder statisticInfo = new StringBuilder(); statisticInfo.AppendLine(string.Format(ECCentral.Portal.UI.Invoice.Resources.ResARWindowQuery.Message_StatisticPrompInfo , ConstValue.Invoice_ToCurrencyString(OrderAmt) , ConstValue.Invoice_ToCurrencyString(PrepayAmt) , ConstValue.Invoice_ToCurrencyString(GiftCardPayAmt) , ConstValue.Invoice_ToCurrencyString(IncomeAmt) , ConstValue.Invoice_ToCurrencyString(UnpayedAmt)) ); return(statisticInfo.ToString()); }
public string ToStatisticText() { return(string.Format(ResInvoiceQuery.Message_StatisticInfoFormat , this.StatisticType.ToDescription() , ConstValue.Invoice_ToCurrencyString(this.InvoiceAmt) , ConstValue.Invoice_ToCurrencyString(this.SOTotalAmt) , ConstValue.Invoice_ToCurrencyString(this.InvoiceAmtWithTax) , ConstValue.Invoice_ToCurrencyString(this.InvoiceTax) , ConstValue.Invoice_ToCurrencyString(this.PrepayAmt) , ConstValue.Invoice_ToCurrencyString(this.IncomeAmt) , ConstValue.Invoice_ToCurrencyString(this.GiftCardPayAmt) , ConstValue.Invoice_ToCurrencyString(this.GiftCardPayAmtWithTax) , ConstValue.Invoice_ToCurrencyString(this.UnionAmt.Value) )); }
private void dgConfirmFailedsResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { if (!string.IsNullOrEmpty(failedSysNoSplitString)) { facade.QuerySO(failedSysNoSplitString, e.PageSize, e.PageIndex, e.SortField, result => { this.dgConfirmFailedsResult.ItemsSource = result[0].Rows; this.dgConfirmFailedsResult.TotalCount = result[0].TotalCount; string msg = string.Format(ResSaleIncomeAutoConfirm.Message_FailedStatisticInfo, ConstValue.Invoice_ToCurrencyString(result[1].Rows[0].TotalAmount)); this.tbFaultInfo.Text = msg; this.tbFaultInfo.Visibility = Visibility.Visible; }); } }
public string ToStatisticText() { int count = 0; decimal totalAmt = 0M; if (SelectedPayAmtList != null) { count = SelectedPayAmtList.Count; totalAmt = SelectedPayAmtList.Sum(); } return(string.Format(ECCentral.Portal.UI.Invoice.Resources.ResPayItemQuery.Message_StatisticInfo , ConstValue.Invoice_ToCurrencyString(PagePayAmt) , count , ConstValue.Invoice_ToCurrencyString(totalAmt) , ConstValue.Invoice_ToCurrencyString(AllPayAmt))); }
public string ToStatisticText() { return(string.Format(ResIncomeCostReport.Message_StatisticInfo, StatisticType.ToDescription(), ConstValue.Invoice_ToCurrencyString(ShippingAmount), ConstValue.Invoice_ToCurrencyString(ProductPriceAmount), ConstValue.Invoice_ToCurrencyString(PromotionDiscountAmount), ConstValue.Invoice_ToCurrencyString(PointPayAmount), ConstValue.Invoice_ToCurrencyString(TariffAmount), ConstValue.Invoice_ToCurrencyString(DiscountAmount), ConstValue.Invoice_ToCurrencyString(PayAmount), ConstValue.Invoice_ToCurrencyString(ShippingGrossMargin), ConstValue.Invoice_ToCurrencyString(ProductCostAmount), ConstValue.Invoice_ToCurrencyString(ProductIncome), ConstValue.Invoice_ToCurrencyString(ProductGrossMargin), ConstValue.Invoice_ToCurrencyString(SOIncome), ConstValue.Invoice_ToCurrencyString(SOGrossMargin))); }
private void DataGrid_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { _facade.Query(_lastQueryVM, e.PageSize, e.PageIndex, e.SortField, result => { this.DataGrid.ItemsSource = result[0].Rows.ToList("IsChecked", false); this.DataGrid.TotalCount = result[0].TotalCount; this.tbStatisticInfo.Visibility = Visibility.Collapsed; if (result[1] != null && !(result[1].Rows is DynamicXml.EmptyList)) { string totalInfo = string.Format(ResBalanceAccountQuery.Message_TotalInfo, ConstValue.Invoice_ToCurrencyString(result[1].Rows[0].TotalStartBalance) , ConstValue.Invoice_ToCurrencyString(result[1].Rows[0].PayedIn) , ConstValue.Invoice_ToCurrencyString(result[1].Rows[0].PayedOut) , ConstValue.Invoice_ToCurrencyString(result[1].Rows[0].TotalEndBalance)); this.tbStatisticInfo.Text = totalInfo; this.tbStatisticInfo.Visibility = Visibility.Visible; } }); }
private void btnMerge_Click(object sender, RoutedEventArgs e) { var selectedList = GetSelectedInvoiceList(); if (selectedList.Count <= 0) { Window.Alert(ResCommon.Message_AtLeastChooseOneRecord); return; } decimal totalInvoiceAmt = 0; decimal totalIncomeAmt = 0; decimal totalPrepayAmt = 0; string prompMessage = string.Empty; selectedList.ForEach(p => { totalInvoiceAmt += p.InvoiceAmt ?? 0M; totalPrepayAmt += p.PrepayAmt ?? 0M; totalIncomeAmt += (p.InvoiceAmt ?? 0M) - (p.PrepayAmt ?? 0M); }); if (!selectedList[0].OrderType.HasValue || selectedList[0].OrderType == SOIncomeOrderType.SO) { prompMessage = string.Format(ResInvoiceQuery.Message_TotalSOAmountFormat , selectedList.Count , ConstValue.Invoice_ToCurrencyString(totalInvoiceAmt) , ConstValue.Invoice_ToCurrencyString(totalPrepayAmt) , ConstValue.Invoice_ToCurrencyString(totalIncomeAmt)); } else { prompMessage = string.Format(ResInvoiceQuery.Message_TotalAmountFormat , selectedList.Count , ConstValue.Invoice_ToCurrencyString(totalInvoiceAmt)); } Window.Alert(prompMessage); }
private void DataGrid_QueryResult_LoadingDataSource(object sender, Newegg.Oversea.Silverlight.Controls.Data.LoadingDataEventArgs e) { ValidationManager.Validate(this.QueryBuilder); if (queryVM.HasValidationErrors) { return; } facade.Query(lastQueryVM, e.PageSize, e.PageIndex, e.SortField, (obj, args) => { list = DynamicConverter <PayableVM> .ConvertToVMList(args.Result[0].Rows); this.DataGrid_QueryResult.ItemsSource = list; this.DataGrid_QueryResult.TotalCount = args.Result[0].TotalCount; this.svStatisticInfo.Visibility = Visibility.Visible; if (list != null && list.Count > 0) { decimal totalPay = 0; decimal totalAlreadyPay = 0; decimal totalUnPay = 0; decimal sapAmount = 0; list.Where(x => x.PayStatus != PayableStatus.Abandon).ToList().ForEach(p => { totalPay += p.PayableAmt ?? 0; totalAlreadyPay += p.AlreadyPayAmt ?? 0; if (p.OrderType == 0) { sapAmount += (p.InstockAmt ?? 0) - (p.ReturnPoint ?? 0); } else if (Convert.ToInt32(p.OrderType) == 11 || Convert.ToInt32(p.OrderType) == 12) { sapAmount += p.PayableAmt ?? 0; } else { sapAmount += p.InstockAmt ?? 0; } }); totalUnPay = totalPay - totalAlreadyPay; Text_CurrentPageStatistic.Text = string.Format(ResPayQuery.Label_CurrentPageStatistic, ConstValue.Invoice_ToCurrencyString(totalPay), ConstValue.Invoice_ToCurrencyString(totalAlreadyPay) , ConstValue.Invoice_ToCurrencyString(totalUnPay), ConstValue.Invoice_ToCurrencyString(sapAmount)); decimal puamt = Convert.ToDecimal(args.Result[1].Rows[0]["PUSum"]); decimal apamt = Convert.ToDecimal(args.Result[1].Rows[0]["APSum"]); decimal sapamt = Convert.ToDecimal(args.Result[1].Rows[0]["SapSum"]); Text_TotalStatistic.Text = string.Format(ResPayQuery.Label_TotalStatistic, ConstValue.Invoice_ToCurrencyString(puamt), ConstValue.Invoice_ToCurrencyString(apamt) , ConstValue.Invoice_ToCurrencyString(puamt - apamt), ConstValue.Invoice_ToCurrencyString(sapamt)); } else { Text_CurrentPageStatistic.Text = string.Format(ResPayQuery.Label_CurrentPageStatistic, ConstValue.Invoice_ToCurrencyString(0), ConstValue.Invoice_ToCurrencyString(0) , ConstValue.Invoice_ToCurrencyString(0), ConstValue.Invoice_ToCurrencyString(0)); Text_TotalStatistic.Text = string.Format(ResPayQuery.Label_TotalStatistic, ConstValue.Invoice_ToCurrencyString(0), ConstValue.Invoice_ToCurrencyString(0) , ConstValue.Invoice_ToCurrencyString(0), ConstValue.Invoice_ToCurrencyString(0)); } }); }
/// <summary> /// 合计选择项 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnTotal_Click(object sender, RoutedEventArgs e) { var selectedItemList = GetSelectedItemList(); if (selectedItemList.Count <= 0) { Window.Alert(ResCommon.Message_AtLeastChooseOneRecord); return; } decimal totalRefundAmt = 0; foreach (dynamic item in selectedItemList) { totalRefundAmt += item.ReturnPrepayAmt; } string totalInfo = string.Format("共选择了{0}条记录; 合计退款金额:{1}", selectedItemList.Count, ConstValue.Invoice_ToCurrencyString(totalRefundAmt)); this.tbStatisticInfo.Text = totalInfo; this.tbStatisticInfo.Visibility = Visibility.Visible; }