コード例 #1
0
        /// <summary>
        /// 清空
        /// </summary>
        public override void ClearAction()
        {
            #region 查询条件初始化
            //销售组织
            mcbWhere_Sales_Org.Clear();
            //供应商
            mcbWhere_Client_Name.Clear();
            //销售时间开始
            dtWhere_Sales_TimeStart.Value = null;
            //销售时间结束
            dtWhere_Sales_TimeEnd.Value = null;
            //给 销售组织 设置焦点
            mcbWhere_Sales_Org.Focus();
            #endregion

            #region Grid初始化
            if (tabControlFull.Tabs[SysConst.EN_LIST].Selected)
            {
                _orgAndCustomerAmountTransTotalReportDS        = new List <OrgAndCustomerAmountTransTotalReportUIModel>();
                OrgAndCustomerAmountTransReportGrid.DataSource = _orgAndCustomerAmountTransTotalReportDS;
                OrgAndCustomerAmountTransReportGrid.DataBind();
            }
            else
            {
                _orgAndCustomerAmountTransDetailReportDS       = new List <OrgAndCustomerAmountTransDetailReportUIModel>();
                OrgAndCustomerAmountTransDetailGrid.DataSource = _orgAndCustomerAmountTransDetailReportDS;
                OrgAndCustomerAmountTransDetailGrid.DataBind();
            }
            #endregion
        }
コード例 #2
0
        /// <summary>
        /// 初始化【列表】Tab内控件
        /// </summary>
        private void InitializeListTabControls()
        {
            #region 初始化下拉框

            //组织下拉框
            _orgList = LoginInfoDAX.OrgList;
            mcbWhere_Sales_Org.DisplayMember = SystemTableColumnEnums.SM_Organization.Code.Org_ShortName;
            mcbWhere_Sales_Org.ValueMember   = SystemTableColumnEnums.SM_Organization.Code.Org_ID;
            mcbWhere_Sales_Org.DataSource    = _orgList;

            //客户
            var tempClientList = BLLCom.GetAllCustomerList(false, LoginInfoDAX.OrgID);
            if (tempClientList != null)
            {
                _clientList = tempClientList.Where(x => x.ClientType != "供应商").ToList();
            }
            mcbWhere_Client_Name.ExtraDisplayMember = "ClientType";
            mcbWhere_Client_Name.DisplayMember      = "ClientName";
            mcbWhere_Client_Name.ValueMember        = "ClientID";
            mcbWhere_Client_Name.DataSource         = _clientList;

            #endregion

            #region 查询条件初始化
            //销售组织
            mcbWhere_Sales_Org.Clear();
            //供应商
            mcbWhere_Client_Name.Clear();
            //销售时间开始
            dtWhere_Sales_TimeStart.Value = null;
            //销售时间结束
            dtWhere_Sales_TimeEnd.Value = null;
            //给 销售组织 设置焦点
            mcbWhere_Sales_Org.Focus();
            #endregion

            #region Grid初始化
            _orgAndCustomerAmountTransTotalReportDS        = new List <OrgAndCustomerAmountTransTotalReportUIModel>();
            OrgAndCustomerAmountTransReportGrid.DataSource = _orgAndCustomerAmountTransTotalReportDS;
            OrgAndCustomerAmountTransReportGrid.DataBind();

            _orgAndCustomerAmountTransDetailReportDS       = new List <OrgAndCustomerAmountTransDetailReportUIModel>();
            OrgAndCustomerAmountTransDetailGrid.DataSource = _orgAndCustomerAmountTransDetailReportDS;
            OrgAndCustomerAmountTransDetailGrid.DataBind();
            #endregion
        }
