/// <summary> /// 初始化 /// </summary> private void DataInit() { BFinance bll = new BFinance(); string planId = Utils.GetQueryStringValue("planID"); if (planId != "") { //支出项目基本信息 MPayRegister model = bll.GetPayRegisterBaseByPlanId(planId); if (model != null) { lbl_listTitle.Text = "计调项:" + model.PlanTyp + " 单位名称:" + model.Supplier + " 结算金额:" + UtilsCommons.GetMoneyString(model.Payable, ProviderToMoney); lbl_listTitle.Text += " 已付金额" + UtilsCommons.GetMoneyString(model.Paid, ProviderToMoney) + " 未付金额:" + UtilsCommons.GetMoneyString(model.Unpaid, ProviderToMoney); if (model.PaymentType == EyouSoft.Model.EnumType.PlanStructure.Payment.导游现付) { this.phdAdd.Visible = false; } } //支出项目登记列表 IList <MRegister> ls = bll.GetPayRegisterLstByPlanId(planId); if (ls != null && ls.Count > 0) { rpt_list.DataSource = ls; rpt_list.DataBind(); } } }
/// <summary> /// 导出 /// </summary> private void ToXls() { int recordCount = 0; decimal sum = 0; MPayRegister queryModel = new MPayRegister(); queryModel.CompanyId = CurrentUserCompanyID; IList <MRegister> ls = new BFinance().GetTodayPaidLst( UtilsCommons.GetToXlsRecordCount(), 1, ref recordCount, ref sum, queryModel); if (ls != null && ls.Count > 0) { StringBuilder sb = new StringBuilder(); //应付账款 sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\n", "计调项", "团号", "供应商", "销售员", "计调员", "请款人", "请款金额", "支付方式"); foreach (MRegister item in ls) { sb.Append(item.PlanTyp + "\t"); sb.Append(item.TourCode + "\t"); sb.Append(item.Supplier + "\t"); sb.Append(item.Salesman + "\t"); sb.Append(item.Planer + "\t"); sb.Append(item.Dealer + "\t"); sb.Append(UtilsCommons.GetMoneyString(item.Payable, ProviderToMoney) + "\t"); sb.Append(item.PaymentName + "\n"); } ResponseToXls(sb.ToString()); } ResponseToXls(string.Empty); }
protected void Page_Load(object sender, EventArgs e) { if (UtilsCommons.IsToXls()) { ToXls(); } #region 分页参数 int pageSize = 20; int pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); int recordCount = 0; #endregion decimal sum = 0; MPayRegister queryModel = new MPayRegister(); queryModel.CompanyId = CurrentUserCompanyID; queryModel.Dealer = txt_SellsSelect1.SellsName = Utils.GetQueryStringValue(txt_SellsSelect1.SellsNameClient); queryModel.DealerId = txt_SellsSelect1.SellsID = Utils.GetQueryStringValue(txt_SellsSelect1.SellsIDClient); queryModel.Supplier = Utils.GetQueryStringValue("Supplier"); queryModel.TourCode = Utils.GetQueryStringValue("TourCode"); IList <MRegister> ls = new BFinance().GetTodayPaidLst( pageSize, pageIndex, ref recordCount, ref sum, queryModel); if (ls != null && ls.Count > 0) { pan_msg.Visible = false; rpt_list.DataSource = ls; rpt_list.DataBind(); //绑定分页 BindPage(pageSize, pageIndex, recordCount); } lbl_sum.Text = UtilsCommons.GetMoneyString(sum, ProviderToMoney); }