Beispiel #1
0
        /// <summary>
        /// 清空
        /// </summary>
        public override void ClearAction()
        {
            #region 查询条件初始化
            //源组织
            mcbWhere_SourOrg.Clear();
            //目的组织
            mcbWhere_DestOrg.Clear();
            //时间开始
            dtWhere_CreatedTimeStart.Value = null;
            //时间结束
            dtWhere_CreatedTimeEnd.Value = null;
            //给 源组织 设置焦点
            mcbWhere_SourOrg.Focus();
            #endregion

            #region Grid初始化
            if (tabControlFull.Tabs[SysConst.EN_LIST].Selected)
            {
                _orgAndOrgAmountTransTotalReportDs        = new List <OrgAndOrgAmountTransTotalReportUIModel>();
                OrgAndOrgAmountTransReportGrid.DataSource = _orgAndOrgAmountTransTotalReportDs;
                OrgAndOrgAmountTransReportGrid.DataBind();
            }
            else
            {
                _orgAndOrgAmountTransDetailReportDs       = new List <OrgAndOrgAmountTransDetailReportUIModel>();
                OrgAndOrgAmountTransDetailGrid.DataSource = _orgAndOrgAmountTransDetailReportDs;
                OrgAndOrgAmountTransDetailGrid.DataBind();
            }
            #endregion
        }
Beispiel #2
0
        /// <summary>
        /// 初始化【列表】Tab内控件
        /// </summary>
        private void InitializeListTabControls()
        {
            #region 初始化下拉框

            //组织下拉框
            _orgList = LoginInfoDAX.OrgList;
            //源组织
            mcbWhere_SourOrg.DisplayMember = SystemTableColumnEnums.SM_Organization.Code.Org_ShortName;
            mcbWhere_SourOrg.ValueMember   = SystemTableColumnEnums.SM_Organization.Code.Org_ID;
            mcbWhere_SourOrg.DataSource    = _orgList;
            //目的组织
            mcbWhere_DestOrg.DisplayMember = SystemTableColumnEnums.SM_Organization.Code.Org_ShortName;
            mcbWhere_DestOrg.ValueMember   = SystemTableColumnEnums.SM_Organization.Code.Org_ID;
            mcbWhere_DestOrg.DataSource    = _orgList;

            #endregion

            #region 查询条件初始化
            //源组织
            mcbWhere_SourOrg.Clear();
            //目的组织
            mcbWhere_DestOrg.Clear();
            //时间开始
            dtWhere_CreatedTimeStart.Value = null;
            //时间结束
            dtWhere_CreatedTimeEnd.Value = null;
            //给 源组织 设置焦点
            mcbWhere_SourOrg.Focus();
            #endregion

            #region Grid初始化
            _orgAndOrgAmountTransTotalReportDs        = new List <OrgAndOrgAmountTransTotalReportUIModel>();
            OrgAndOrgAmountTransReportGrid.DataSource = _orgAndOrgAmountTransTotalReportDs;
            OrgAndOrgAmountTransReportGrid.DataBind();

            _orgAndOrgAmountTransDetailReportDs       = new List <OrgAndOrgAmountTransDetailReportUIModel>();
            OrgAndOrgAmountTransDetailGrid.DataSource = _orgAndOrgAmountTransDetailReportDs;
            OrgAndOrgAmountTransDetailGrid.DataBind();
            #endregion
        }
