/// <summary> /// 导出全部 /// </summary> public override void ExportAllAction(UltraGrid paramGrid, string paramGridName = "") { paramGridName = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? "组织与供应商资金往来统计汇总" : "组织与供应商资金往来统计明细"; OrgAndSupplierAmountTransReportQCModel tempConditionDS = new OrgAndSupplierAmountTransReportQCModel() { //SqlId SqlId = tabControlFull.Tabs[SysConst.EN_LIST].Selected ? SQLID.RPT_OrgAndSupplierAmountTransReport_SQL01 : SQLID.RPT_OrgAndSupplierAmountTransReport_SQL02, //客户ID SupplierID = this.mcbWhere_Supplier_Name.SelectedValue, PageIndex = 1, PageSize = null }; //组织ID if (string.IsNullOrEmpty(mcbWhere_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_Org.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 <OrgAndSupplierAmountTransTotalReportUIModel> resultAllList = new List <OrgAndSupplierAmountTransTotalReportUIModel>(); _bll.QueryForList(SQLID.RPT_OrgAndSupplierAmountTransReport_SQL01, tempConditionDS, resultAllList); decimal totalAccountPayableAmountOfCurPage = 0; decimal totalPaidAmountOfCurPage = 0; decimal totalAccountPayableAmountOfAllPage = 0; decimal totalPaidAmountOfAllPage = 0; if (resultAllList.Count > 0) { OrgAndSupplierAmountTransTotalReportUIModel subObject = resultAllList[0]; totalAccountPayableAmountOfAllPage = (subObject.TotalAccountPayableAmount ?? 0); totalPaidAmountOfAllPage = (subObject.TotalPaidAmount ?? 0); } foreach (var loopSotckInTotalItem in resultAllList) { totalAccountPayableAmountOfCurPage += (loopSotckInTotalItem.APB_AccountPayableAmount ?? 0); totalPaidAmountOfCurPage += (loopSotckInTotalItem.APB_PaidAmount ?? 0); } OrgAndSupplierAmountTransTotalReportUIModel curPageTotal = new OrgAndSupplierAmountTransTotalReportUIModel { SupplierName = _sumCurPageDesc, APB_AccountPayableAmount = Math.Round(totalAccountPayableAmountOfCurPage, 2), APB_PaidAmount = Math.Round(totalPaidAmountOfCurPage, 2) }; resultAllList.Add(curPageTotal); OrgAndSupplierAmountTransTotalReportUIModel allPageTotal = new OrgAndSupplierAmountTransTotalReportUIModel { SupplierName = _sumAllPageDesc, APB_AccountPayableAmount = Math.Round(totalAccountPayableAmountOfAllPage, 2), APB_PaidAmount = Math.Round(totalPaidAmountOfAllPage, 2) }; resultAllList.Add(allPageTotal); UltraGrid allGrid = OrgAndSupplierAmountTransReportGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); OrgAndSupplierAmountTransReportGrid.DataSource = _orgAndSupplierAmountTransTotalReportDs; OrgAndSupplierAmountTransReportGrid.DataBind(); } else { List <OrgAndSupplierAmountTransDetailReportUIModel> resultAllList = new List <OrgAndSupplierAmountTransDetailReportUIModel>(); _bll.QueryForList(SQLID.RPT_OrgAndSupplierAmountTransReport_SQL02, tempConditionDS, resultAllList); decimal totalAutoPartsQtyOfCurPage = 0; decimal totalAutoPartsAmountOfCurPage = 0; decimal totalAutoPartsQtyOfAllPage = 0; decimal totalAutoPartsAmountOfAllPage = 0; if (resultAllList.Count > 0) { OrgAndSupplierAmountTransDetailReportUIModel 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); } OrgAndSupplierAmountTransDetailReportUIModel curPageTotal = new OrgAndSupplierAmountTransDetailReportUIModel { APA_Specification = _sumCurPageDesc, AutoPartsQty = Math.Round(totalAutoPartsQtyOfCurPage, 0), AutoPartsAmount = Math.Round(totalAutoPartsAmountOfCurPage, 2) }; resultAllList.Add(curPageTotal); OrgAndSupplierAmountTransDetailReportUIModel allPageTotal = new OrgAndSupplierAmountTransDetailReportUIModel { APA_Specification = _sumAllPageDesc, AutoPartsQty = Math.Round(totalAutoPartsQtyOfAllPage, 0), AutoPartsAmount = Math.Round(totalAutoPartsAmountOfAllPage, 2) }; resultAllList.Add(allPageTotal); UltraGrid allGrid = OrgAndSupplierAmountTransDetailGrid; allGrid.DataSource = resultAllList; allGrid.DataBind(); base.ExportAllAction(allGrid, paramGridName); OrgAndSupplierAmountTransDetailGrid.DataSource = _orgAndSupplierAmountTransDetailReportDs; OrgAndSupplierAmountTransDetailGrid.DataBind(); } }
/// <summary> /// 查询组织与供应商资金往来统计明细 /// </summary> /// <param name="paramTotalReport">汇总行</param> private void QueryOrgAndSupplierAmountTransDetailReport(OrgAndSupplierAmountTransTotalReportUIModel paramTotalReport = null) { try { OrgAndSupplierAmountTransReportQCModel argsModel = ConditionDS; argsModel.PageSize = PageSizeOfDetail; argsModel.PageIndex = PageIndexOfDetail; argsModel.SqlId = SQLID.RPT_OrgAndSupplierAmountTransReport_SQL02; if (paramTotalReport != null) { argsModel.OrgIdList = paramTotalReport.OrgID; argsModel.SupplierID = paramTotalReport.SupplierID; argsModel.BusinessType = paramTotalReport.BusinessType; } else { argsModel.BusinessType = null; } _orgAndSupplierAmountTransDetailReportDs = new List <OrgAndSupplierAmountTransDetailReportUIModel>(); _bll.QueryForList(argsModel.SqlId, argsModel, _orgAndSupplierAmountTransDetailReportDs); decimal totalAutoPartsQtyOfCurPage = 0; decimal totalAutoPartsAmountOfCurPage = 0; decimal totalAutoPartsQtyOfAllPage = 0; decimal totalAutoPartsAmountOfAllPage = 0; if (_orgAndSupplierAmountTransDetailReportDs.Count > 0) { OrgAndSupplierAmountTransDetailReportUIModel subObject = _orgAndSupplierAmountTransDetailReportDs[0]; TotalRecordCountOfDetail = (subObject.RecordCount ?? 0); totalAutoPartsQtyOfAllPage = (subObject.TotalAutoPartsQty ?? 0); totalAutoPartsAmountOfAllPage = (subObject.TotalAutoPartsAmount ?? 0); } else { TotalRecordCountOfDetail = 0; } foreach (var loopDetail in _orgAndSupplierAmountTransDetailReportDs) { totalAutoPartsQtyOfCurPage += (loopDetail.AutoPartsQty ?? 0); totalAutoPartsAmountOfCurPage += (loopDetail.AutoPartsAmount ?? 0); } OrgAndSupplierAmountTransDetailReportUIModel curPageTotal = new OrgAndSupplierAmountTransDetailReportUIModel { APA_Specification = _sumCurPageDesc, AutoPartsQty = Math.Round(totalAutoPartsQtyOfCurPage, 0), AutoPartsAmount = Math.Round(totalAutoPartsAmountOfCurPage, 2) }; _orgAndSupplierAmountTransDetailReportDs.Add(curPageTotal); OrgAndSupplierAmountTransDetailReportUIModel allPageTotal = new OrgAndSupplierAmountTransDetailReportUIModel { APA_Specification = _sumAllPageDesc, AutoPartsQty = Math.Round(totalAutoPartsQtyOfAllPage, 0), AutoPartsAmount = Math.Round(totalAutoPartsAmountOfAllPage, 2) }; _orgAndSupplierAmountTransDetailReportDs.Add(allPageTotal); //重新计算[总页数],设置最新[总记录条数] SetTotalPageCountAndTotalRecordCountOfDetail(TotalRecordCountOfDetail); //设置翻页按钮状态 SetPageButtonStatusOfDetail(); OrgAndSupplierAmountTransDetailGrid.DataSource = _orgAndSupplierAmountTransDetailReportDs; OrgAndSupplierAmountTransDetailGrid.DataBind(); OrgAndSupplierAmountTransDetailGrid.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.VisibleRows); } catch (Exception ex) { throw ex; } }