protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.cmdReturn1["Return"].NavigateUrl = this.cmdReturn2["Return"].NavigateUrl = WebUtil.Param("return");
         this.hidReturnUrl.Value = WebUtil.Param("return");
         this.drpPeriod.Items.Clear();
         this.txtMbrID.Text   = WebUtil.Param("mnum");
         this.txtMbrName.Text = WebUtil.Param("mname");
         using (ISession session = new Session())
         {
             IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session);
             foreach (INVPeriod p in periods)
             {
                 this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString()));
             }
             this.drpPeriod.SelectedValue = WebUtil.Param("pd");
             this.QueryAndBindData(session, 1, this.magicPagerMain.PageSize, true);
         }
     }
     else
     {
         this.frameDownload.Attributes["src"] = "about:blank;";
     }
 }
Example #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.txtDateFrom.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
            this.txtDateTo.Text   = DateTime.Now.ToString("yyyy-MM-dd");

            this.drpPeriod.Items.Clear();
            this.drpPeriod.Items.Add(new ListItem(" ", "0"));
            using (ISession session = new Session())
            {
                IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session);
                foreach (INVPeriod p in periods)
                {
                    this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString()));
                }
                if (this.drpPeriod.Items.Count > 1)
                {
                    this.drpPeriod.SelectedIndex = 1;
                }
                this.RestoreLastQuery(session);
            }
        }
        else
        {
            this.frameDownload.Attributes["src"] = "about:blank;";
        }
    }
Example #3
0
    private void QueryAndBindData(ISession session)
    {
        DateTime defaultDate = new DateTime(1900, 1, 1);
        DateTime startDate   = Cast.DateTime(this.txtDateFrom.Text, defaultDate);
        DateTime endDate     = Cast.DateTime(this.txtDateTo.Text, defaultDate);
        //如果选择了库存期间,使用库存期间的起始日期
        int periodId = Cast.Int(this.drpPeriod.SelectedValue, 0);

        if (periodId > 0)
        {
            INVPeriod period = INVPeriod.Retrieve(session, periodId);
            if (period != null)
            {
                startDate = period.StartingDate;
                endDate   = period.EndDate;
            }
        }
        if (startDate <= defaultDate || endDate <= defaultDate)
        {
            WebUtil.ShowError(this, "请选择时间范围或库存期间");
            return;
        }

        this.repeater.DataSource = Report.SaleAmtSum(session, startDate, endDate);
        this.repeater.DataBind();
        this.hidReturnUrl.Value = this.GetReturnUrl();
    }
    protected void MagicItemCommand(object sender, MagicItemEventArgs e)
    {
        if (e.CommandName != "Download")
        {
            return;
        }

        using (ISession session = new Session())
        {
            DateTime defaultDate = new DateTime(1900, 1, 1);
            DateTime startDate   = Cast.DateTime(this.txtDateFrom.Text, defaultDate);
            DateTime endDate     = Cast.DateTime(this.txtDateTo.Text, defaultDate);
            //如果选择了库存期间,使用库存期间的起始日期
            int periodId = Cast.Int(this.drpPeriod.SelectedValue, 0);
            if (periodId > 0)
            {
                INVPeriod period = INVPeriod.Retrieve(session, periodId);
                if (period != null)
                {
                    startDate = period.StartingDate;
                    endDate   = period.EndDate;
                }
            }
            if (startDate <= defaultDate || endDate <= defaultDate)
            {
                WebUtil.ShowError(this, "请选择时间范围或库存期间");
                return;
            }

            int     count = 0;
            DataSet ds    = Report.MbrAccountDetail(session, startDate, endDate
                                                    , Cast.Int(this.drpFlush.SelectedValue), Cast.Int(this.drpPayment.SelectedValue)
                                                    , this.txtOrder.Text, this.txtMbrID.Text, this.txtMbrName.Text, this.txtUser.Text
                                                    , -1, 0, false, ref count);
            string fileName = DownloadUtil.DownloadXls("Member_Account_Detail_" + DateTime.Now.ToString("yyMMdd") + ".xls", "RPT_MBR_ACC_",
                                                       new List <DownloadFormat>()
            {
                new DownloadFormat(DataType.Date, "日期", "FlushDate"),
                new DownloadFormat(DataType.Text, "变动原因", "FlushType"),
                new DownloadFormat(DataType.Text, "支付方式", "PaymentType"),
                new DownloadFormat(DataType.NumberText, "会员号", "MbrNum"),
                new DownloadFormat(DataType.Text, "姓名", "MbrName"),
                new DownloadFormat(DataType.NumberText, "凭证号", "OrderNumber"),
                new DownloadFormat(DataType.Number, "变动金额", "FlushAmt"),
                new DownloadFormat(DataType.Text, "操作人", "UserName"),
                new DownloadFormat(DataType.Text, "操作备注", "comments")
            }, ds);
            this.frameDownload.Attributes["src"] = fileName;
            WebUtil.DownloadHack(this, "txtDateFrom", "txtDateTo");
        }
    }
