protected void BindGv() { DataTable completedMonthlyReport = EReport.GetCompletedMonthlyReport(this.taskId, System.Convert.ToDateTime(this.date), this.hfldIsWBSRelevance.Value); this.gvConstruct.DataSource = this.formatData(completedMonthlyReport, false); this.gvConstruct.DataBind(); }
private void DataBindContract() { DataTable indirectCostDetails = EReport.GetIndirectCostDetails(BudgetManage_Report_IndirectCostDetail.prjId, BudgetManage_Report_IndirectCostDetail.cBSCode, this.txtDiaryName.Text.Trim(), this.txtIssuedBy.Text.Trim(), this.txtStartDate.Text.Trim(), this.txtEndDate.Text.Trim()); this.ViewState["CostDetail"] = indirectCostDetails; this.AspNetPager1.RecordCount = indirectCostDetails.Rows.Count; int num = (this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize; DataTable dataTable; if (indirectCostDetails.Rows.Count <= this.AspNetPager1.PageSize) { dataTable = indirectCostDetails; } else { dataTable = indirectCostDetails.Clone(); dataTable.Clear(); int num2 = num; while (num2 < num + this.AspNetPager1.PageSize && indirectCostDetails.Rows.Count > num2) { dataTable.Rows.Add(indirectCostDetails.Rows[num2].ItemArray); num2++; } } string total = indirectCostDetails.Compute("SUM(Amount)", string.Empty).ToString(); this.gvwCostDetail.DataSource = dataTable; this.gvwCostDetail.DataBind(); BudgetManage_Report_IndirectCostDetail.AddTotalRow(this.gvwCostDetail, total, 6, indirectCostDetails.Columns.Count); }
protected void BindGv() { this.AspNetPager1.RecordCount = EReport.GetEvenAnalysis(this.txtPrjCode.Text.Trim(), this.txtPrjName.Text.Trim(), 0, 0, base.UserCode, this.hfldIsWBSRelevance.Value).Rows.Count; this.dtEvenAnalysis = EReport.GetEvenAnalysis(this.txtPrjCode.Text.Trim(), this.txtPrjName.Text.Trim(), this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex, base.UserCode, this.hfldIsWBSRelevance.Value); dtEvenAnalysis.Columns.Add("ysk", System.Type.GetType("System.Double")); dtEvenAnalysis.Columns.Add("dsk", System.Type.GetType("System.Double")); //DataTable dt= this.incometContractBll.GetReportTb(this.txtConType.Text.Trim(), this.txtPrjName.Value, this.txtContractCode.Text.Trim(), this.txtContractName.Text.Trim(), this.txtStartTime.Text.Trim(), this.txtEndTime.Text.Trim(), this.txtParty.Value.Trim(), "Payment", strWhere, this.dropPrjKindClass.SelectedValue, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); DataTable dt = this.incometContractBll.GetReportTb("", "", "", "", "", "", "", "Payment", "", "", 1, 99999999); foreach (DataRow dr1 in dtEvenAnalysis.Rows) { double ii = 0.00; foreach (DataRow dr2 in dt.Rows) { if (dr1["PrjName"].ToString() == dr2["prjName"].ToString()) { ii += Convert.ToDouble(dr2["CllectionPrice"].ToString()); } } dr1["ysk"] = ii; dr1["dsk"] = Convert.ToDouble(dr1["ContractBud"].ToString()) - ii; } this.gvCost.DataSource = this.dtEvenAnalysis; this.gvCost.DataBind(); }
protected void btnExcel_Click(object sender, System.EventArgs e) { DataTable completedMonthlyReport = EReport.GetCompletedMonthlyReport(this.taskId, System.Convert.ToDateTime(this.date), this.hfldIsWBSRelevance.Value); DataTable dataTable = this.formatData(completedMonthlyReport, true); System.Collections.Generic.List <ExcelHeader> list = new System.Collections.Generic.List <ExcelHeader>(); list.Add(ExcelHeader.Create("金额(元)", 1, 2, 5, 0)); list.Add(ExcelHeader.Create("上期末完成", 1, 2, 7, 0)); list.Add(ExcelHeader.Create("本期完成", 1, 2, 9, 0)); list.Add(ExcelHeader.Create("本期末完成", 1, 2, 11, 0)); System.Collections.Generic.List <int> list2 = new System.Collections.Generic.List <int>(); foreach (DataColumn dataColumn in dataTable.Columns) { if (dataColumn.Ordinal >= 4) { list2.Add(dataColumn.Ordinal); } if (dataColumn.Ordinal < 4) { list.Add(ExcelHeader.Create(dataColumn.ColumnName, 2, 0, 0, 2)); } else { list.Add(ExcelHeader.Create(dataColumn.ColumnName, 2, 0, 0, 0)); } } ExcelHelper.ExportExcel(dataTable, this.title, this.title, this.title + ".xls", list, null, 0, base.Request.Browser.Browser); }
protected void btnExcel_Click(object sender, System.EventArgs e) { DataTable prjSummary = EReport.GetPrjSummary(this.prjId, 1, System.Convert.ToDateTime(this.hfldDate.Value.Trim()).ToString("yyyy-MM-dd"), this.hfldIsWBSRelevance.Value); int month = System.Convert.ToDateTime(this.hfldDate.Value.Trim()).Month; string text = this.prjName + "工程" + month.ToString() + "月工程汇总表"; ExcelHelper.ExportExcel(this.formatData(prjSummary, true), text, text, text + ".xls", null, null, 0, base.Request.Browser.Browser); }
public void BindGv() { this.AspNetPager1.RecordCount = ConstructReport.GetEvenAnalysisDetailCount(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.prjId); this.dt = EReport.GetEvenAnalysisDetail(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.prjId, this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex, this.hfldIsWBSRelevance.Value); this.ViewState["dt"] = this.dt; this.gvCost.DataSource = this.dt; this.gvCost.DataBind(); }
protected void AspNetPager1_PageChanged(object sender, System.EventArgs e) { if (this.ViewState["analysis"] != null) { DataTable dtAll = this.ViewState["analysis"] as DataTable; this.rptBudget.DataSource = EReport.GetPageDataTable(dtAll, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.rptBudget.DataBind(); } }
protected void BindGv() { DataTable prjSummary = EReport.GetPrjSummary(this.prjId, 1, System.Convert.ToDateTime(this.txtDate.Text.Trim()).ToString("yyyy-MM-dd"), this.hfldIsWBSRelevance.Value); this.gvConstruct.DataSource = this.formatData(prjSummary, false); this.gvConstruct.DataBind(); this.hfldMonth.Value = System.Convert.ToDateTime(this.txtDate.Text.Trim()).Month.ToString(); this.hfldDate.Value = this.txtDate.Text.Trim(); }
private void DataBindGvwSubProject(DataTable table) { this.AspNetPager1.RecordCount = EReport.GetReport(this.prjId, 0, 0, this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.hfldIsWBSRelevance.Value).Rows.Count; this.rptSubProject.DataSource = table; this.rptSubProject.DataBind(); if (table.Rows.Count == 0) { base.RegisterScript("$('#tableSubProject tr:last-child').remove();"); } }
public void BindGv() { string safeString = this.GetSafeString(this.txtclassName.Text.Trim()); string safeString2 = this.GetSafeString(this.txtTemplateName.Text.Trim()); string safeString3 = this.GetSafeString(this.txtOrganizer.Text.Trim()); DataTable workFlowList = WorkFlow.GetWorkFlowList(safeString, safeString2, safeString3, this.txtStartTime.Text.Trim(), this.dropWFState.SelectedValue, this.dropBusinessClass.SelectedValue); this.AspNetPager1.RecordCount = workFlowList.Rows.Count; this.gvWorkFlow.DataSource = EReport.GetPageDataTable(workFlowList, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.gvWorkFlow.DataBind(); }
private void BindGvw() { this.AspNetPager1.RecordCount = EReport.GetBudGetOutPut(this.prjId, 0, 0).Rows.Count; DataTable dataTable = (DataTable)this.ViewState["dtReport"]; DataView dataView = dataTable.AsDataView(); dataView.Sort = "OrderNumber"; dataTable = dataView.ToTable(); this.ViewState["dtReport"] = dataTable; this.gvwBudGetOutPut.DataSource = dataTable; this.gvwBudGetOutPut.DataBind(); }
private void bindGv() { this.ViewState["Cost"] = EReport.GetBudTaskCost(this.txtCode.Text.Trim(), this.txtName.Text.Trim(), base.UserCode, this.hfldIsWBSRelevance.Value); DataTable dataTable = this.ViewState["Cost"] as DataTable; this.AspNetPager1.RecordCount = dataTable.Rows.Count; this.AspNetPager1.PageSize = NBasePage.pagesize; if (dataTable.Rows.Count != 0) { string[] array = new string[12]; array[0] = dataTable.Compute("SUM(MonthRealitybud)", string.Empty).ToString(); array[1] = dataTable.Compute("SUM(Monthbud)", string.Empty).ToString(); array[2] = dataTable.Compute("SUM(MonthReality)", string.Empty).ToString(); array[3] = dataTable.Compute("SUM(Monthacc)", string.Empty).ToString(); array[4] = dataTable.Compute("SUM(MonthChazhi)", string.Empty).ToString(); if (System.Convert.ToDecimal(array[0]) + System.Convert.ToDecimal(array[1]) != 0m) { decimal d = System.Convert.ToDecimal(array[4]) / (System.Convert.ToDecimal(array[0]) + System.Convert.ToDecimal(array[1])); array[5] = (decimal.Floor(d * 10000m) / 100m).ToString() + "%"; } else { array[5] = "0.00%"; } array[6] = dataTable.Compute("SUM(Target)", string.Empty).ToString(); array[7] = dataTable.Compute("SUM(IndirBud)", string.Empty).ToString(); array[8] = dataTable.Compute("SUM(Reality)", string.Empty).ToString(); array[9] = dataTable.Compute("SUM(IndirAcc)", string.Empty).ToString(); array[10] = dataTable.Compute("SUM(Chazhi)", string.Empty).ToString(); if (System.Convert.ToDecimal(array[6]) + System.Convert.ToDecimal(array[7]) != 0m) { decimal d2 = System.Convert.ToDecimal(array[10]) / (System.Convert.ToDecimal(array[6]) + System.Convert.ToDecimal(array[7])); array[11] = (decimal.Floor(d2 * 10000m) / 100m).ToString() + "%"; } else { array[11] = "0.00%"; } this.ViewState["Total"] = array; } this.gvCost.DataSource = EReport.GetPageDataTable(dataTable, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.gvCost.DataKeyNames = new string[] { "PrjGuid" }; this.gvCost.DataBind(); }
protected void BindGV() { if (this.ViewState["cost"] == null) { string code = base.Request["code"]; string name = base.Request["name"]; this.ViewState["cost"] = EReport.GetCostAnalysis(name, code); } DataTable dataTable = this.ViewState["cost"] as DataTable; this.AspNetPager1.RecordCount = dataTable.Rows.Count; this.AspNetPager1.PageSize = NBasePage.pagesize; int currentPageIndex = this.AspNetPager1.CurrentPageIndex; this.gvBudget.DataSource = BudgetManage_Report_CostAnalysis.GetPageDataTable(dataTable, currentPageIndex, NBasePage.pagesize); this.gvBudget.DataBind(); }
protected void btnExcel_Click(object sender, System.EventArgs e) { DataTable dataTable = new DataTable(); dataTable = EReport.GetEvenAnalysisDetail(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.prjId, 0, 0, this.hfldIsWBSRelevance.Value); if (dataTable.Rows.Count > 0) { DataRow dataRow = dataTable.NewRow(); dataRow["No"] = "合计"; dataRow["ContractCost"] = dataTable.Compute("sum(ContractCost)", "1>0"); dataRow["ConstructCost"] = dataTable.Compute("sum(ConstructCost)", "1>0"); dataRow["GainLoss"] = dataTable.Compute("sum(GainLoss)", "1>0"); if (System.Convert.ToDecimal(dataRow["ContractCost"]) != 0m) { decimal d = System.Convert.ToDecimal(dataRow["GainLoss"]) / System.Convert.ToDecimal(dataRow["ContractCost"]); dataRow["RatioGainLoss"] = (decimal.Floor(d * 10000m) / 100m).ToString() + "%"; } else { dataRow["RatioGainLoss"] = "0.00%"; } dataTable.Rows.Add(dataRow); } dataTable = this.GetTitleByTable(dataTable); dataTable.Columns.Remove("OrderNumber"); System.Collections.Generic.List <ExcelHeader> list = new System.Collections.Generic.List <ExcelHeader>(); list.Add(ExcelHeader.Create("累计数", 1, 4, 3, 0)); System.Collections.Generic.List <int> list2 = new System.Collections.Generic.List <int>(); foreach (DataColumn dataColumn in dataTable.Columns) { if (dataColumn.Ordinal >= 3) { list2.Add(dataColumn.Ordinal); } if (dataColumn.Ordinal < 3) { list.Add(ExcelHeader.Create(dataColumn.ColumnName, 2, 0, 0, 2)); } else { list.Add(ExcelHeader.Create(dataColumn.ColumnName, 2, 0, 0, 0)); } } ExcelHelper.ExportExcel(dataTable, "盈亏明细表", "盈亏明细表", "盈亏明细表.xls", list, null, 3, base.Request.Browser.Browser); }
protected void BindRpt() { string prjCode = this.txtPrjCode.Text.Trim(); string prjName = this.txtPrjName.Text.Trim(); string text = this.txtStartDate.Text; string text2 = this.txtEndDate.Text; this.ViewState["analysis"] = EReport.GetBudAnalysis(prjCode, prjName, text, text2, base.UserCode, this.hfldIsWBSRelevance.Value); DataTable dataTable = this.ViewState["analysis"] as DataTable; this.AspNetPager1.RecordCount = dataTable.Rows.Count; this.AspNetPager1.PageSize = NBasePage.pagesize; this.rptBudget.DataSource = EReport.GetPageDataTable(dataTable, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.rptBudget.DataBind(); if (this.rptBudget.Items.Count == 0) { base.RegisterScript("$('#rptBudget tr:last-child').remove();"); } }
public void BindRpt() { string taskCode = this.txtTaskCode.Text.Trim(); string taskName = this.txtTaskName.Text.Trim(); this.ViewState["detail"] = EReport.GetBudAnalysisDetail(this.prjId, taskCode, taskName, this.hfldIsWBSRelevance.Value); DataTable dataTable = this.ViewState["detail"] as DataTable; if (dataTable == null) { return; } this.AspNetPager1.RecordCount = dataTable.Rows.Count; this.AspNetPager1.PageSize = NBasePage.pagesize; this.rptBudget.DataSource = EReport.GetPageDataTable(dataTable, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.rptBudget.DataBind(); if (this.rptBudget.Items.Count == 0) { base.RegisterScript("$('#rptBudget tr:last-child').remove();"); } }
private void BindGv() { this.ViewState["Task"] = EReport.GetTaskReport(this.tvBudget.SelectedValue, this.txtCode.Text.Trim(), this.txtName.Text.Trim()); DataTable dataTable = this.ViewState["Task"] as DataTable; if (dataTable != null) { this.AspNetPager1.RecordCount = dataTable.Rows.Count; this.AspNetPager1.PageSize = NBasePage.pagesize; this.gvBudget.DataSource = EReport.GetPageDataTable(dataTable, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.gvBudget.DataKeyNames = new string[] { "TaskId" }; this.gvBudget.DataBind(); if (dataTable.Rows.Count != 0) { string[] value = new string[] { dataTable.Compute("SUM(TotalBudget)", string.Empty).ToString(), dataTable.Compute("SUM(TotalAcc)", string.Empty).ToString(), dataTable.Compute("SUM(JieChao)", string.Empty).ToString() }; int[] index = new int[] { 6, 7, 8 }; GridViewUtility.AddTotalRow(this.gvBudget, value, index); this.ViewState["Total"] = value; return; } } else { this.gvBudget.DataSource = dataTable; this.gvBudget.DataBind(); } }
public void BindGv() { this.ViewState["Cost"] = EReport.GetTargetCostDetail(this.prjId, this.txtCode.Text.Trim(), this.txtName.Text.Trim()); DataTable dataTable = this.ViewState["Cost"] as DataTable; this.AspNetPager1.RecordCount = dataTable.Rows.Count; this.AspNetPager1.PageSize = NBasePage.pagesize; if (dataTable.Rows.Count != 0) { string[] array = new string[8]; array[0] = dataTable.Compute("SUM(MonthBud)", string.Empty).ToString(); array[1] = dataTable.Compute("SUM(MonthAcc)", string.Empty).ToString(); array[2] = (System.Convert.ToDecimal(array[0]) - System.Convert.ToDecimal(array[1])).ToString(); if (System.Convert.ToDecimal(array[0]) != 0m) { decimal d = System.Convert.ToDecimal(array[2]) / System.Convert.ToDecimal(array[0]); array[3] = (decimal.Floor(d * 10000m) / 100m).ToString() + "%"; } else { array[3] = "0.00%"; } array[4] = dataTable.Compute("SUM(Bud)", string.Empty).ToString(); array[5] = dataTable.Compute("SUM(Acc)", string.Empty).ToString(); array[6] = (System.Convert.ToDecimal(array[4]) - System.Convert.ToDecimal(array[5])).ToString(); if (System.Convert.ToDecimal(array[4]) != 0m) { decimal d2 = System.Convert.ToDecimal(array[6]) / System.Convert.ToDecimal(array[4]); array[7] = (decimal.Floor(d2 * 10000m) / 100m).ToString() + "%"; } else { array[7] = "0.00%"; } this.ViewState["Total"] = array; this.gvCost.DataSource = EReport.GetPageDataTable(dataTable, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.gvCost.DataBind(); } }
protected void ComputeTotal() { this.txtTaskCode.Text = ""; this.txtTaskName.Text = ""; this.AspNetPager1.CurrentPageIndex = 1; DataTable evenAnalysisDetail = EReport.GetEvenAnalysisDetail(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.prjId, 0, 0, this.hfldIsWBSRelevance.Value); string[] array = new string[4]; if (evenAnalysisDetail.Rows.Count != 0) { array[0] = System.Convert.ToDecimal(evenAnalysisDetail.Compute("sum(ContractCost)", "1>0")).ToString("0.000"); array[1] = System.Convert.ToDecimal(evenAnalysisDetail.Compute("sum(ConstructCost)", "1>0")).ToString("0.000"); array[2] = System.Convert.ToDecimal(evenAnalysisDetail.Compute("sum(GainLoss)", "1>0")).ToString("0.000"); } else { array[0] = "0.000"; array[1] = "0.000"; array[2] = "0.000"; } if (System.Convert.ToDecimal(array[0]) != 0m) { decimal d = System.Convert.ToDecimal(array[2]) / System.Convert.ToDecimal(array[0]); array[3] = (decimal.Floor(d * 10000m) / 100m).ToString() + "%"; } else { array[3] = "0.00%"; } int[] value = new int[] { 3, 4, 5, 6 }; this.ViewState["Total"] = array; this.ViewState["index"] = value; }
protected void BindgvSouce() { string depment = this.txtDepmentName.Value.Trim(); string userName = this.txtUserName.Value.Trim(); System.DateTime inputDate = string.IsNullOrEmpty(this.txtInputDate.Text.Trim()) ? System.DateTime.Now : System.Convert.ToDateTime(this.txtInputDate.Text.Trim()); DataTable indirectOrgCosts = EReport.GetIndirectOrgCosts(depment, userName, inputDate); this.gvCostInOrgList.DataSource = indirectOrgCosts; this.gvCostInOrgList.DataBind(); this.RowSpanTalbe(1, 3, this.gvCostInOrgList); this.ViewState["gvwdataSouce"] = indirectOrgCosts; this.ViewState["gvwCostIndirectOrg"] = this.Formatdata(indirectOrgCosts); string[] sumAmount = this.GetSumAmount(indirectOrgCosts); int[] index = new int[] { 7, 9, 12, 14 }; GridViewUtility.AddTotalRow(this.gvCostInOrgList, sumAmount, index); }
public void BindGv() { this.ViewState["Jixie"] = EReport.GetJixieAnalysis(this.prjId, this.txtName.Text.Trim()); DataTable dataTable = this.ViewState["Jixie"] as DataTable; if (dataTable.Rows.Count != 0) { string[] array = new string[8]; array[0] = dataTable.Compute("SUM(MonthTotalBud)", string.Empty).ToString(); array[1] = dataTable.Compute("SUM(MonthTotalAcc)", string.Empty).ToString(); array[2] = dataTable.Compute("SUM(MonthChazhi)", string.Empty).ToString(); if (System.Convert.ToDecimal(array[0]) != 0m) { array[3] = (System.Convert.ToDecimal(array[2]) / System.Convert.ToDecimal(array[0])).ToString("P2"); } else { array[3] = "0.00%"; } array[4] = dataTable.Compute("SUM(TotalBud)", string.Empty).ToString(); array[5] = dataTable.Compute("SUM(TotalAcc)", string.Empty).ToString(); array[6] = dataTable.Compute("SUM(Chazhi)", string.Empty).ToString(); if (System.Convert.ToDecimal(array[4]) != 0m) { array[7] = (System.Convert.ToDecimal(array[6]) / System.Convert.ToDecimal(array[4])).ToString("P2"); } else { array[7] = "0.00%"; } this.ViewState["Total"] = array; } this.AspNetPager1.RecordCount = dataTable.Rows.Count; this.AspNetPager1.PageSize = NBasePage.pagesize; this.gvCost.DataSource = EReport.GetPageDataTable(dataTable, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.gvCost.DataBind(); }
public void BindRpt() { string cbsCode = this.txtTaskCode.Text.Trim(); string cbsName = this.txtTaskName.Text.Trim(); DataTable dataTable; if (this.year == "zzjg") { dataTable = EReport.GetOrganizationCosts(this.prjId, cbsCode, cbsName); } else { dataTable = EReport.GetIndirectCosts(this.prjId, cbsCode, cbsName); } this.ViewState["costs"] = dataTable; this.AspNetPager1.RecordCount = dataTable.Rows.Count; this.AspNetPager1.PageSize = NBasePage.pagesize; this.rptBudget.DataSource = EReport.GetPageDataTable(dataTable, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.rptBudget.DataBind(); if (this.rptBudget.Items.Count == 0) { base.RegisterScript("$('#rptBudget tr:last-child').remove();"); } }
public void BindGv() { this.ViewState["Jixie"] = EReport.GetJixieChayi(this.prjId, this.txtName.Text.Trim()); DataTable dataTable = this.ViewState["Jixie"] as DataTable; if (dataTable.Rows.Count != 0) { string[] value = new string[] { dataTable.Compute("SUM(MonthTotalBud)", string.Empty).ToString(), dataTable.Compute("SUM(Monthjiacha)", string.Empty).ToString(), dataTable.Compute("SUM(Monthchazhi)", string.Empty).ToString(), dataTable.Compute("SUM(TotalBud)", string.Empty).ToString(), dataTable.Compute("SUM(QuantityChazhi)", string.Empty).ToString(), dataTable.Compute("SUM(Jiacha)", string.Empty).ToString(), dataTable.Compute("SUM(Chazhi)", string.Empty).ToString() }; this.ViewState["Total"] = value; } this.AspNetPager1.RecordCount = dataTable.Rows.Count; this.AspNetPager1.PageSize = NBasePage.pagesize; this.gvCost.DataSource = EReport.GetPageDataTable(dataTable, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); this.gvCost.DataBind(); }
private void GetTable(int pageSize, int pageIndex) { DataTable budGetOutPut = EReport.GetBudGetOutPut(this.prjId, pageSize, pageIndex); budGetOutPut.Columns.Add("LossCoefficient", System.Type.GetType("System.Decimal")); budGetOutPut.Columns.Add("ResourcePrice", System.Type.GetType("System.Decimal")); budGetOutPut.Columns["LossCoefficient"].SetOrdinal(11); budGetOutPut.Columns["ResourcePrice"].SetOrdinal(12); DataTable dataTable = new DataTable(); string text = string.Empty; foreach (DataRow dataRow in budGetOutPut.Rows) { text = text + "'" + dataRow["TaskId"].ToString() + "',"; } if (text.Length >= 1) { text = text.Remove(text.Length - 1); dataTable = BudTask.GetTaskRes(text); dataTable.Columns.Add(new DataColumn("OrderNumber", System.Type.GetType("System.String"))); foreach (DataRow dataRow2 in budGetOutPut.Rows) { int num = 1; foreach (DataRow dataRow3 in dataTable.Rows) { if (dataRow3["TaskId"].ToString() == dataRow2["TaskId"].ToString()) { dataRow3["OrderNumber"] = dataRow2["OrderNumber"].ToString() + num.ToString(); num++; } } } System.Collections.IEnumerator enumerator4 = dataTable.Rows.GetEnumerator(); try { while (enumerator4.MoveNext()) { DataRow dataRow4 = (DataRow)enumerator4.Current; DataRow dataRow5 = budGetOutPut.NewRow(); dataRow5["TaskCode"] = string.Empty; dataRow5["OrderNumber"] = dataRow4["OrderNumber"]; dataRow5["TaskName"] = string.Empty; dataRow5["FeatureDescription"] = dataRow4["ResourceName"].ToString(); dataRow5["TypeName"] = dataRow4["ResourceTypeName"].ToString(); dataRow5["Unit"] = dataRow4["UnitName"].ToString(); dataRow5["Quantity"] = dataRow4["ResourceQuantity"].ToString(); dataRow5["ConUnitPrice"] = System.DBNull.Value; dataRow5["ConTotal"] = System.DBNull.Value; dataRow5["LossCoefficient"] = dataRow4["LossCoefficient"]; dataRow5["ResourcePrice"] = dataRow4["ResourcePrice"]; dataRow5["BudTotal"] = dataRow4["ResTotal"]; dataRow5["BudUnitPrice"] = System.DBNull.Value; dataRow5["Profit"] = System.DBNull.Value; dataRow5["ProfitRate"] = string.Empty; budGetOutPut.Rows.Add(dataRow5); } goto IL_39C; } finally { System.IDisposable disposable4 = enumerator4 as System.IDisposable; if (disposable4 != null) { disposable4.Dispose(); } } } dataTable = null; IL_39C: this.ViewState["dtReport"] = budGetOutPut; }
private DataTable GetFormatDataTable() { DataTable dataTable = new DataTable(); dataTable.Columns.Add("序号"); dataTable.Columns.Add("CBS编码"); dataTable.Columns.Add("成本科目"); dataTable.Columns.Add("目标成本"); dataTable.Columns.Add("实际成本"); dataTable.Columns.Add("降低额"); dataTable.Columns.Add("降低率"); dataTable.Columns.Add("目标成本 "); dataTable.Columns.Add("实际成本 "); dataTable.Columns.Add("降低额 "); dataTable.Columns.Add("降低率 "); int num = 0; string cbsCode = this.txtTaskCode.Text.Trim(); string cbsName = this.txtTaskName.Text.Trim(); DataTable dataTable2; if (this.year == "zzjg") { dataTable2 = EReport.GetOrganizationCosts(this.prjId, cbsCode, cbsName); } else { dataTable2 = EReport.GetIndirectCosts(this.prjId, cbsCode, cbsName); } foreach (DataRow dataRow in dataTable2.Rows) { num++; DataRow dataRow2 = dataTable.NewRow(); dataRow2["序号"] = num.ToString(); dataRow2["CBS编码"] = dataRow["CBSCode"]; dataRow2["成本科目"] = dataRow["CBSName"]; dataRow2["目标成本"] = dataRow["MonthTarget"]; dataRow2["实际成本"] = dataRow["MonthReality"]; dataRow2["降低额"] = decimal.Parse(dataRow["MonthTarget"].ToString()) - decimal.Parse(dataRow["MonthReality"].ToString()); string text = 0m.ToString("P2"); text = ((decimal.Parse(dataRow["MonthTarget"].ToString()) == 0m) ? text : (decimal.Parse(dataRow2["降低额"].ToString()) / decimal.Parse(dataRow["MonthTarget"].ToString())).ToString("P2")); dataRow2["降低率"] = text; dataRow2["目标成本 "] = dataRow["TotalTarget"]; dataRow2["实际成本 "] = dataRow["TotalReality"]; dataRow2["降低额 "] = decimal.Parse(dataRow["TotalTarget"].ToString()) - decimal.Parse(dataRow["TotalReality"].ToString()); text = 0m.ToString("P2"); text = ((decimal.Parse(dataRow["TotalTarget"].ToString()) == 0m) ? text : (decimal.Parse(dataRow2["降低额 "].ToString()) / decimal.Parse(dataRow["TotalTarget"].ToString())).ToString("P2")); dataRow2["降低率 "] = text; dataTable.Rows.Add(dataRow2); } if (this.ViewState["sum"] != null) { System.Collections.Generic.Dictionary <string, decimal> dictionary = this.ViewState["sum"] as System.Collections.Generic.Dictionary <string, decimal>; DataRow dataRow3 = dataTable.NewRow(); dataRow3["序号"] = "合 计"; dataRow3["CBS编码"] = string.Empty; dataRow3["成本科目"] = string.Empty; dataRow3["目标成本"] = dictionary["MonthTarget"]; dataRow3["实际成本"] = dictionary["MonthReality"]; dataRow3["降低额"] = dictionary["MonthLower"]; dataRow3["降低率"] = dictionary["MonthLowerRate"].ToString("P2"); dataRow3["目标成本 "] = dictionary["TotalTarget"]; dataRow3["实际成本 "] = dictionary["TotalReality"]; dataRow3["降低额 "] = dictionary["TotalLower"]; dataRow3["降低率 "] = dictionary["TotalLowerRate"].ToString("P2"); dataTable.Rows.Add(dataRow3); } return(dataTable); }
private DataTable GetSubProject(int pageIndex, int pageSize) { return(EReport.GetReport(this.prjId, pageSize, pageIndex, this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.hfldIsWBSRelevance.Value)); }
protected void ComputeTotal() { this.AspNetPager1.CurrentPageIndex = 1; DataTable evenAnalysis = EReport.GetEvenAnalysis(this.txtPrjCode.Text.Trim(), this.txtPrjName.Text.Trim(), 0, 0, base.UserCode, this.hfldIsWBSRelevance.Value); //evenAnalysis.Columns.Add("ysk"); evenAnalysis.Columns.Add("ysk", System.Type.GetType("System.Double")); evenAnalysis.Columns.Add("dsk", System.Type.GetType("System.Double")); //evenAnalysis.Columns["ysk"].DataType = Type.GetType("System.Double"); //evenAnalysis.Columns.Add("dsk"); //evenAnalysis.Columns["dsk"].DataType = Type.GetType("System.Double"); //DataTable dt= this.incometContractBll.GetReportTb(this.txtConType.Text.Trim(), this.txtPrjName.Value, this.txtContractCode.Text.Trim(), this.txtContractName.Text.Trim(), this.txtStartTime.Text.Trim(), this.txtEndTime.Text.Trim(), this.txtParty.Value.Trim(), "Payment", strWhere, this.dropPrjKindClass.SelectedValue, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize); DataTable dt = this.incometContractBll.GetReportTb("", "", "", "", "", "", "", "Payment", "", "", 1, 99999999); foreach (DataRow dr1 in evenAnalysis.Rows) { double ii = 0.00; foreach (DataRow dr2 in dt.Rows) { if (dr1["PrjName"].ToString() == dr2["prjName"].ToString()) { ii += Convert.ToDouble(dr2["CllectionPrice"].ToString()); } } dr1["ysk"] = ii; dr1["dsk"] = Convert.ToDouble(dr1["ContractBud"].ToString()) - ii; } string[] array = new string[7]; if (evenAnalysis.Rows.Count != 0) { array[0] = System.Convert.ToDecimal(evenAnalysis.Compute("sum(ContractBud)", "1>0")).ToString("0.000"); array[1] = System.Convert.ToDecimal(evenAnalysis.Compute("sum(DirectCost)", "1>0")).ToString("0.000"); array[2] = System.Convert.ToDecimal(evenAnalysis.Compute("sum(IndirectCost)", "1>0")).ToString("0.000"); array[3] = System.Convert.ToDecimal(evenAnalysis.Compute("sum(GainLoss)", "1>0")).ToString("0.000"); array[5] = System.Convert.ToDecimal(evenAnalysis.Compute("sum(ysk)", "1>0")).ToString("0.000"); array[6] = System.Convert.ToDecimal(evenAnalysis.Compute("sum(dsk)", "1>0")).ToString("0.000"); } else { array[0] = "0.000"; array[1] = "0.000"; array[2] = "0.000"; array[3] = "0.000"; array[5] = "0.000"; array[6] = "0.000"; } if (System.Convert.ToDecimal(array[0]) != 0m) { decimal d = System.Convert.ToDecimal(array[3]) / System.Convert.ToDecimal(array[0]); array[4] = (decimal.Floor(d * 10000m) / 100m).ToString() + "%"; } else { array[4] = "0.00%"; } int[] value = new int[] { 3, 4, 5, 6, 7, 8, 9 }; this.ViewState["Total"] = array; this.ViewState["index"] = value; }