/// <summary>
        /// 根据时间统计销售
        /// </summary>
        private void QueryStatisticsSalesByTimeReport()
        {
            try
            {
                ManagementSituationReportQCModel argsModel = ConditionDS;

                if (rbByMonth.Checked)
                {
                    //按月统计
                    argsModel.StatisticsMode = "Month";
                }
                else if (rbByQuarter.Checked)
                {
                    //按季度统计
                    argsModel.StatisticsMode = "Quarter";
                }
                else if (rbByYear.Checked)
                {
                    //按年统计
                    argsModel.StatisticsMode = "Year";
                }

                //是否包含退货
                argsModel.IsContainReturn = ckByTimeIsContainReturn.Checked;

                argsModel.SqlId = SQLID.RPT_ManagementSituationReport_SQL02;
                _statisticsSalesByTimeReportDs = new List <ManagementSituationDetailReportUIModel>();
                _bll.QueryForList(argsModel.SqlId, argsModel, _statisticsSalesByTimeReportDs);

                decimal totalSalesQtyOfCurPage          = 0;
                decimal totalSalesAmountOfCurPage       = 0;
                decimal totalGrossProfitAmountOfCurPage = 0;

                foreach (var loopDetail in _statisticsSalesByTimeReportDs)
                {
                    totalSalesQtyOfCurPage          += (loopDetail.SalesQty ?? 0);
                    totalSalesAmountOfCurPage       += (loopDetail.SalesAmount ?? 0);
                    totalGrossProfitAmountOfCurPage += (loopDetail.GrossProfitAmount ?? 0);
                }
                ManagementSituationDetailReportUIModel curPageTotal = new ManagementSituationDetailReportUIModel
                {
                    StatisticsType    = _sumCurPageDesc,
                    SalesQty          = Math.Round(totalSalesQtyOfCurPage, 0),
                    SalesAmount       = Math.Round(totalSalesAmountOfCurPage, 2),
                    GrossProfitAmount = Math.Round(totalGrossProfitAmountOfCurPage, 2)
                };
                _statisticsSalesByTimeReportDs.Add(curPageTotal);

                TJSalesByTimeGrid.DataSource = _statisticsSalesByTimeReportDs;
                TJSalesByTimeGrid.DataBind();
                TJSalesByTimeGrid.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.VisibleRows);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        ///// <summary>
        ///// 导出全部
        ///// </summary>
        //public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "")
        //{
        //    paramGridName = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? "经营情况统计" : "销售业绩明细";
        //    ManagementSituationReportQCModel tempConditionDS = new ManagementSituationReportQCModel()
        //    {
        //        //SqlId
        //        SqlId = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? SQLID.RPT_ManagementSituationReport_SQL01 : SQLID.RPT_ManagementSituationReport_SQL02,
        //        //组织ID
        //        OrgID = mcbWhere_Org.SelectedValue,
        //        PageIndex = 1,
        //        PageSize = null
        //    };
        //    if (this.dtWhere_StatisticsTimeStart.Value != null)
        //    {
        //        //统计时间-开始
        //        tempConditionDS.StartTime = this.dtWhere_StatisticsTimeStart.DateTime;
        //    }
        //    if (this.dtWhere_StatisticsTimeEnd.Value != null)
        //    {
        //        //统计时间-终了
        //        tempConditionDS.EndTime = this.dtWhere_StatisticsTimeEnd.DateTime;
        //    }

        //    if (tabControlFull.Tabs[SysConst.EN_LIST].Selected)
        //    {
        //        List<ManagementSituationTotalReportUIModel> resultAllList = new List<ManagementSituationTotalReportUIModel>();
        //        _bll.QueryForList(SQLID.RPT_ManagementSituationReport_SQL01, tempConditionDS, resultAllList);

        //        decimal totalAccountPayableAmountOfCurPage = 0;
        //        decimal totalPaidAmountOfCurPage = 0;
        //        decimal totalAccountPayableAmountOfAllPage = 0;
        //        decimal totalPaidAmountOfAllPage = 0;

        //        if (resultAllList.Count > 0)
        //        {
        //            ManagementSituationTotalReportUIModel subObject = resultAllList[0];
        //            //totalAccountPayableAmountOfAllPage = (subObject.TotalSalesAmount ?? 0);
        //            //totalPaidAmountOfAllPage = (subObject.TotalSalesReturnAmount ?? 0);
        //        }

        //        foreach (var loopSotckInTotalItem in resultAllList)
        //        {
        //            totalAccountPayableAmountOfCurPage += (loopSotckInTotalItem.StatisticsAmount ?? 0);
        //            //totalPaidAmountOfCurPage += (loopSotckInTotalItem.SalesReturnAmount ?? 0);
        //        }

        //        ManagementSituationTotalReportUIModel curPageTotal = new ManagementSituationTotalReportUIModel
        //        {
        //            StatisticsType = _sumCurPageDesc,
        //            StatisticsAmount = Math.Round(totalAccountPayableAmountOfCurPage, 2),
        //            //SalesReturnAmount = Math.Round(totalPaidAmountOfCurPage, 2)
        //        };
        //        resultAllList.Add(curPageTotal);

        //        ManagementSituationTotalReportUIModel allPageTotal = new ManagementSituationTotalReportUIModel
        //        {
        //            StatisticsType = _sumAllPageDesc,
        //            StatisticsAmount = Math.Round(totalAccountPayableAmountOfAllPage, 2),
        //            //SalesReturnAmount = Math.Round(totalPaidAmountOfAllPage, 2)
        //        };
        //        resultAllList.Add(allPageTotal);

        //        UltraGrid allGrid = ManagementSituationReportGrid;
        //        allGrid.DataSource = resultAllList;
        //        allGrid.DataBind();

        //        base.ExportAllAction(allGrid, paramGridName);

        //        ManagementSituationReportGrid.DataSource = _managementSituationTotalReportDs;
        //        ManagementSituationReportGrid.DataBind();
        //    }
        //    else
        //    {
        //        List<ManagementSituationDetailReportUIModel> resultAllList = new List<ManagementSituationDetailReportUIModel>();
        //        _bll.QueryForList(SQLID.RPT_ManagementSituationReport_SQL02, tempConditionDS, resultAllList);

        //        decimal totalSalesPerforamnceQtyOfCurPage = 0;
        //        decimal totalSalesPerforamnceAmountOfCurPage = 0;

        //        //foreach (var loopDetail in resultAllList)
        //        //{
        //        //    totalSalesPerforamnceQtyOfCurPage += (loopDetail.DetailSalesQty ?? 0);
        //        //    totalSalesPerforamnceAmountOfCurPage += (loopDetail.DetailSalesAmount ?? 0);
        //        //}
        //        //ManagementSituationDetailReportUIModel curPageTotal = new ManagementSituationDetailReportUIModel
        //        //{
        //        //    SO_CustomerName = _sumCurPageDesc,
        //        //    DetailSalesQty = Math.Round(totalSalesPerforamnceQtyOfCurPage, 0),
        //        //    DetailSalesAmount = Math.Round(totalSalesPerforamnceAmountOfCurPage, 2)
        //        //};
        //        //resultAllList.Add(curPageTotal);

        //        //ManagementSituationDetailReportUIModel allPageTotal = new ManagementSituationDetailReportUIModel
        //        //{
        //        //    SO_CustomerName = _sumAllPageDesc,
        //        //    DetailSalesQty = Math.Round(totalSalesPerforamnceQtyOfAllPage, 0),
        //        //    DetailSalesAmount = Math.Round(totalSalesPerforamnceAmountOfAllPage, 2)
        //        //};
        //        //resultAllList.Add(allPageTotal);

        //        UltraGrid allGrid = TJSalesByTimeGrid;
        //        allGrid.DataSource = resultAllList;
        //        allGrid.DataBind();

        //        base.ExportAllAction(allGrid, paramGridName);

        //        TJSalesByTimeGrid.DataSource = _statisticsSalesByTimeReportDs;
        //        TJSalesByTimeGrid.DataBind();
        //    }
        //}

        #endregion

        #endregion

        #region 自定义方法

        /// <summary>
        /// 初始化【列表】Tab内控件
        /// </summary>
        private void InitializeListTabControls()
        {
            #region 初始化下拉框

            //组织
            _orgList = LoginInfoDAX.OrgList;
            mcbWhere_Org.DisplayMember = SystemTableColumnEnums.SM_Organization.Code.Org_ShortName;
            mcbWhere_Org.ValueMember   = SystemTableColumnEnums.SM_Organization.Code.Org_ID;
            mcbWhere_Org.DataSource    = _orgList;

            #endregion

            #region 查询条件初始化
            //组织
            mcbWhere_Org.Clear();
            //统计时间开始
            dtWhere_StatisticsTimeStart.Value = null;
            //统计时间结束
            dtWhere_StatisticsTimeEnd.Value = null;
            //给 组织 设置焦点
            mcbWhere_Org.Focus();

            //设置默认值
            ckByTimeIsContainReturn.Checked = false;
            rbByMonth.Checked = true;
            ckByProductIsContainReturn.Checked  = false;
            rbSellTopTenProduct.Checked         = true;
            ckByCustomerIsContainReturn.Checked = false;
            rbSalesAmountTopTenCustomer.Checked = true;
            #endregion

            #region Grid初始化

            //经营情况统计汇总数据源
            _managementSituationTotalReportDs        = new List <ManagementSituationTotalReportUIModel>();
            ManagementSituationReportGrid.DataSource = _managementSituationTotalReportDs;
            ManagementSituationReportGrid.DataBind();

            //【销售统计】根据时间统计销售数据源
            _statisticsSalesByTimeReportDs = new List <ManagementSituationDetailReportUIModel>();
            TJSalesByTimeGrid.DataSource   = _statisticsSalesByTimeReportDs;
            TJSalesByTimeGrid.DataBind();

            //【销售统计】根据产品统计销售数据源
            _statisticsSalesByProductReportDs = new List <ManagementSituationDetailReportUIModel>();
            TJSalesByProductGrid.DataSource   = _statisticsSalesByProductReportDs;
            TJSalesByProductGrid.DataBind();

            //【销售统计】根据客户统计销售数据源
            _statisticsSalesByCustomerReportDs = new List <ManagementSituationDetailReportUIModel>();
            TJSalesByCustomerGrid.DataSource   = _statisticsSalesByCustomerReportDs;
            TJSalesByCustomerGrid.DataBind();
            #endregion
        }
        /// <summary>
        /// 清空
        /// </summary>
        public override void ClearAction()
        {
            #region 查询条件初始化
            //组织
            mcbWhere_Org.Clear();
            //统计时间开始
            dtWhere_StatisticsTimeStart.Value = null;
            //统计时间结束
            dtWhere_StatisticsTimeEnd.Value = null;
            //给 组织 设置焦点
            mcbWhere_Org.Focus();

            //设置默认值
            ckByTimeIsContainReturn.Checked = false;
            rbByMonth.Checked = true;
            ckByProductIsContainReturn.Checked  = false;
            rbSellTopTenProduct.Checked         = true;
            ckByCustomerIsContainReturn.Checked = false;
            rbSalesAmountTopTenCustomer.Checked = true;
            #endregion

            #region Grid初始化
            if (tabControlFull.Tabs[SysConst.EN_LIST].Selected)
            {
                //经营情况统计汇总数据源
                _managementSituationTotalReportDs        = new List <ManagementSituationTotalReportUIModel>();
                ManagementSituationReportGrid.DataSource = _managementSituationTotalReportDs;
                ManagementSituationReportGrid.DataBind();
            }
            else
            {
                //【销售统计】根据时间统计销售数据源
                _statisticsSalesByTimeReportDs = new List <ManagementSituationDetailReportUIModel>();
                TJSalesByTimeGrid.DataSource   = _statisticsSalesByTimeReportDs;
                TJSalesByTimeGrid.DataBind();

                //【销售统计】根据产品统计销售数据源
                _statisticsSalesByProductReportDs = new List <ManagementSituationDetailReportUIModel>();
                TJSalesByProductGrid.DataSource   = _statisticsSalesByProductReportDs;
                TJSalesByProductGrid.DataBind();

                //【销售统计】根据客户统计销售数据源
                _statisticsSalesByCustomerReportDs = new List <ManagementSituationDetailReportUIModel>();
                TJSalesByCustomerGrid.DataSource   = _statisticsSalesByCustomerReportDs;
                TJSalesByCustomerGrid.DataBind();
            }
            #endregion
        }