Example #5
0
    protected void MagicItemCommand(object sender, MagicItemEventArgs e)
    {
        if (e.CommandName != "Download")
        {
            return;
        }

        using (ISession session = new Session())
        {
            DateTime defaultDate = new DateTime(1900, 1, 1);
            DateTime startDate   = Cast.DateTime(this.txtDateFrom.Text, defaultDate);
            DateTime endDate     = Cast.DateTime(this.txtDateTo.Text, defaultDate);
            //如果选择了库存期间,使用库存期间的起始日期
            int periodId = Cast.Int(this.drpPeriod.SelectedValue, 0);
            if (periodId > 0)
            {
                INVPeriod period = INVPeriod.Retrieve(session, periodId);
                if (period != null)
                {
                    startDate = period.StartingDate;
                    endDate   = period.EndDate;
                }
            }
            if (startDate <= defaultDate || endDate <= defaultDate)
            {
                WebUtil.ShowError(this, "请选择时间范围或库存期间");
                return;
            }

            DataSet ds       = Report.SaleAmtSum(session, startDate, endDate);
            string  fileName = DownloadUtil.DownloadXls("Sale_Sum_" + DateTime.Now.ToString("yyMMdd") + ".xls", "RPT_SALE_AMT_SUM_",
                                                        new List <DownloadFormat>()
            {
                new DownloadFormat(DataType.Text, "物流公司", "LogisName"),
                new DownloadFormat(DataType.Number, "销售收入", "SaleAmt"),
                new DownloadFormat(DataType.Number, "发送费", "TransportAmt"),
                new DownloadFormat(DataType.Number, "包装费", "PackageAmt"),
                new DownloadFormat(DataType.Number, "礼券抵扣", "CouponsAmt"),
                new DownloadFormat(DataType.Number, "销售折扣", "DiscountAmt"),
                new DownloadFormat(DataType.Number, "订单金额合计", "OrderAmt"),
                new DownloadFormat(DataType.Number, "礼金支付", "EMoneyAmt"),
                new DownloadFormat(DataType.Number, "帐户支付", "AccountReceivable"),
                new DownloadFormat(DataType.Number, "POS机收款", "PosReceivable"),
                new DownloadFormat(DataType.Number, "物流应收款", "LogisReceivable")
            }, ds);
            this.frameDownload.Attributes["src"] = fileName;
        }
        WebUtil.DownloadHack(this, "txtDateFrom", "txtDateTo");
    }
Example #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.drpPeriod.Items.Clear();
            this.drpItemCat.Items.Clear();
            this.drpItemCat.Items.Add(new ListItem(" ", "0"));

            using (ISession session = new Session())
            {
                IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session);
                foreach (INVPeriod p in periods)
                {
                    this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString()));
                }
                IList <ItemCategory> cats = session.CreateEntityQuery <ItemCategory>()
                                            .List <ItemCategory>();
                foreach (ItemCategory c in cats)
                {
                    this.drpItemCat.Items.Add(new ListItem(c.CatName, c.CategoryID.ToString()));
                }

                if (WebUtil.Param("mode").Trim().ToLower() == "fix")
                {
                    this.cmdReturn1.Visible = true;
                    this.cmdReturn2.Visible = true;
                    this.cmdReturn1["Return"].NavigateUrl = "StockBalanceSum.aspx?pd=" + WebUtil.Param("pd");
                    this.cmdReturn2["Return"].NavigateUrl = "StockBalanceSum.aspx?pd=" + WebUtil.Param("pd");
                    this.drpItemCat.SelectedValue         = WebUtil.Param("cat");
                    this.drpPeriod.SelectedValue          = WebUtil.Param("pd");
                }
                else
                {
                    this.cmdReturn1.Visible = false;
                    this.cmdReturn2.Visible = false;
                }

                this.QueryAndBindData(session, 1, this.magicPagerMain.PageSize, true);
            }
        }
        else
        {
            this.frameDownload.Attributes["src"] = "about:blank;";
        }
    }
