/// <summary> /// 清空 /// </summary> public override void ClearAction() { #region 查询条件初始化 //销售组织 mcbWhere_Org.Clear(); //供应商 mcbWhere_Supplier_Name.Clear(); //出/入库时间开始 dtWhere_CreatedTimeStart.Value = null; //出/入库时间结束 dtWhere_CreatedTimeEnd.Value = null; //给 销售组织 设置焦点 mcbWhere_Org.Focus(); #endregion #region Grid初始化 if (tabControlFull.Tabs[SysConst.EN_LIST].Selected) { _orgAndSupplierAmountTransTotalReportDs = new List <OrgAndSupplierAmountTransTotalReportUIModel>(); OrgAndSupplierAmountTransReportGrid.DataSource = _orgAndSupplierAmountTransTotalReportDs; OrgAndSupplierAmountTransReportGrid.DataBind(); } else { _orgAndSupplierAmountTransDetailReportDs = new List <OrgAndSupplierAmountTransDetailReportUIModel>(); OrgAndSupplierAmountTransDetailGrid.DataSource = _orgAndSupplierAmountTransDetailReportDs; OrgAndSupplierAmountTransDetailGrid.DataBind(); } #endregion }
/// <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; //客户 var tempClientList = BLLCom.GetAllCustomerList(true, LoginInfoDAX.OrgID); if (tempClientList != null) { _clientList = tempClientList.Where(x => x.ClientType == "供应商").ToList(); } mcbWhere_Supplier_Name.ExtraDisplayMember = "ClientType"; mcbWhere_Supplier_Name.DisplayMember = "ClientName"; mcbWhere_Supplier_Name.ValueMember = "ClientID"; mcbWhere_Supplier_Name.DataSource = _clientList; #endregion #region 查询条件初始化 //销售组织 mcbWhere_Org.Clear(); //供应商 mcbWhere_Supplier_Name.Clear(); //出/入库时间开始 dtWhere_CreatedTimeStart.Value = null; //出/入库时间结束 dtWhere_CreatedTimeEnd.Value = null; //给 销售组织 设置焦点 mcbWhere_Org.Focus(); #endregion #region Grid初始化 _orgAndSupplierAmountTransTotalReportDs = new List <OrgAndSupplierAmountTransTotalReportUIModel>(); OrgAndSupplierAmountTransReportGrid.DataSource = _orgAndSupplierAmountTransTotalReportDs; OrgAndSupplierAmountTransReportGrid.DataBind(); _orgAndSupplierAmountTransDetailReportDs = new List <OrgAndSupplierAmountTransDetailReportUIModel>(); OrgAndSupplierAmountTransDetailGrid.DataSource = _orgAndSupplierAmountTransDetailReportDs; OrgAndSupplierAmountTransDetailGrid.DataBind(); #endregion }
/// <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> private void QueryOrgAndSupplierAmountTransTotalReport() { try { OrgAndSupplierAmountTransReportQCModel argsModel = ConditionDS; argsModel.PageSize = PageSizeOfTotal; argsModel.PageIndex = PageIndexOfTotal; //SqlId argsModel.SqlId = SQLID.RPT_OrgAndSupplierAmountTransReport_SQL01; _orgAndSupplierAmountTransTotalReportDs = new List <OrgAndSupplierAmountTransTotalReportUIModel>(); _bll.QueryForList(argsModel.SqlId, argsModel, _orgAndSupplierAmountTransTotalReportDs); decimal totalAccountPayableAmountOfCurPage = 0; decimal totalPaidAmountOfCurPage = 0; decimal totalUnpaidAmountOfCurPage = 0; decimal totalAccountPayableAmountOfAllPage = 0; decimal totalPaidAmountOfAllPage = 0; decimal totalUnpaidAmountOfAllPage = 0; if (_orgAndSupplierAmountTransTotalReportDs.Count > 0) { OrgAndSupplierAmountTransTotalReportUIModel subObject = _orgAndSupplierAmountTransTotalReportDs[0]; TotalRecordCountOfTotal = subObject.RecordCount ?? 0; totalAccountPayableAmountOfAllPage = (subObject.TotalAccountPayableAmount ?? 0); totalPaidAmountOfAllPage = (subObject.TotalPaidAmount ?? 0); totalUnpaidAmountOfAllPage = (subObject.TotalUnpaidAmount ?? 0); } else { TotalRecordCountOfTotal = 0; } foreach (var loopSotckInTotalItem in _orgAndSupplierAmountTransTotalReportDs) { totalAccountPayableAmountOfCurPage += (loopSotckInTotalItem.APB_AccountPayableAmount ?? 0); totalPaidAmountOfCurPage += (loopSotckInTotalItem.APB_PaidAmount ?? 0); totalUnpaidAmountOfCurPage += (loopSotckInTotalItem.APB_UnpaidAmount ?? 0); } OrgAndSupplierAmountTransTotalReportUIModel curPageTotal = new OrgAndSupplierAmountTransTotalReportUIModel { SupplierName = _sumCurPageDesc, APB_AccountPayableAmount = Math.Round(totalAccountPayableAmountOfCurPage, 2), APB_PaidAmount = Math.Round(totalPaidAmountOfCurPage, 2), APB_UnpaidAmount = Math.Round(totalUnpaidAmountOfCurPage, 2) }; _orgAndSupplierAmountTransTotalReportDs.Add(curPageTotal); OrgAndSupplierAmountTransTotalReportUIModel allPageTotal = new OrgAndSupplierAmountTransTotalReportUIModel { SupplierName = _sumAllPageDesc, APB_AccountPayableAmount = Math.Round(totalAccountPayableAmountOfAllPage, 2), APB_PaidAmount = Math.Round(totalPaidAmountOfAllPage, 2), APB_UnpaidAmount = Math.Round(totalUnpaidAmountOfAllPage, 2) }; _orgAndSupplierAmountTransTotalReportDs.Add(allPageTotal); //重新计算[总页数],设置最新[allPageTotal] SetTotalPageCountAndTotalRecordCountOfTotal(TotalRecordCountOfTotal); //设置翻页按钮状态 SetPageButtonStatusOfTotal(); OrgAndSupplierAmountTransReportGrid.DataSource = _orgAndSupplierAmountTransTotalReportDs; OrgAndSupplierAmountTransReportGrid.DataBind(); OrgAndSupplierAmountTransReportGrid.DisplayLayout.Bands[0].PerformAutoResizeColumns(true, PerformAutoSizeType.VisibleRows); } catch (Exception ex) { throw ex; } }