Ejemplo n.º 1
0
        /// <summary>
        /// 导出
        /// </summary>
        private void ToXls()
        {
            int recordCount = 0;
            //金额汇总信息
            decimal sum = 0;


            MAuditBase queryModel = new MAuditBase();

            queryModel.TourCode   = Utils.GetQueryStringValue("tourID");
            queryModel.IssueTimeS = Utils.GetQueryStringValue("SDate");
            queryModel.IssueTimeE = Utils.GetQueryStringValue("EDate");
            queryModel.SellerId   = txt_Seller.SellsID = Utils.GetQueryStringValue(txt_Seller.SellsIDClient);
            queryModel.SellerName = txt_Seller.SellsName = Utils.GetQueryStringValue(txt_Seller.SellsNameClient);
            queryModel.Crm        = Utils.GetQueryStringValue(CustomerUnitSelect1.ClientNameKHMC);
            queryModel.CrmId      = Utils.GetQueryStringValue(CustomerUnitSelect1.ClientNameKHBH);
            IList <MReconciliation> ls = new BFinance().GetReconciliationLst(
                UtilsCommons.GetToXlsRecordCount(),
                1,
                ref recordCount,
                ref sum,
                ReconciliationType.今日应收,
                CurrentUserCompanyID,
                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}\n",
                                "订单号",
                                "线路名称",
                                "客户单位",
                                "销售员",
                                "应收金额",
                                "核算日期",
                                "财务人");

                foreach (MReconciliation item in ls)
                {
                    sb.Append(item.OrderCode + "\t");
                    sb.Append(item.RouteName + "\t");
                    sb.Append(item.Crm + "\t");
                    sb.Append(item.SellerName + "\t");
                    sb.Append(UtilsCommons.GetMoneyString(item.Amount, ProviderToMoney) + "\t");
                    sb.Append(UtilsCommons.GetDateString(item.IssueTime, ProviderToDate) + "\t");
                    sb.Append(item.Operator + "\n");
                }
                ResponseToXls(sb.ToString());
            }
            ResponseToXls(string.Empty);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void DataInit()
        {
            CustomerUnitSelect1.DefaultTab = PlanProject.酒店;
            #region 分页参数
            int pageSize    = 20;
            int pageIndex   = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            int recordCount = 0;
            #endregion
            MAuditBase queryModel = new MAuditBase();
            queryModel.TourCode   = Utils.GetQueryStringValue("tourID");
            queryModel.IssueTimeS = Utils.GetQueryStringValue("SDate");
            queryModel.IssueTimeE = Utils.GetQueryStringValue("EDate");
            queryModel.SellerId   = txt_Seller.SellsID = Utils.GetQueryStringValue(txt_Seller.SellsIDClient);
            queryModel.SellerName = txt_Seller.SellsName = Utils.GetQueryStringValue(txt_Seller.SellsNameClient);
            queryModel.Crm        = Utils.GetQueryStringValue(CustomerUnitSelect1.ClientNameKHMC);
            queryModel.CrmId      = Utils.GetQueryStringValue(CustomerUnitSelect1.ClientNameKHBH);
            queryModel.SignAmount = (EqualSign?)Utils.GetEnumValueNull(typeof(EqualSign), Utils.GetQueryStringValue(CaiWuShaiXuan1.ClientUniqueIDOperator));
            queryModel.Amount     = Utils.GetDecimalNull(Utils.GetQueryStringValue(CaiWuShaiXuan1.ClientUniqueIDOperatorNumber));
            queryModel.PlanItem   = (PlanProject?)Utils.GetEnumValueNull(typeof(PlanProject), Utils.GetQueryStringValue("item"));
            decimal sum = 0;
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);

            IList <MReconciliation> ls = new BFinance().GetReconciliationLst(
                pageSize,
                pageIndex,
                ref recordCount,
                ref sum,
                ReconciliationType.今日应付,
                CurrentUserCompanyID,
                queryModel
                );
            lbl_sum.Text = UtilsCommons.GetMoneyString(sum, ProviderToMoney);
            if (ls != null && ls.Count > 0)
            {
                pan_sum.Visible     = !(pan_Msg.Visible = false);
                rpt_list.DataSource = ls;
                rpt_list.DataBind();
                //绑定分页
                BindPage(pageSize, pageIndex, recordCount);
            }
            ExporPageInfoSelect1.Visible = ls != null && ls.Count > 0 && recordCount > pageSize;
        }