Example #7
0
    protected void MagicItemCommand(object sender, MagicItemEventArgs e)
    {
        if (e.CommandName != "Download")
        {
            return;
        }

        using (ISession session = new Session())
        {
            DateTime defaultDate = new DateTime(1900, 1, 1);
            DateTime startDate   = Cast.DateTime(this.txtDateFrom.Text, defaultDate);
            DateTime endDate     = Cast.DateTime(this.txtDateTo.Text, defaultDate);
            //如果选择了库存期间,使用库存期间的起始日期
            int periodId = Cast.Int(this.drpPeriod.SelectedValue, 0);
            if (periodId > 0)
            {
                INVPeriod period = INVPeriod.Retrieve(session, periodId);
                if (period != null)
                {
                    startDate = period.StartingDate;
                    endDate   = period.EndDate;
                }
            }
            if (startDate <= defaultDate || endDate <= defaultDate)
            {
                WebUtil.ShowError(this, "请选择时间范围或库存期间");
                return;
            }

            DataSet ds       = Report.LogisticDeliverySum(session, startDate, endDate);
            string  fileName = DownloadUtil.DownloadXls("Logis_Deliver_Sum_" + DateTime.Now.ToString("yyMMdd") + ".xls", "RPT_IC_Sum",
                                                        new List <DownloadFormat>()
            {
                new DownloadFormat(DataType.Text, "物流公司", "LogisName"),
                new DownloadFormat(DataType.Number, "发单数量", "OrderCount"),
                new DownloadFormat(DataType.Number, "包裹数量", "PackageCount"),
                new DownloadFormat(DataType.Number, "代收款金额", "AgentAmt"),
                new DownloadFormat(DataType.Number, "物流退货订单数量", "RtnOrdCount"),
                new DownloadFormat(DataType.Number, "退货订单代收款金额", "RtnAgentAmt"),
                new DownloadFormat(DataType.Number, "代收款差额", "DiffAmt")
            }, ds);
            this.frameDownload.Attributes["src"] = fileName;
            WebUtil.DownloadHack(this, "txtDateFrom", "txtDateTo");
        }
    }
    private void QueryAndBindData(ISession session, int pageIndex, int pageSize, bool fetchRecordCount)
    {
        DateTime defaultDate = new DateTime(1900, 1, 1);
        DateTime startDate   = Cast.DateTime(this.txtDateFrom.Text, defaultDate);
        DateTime endDate     = Cast.DateTime(this.txtDateTo.Text, defaultDate);
        //如果选择了库存期间,使用库存期间的起始日期
        int periodId = Cast.Int(this.drpPeriod.SelectedValue, 0);

        if (periodId > 0)
        {
            INVPeriod period = INVPeriod.Retrieve(session, periodId);
            if (period != null)
            {
                startDate = period.StartingDate;
                endDate   = period.EndDate;
            }
        }
        if (startDate <= defaultDate || endDate <= defaultDate)
        {
            WebUtil.ShowError(this, "请选择时间范围或库存期间");
            return;
        }
        int logisId = WebUtil.ParamInt("lg", 0);

        if (logisId != -99)
        {
            logisId = Cast.Int(this.drpLogis.SelectedValue);
        }

        int count = 0;

        this.repeater.DataSource = Report.SaleAmt(session, startDate, endDate, logisId
                                                  , this.txtSNNumber.Text, this.txtSONumber.Text, this.txtShippingNumber.Text
                                                  , pageIndex, pageSize, fetchRecordCount, ref count);
        this.repeater.DataBind();
        if (fetchRecordCount)
        {
            this.magicPagerMain.RecordCount = this.magicPagerSub.RecordCount = count;
        }
        WebUtil.SetMagicPager(magicPagerMain, pageSize, pageIndex);
        WebUtil.SetMagicPager(magicPagerSub, pageSize, pageIndex);
        this.hidReturnUrl.Value = this.GetReturnUrl();
    }
