예제 #1
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");
        }
    }
예제 #3
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");
    }
예제 #4
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");
        }
    }
예제 #5
0
    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();
    }
예제 #6
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);
    }
예제 #8
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;
            }
            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");
        }
    }