/// <summary> /// 导出 /// </summary> private void ToXls() { int recordCount = 0; //金额汇总信息 MReceivableSum sum = new MReceivableSum(); MReceivableBase queryModel = GetChaXunInfo(); IList <MReceivableInfo> ls = new BFinance().GetReceivableInfoLst( UtilsCommons.GetToXlsRecordCount(), 1, ref recordCount, ref sum, queryModel); if (ls != null && ls.Count > 0) { StringBuilder sb = new StringBuilder(); sb.Append("订单号\t线路名称\t客源单位\t客源单位部门\t客源单位联系人\t"); sb.Append("销售员\t下单人\t金额\t状态\t已收金额\t"); sb.Append("已收待审\t欠款金额\t已退金额\t已退待审金额\t开票金额\n"); foreach (MReceivableInfo item in ls) { sb.Append(item.OrderCode + "\t"); sb.Append(item.RouteName + "\t"); sb.Append(item.Customer + "\t"); sb.Append(item.KeHuDeptName + "\t"); sb.Append(item.Contact + "\t"); sb.Append(item.Salesman + "\t"); sb.Append(item.OperatorName + "\t"); sb.Append(UtilsCommons.GetMoneyString(item.Receivable, ProviderToMoney) + "\t"); sb.Append((item.IsConfirmed ? "已确认" : "未确认") + item.TourType + "\t"); sb.Append(UtilsCommons.GetMoneyString(item.Received, ProviderToMoney) + "\t"); sb.Append(UtilsCommons.GetMoneyString(item.UnChecked, ProviderToMoney) + "\t"); sb.Append(UtilsCommons.GetMoneyString(item.UnReceived, ProviderToMoney) + "\t"); sb.Append(UtilsCommons.GetMoneyString(item.Returned, ProviderToMoney) + "\t"); sb.Append(UtilsCommons.GetMoneyString(item.UnChkRtn, ProviderToMoney) + "\t"); sb.Append(UtilsCommons.GetMoneyString(item.Bill, ProviderToMoney) + "\n"); } ResponseToXls(sb.ToString()); } ResponseToXls(string.Empty); }
/// <summary> /// 初始化 /// </summary> private void DataInit() { #region 分页参数 int pageSize = 20; int pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); int recordCount = 0; #endregion #region 查询实体 MReceivableBase queryModel = GetChaXunInfo(); #endregion //金额汇总信息 MReceivableSum sum = new MReceivableSum(); IList <MReceivableInfo> ls = new BFinance().GetReceivableInfoLst( pageSize, pageIndex, ref recordCount, ref sum, queryModel); lbl_totalBill.Text = UtilsCommons.GetMoneyString(sum.TotalBill, ProviderToMoney); lbl_totalReceived.Text = UtilsCommons.GetMoneyString(sum.TotalReceived, ProviderToMoney); lbl_totalReturned.Text = UtilsCommons.GetMoneyString(sum.TotalReturned, ProviderToMoney); lbl_totalSumPrice.Text = UtilsCommons.GetMoneyString(sum.TotalSumPrice, ProviderToMoney); lbl_totalUnchecked.Text = UtilsCommons.GetMoneyString(sum.TotalUnchecked, ProviderToMoney); lbl_totalUnChkReturn.Text = UtilsCommons.GetMoneyString(sum.TotalUnChkReturn, ProviderToMoney); lbl_totalUnReceived.Text = UtilsCommons.GetMoneyString(sum.TotalUnReceived, ProviderToMoney); if (ls != null && ls.Count > 0) { pan_sum.Visible = true; pan_Msg.Visible = false; rpt_list.DataSource = ls; rpt_list.DataBind(); BindPage(pageSize, pageIndex, recordCount); } ExporPageInfoSelect1.Visible = ls != null && ls.Count > 0 && recordCount > pageSize; }