Example #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         this.drpPeriod.Items.Clear();
         using (ISession session = new Session())
         {
             IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session);
             foreach (INVPeriod p in periods)
             {
                 this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString()));
             }
             this.QueryAndBindData(session);
         }
     }
     else
     {
         this.frameDownload.Attributes["src"] = "about:blank;";
     }
 }
Example #10
0
    private void QueryAndBindData(ISession session)
    {
        DateTime defaultDate = new DateTime(1900, 1, 1);
        DateTime startDate   = Cast.DateTime(this.txtDateFrom.Text, defaultDate);
        DateTime endDate     = Cast.DateTime(this.txtDateTo.Text, defaultDate);
        //如果选择了库存期间,使用库存期间的起始日期
        int periodId = Cast.Int(this.drpPeriod.SelectedValue, 0);

        if (periodId > 0)
        {
            INVPeriod period = INVPeriod.Retrieve(session, periodId);
            if (period != null)
            {
                startDate = period.StartingDate;
                endDate   = period.EndDate;
            }
        }
        if (startDate <= defaultDate || endDate <= defaultDate)
        {
            WebUtil.ShowError(this, "请选择时间范围或库存期间");
            return;
        }

        if (periodId > 0)
        {
            DbSession  dbsession = session.DbSession as DbSession;
            IDbCommand cmd       = dbsession.CreateSqlStringCommand("select sum(begin_amt) as begin_amt,sum(end_amt) as end_amt from fi_rpt_cash_account_balance where pd_id=" + periodId.ToString());
            DataSet    ds        = dbsession.ExecuteDataSet(cmd);
            if (ds.Tables[0].Rows.Count > 0)
            {
                this.lblBegin.Text = RenderUtil.FormatNumber(Cast.Decimal(ds.Tables[0].Rows[0]["begin_amt"]), "#,##0.#0", "0.00");
                this.lblEnd.Text   = RenderUtil.FormatNumber(Cast.Decimal(ds.Tables[0].Rows[0]["end_amt"]), "#,##0.#0", "0.00");
            }
        }

        this.repeater.DataSource = Report.MbrAccountSum(session, startDate, endDate);
        this.repeater.DataBind();
        this.hidReturnUrl.Value = this.GetReturnUrl();
    }
    private void QueryAndBindData(ISession session, int pageIndex, int pageSize, bool fetchRecordCount)
    {
        DateTime defaultDate = new DateTime(1900, 1, 1);
        DateTime startDate   = Cast.DateTime(this.txtDateFrom.Text, defaultDate);
        DateTime endDate     = Cast.DateTime(this.txtDateTo.Text, defaultDate);
        //如果选择了库存期间,使用库存期间的起始日期
        int periodId = Cast.Int(this.drpPeriod.SelectedValue, 0);

        if (periodId > 0)
        {
            INVPeriod period = INVPeriod.Retrieve(session, periodId);
            if (period != null)
            {
                startDate = period.StartingDate;
                endDate   = period.EndDate;
            }
        }
        if (startDate <= defaultDate || endDate <= defaultDate)
        {
            WebUtil.ShowError(this, "请选择时间范围或库存期间");
            return;
        }

        int count = 0;

        this.repeater.DataSource = Report.MbrAccountDetail(session, startDate, endDate
                                                           , Cast.Int(this.drpFlush.SelectedValue), Cast.Int(this.drpPayment.SelectedValue)
                                                           , this.txtOrder.Text, this.txtMbrID.Text, this.txtMbrName.Text, this.txtUser.Text
                                                           , pageIndex, pageSize, fetchRecordCount, ref count);
        this.repeater.DataBind();
        if (fetchRecordCount)
        {
            this.magicPagerMain.RecordCount = this.magicPagerSub.RecordCount = count;
        }
        WebUtil.SetMagicPager(magicPagerMain, pageSize, pageIndex);
        WebUtil.SetMagicPager(magicPagerSub, pageSize, pageIndex);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.cmdReturn1.Visible = false;
            this.cmdReturn2.Visible = false;

            this.txtDateFrom.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
            this.txtDateTo.Text   = DateTime.Now.ToString("yyyy-MM-dd");

            this.drpPeriod.Items.Clear();
            this.drpPeriod.Items.Add(new ListItem(" ", "0"));
            this.drpFlush.Items.Clear();
            this.drpFlush.Items.Add(new ListItem(" ", "0"));
            this.drpPayment.Items.Clear();
            this.drpPayment.Items.Add(new ListItem(" ", "0"));
            using (ISession session = new Session())
            {
                IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session);
                foreach (INVPeriod p in periods)
                {
                    this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString()));
                }
                if (this.drpPeriod.Items.Count > 1)
                {
                    this.drpPeriod.SelectedIndex = 1;
                }
                IList <FlushType> flush = FlushType.EffectiveList(session);
                foreach (FlushType f in flush)
                {
                    this.drpFlush.Items.Add(new ListItem(f.Name, f.ID.ToString()));
                }

                //直接sql取了
                IList <PaymentMethod> payment = session.CreateObjectQuery(@"
Select * From s_payment_METHOD Where Id In(
    Select Distinct pay_method From mbr_money_history
)
order by name")
                                                .List <PaymentMethod>();
                foreach (PaymentMethod p in payment)
                {
                    this.drpPayment.Items.Add(new ListItem(p.Name, p.ID.ToString()));
                }

                string mode = WebUtil.Param("mode");
                if (mode.Trim().ToLower() == "fix")
                {
                    //从帐户变动汇总导航过来
                    this.cmdReturn1.Visible = true;
                    this.cmdReturn2.Visible = true;
                    this.cmdReturn1["Return"].NavigateUrl = this.cmdReturn2["Return"].NavigateUrl = WebUtil.Param("return");

                    this.drpPeriod.SelectedValue  = WebUtil.ParamInt("pd", 0).ToString();
                    this.drpFlush.SelectedValue   = WebUtil.ParamInt("flush", 0).ToString();
                    this.drpPayment.SelectedValue = WebUtil.ParamInt("payment", 0).ToString();
                    DateTime dt;
                    dt = Cast.DateTime(WebUtil.Param("df"), new DateTime(1900, 1, 1));
                    if (dt > new DateTime(1900, 1, 1))
                    {
                        this.txtDateFrom.Text = dt.ToString("yyyy-MM-dd");
                    }
                    dt = Cast.DateTime(WebUtil.Param("dt"), new DateTime(1900, 1, 1));
                    if (dt > new DateTime(1900, 1, 1))
                    {
                        this.txtDateTo.Text = dt.ToString("yyyy-MM-dd");
                    }
                    this.txtMbrID.Text = WebUtil.Param("mbr");
                }

                this.QueryAndBindData(session, 1, this.magicPagerMain.PageSize, true);
            }
        }
        else
        {
            this.frameDownload.Attributes["src"] = "about:blank;";
        }
    }
    protected void MagicItemCommand(object sender, MagicItemEventArgs e)
    {
        if (e.CommandName != "Download")
        {
            return;
        }

        using (ISession session = new Session())
        {
            DateTime defaultDate = new DateTime(1900, 1, 1);
            DateTime startDate   = Cast.DateTime(this.txtDateFrom.Text, defaultDate);
            DateTime endDate     = Cast.DateTime(this.txtDateTo.Text, defaultDate);
            //如果选择了库存期间,使用库存期间的起始日期
            int periodId = Cast.Int(this.drpPeriod.SelectedValue, 0);
            if (periodId > 0)
            {
                INVPeriod period = INVPeriod.Retrieve(session, periodId);
                if (period != null)
                {
                    startDate = period.StartingDate;
                    endDate   = period.EndDate;
                }
            }
            if (startDate <= defaultDate || endDate <= defaultDate)
            {
                WebUtil.ShowError(this, "请选择时间范围或库存期间");
                return;
            }
            int logisId = WebUtil.ParamInt("lg", 0);
            if (logisId != -99)
            {
                logisId = Cast.Int(this.drpLogis.SelectedValue);
            }

            int     count = 0;
            DataSet ds    = Report.SaleAmt(session, startDate, endDate, logisId
                                           , this.txtSNNumber.Text, this.txtSONumber.Text, this.txtShippingNumber.Text
                                           , -1, 0, false, ref count);
            string fileName = DownloadUtil.DownloadXls("Sale_" + DateTime.Now.ToString("yyMMdd") + ".xls", "RPT_SALE_AMT_DTL_",
                                                       new List <DownloadFormat>()
            {
                new DownloadFormat(DataType.Date, "发货日期", "TransDate"),
                new DownloadFormat(DataType.NumberText, "发货单", "SNNumber"),
                new DownloadFormat(DataType.NumberText, "订单", "SONumber"),
                new DownloadFormat(DataType.NumberText, "运单号", "ShippingNumber"),
                new DownloadFormat(DataType.Number, "成本金额", "CostAmt"),
                new DownloadFormat(DataType.Number, "销售收入", "SaleAmt"),
                new DownloadFormat(DataType.Number, "发送费", "TransportAmt"),
                new DownloadFormat(DataType.Number, "包装费", "PackageAmt"),
                new DownloadFormat(DataType.Number, "礼券抵扣", "CouponsAmt"),
                new DownloadFormat(DataType.Number, "销售折扣", "DiscountAmt"),
                new DownloadFormat(DataType.Number, "礼金支付", "EMoneyAmt"),
                new DownloadFormat(DataType.Number, "帐户支付", "AccountReceivable"),
                new DownloadFormat(DataType.Number, "POS机收款", "PosReceivable"),
                new DownloadFormat(DataType.Number, "物流应收款", "LogisReceivable"),
                new DownloadFormat(DataType.Number, "实际应收款", "ActualReceivable")
            }, ds);
            this.frameDownload.Attributes["src"] = fileName;
            WebUtil.DownloadHack(this, "txtDateFrom", "txtDateTo");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.cmdReturn1.Visible = false;
            this.cmdReturn2.Visible = false;

            this.txtDateFrom.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
            this.txtDateTo.Text   = DateTime.Now.ToString("yyyy-MM-dd");

            this.drpPeriod.Items.Clear();
            this.drpPeriod.Items.Add(new ListItem(" ", "0"));
            this.drpLogis.Items.Clear();
            this.drpLogis.Items.Add(new ListItem(" ", "0"));
            using (ISession session = new Session())
            {
                IList <INVPeriod> periods = INVPeriod.ClosedPeriods(session);
                foreach (INVPeriod p in periods)
                {
                    this.drpPeriod.Items.Add(new ListItem(p.PeriodCode, p.PeriodID.ToString()));
                }
                if (this.drpPeriod.Items.Count > 1)
                {
                    this.drpPeriod.SelectedIndex = 1;
                }
                IList <Logistics> logis = session.CreateEntityQuery <Logistics>()
                                          .OrderBy("ShortName")
                                          .List <Logistics>();
                foreach (Logistics lg in logis)
                {
                    this.drpLogis.Items.Add(new ListItem(lg.ShortName, lg.LogisticCompID.ToString()));
                }

                string mode = WebUtil.Param("mode");
                if (mode.Trim().ToLower() == "fix")
                {
                    //从销售款统计导航过来
                    this.cmdReturn1.Visible = true;
                    this.cmdReturn2.Visible = true;
                    this.cmdReturn1["Return"].NavigateUrl = this.cmdReturn2["Return"].NavigateUrl = WebUtil.Param("return");

                    this.drpPeriod.SelectedValue = WebUtil.ParamInt("pd", 0).ToString();
                    int logisId = WebUtil.ParamInt("lg", 0);
                    if (logisId < 0)
                    {
                        logisId = 0;
                    }
                    this.drpLogis.SelectedValue = logisId.ToString();
                    DateTime dt;
                    dt = Cast.DateTime(WebUtil.Param("df"), new DateTime(1900, 1, 1));
                    if (dt > new DateTime(1900, 1, 1))
                    {
                        this.txtDateFrom.Text = dt.ToString("yyyy-MM-dd");
                    }
                    dt = Cast.DateTime(WebUtil.Param("dt"), new DateTime(1900, 1, 1));
                    if (dt > new DateTime(1900, 1, 1))
                    {
                        this.txtDateTo.Text = dt.ToString("yyyy-MM-dd");
                    }
                }

                this.RestoreLastQuery(session);
            }
        }
        else
        {
            this.frameDownload.Attributes["src"] = "about:blank;";
        }
    }