コード例 #3
0
        /// <summary>
        /// 导出全部
        /// </summary>
        public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "")
        {
            paramGridName = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? "组织与客户资金往来统计汇总" : "组织与客户资金往来统计明细";
            OrgAndCustomerAmountTransReportQCModel tempConditionDS = new OrgAndCustomerAmountTransReportQCModel()
            {
                //SqlId
                SqlId = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? SQLID.RPT_OrgAndCustomerAmountTransReport_SQL01 : SQLID.RPT_OrgAndCustomerAmountTransReport_SQL02,
                //客户ID
                CustomerID = this.mcbWhere_Client_Name.SelectedValue,
                PageIndex  = 1,
                PageSize   = null
            };

            //组织ID
            if (string.IsNullOrEmpty(mcbWhere_Sales_Org.SelectedValue))
            {
                var tmpOrgList = _orgList.Select(p => p.Org_ID).ToList();

                if (tmpOrgList.Count > 0)
                {
                    ConditionDS.OrgIdList = string.Join(SysConst.Semicolon_DBC, tmpOrgList);
                }
            }
            else
            {
                ConditionDS.OrgIdList = mcbWhere_Sales_Org.SelectedValue;
            }
            if (this.dtWhere_Sales_TimeStart.Value != null)
            {
                //销售时间-开始
                tempConditionDS.StartTime = this.dtWhere_Sales_TimeStart.DateTime;
            }
            if (this.dtWhere_Sales_TimeEnd.Value != null)
            {
                //销售时间-终了
                tempConditionDS.EndTime = this.dtWhere_Sales_TimeEnd.DateTime;
            }

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

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

                if (resultAllList.Count > 0)
                {
                    OrgAndCustomerAmountTransTotalReportUIModel subObject = resultAllList[0];
                    totalAccountPayableAmountOfAllPage = (subObject.TotalAccountReceivableAmount ?? 0);
                    totalPaidAmountOfAllPage           = (subObject.TotalReceivedAmount ?? 0);
                }

                foreach (var loopSotckInTotalItem in resultAllList)
                {
                    totalAccountPayableAmountOfCurPage += (loopSotckInTotalItem.ARB_AccountReceivableAmount ?? 0);
                    totalPaidAmountOfCurPage           += (loopSotckInTotalItem.ARB_ReceivedAmount ?? 0);
                }
                OrgAndCustomerAmountTransTotalReportUIModel curPageTotal = new OrgAndCustomerAmountTransTotalReportUIModel
                {
                    CustomerName = _sumCurPageDesc,
                    ARB_AccountReceivableAmount = Math.Round(totalAccountPayableAmountOfCurPage, 2),
                    ARB_ReceivedAmount          = Math.Round(totalPaidAmountOfCurPage, 2)
                };
                resultAllList.Add(curPageTotal);

                OrgAndCustomerAmountTransTotalReportUIModel allPageTotal = new OrgAndCustomerAmountTransTotalReportUIModel
                {
                    CustomerName = _sumAllPageDesc,
                    ARB_AccountReceivableAmount = Math.Round(totalAccountPayableAmountOfAllPage, 2),
                    ARB_ReceivedAmount          = Math.Round(totalPaidAmountOfAllPage, 2)
                };
                resultAllList.Add(allPageTotal);

                UltraGrid allGrid = OrgAndCustomerAmountTransReportGrid;
                allGrid.DataSource = resultAllList;
                allGrid.DataBind();

                base.ExportAllAction(allGrid, paramGridName);

                OrgAndCustomerAmountTransReportGrid.DataSource = _orgAndCustomerAmountTransTotalReportDS;
                OrgAndCustomerAmountTransReportGrid.DataBind();
            }
            else
            {
                List <OrgAndCustomerAmountTransDetailReportUIModel> resultAllList = new List <OrgAndCustomerAmountTransDetailReportUIModel>();
                _bll.QueryForList(SQLID.RPT_OrgAndCustomerAmountTransReport_SQL02, tempConditionDS, resultAllList);

                decimal totalAutoPartsQtyOfCurPage    = 0;
                decimal totalAutoPartsAmountOfCurPage = 0;
                decimal totalAutoPartsQtyOfAllPage    = 0;
                decimal totalAutoPartsAmountOfAllPage = 0;

                if (resultAllList.Count > 0)
                {
                    OrgAndCustomerAmountTransDetailReportUIModel subObject = resultAllList[0];
                    TotalRecordCountOfDetail      = (subObject.RecordCount ?? 0);
                    totalAutoPartsQtyOfAllPage    = (subObject.TotalAutoPartsQty ?? 0);
                    totalAutoPartsAmountOfAllPage = (subObject.TotalAutoPartsAmount ?? 0);
                }
                else
                {
                    TotalRecordCountOfDetail = 0;
                }

                foreach (var loopSotckInDetailItem in resultAllList)
                {
                    totalAutoPartsQtyOfCurPage    += (loopSotckInDetailItem.AutoPartsQty ?? 0);
                    totalAutoPartsAmountOfCurPage += (loopSotckInDetailItem.AutoPartsAmount ?? 0);
                }
                OrgAndCustomerAmountTransDetailReportUIModel curPageTotal = new OrgAndCustomerAmountTransDetailReportUIModel
                {
                    APA_Specification = _sumCurPageDesc,
                    AutoPartsQty      = Math.Round(totalAutoPartsQtyOfCurPage, 0),
                    AutoPartsAmount   = Math.Round(totalAutoPartsAmountOfCurPage, 2)
                };
                resultAllList.Add(curPageTotal);

                OrgAndCustomerAmountTransDetailReportUIModel allPageTotal = new OrgAndCustomerAmountTransDetailReportUIModel
                {
                    APA_Specification = _sumAllPageDesc,
                    AutoPartsQty      = Math.Round(totalAutoPartsQtyOfAllPage, 0),
                    AutoPartsAmount   = Math.Round(totalAutoPartsAmountOfAllPage, 2)
                };
                resultAllList.Add(allPageTotal);

                UltraGrid allGrid = OrgAndCustomerAmountTransDetailGrid;
                allGrid.DataSource = resultAllList;
                allGrid.DataBind();

                base.ExportAllAction(allGrid, paramGridName);

                OrgAndCustomerAmountTransDetailGrid.DataSource = _orgAndCustomerAmountTransDetailReportDS;
                OrgAndCustomerAmountTransDetailGrid.DataBind();
            }
        }