Beispiel #3
0
        /// <summary>
        /// 导出全部
        /// </summary>
        public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "")
        {
            paramGridName = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? "组织与组织资金往来统计汇总" : "组织与组织资金往来统计明细";
            OrgAndOrgAmountTransReportQCModel tempConditionDS = new OrgAndOrgAmountTransReportQCModel()
            {
                //SqlId
                SqlId     = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? SQLID.RPT_OrgAndOrgAmountTransReport_SQL01 : SQLID.RPT_OrgAndOrgAmountTransReport_SQL02,
                PageIndex = 1,
                PageSize  = null
            };

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

                if (tmpOrgList.Count > 0)
                {
                    tempConditionDS.SourOrgIdList = string.Join(SysConst.Semicolon_DBC, tmpOrgList);
                }
            }
            else
            {
                tempConditionDS.SourOrgIdList = mcbWhere_SourOrg.SelectedValue;
            }
            //目的组织ID
            if (string.IsNullOrEmpty(mcbWhere_DestOrg.SelectedValue))
            {
                var tmpOrgList = _orgList.Select(p => p.Org_ID).ToList();

                if (tmpOrgList.Count > 0)
                {
                    tempConditionDS.DestOrgIdList = string.Join(SysConst.Semicolon_DBC, tmpOrgList);
                }
            }
            else
            {
                tempConditionDS.DestOrgIdList = mcbWhere_DestOrg.SelectedValue;
            }

            if (this.dtWhere_CreatedTimeStart.Value != null)
            {
                //时间-开始
                tempConditionDS.StartTime = this.dtWhere_CreatedTimeStart.DateTime;
            }
            if (this.dtWhere_CreatedTimeEnd.Value != null)
            {
                //时间-终了
                tempConditionDS.EndTime = this.dtWhere_CreatedTimeEnd.DateTime;
            }

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

                //当前页合计
                decimal totalAccountReceivableAmountOfCurPage = 0;
                decimal totalReceivedAmountOfCurPage          = 0;
                decimal totalAccountPayableAmountOfCurPage    = 0;
                decimal totalPaidAmountOfCurPage = 0;
                //合计
                decimal totalAccountReceivableAmountOfAllPage = 0;
                decimal totalReceivedAmountOfAllPage          = 0;
                decimal totalAccountPayableAmountOfAllPage    = 0;
                decimal totalPaidAmountOfAllPage = 0;

                foreach (var loopItem in resultAllList)
                {
                    totalAccountReceivableAmountOfCurPage += (loopItem.ARB_AccountReceivableAmount ?? 0);
                    totalReceivedAmountOfCurPage          += (loopItem.ARB_ReceivedAmount ?? 0);
                    totalAccountPayableAmountOfCurPage    += (loopItem.APB_AccountPayableAmount ?? 0);
                    totalPaidAmountOfCurPage += (loopItem.APB_PaidAmount ?? 0);
                }
                OrgAndOrgAmountTransTotalReportUIModel curPageTotal = new OrgAndOrgAmountTransTotalReportUIModel
                {
                    DestOrgName = _sumCurPageDesc,
                    ARB_AccountReceivableAmount = Math.Round(totalAccountReceivableAmountOfCurPage, 2),
                    ARB_ReceivedAmount          = Math.Round(totalReceivedAmountOfCurPage, 2),
                    APB_AccountPayableAmount    = Math.Round(totalAccountPayableAmountOfCurPage, 2),
                    APB_PaidAmount = Math.Round(totalPaidAmountOfCurPage, 2)
                };
                resultAllList.Add(curPageTotal);

                if (resultAllList.Count > 0)
                {
                    OrgAndOrgAmountTransTotalReportUIModel subObject = _orgAndOrgAmountTransTotalReportDs[0];
                    TotalRecordCountOfTotal = subObject.RecordCount ?? 0;
                    totalAccountReceivableAmountOfAllPage = (subObject.TotalAccountReceivableAmount ?? 0);
                    totalReceivedAmountOfAllPage          = (subObject.TotalReceivedAmount ?? 0);
                    totalAccountPayableAmountOfAllPage    = (subObject.TotalAccountPayableAmount ?? 0);
                    totalPaidAmountOfAllPage = (subObject.TotalPaidAmount ?? 0);
                }

                OrgAndOrgAmountTransTotalReportUIModel allPageTotal = new OrgAndOrgAmountTransTotalReportUIModel
                {
                    DestOrgName = _sumAllPageDesc,
                    ARB_AccountReceivableAmount = Math.Round(totalAccountReceivableAmountOfAllPage, 2),
                    ARB_ReceivedAmount          = Math.Round(totalReceivedAmountOfAllPage, 2),
                    APB_AccountPayableAmount    = Math.Round(totalAccountPayableAmountOfAllPage, 2),
                    APB_PaidAmount = Math.Round(totalPaidAmountOfAllPage, 2)
                };
                resultAllList.Add(allPageTotal);

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

                base.ExportAllAction(allGrid, paramGridName);

                OrgAndOrgAmountTransReportGrid.DataSource = _orgAndOrgAmountTransTotalReportDs;
                OrgAndOrgAmountTransReportGrid.DataBind();
            }
            else
            {
                List <OrgAndOrgAmountTransDetailReportUIModel> resultAllList = new List <OrgAndOrgAmountTransDetailReportUIModel>();
                _bll.QueryForList(SQLID.RPT_OrgAndOrgAmountTransReport_SQL02, tempConditionDS, resultAllList);

                //当前页合计
                decimal totalQtyOfCurPage    = 0;
                decimal totalAmountOfCurPage = 0;
                //合计
                decimal totalQtyOfAllPage    = 0;
                decimal totalAmountOfAllPage = 0;

                foreach (var loopDetail in resultAllList)
                {
                    totalQtyOfCurPage    += (loopDetail.TBD_Qty ?? 0);
                    totalAmountOfCurPage += (loopDetail.TransferAmount ?? 0);
                }
                OrgAndOrgAmountTransDetailReportUIModel curPageTotal = new OrgAndOrgAmountTransDetailReportUIModel
                {
                    TBD_Specification = _sumCurPageDesc,
                    TBD_Qty           = Math.Round(totalQtyOfCurPage, 2),
                    TransferAmount    = Math.Round(totalAmountOfCurPage, 2),
                };
                resultAllList.Add(curPageTotal);

                if (resultAllList.Count > 0)
                {
                    OrgAndOrgAmountTransDetailReportUIModel subObject = resultAllList[0];
                    TotalRecordCountOfDetail = (subObject.RecordCount ?? 0);
                    totalQtyOfAllPage        = (subObject.TotalQty ?? 0);
                    totalAmountOfAllPage     = (subObject.TotalAmount ?? 0);
                }
                else
                {
                    TotalRecordCountOfDetail = 0;
                }

                OrgAndOrgAmountTransDetailReportUIModel allPageTotal = new OrgAndOrgAmountTransDetailReportUIModel
                {
                    TBD_Specification = _sumAllPageDesc,
                    TBD_Qty           = Math.Round(totalQtyOfAllPage, 2),
                    TransferAmount    = Math.Round(totalAmountOfAllPage, 2),
                };
                resultAllList.Add(allPageTotal);

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

                base.ExportAllAction(allGrid, paramGridName);

                OrgAndOrgAmountTransDetailGrid.DataSource = _orgAndOrgAmountTransDetailReportDs;
                OrgAndOrgAmountTransDetailGrid.DataBind();
            }
        }
Beispiel #4
0
        /// <summary>
        /// 查询组织与组织资金往来统计汇总
        /// </summary>
        private void QueryOrgAndOrgAmountTransTotalReport()
        {
            try
            {
                OrgAndOrgAmountTransReportQCModel argsModel = ConditionDS;
                argsModel.PageSize  = PageSizeOfTotal;
                argsModel.PageIndex = PageIndexOfTotal;
                //SqlId
                argsModel.SqlId = SQLID.RPT_OrgAndOrgAmountTransReport_SQL01;

                _orgAndOrgAmountTransTotalReportDs = new List <OrgAndOrgAmountTransTotalReportUIModel>();
                _bll.QueryForList(argsModel.SqlId, argsModel, _orgAndOrgAmountTransTotalReportDs);

                //当前页合计
                decimal totalAccountReceivableAmountOfCurPage = 0;
                decimal totalReceivedAmountOfCurPage          = 0;
                decimal totalAccountPayableAmountOfCurPage    = 0;
                decimal totalPaidAmountOfCurPage = 0;
                //合计
                decimal totalAccountReceivableAmountOfAllPage = 0;
                decimal totalReceivedAmountOfAllPage          = 0;
                decimal totalAccountPayableAmountOfAllPage    = 0;
                decimal totalPaidAmountOfAllPage = 0;

                foreach (var loopTotal in _orgAndOrgAmountTransTotalReportDs)
                {
                    totalAccountReceivableAmountOfCurPage += (loopTotal.ARB_AccountReceivableAmount ?? 0);
                    totalReceivedAmountOfCurPage          += (loopTotal.ARB_ReceivedAmount ?? 0);
                    totalAccountPayableAmountOfCurPage    += (loopTotal.APB_AccountPayableAmount ?? 0);
                    totalPaidAmountOfCurPage += (loopTotal.APB_PaidAmount ?? 0);
                }
                OrgAndOrgAmountTransTotalReportUIModel curPageTotal = new OrgAndOrgAmountTransTotalReportUIModel
                {
                    DestOrgName = _sumCurPageDesc,
                    ARB_AccountReceivableAmount = Math.Round(totalAccountReceivableAmountOfCurPage, 2),
                    ARB_ReceivedAmount          = Math.Round(totalReceivedAmountOfCurPage, 2),
                    APB_AccountPayableAmount    = Math.Round(totalAccountPayableAmountOfCurPage, 2),
                    APB_PaidAmount = Math.Round(totalPaidAmountOfCurPage, 2),
                };
                _orgAndOrgAmountTransTotalReportDs.Add(curPageTotal);

                if (_orgAndOrgAmountTransTotalReportDs.Count > 0)
                {
                    OrgAndOrgAmountTransTotalReportUIModel subObject = _orgAndOrgAmountTransTotalReportDs[0];
                    TotalRecordCountOfTotal = subObject.RecordCount ?? 0;
                    totalAccountReceivableAmountOfAllPage = (subObject.TotalAccountReceivableAmount ?? 0);
                    totalReceivedAmountOfAllPage          = (subObject.TotalReceivedAmount ?? 0);
                    totalAccountPayableAmountOfAllPage    = (subObject.TotalAccountPayableAmount ?? 0);
                    totalPaidAmountOfAllPage = (subObject.TotalPaidAmount ?? 0);
                }
                else
                {
                    TotalRecordCountOfTotal = 0;
                }
                OrgAndOrgAmountTransTotalReportUIModel allPageTotal = new OrgAndOrgAmountTransTotalReportUIModel
                {
                    DestOrgName = _sumAllPageDesc,
                    ARB_AccountReceivableAmount = Math.Round(totalAccountReceivableAmountOfAllPage, 2),
                    ARB_ReceivedAmount          = Math.Round(totalReceivedAmountOfAllPage, 2),
                    APB_AccountPayableAmount    = Math.Round(totalAccountPayableAmountOfAllPage, 2),
                    APB_PaidAmount = Math.Round(totalPaidAmountOfAllPage, 2),
                };
                _orgAndOrgAmountTransTotalReportDs.Add(allPageTotal);

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

                OrgAndOrgAmountTransReportGrid.DataSource = _orgAndOrgAmountTransTotalReportDs;
                OrgAndOrgAmountTransReportGrid.DataBind();
                OrgAndOrgAmountTransReportGrid.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.VisibleRows);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #5
0
 /// <summary>
 /// 【汇总】Grid的CellChange事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OrgAndOrgAmountTransReportGrid_CellChange(object sender, CellEventArgs e)
 {
     OrgAndOrgAmountTransReportGrid.UpdateData();
 }