コード例 #4
0
        /// <summary>
        /// 查询组织与客户资金往来统计汇总
        /// </summary>
        private void QueryOrgAndCustomerAmountTransTotalReport()
        {
            try
            {
                OrgAndCustomerAmountTransReportQCModel argsModel = ConditionDS;
                argsModel.PageSize  = PageSizeOfTotal;
                argsModel.PageIndex = PageIndexOfTotal;
                //SqlId
                argsModel.SqlId = SQLID.RPT_OrgAndCustomerAmountTransReport_SQL01;

                _orgAndCustomerAmountTransTotalReportDS = new List <OrgAndCustomerAmountTransTotalReportUIModel>();
                _bll.QueryForList(argsModel.SqlId, argsModel, _orgAndCustomerAmountTransTotalReportDS);

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

                if (_orgAndCustomerAmountTransTotalReportDS.Count > 0)
                {
                    OrgAndCustomerAmountTransTotalReportUIModel subObject = _orgAndCustomerAmountTransTotalReportDS[0];
                    TotalRecordCountOfTotal            = subObject.RecordCount ?? 0;
                    totalAccountPayableAmountOfAllPage = (subObject.TotalAccountReceivableAmount ?? 0);
                    totalPaidAmountOfAllPage           = (subObject.TotalReceivedAmount ?? 0);
                }
                else
                {
                    TotalRecordCountOfTotal = 0;
                }

                foreach (var loopSotckInTotalItem in _orgAndCustomerAmountTransTotalReportDS)
                {
                    totalAccountPayableAmountOfCurPage += (loopSotckInTotalItem.ARB_AccountReceivableAmount ?? 0);
                    totalPaidAmountOfCurPage           += (loopSotckInTotalItem.ARB_ReceivedAmount ?? 0);
                }
                OrgAndCustomerAmountTransTotalReportUIModel curPageTotal = new OrgAndCustomerAmountTransTotalReportUIModel
                {
                    CustomerName = _sumCurPageDesc,
                    ARB_AccountReceivableAmount = Math.Round(totalAccountPayableAmountOfCurPage, 2),
                    ARB_ReceivedAmount          = Math.Round(totalPaidAmountOfCurPage, 2)
                };
                _orgAndCustomerAmountTransTotalReportDS.Add(curPageTotal);

                OrgAndCustomerAmountTransTotalReportUIModel allPageTotal = new OrgAndCustomerAmountTransTotalReportUIModel
                {
                    CustomerName = _sumAllPageDesc,
                    ARB_AccountReceivableAmount = Math.Round(totalAccountPayableAmountOfAllPage, 2),
                    ARB_ReceivedAmount          = Math.Round(totalPaidAmountOfAllPage, 2)
                };
                _orgAndCustomerAmountTransTotalReportDS.Add(allPageTotal);

                //重新计算[总页数],设置最新[allPageTotal]
                SetTotalPageCountAndTotalRecordCountOfTotal(TotalRecordCountOfTotal);
                //设置翻页按钮状态
                SetPageButtonStatusOfTotal();

                OrgAndCustomerAmountTransReportGrid.DataSource = _orgAndCustomerAmountTransTotalReportDS;
                OrgAndCustomerAmountTransReportGrid.DataBind();
                OrgAndCustomerAmountTransReportGrid.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.VisibleRows);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }