Example #1
0
    protected void ComputeTotal()
    {
        this.AspNetPager1.CurrentPageIndex = 1;
        DataTable lSMTaskAnalysis = ConstructReport.GetLSMTaskAnalysis(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.prjId, 0, 0);

        string[] array = new string[9];
        if (lSMTaskAnalysis.Rows.Count != 0)
        {
            array[0] = System.Convert.ToDecimal(lSMTaskAnalysis.Compute("sum(LaborBudCost)", "1>0")).ToString("0.000");
            array[1] = System.Convert.ToDecimal(lSMTaskAnalysis.Compute("sum(StuffBudCost)", "1>0")).ToString("0.000");
            array[2] = System.Convert.ToDecimal(lSMTaskAnalysis.Compute("sum(MachineBudCost)", "1>0")).ToString("0.000");
            array[3] = System.Convert.ToDecimal(lSMTaskAnalysis.Compute("sum(BudTotal)", "1>0")).ToString("0.000");
            array[4] = System.Convert.ToDecimal(lSMTaskAnalysis.Compute("sum(LaborConsCost)", "1>0")).ToString("0.000");
            array[5] = System.Convert.ToDecimal(lSMTaskAnalysis.Compute("sum(StuffConsCost)", "1>0")).ToString("0.000");
            array[6] = System.Convert.ToDecimal(lSMTaskAnalysis.Compute("sum(MachineConsCost)", "1>0")).ToString("0.000");
            array[7] = System.Convert.ToDecimal(lSMTaskAnalysis.Compute("sum(ConsTotal)", "1>0")).ToString("0.000");
            array[8] = System.Convert.ToDecimal(lSMTaskAnalysis.Compute("sum(DiffTotal)", "1>0")).ToString("0.000");
        }
        else
        {
            array[0] = "0.000";
            array[1] = "0.000";
            array[2] = "0.000";
            array[3] = "0.000";
            array[4] = "0.000";
            array[5] = "0.000";
            array[6] = "0.000";
            array[7] = "0.000";
            array[8] = "0.000";
        }
        this.ViewState["Total"] = array;
    }
Example #2
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.hfldIsWBSRelevance.Value = this.isWBSRelevance;
         if (this.type == "add")
         {
             this.txtDate.Text       = System.DateTime.Now.ToString("yyyy-M-d");
             this.txtInputUser.Text  = PageHelper.QueryUser(this, base.UserCode);
             this.hfldReportId.Value = System.Guid.NewGuid().ToString();
         }
         else
         {
             this.hfldReportId.Value = this.conId;
             this.BindGv();
             ConstructReport byId = ConstructReport.GetById(this.conId);
             this.txtDate.Text      = byId.InputDate.ToString("yyyy-M-dd");
             this.txtInputUser.Text = byId.InputUser;
             this.txtWorkCard.Value = byId.WorkCard;
         }
         this.hfldAddOrEdit.Value    = this.type;
         this.hfldPrjId.Value        = this.prjId;
         this.FileUpload1.RecordCode = this.hfldReportId.Value;
     }
 }
Example #3
0
    protected void ComputeTotal()
    {
        this.AspNetPager1.CurrentPageIndex = 1;
        DataTable majorStuffDiffAnalysis = ConstructReport.GetMajorStuffDiffAnalysis(this.txtResourceCode.Text.Trim(), this.txtResourceName.Text.Trim(), this.prjId, 0, 0);

        string[] array = new string[9];
        if (majorStuffDiffAnalysis.Rows.Count != 0)
        {
            array[0] = System.Convert.ToDecimal(majorStuffDiffAnalysis.Compute("sum(CurrentBudCost)", "1>0")).ToString("0.000");
            array[1] = System.Convert.ToDecimal(majorStuffDiffAnalysis.Compute("sum(CurrentConsCost)", "1>0")).ToString("0.000");
            array[2] = System.Convert.ToDecimal(majorStuffDiffAnalysis.Compute("sum(CurrentDiffPrice)", "1>0")).ToString("0.000");
            array[3] = System.Convert.ToDecimal(majorStuffDiffAnalysis.Compute("sum(CurrentReductionAmount)", "1>0")).ToString("0.000");
            array[4] = System.Convert.ToDecimal(majorStuffDiffAnalysis.Compute("sum(BudCost)", "1>0")).ToString("0.000");
            array[5] = System.Convert.ToDecimal(majorStuffDiffAnalysis.Compute("sum(ConsCost)", "1>0")).ToString("0.000");
            array[6] = System.Convert.ToDecimal(majorStuffDiffAnalysis.Compute("sum(DiffQuantity)", "1>0")).ToString("0.000");
            array[7] = System.Convert.ToDecimal(majorStuffDiffAnalysis.Compute("sum(DiffPrice)", "1>0")).ToString("0.000");
            array[8] = System.Convert.ToDecimal(majorStuffDiffAnalysis.Compute("sum(ReductionAmount)", "1>0")).ToString("0.000");
        }
        else
        {
            array[0] = "0.000";
            array[1] = "0.000";
            array[2] = "0.000";
            array[3] = "0.000";
            array[4] = "0.000";
            array[5] = "0.000";
            array[6] = "0.000";
            array[7] = "0.000";
            array[8] = "0.000";
        }
        this.ViewState["Total"] = array;
    }
Example #4
0
 protected void BindGv()
 {
     this.AspNetPager1.RecordCount = ConstructReport.GetStuffCount(this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtBrand.Text.Trim(), this.txtUnitName.Text.Trim(), this.prjId, this.hfldIsWBSRelevance.Value);
     this.dtStuff            = ConstructReport.GetStuffInfo(this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtBrand.Text.Trim(), this.txtUnitName.Text.Trim(), this.prjId, this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize, this.hfldIsWBSRelevance.Value);
     this.gvStuff.DataSource = this.dtStuff;
     this.gvStuff.DataBind();
 }
Example #5
0
 public void BindGv()
 {
     this.AspNetPager1.RecordCount = ConstructReport.GetStuffCount(this.txtResourceCode.Text.Trim(), this.txtResourceName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtBrand.Text.Trim(), this.prjId);
     this.dt = ConstructReport.GetMajorStuffAnalysis(this.txtResourceCode.Text.Trim(), this.txtResourceName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtBrand.Text.Trim(), this.prjId, this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex);
     this.gvMajorStuff.DataSource = this.dt;
     this.gvMajorStuff.DataBind();
 }
Example #6
0
 public void BindGv()
 {
     this.AspNetPager1.RecordCount = ConstructReport.GetLaborCostCount(this.txtResourceCode.Text.Trim(), this.txtResourceName.Text.Trim(), this.prjId);
     this.dt = ConstructReport.GetLaborCostAnalysis(this.txtResourceCode.Text.Trim(), this.txtResourceName.Text.Trim(), this.prjId, this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex);
     this.gvLaborCost.DataSource = this.dt;
     this.gvLaborCost.DataBind();
 }
Example #7
0
    protected void ComputeTotal()
    {
        this.AspNetPager1.CurrentPageIndex = 1;
        DataTable stuffInfo = ConstructReport.GetStuffInfo(this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtBrand.Text.Trim(), this.txtUnitName.Text.Trim(), this.prjId, 0, 0, this.hfldIsWBSRelevance.Value);

        string[] array = new string[6];
        if (stuffInfo.Rows.Count != 0)
        {
            array[0] = System.Convert.ToDecimal(stuffInfo.Compute("sum(BudQuantity)", "1>0")).ToString("0.000");
            array[1] = System.Convert.ToDecimal(stuffInfo.Compute("sum(ConsQuantity)", "1>0")).ToString("0.000");
            array[2] = System.Convert.ToDecimal(stuffInfo.Compute("sum(RealityNumber)", "1>0")).ToString("0.000");
            array[3] = System.Convert.ToDecimal(stuffInfo.Compute("sum(BudTotal)", "1>0")).ToString("0.000");
            array[4] = System.Convert.ToDecimal(stuffInfo.Compute("sum(ConsTotal)", "1>0")).ToString("0.000");
            array[5] = System.Convert.ToDecimal(stuffInfo.Compute("sum(RealityTotal)", "1>0")).ToString("0.000");
        }
        else
        {
            array[0] = "0.000";
            array[1] = "0.000";
            array[2] = "0.000";
            array[3] = "0.000";
            array[4] = "0.000";
            array[5] = "0.000";
        }
        this.ViewState["Total"] = array;
    }
    protected void ComputeTotal()
    {
        this.AspNetPager1.CurrentPageIndex = 1;
        string    taskCode        = this.txtTaskCode.Text.Trim();
        string    taskName        = this.txtTaskName.Text.Trim();
        string    resourceCode    = this.txtResourceCode.Text.Trim();
        string    resourceName    = this.txtResourceName.Text.Trim();
        DataTable cBSTaskAnalysis = ConstructReport.GetCBSTaskAnalysis(taskCode, taskName, resourceCode, resourceName, this.prjId, "StuffCBSCode", 0, 0);

        string[] array = new string[4];
        if (cBSTaskAnalysis.Rows.Count != 0)
        {
            array[0] = System.Convert.ToDecimal(cBSTaskAnalysis.Compute("sum(BudCost)", "1>0")).ToString("0.000");
            array[1] = System.Convert.ToDecimal(cBSTaskAnalysis.Compute("sum(ConsCost)", "1>0")).ToString("0.000");
            array[2] = System.Convert.ToDecimal(cBSTaskAnalysis.Compute("sum(ReductionAmount)", "1>0")).ToString("0.000");
            array[3] = System.Convert.ToDecimal(cBSTaskAnalysis.Compute("sum(OutPrice)", "1>0")).ToString("0.000");
        }
        else
        {
            array[0] = "0.000";
            array[1] = "0.000";
            array[2] = "0.000";
            array[3] = "0.000";
        }
        this.ViewState["Total"] = array;
    }
Example #9
0
 protected void BindGv()
 {
     this.AspNetPager1.RecordCount = ConstructReport.GetProfitCount(this.txtPrjCode.Text.Trim(), this.txtPrjName.Text.Trim(), base.UserCode, this.dropPrjState.SelectedValue, this.txtPrjPeopleName.Text.Trim(), this.txtPrjStartDate.Text.Trim(), this.txtPrjEndDate.Text.Trim());
     this.dtProfit = ConstructReport.GetProfitInfo(this.txtPrjCode.Text.Trim(), this.txtPrjName.Text.Trim(), base.UserCode, this.dropPrjState.SelectedValue, this.txtPrjPeopleName.Text.Trim(), this.txtPrjStartDate.Text.Trim(), this.txtPrjEndDate.Text.Trim(), this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize, this.hfldIsWBSRelevance.Value);
     this.SetPrjStates(this.dtProfit);
     this.gvProfit.DataSource = this.dtProfit;
     this.gvProfit.DataBind();
 }
Example #10
0
 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();
 }
Example #11
0
    private DataTable GetCBSCost()
    {
        DataTable dataTable = new DataTable();

        dataTable.Clear();
        DataTable cBSCost = ConstructReport.GetCBSCost(this.prjId);

        if (cBSCost != null)
        {
            dataTable = cBSCost.Clone();
            DataRow dataRow = dataTable.NewRow();
            dataRow = this.GetDataRow("all", dataRow, cBSCost);
            dataTable.Rows.Add(dataRow);
            DataRow dataRow2 = dataTable.NewRow();
            dataRow2 = this.GetDataRow("self", dataRow2, cBSCost);
            dataTable.Rows.Add(dataRow2);
            DataRow[] array  = cBSCost.Select("CBSCode<>'" + this.outSourceCBSCode + "' AND Type='D'", "CBSCode");
            int       num    = 0;
            DataRow[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                DataRow dataRow3 = array2[i];
                num++;
                DataRow dataRow4 = dataTable.NewRow();
                dataRow4.ItemArray = dataRow3.ItemArray;
                dataRow4["Num"]    = num.ToString();
                dataTable.Rows.Add(dataRow4);
            }
            DataRow dataRow5 = dataTable.NewRow();
            dataRow5 = this.GetDataRow("indInfo", dataRow5, cBSCost);
            dataTable.Rows.Add(dataRow5);
            DataRow[] array3 = cBSCost.Select("Type='I'", "CBSCode");
            int       num2   = 0;
            num++;
            DataRow[] array4 = array3;
            for (int j = 0; j < array4.Length; j++)
            {
                DataRow dataRow6 = array4[j];
                num2++;
                string  value    = num.ToString() + "." + num2.ToString();
                DataRow dataRow7 = dataTable.NewRow();
                dataRow7.ItemArray = dataRow6.ItemArray;
                dataRow7["Num"]    = value;
                dataTable.Rows.Add(dataRow7);
            }
            DataRow[] array5 = cBSCost.Select("CBSCode='" + this.outSourceCBSCode + "'");
            DataRow[] array6 = array5;
            for (int k = 0; k < array6.Length; k++)
            {
                DataRow dataRow8 = array6[k];
                DataRow dataRow9 = dataTable.NewRow();
                dataRow9.ItemArray = dataRow8.ItemArray;
                dataRow9["Num"]    = "(二)";
                dataTable.Rows.Add(dataRow9);
            }
        }
        return(dataTable);
    }
Example #12
0
 protected void BindGv()
 {
     this.AspNetPager1.RecordCount = ConstructReport.GetConsResCount(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.txtReourceCode.Text.Trim(), this.txtReourceName.Text.Trim(), this.prjId, WebUtil.GetUserNames(base.UserCode));
     this.gvConstruct.DataSource   = ConstructReport.GetConsRes(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.txtReourceCode.Text.Trim(), this.txtReourceName.Text.Trim(), this.prjId, WebUtil.GetUserNames(base.UserCode), this.AspNetPager1.CurrentPageIndex, this.AspNetPager1.PageSize);
     this.gvConstruct.DataBind();
     string[] value = (string[])this.ViewState["Total"];
     int[]    index = (int[])this.ViewState["index"];
     GridViewUtility.AddTotalRow(this.gvConstruct, value, index);
 }
Example #13
0
    protected void btnExcel_Click(object sender, System.EventArgs e)
    {
        DataTable dataTable = new DataTable();

        dataTable = ConstructReport.GetLaborAnalysis(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.prjId, 0, 0);
        if (dataTable.Rows.Count > 0)
        {
            DataRow dataRow = dataTable.NewRow();
            dataRow["Num"] = "合计";
            dataRow["CurrentLaborBudCost"]    = dataTable.Compute("sum(CurrentLaborBudCost)", "1>0");
            dataRow["CurrentLaborConsCost"]   = dataTable.Compute("sum(CurrentLaborConsCost)", "1>0");
            dataRow["CurrentReductionAmount"] = dataTable.Compute("sum(CurrentReductionAmount)", "1>0");
            dataRow["LaborBudCost"]           = dataTable.Compute("sum(LaborBudCost)", "1>0");
            dataRow["LaborConsCost"]          = dataTable.Compute("sum(LaborConsCost)", "1>0");
            dataRow["ReductionAmount"]        = dataTable.Compute("sum(ReductionAmount)", "1>0");
            if (System.Convert.ToDecimal(dataRow["CurrentLaborBudCost"]) != 0m)
            {
                decimal d = System.Convert.ToDecimal(dataRow["CurrentReductionAmount"]) / System.Convert.ToDecimal(dataRow["CurrentLaborBudCost"]);
                dataRow["CurrentReductionRate"] = (decimal.Floor(d * 10000m) / 100m).ToString("0.00") + "%";
            }
            else
            {
                dataRow["CurrentReductionRate"] = "0.00%";
            }
            if (System.Convert.ToDecimal(dataRow["LaborBudCost"]) != 0m)
            {
                decimal d2 = System.Convert.ToDecimal(dataRow["ReductionAmount"]) / System.Convert.ToDecimal(dataRow["LaborBudCost"]);
                dataRow["ReductionRate"] = (decimal.Floor(d2 * 10000m) / 100m).ToString("0.00") + "%";
            }
            else
            {
                dataRow["ReductionRate"] = "0.00%";
            }
            dataTable.Rows.Add(dataRow);
        }
        dataTable = this.GetTitleByTable(dataTable);
        System.Collections.Generic.List <ExcelHeader> list = new System.Collections.Generic.List <ExcelHeader>();
        list.Add(ExcelHeader.Create("本月数", 1, 4, 3, 0));
        list.Add(ExcelHeader.Create("累计数", 1, 4, 7, 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, 2, base.Request.Browser.Browser);
    }
Example #14
0
    protected void BindGv()
    {
        int recordCount = ConstructReport.GetByPrj(this.prjId).Count <ConstructReport>();

        this.AspNetPager1.RecordCount = recordCount;
        System.Collections.Generic.IList <ConstructReport> dataSource = ConstructReport.GetByPrj(this.prjId).Skip((this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize).Take(this.AspNetPager1.PageSize).ToList <ConstructReport>();
        this.gvConstruct.DataSource = dataSource;
        this.gvConstruct.DataBind();
    }
Example #15
0
    protected void btnExcel_Click(object sender, System.EventArgs e)
    {
        DataTable dataTable = new DataTable();

        dataTable = ConstructReport.GetEvenAnalysis(this.txtPrjCode.Text.Trim(), this.txtPrjName.Text.Trim(), 0, 0, base.UserCode, this.hfldIsWBSRelevance.Value);
        if (dataTable.Rows.Count > 0)
        {
            DataRow dataRow = dataTable.NewRow();
            dataRow["Num"]          = "合计";
            dataRow["ContractBud"]  = dataTable.Compute("sum(ContractBud)", "1>0");
            dataRow["DirectCost"]   = dataTable.Compute("sum(DirectCost)", "1>0");
            dataRow["IndirectCost"] = dataTable.Compute("sum(IndirectCost)", "1>0");
            dataRow["GainLoss"]     = dataTable.Compute("sum(GainLoss)", "1>0");
            if (System.Convert.ToDecimal(dataRow["ContractBud"]) != 0m)
            {
                decimal d = System.Convert.ToDecimal(dataRow["GainLoss"]) / System.Convert.ToDecimal(dataRow["ContractBud"]);
                dataRow["RatioGainLoss"] = (decimal.Floor(d * 10000m) / 100m).ToString() + "%";
            }
            else
            {
                dataRow["RatioGainLoss"] = "0.00%";
            }
            dataTable.Rows.Add(dataRow);
        }
        dataTable = this.GetTitleByTable(dataTable);
        System.Collections.Generic.List <ExcelHeader> list = new System.Collections.Generic.List <ExcelHeader>();
        list.Add(ExcelHeader.Create("累计数", 1, 5, 3, 0));
        list.Add(ExcelHeader.Create("实际成本", 2, 2, 4, 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, 3, 0, 0, 3));
            }
            else
            {
                if (dataColumn.Ordinal > 3 && dataColumn.Ordinal < 6)
                {
                    list.Add(ExcelHeader.Create(dataColumn.ColumnName, 3, 0, 0, 0));
                }
                else
                {
                    list.Add(ExcelHeader.Create(dataColumn.ColumnName, 2, 0, 0, 2));
                }
            }
        }
        ExcelHelper.ExportExcel(dataTable, "盈亏分析", "盈亏分析", "盈亏分析.xls", list, null, 3, base.Request.Browser.Browser);
    }
Example #16
0
    protected void ComputeTotal()
    {
        this.AspNetPager1.CurrentPageIndex = 1;
        DataTable laborCostAnalysis = ConstructReport.GetLaborCostAnalysis(this.txtResourceCode.Text.Trim(), this.txtResourceName.Text.Trim(), this.prjId, 0, 0);

        string[] array = new string[12];
        if (laborCostAnalysis.Rows.Count != 0)
        {
            array[0]  = System.Convert.ToDecimal(laborCostAnalysis.Compute("sum(CurrentBudQuantity)", "1>0")).ToString("0.000");
            array[1]  = System.Convert.ToDecimal(laborCostAnalysis.Compute("sum(CurrentBudCost)", "1>0")).ToString("0.000");
            array[2]  = System.Convert.ToDecimal(laborCostAnalysis.Compute("sum(CurrentConsQuantity)", "1>0")).ToString("0.000");
            array[3]  = System.Convert.ToDecimal(laborCostAnalysis.Compute("sum(CurrentConsCost)", "1>0")).ToString("0.000");
            array[4]  = System.Convert.ToDecimal(laborCostAnalysis.Compute("sum(CurrentReductionAmount)", "1>0")).ToString("0.000");
            array[6]  = System.Convert.ToDecimal(laborCostAnalysis.Compute("sum(BudQuantity)", "1>0")).ToString("0.000");
            array[7]  = System.Convert.ToDecimal(laborCostAnalysis.Compute("sum(BudCost)", "1>0")).ToString("0.000");
            array[8]  = System.Convert.ToDecimal(laborCostAnalysis.Compute("sum(ConsQuantity)", "1>0")).ToString("0.000");
            array[9]  = System.Convert.ToDecimal(laborCostAnalysis.Compute("sum(ConsCost)", "1>0")).ToString("0.000");
            array[10] = System.Convert.ToDecimal(laborCostAnalysis.Compute("sum(ReductionAmount)", "1>0")).ToString("0.000");
        }
        else
        {
            array[0]  = "0.000";
            array[1]  = "0.000";
            array[2]  = "0.000";
            array[3]  = "0.000";
            array[4]  = "0.000";
            array[6]  = "0.000";
            array[7]  = "0.000";
            array[8]  = "0.000";
            array[9]  = "0.000";
            array[10] = "0.000";
        }
        if (System.Convert.ToDecimal(array[1]) != 0m)
        {
            decimal d = System.Convert.ToDecimal(array[4]) / System.Convert.ToDecimal(array[1]);
            array[5] = (decimal.Floor(d * 10000m) / 100m).ToString("0.00") + "%";
        }
        else
        {
            array[5] = "0.00%";
        }
        if (System.Convert.ToDecimal(array[7]) != 0m)
        {
            decimal d2 = System.Convert.ToDecimal(array[10]) / System.Convert.ToDecimal(array[7]);
            array[11] = (decimal.Floor(d2 * 10000m) / 100m).ToString("0.00") + "%";
        }
        else
        {
            array[11] = "0.00%";
        }
        this.ViewState["Total"] = array;
    }
Example #17
0
    public void BindGv()
    {
        string taskCode     = this.txtTaskCode.Text.Trim();
        string taskName     = this.txtTaskName.Text.Trim();
        string resourceCode = this.txtResourceCode.Text.Trim();
        string resourceName = this.txtResourceName.Text.Trim();

        this.AspNetPager1.RecordCount = ConstructReport.GetCBSTaskCount(taskCode, taskName, resourceCode, resourceName, this.prjId, "LaborCBSCode");
        DataTable cBSTaskAnalysis = ConstructReport.GetCBSTaskAnalysis(taskCode, taskName, resourceCode, resourceName, this.prjId, "LaborCBSCode", this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex);

        this.gvLaborCost.DataSource = cBSTaskAnalysis;
        this.gvLaborCost.DataBind();
    }
Example #18
0
    protected void btnExcel_Click(object sender, System.EventArgs e)
    {
        DataTable dataTable = new DataTable();

        dataTable = ConstructReport.GetLSMTaskAnalysis(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.prjId, 0, 0);
        if (dataTable.Rows.Count > 0)
        {
            DataRow dataRow = dataTable.NewRow();
            dataRow["Num"]             = "合计";
            dataRow["LaborBudCost"]    = System.Convert.ToDecimal(dataTable.Compute("sum(LaborBudCost)", "1>0")).ToString("0.000");
            dataRow["StuffBudCost"]    = System.Convert.ToDecimal(dataTable.Compute("sum(StuffBudCost)", "1>0")).ToString("0.000");
            dataRow["MachineBudCost"]  = System.Convert.ToDecimal(dataTable.Compute("sum(MachineBudCost)", "1>0")).ToString("0.000");
            dataRow["BudTotal"]        = System.Convert.ToDecimal(dataTable.Compute("sum(BudTotal)", "1>0")).ToString("0.000");
            dataRow["LaborConsCost"]   = System.Convert.ToDecimal(dataTable.Compute("sum(LaborConsCost)", "1>0")).ToString("0.000");
            dataRow["StuffConsCost"]   = System.Convert.ToDecimal(dataTable.Compute("sum(StuffConsCost)", "1>0")).ToString("0.000");
            dataRow["MachineConsCost"] = System.Convert.ToDecimal(dataTable.Compute("sum(MachineConsCost)", "1>0")).ToString("0.000");
            dataRow["ConsTotal"]       = System.Convert.ToDecimal(dataTable.Compute("sum(ConsTotal)", "1>0")).ToString("0.000");
            dataRow["DiffTotal"]       = System.Convert.ToDecimal(dataTable.Compute("sum(DiffTotal)", "1>0")).ToString("0.000");
            dataTable.Rows.Add(dataRow);
        }
        dataTable = this.GetTitleByTable(dataTable);
        System.Collections.Generic.List <ExcelHeader> list = new System.Collections.Generic.List <ExcelHeader>();
        list.Add(ExcelHeader.Create("目标成本", 1, 4, 3, 0));
        list.Add(ExcelHeader.Create("报量成本", 1, 4, 7, 0));
        System.Collections.Generic.List <int> list2 = new System.Collections.Generic.List <int>();
        foreach (DataColumn dataColumn in dataTable.Columns)
        {
            if (dataColumn.Ordinal >= 3 && dataColumn.Ordinal < 11)
            {
                list2.Add(dataColumn.Ordinal);
            }
            if (dataColumn.Ordinal < 3)
            {
                list.Add(ExcelHeader.Create(dataColumn.ColumnName, 2, 0, 0, 2));
            }
            else
            {
                if (dataColumn.Ordinal > 10)
                {
                    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, 2, base.Request.Browser.Browser);
    }
Example #19
0
    protected void btnExcel_Click(object sender, System.EventArgs e)
    {
        DataTable dataTable = new DataTable();

        dataTable = ConstructReport.GetConsRes(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.txtReourceCode.Text.Trim(), this.txtReourceName.Text.Trim(), this.prjId, WebUtil.GetUserNames(base.UserCode), 0, 0);
        if (dataTable.Rows.Count > 0)
        {
            DataRow dataRow = dataTable.NewRow();
            dataRow["Num"] = "合计";
            dataRow["AccountingQuantity"] = dataTable.Compute("sum(AccountingQuantity)", "1>0");
            dataRow["Total"] = dataTable.Compute("sum(Total)", "1>0");
            dataTable.Rows.Add(dataRow);
        }
        dataTable = this.GetTitleByTable(dataTable);
        ExcelHelper.ExportExcel(dataTable, "施工报量查询", "施工报量查询", "施工报量查询.xls", null, null, 3, base.Request.Browser.Browser);
    }
Example #20
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.hfldIsWBSRelevance.Value = this.isWBSRelevance;
         this.BindGv();
         ConstructReport byId = ConstructReport.GetById(this.conId);
         this.txtDate.Text       = byId.InputDate.ToString("yyyy-M-dd");
         this.txtInputUser.Text  = byId.InputUser;
         this.txtWorkCard.Value  = byId.WorkCard;
         this.hfldReportId.Value = this.conId;
         ProjectInfo byId2 = ProjectInfo.GetById(byId.ProjectId);
         this.lblPrjName.Text = StringUtility.GetStr(byId2.PrjName, 25);
         this.spPrjName.Attributes.Add("title", byId2.PrjName);
         this.FileUpload1.InnerHtml = this.FilesBind(this.conId);
     }
 }
Example #21
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.InitPage();
         PrjInfoModel    prjInfoModel = new PrjInfoModel();
         ConstructReport byId         = ConstructReport.GetById(this.consRepId);
         prjInfoModel = this.ptPrjInfoBll.GetModelByPrjGuid(byId.ProjectId);
         System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
         stringBuilder.AppendFormat(prjInfoModel.PrjName + "下", new object[0]);
         stringBuilder.Append(byId.InputDate.ToString("yyyy年MM月dd日"));
         stringBuilder.Append("的施工报量");
         this.lblPrjName.Text = stringBuilder.ToString();
         this.BindGv();
         this.hfldConsRepId.Value = this.consRepId;
     }
 }
Example #22
0
    protected void btnUpdate_Click(object sender, System.EventArgs e)
    {
        if (this.gvTask.Rows.Count == 0)
        {
            base.RegisterScript("alert('系统提示:\\n\\n没有选择任务的时候不能进行保存!')");
            return;
        }
        this.hfldIsPostBack.Value = "true";
        ConstructReport constructReport = ConstructReport.Create(this.hfldReportId.Value, this.hfldPrjId.Value, this.txtInputUser.Text.Trim(), System.Convert.ToDateTime(this.txtDate.Text), null, this.txtWorkCard.Value.Trim(), -1);
        ConstructReport byId            = ConstructReport.GetById(this.hfldReportId.Value);

        constructReport.IsValid = true;
        if (byId != null)
        {
            constructReport.Update(constructReport);
            System.Collections.IEnumerator enumerator = this.gvTask.Rows.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    GridViewRow gridViewRow = (GridViewRow)enumerator.Current;
                    string      taskId      = this.gvTask.DataKeys[gridViewRow.RowIndex].Values[0].ToString();
                    string      id          = this.gvTask.DataKeys[gridViewRow.RowIndex].Values[1].ToString();
                    string      text        = ((TextBox)gridViewRow.FindControl("txtCompleteQuantity")).Text;
                    string      text2       = ((TextBox)gridViewRow.FindControl("txtWorkContent")).Text;
                    System.Collections.Generic.List <ConstructResource> resourceList = null;
                    ConstructTask constructTask = ConstructTask.Create(id, this.hfldReportId.Value, taskId, System.Convert.ToDecimal(text), text2, "", resourceList);
                    constructTask.Update(constructTask);
                }
                goto IL_1A8;
            }
            finally
            {
                System.IDisposable disposable = enumerator as System.IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }
        constructReport.State = "0";
        constructReport.Add(constructReport);
IL_1A8:
        base.RegisterScript("top.ui.tabSuccess({ parentName: '_ConstructTask' });");
    }
Example #23
0
    protected void btnExcel_Click(object sender, System.EventArgs e)
    {
        DataTable dataTable = ConstructReport.GetProfitInfo(this.txtPrjCode.Text.Trim(), this.txtPrjName.Text.Trim(), base.UserCode, this.dropPrjState.SelectedValue, this.txtPrjPeopleName.Text.Trim(), this.txtPrjStartDate.Text.Trim(), this.txtPrjEndDate.Text.Trim(), 0, 0, this.hfldIsWBSRelevance.Value);

        this.SetPrjStates(dataTable);
        if (dataTable.Rows.Count > 0)
        {
            DataRow dataRow = dataTable.NewRow();
            dataRow["Num"]           = "合计";
            dataRow["ContractCost"]  = dataTable.Compute("sum(ContractCost)", "1>0");
            dataRow["BudCost"]       = dataTable.Compute("sum(BudCost)", "1>0");
            dataRow["ConsTotal"]     = dataTable.Compute("sum(ConsTotal)", "1>0");
            dataRow["StuffCost"]     = dataTable.Compute("sum(StuffCost)", "1>0");
            dataRow["LaborCost"]     = dataTable.Compute("sum(LaborCost)", "1>0");
            dataRow["MachineCost"]   = dataTable.Compute("sum(MachineCost)", "1>0");
            dataRow["OutSourceCost"] = dataTable.Compute("sum(OutSourceCost)", "1>0");
            dataRow["ElseCBSCost"]   = dataTable.Compute("sum(ElseCBSCost)", "1>0");
            dataRow["DirectCost"]    = dataTable.Compute("sum(DirectCost)", "1>0");
            dataRow["IndirectCost"]  = dataTable.Compute("sum(IndirectCost)", "1>0");
            dataRow["TargetProfit"]  = dataTable.Compute("sum(TargetProfit)", "1>0");
            dataRow["RealityProfit"] = dataTable.Compute("sum(RealityProfit)", "1>0");
            dataTable.Rows.Add(dataRow);
        }
        dataTable = this.GetTitleByTable(dataTable);
        System.Collections.Generic.List <ExcelHeader> list = new System.Collections.Generic.List <ExcelHeader>();
        list.Add(ExcelHeader.Create("直接费用", 1, 6, 10, 0));
        list.Add(ExcelHeader.Create("利润", 1, 2, 17, 0));
        System.Collections.Generic.List <int> list2 = new System.Collections.Generic.List <int>();
        foreach (DataColumn dataColumn in dataTable.Columns)
        {
            if (dataColumn.Ordinal >= 10)
            {
                list2.Add(dataColumn.Ordinal);
            }
            if (dataColumn.Ordinal < 10 || dataColumn.Ordinal == 16)
            {
                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);
    }
Example #24
0
    protected void btn_Search_Click(object sender, System.EventArgs e)
    {
        this.AspNetPager1.CurrentPageIndex = 1;
        DataTable laborAnalysis = ConstructReport.GetLaborAnalysis(this.txtTaskCode.Text.Trim(), this.txtTaskName.Text.Trim(), this.prjId, 0, 0);

        string[] array = new string[8];
        if (laborAnalysis.Rows.Count != 0)
        {
            array[0] = System.Convert.ToDecimal(laborAnalysis.Compute("sum(CurrentLaborBudCost)", "1>0")).ToString("0.000");
            array[1] = System.Convert.ToDecimal(laborAnalysis.Compute("sum(CurrentLaborConsCost)", "1>0")).ToString("0.000");
            array[2] = System.Convert.ToDecimal(laborAnalysis.Compute("sum(CurrentReductionAmount)", "1>0")).ToString("0.000");
            array[4] = System.Convert.ToDecimal(laborAnalysis.Compute("sum(LaborBudCost)", "1>0")).ToString("0.000");
            array[5] = System.Convert.ToDecimal(laborAnalysis.Compute("sum(LaborConsCost)", "1>0")).ToString("0.000");
            array[6] = System.Convert.ToDecimal(laborAnalysis.Compute("sum(ReductionAmount)", "1>0")).ToString("0.000");
        }
        else
        {
            array[0] = "0.000";
            array[1] = "0.000";
            array[2] = "0.000";
            array[4] = "0.000";
            array[5] = "0.000";
            array[6] = "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("0.00") + "%";
        }
        else
        {
            array[3] = "0.00%";
        }
        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("0.00") + "%";
        }
        else
        {
            array[7] = "0.00%";
        }
        this.ViewState["Total"] = array;
        this.BindGv();
    }
Example #25
0
 protected void btnDelete_Click(object sender, System.EventArgs e)
 {
     System.Collections.Generic.List <string> listFromJson = JsonHelper.GetListFromJson(this.hfldPurchaseChecked.Value);
     try
     {
         foreach (string current in listFromJson)
         {
             SelfEventAction.SuperDelete(current, "Bud_ConsReport", "FlowState");
         }
         ConstructReport.Delete(listFromJson);
         base.RegisterScript("$('#btnBindResTask').hide();setWidthAndHeight(); alert('系统提示:\\n\\删除成功!')");
         this.BindGv();
     }
     catch
     {
         base.RegisterScript("setWidthAndHeight();alert('系统提示:\\n\\n删除失败!');");
     }
 }
Example #26
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        List <string> listFromJson = JsonHelper.GetListFromJson(this.hfldRptId.Value);

        try
        {
            foreach (string current in listFromJson)
            {
                SelfEventAction.SuperDelete(current, "Bud_ConsReport", "FlowState");
            }
            ConstructReport.Delete(listFromJson);
            base.RegisterScript("top.ui.show('删除成功');");
            this.BindRpt();
        }
        catch
        {
            base.RegisterScript("top.ui.alert('删除失败');");
        }
    }
Example #27
0
    protected void btnExcel_Click(object sender, System.EventArgs e)
    {
        DataTable dataTable = new DataTable();

        dataTable = ConstructReport.GetMajorStuffDiffAnalysis(this.txtResourceCode.Text.Trim(), this.txtResourceName.Text.Trim(), this.prjId, 0, 0);
        if (dataTable.Rows.Count > 0)
        {
            DataRow dataRow = dataTable.NewRow();
            dataRow["Num"]                    = "合计";
            dataRow["CurrentBudCost"]         = dataTable.Compute("sum(CurrentBudCost)", "1>0");
            dataRow["CurrentConsCost"]        = dataTable.Compute("sum(CurrentConsCost)", "1>0");
            dataRow["CurrentDiffPrice"]       = dataTable.Compute("sum(CurrentDiffPrice)", "1>0");
            dataRow["CurrentReductionAmount"] = dataTable.Compute("sum(CurrentReductionAmount)", "1>0");
            dataRow["BudCost"]                = dataTable.Compute("sum(BudCost)", "1>0");
            dataRow["ConsCost"]               = dataTable.Compute("sum(ConsCost)", "1>0");
            dataRow["DiffQuantity"]           = dataTable.Compute("sum(DiffQuantity)", "1>0");
            dataRow["DiffPrice"]              = dataTable.Compute("sum(DiffPrice)", "1>0");
            dataRow["ReductionAmount"]        = dataTable.Compute("sum(ReductionAmount)", "1>0");
            dataTable.Rows.Add(dataRow);
        }
        dataTable = this.GetTitleByTable(dataTable);
        System.Collections.Generic.List <ExcelHeader> list = new System.Collections.Generic.List <ExcelHeader>();
        list.Add(ExcelHeader.Create("本月数", 1, 4, 7, 0));
        list.Add(ExcelHeader.Create("累计数", 1, 5, 11, 0));
        System.Collections.Generic.List <int> list2 = new System.Collections.Generic.List <int>();
        foreach (DataColumn dataColumn in dataTable.Columns)
        {
            if (dataColumn.Ordinal >= 7)
            {
                list2.Add(dataColumn.Ordinal);
            }
            if (dataColumn.Ordinal < 7)
            {
                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, 2, base.Request.Browser.Browser);
    }
Example #28
0
 protected void BindGv()
 {
     this.dtCostSum = ConstructReport.GetCostSummary(this.ddlPrject.SelectedValue, 1);
     this.ViewState["dtCostSum"] = this.dtCostSum;
     this.gvCost.DataSource      = this.dtCostSum;
     this.gvCost.DataBind();
     string[] value = new string[]
     {
         System.Convert.ToDecimal(this.dtCostSum.Compute("sum(BudAmount)", "1>0")).ToString("0.000"),
         System.Convert.ToDecimal(this.dtCostSum.Compute("sum(Cost)", "1>0")).ToString("0.000"),
         System.Convert.ToDecimal(this.dtCostSum.Compute("sum(Disparity)", "1>0")).ToString("0.000")
     };
     int[] index = new int[]
     {
         2,
         3,
         4
     };
     GridViewUtility.AddTotalRow(this.gvCost, value, index);
 }
Example #29
0
    protected void btnExcel_Click(object sender, System.EventArgs e)
    {
        DataTable dataTable    = new DataTable();
        string    taskCode     = this.txtTaskCode.Text.Trim();
        string    taskName     = this.txtTaskName.Text.Trim();
        string    resourceCode = this.txtResourceCode.Text.Trim();
        string    resourceName = this.txtResourceName.Text.Trim();

        dataTable = ConstructReport.GetCBSTaskAnalysis(taskCode, taskName, resourceCode, resourceName, this.prjId, "LaborCBSCode", 0, 0);
        if (dataTable.Rows.Count > 0)
        {
            DataRow dataRow = dataTable.NewRow();
            dataRow["Num"]             = "合计";
            dataRow["BudCost"]         = dataTable.Compute("sum(BudCost)", "1>0");
            dataRow["ConsCost"]        = dataTable.Compute("sum(ConsCost)", "1>0");
            dataRow["ReductionAmount"] = dataTable.Compute("sum(ReductionAmount)", "1>0");
            dataTable.Rows.Add(dataRow);
        }
        dataTable = this.GetTitleByTable(dataTable);
        ExcelHelper.ExportExcel(dataTable, "人工明细表", "人工明细表", "人工明细表.xls", null, null, 2, base.Request.Browser.Browser);
    }
Example #30
0
    protected void btnExcel_Click(object sender, System.EventArgs e)
    {
        DataTable dataTable = new DataTable();

        dataTable = ConstructReport.GetStuffInfo(this.txtCode.Text.Trim(), this.txtName.Text.Trim(), this.txtSpecification.Text.Trim(), this.txtBrand.Text.Trim(), this.txtUnitName.Text.Trim(), this.prjId, 0, 0, this.hfldIsWBSRelevance.Value);
        if (dataTable.Rows.Count > 0)
        {
            DataRow dataRow = dataTable.NewRow();
            dataRow["Num"]           = "合计";
            dataRow["BudQuantity"]   = dataTable.Compute("sum(BudQuantity)", "1>0");
            dataRow["ConsQuantity"]  = dataTable.Compute("sum(ConsQuantity)", "1>0");
            dataRow["RealityNumber"] = dataTable.Compute("sum(RealityNumber)", "1>0");
            dataRow["BudTotal"]      = dataTable.Compute("sum(BudTotal)", "1>0");
            dataRow["ConsTotal"]     = dataTable.Compute("sum(ConsTotal)", "1>0");
            dataRow["RealityTotal"]  = dataTable.Compute("sum(RealityTotal)", "1>0");
            dataTable.Rows.Add(dataRow);
        }
        dataTable = this.GetTitleByTable(dataTable);
        System.Collections.Generic.List <ExcelHeader> list = new System.Collections.Generic.List <ExcelHeader>();
        list.Add(ExcelHeader.Create("材料数量", 1, 3, 6, 0));
        list.Add(ExcelHeader.Create("材料价格", 1, 3, 9, 0));
        list.Add(ExcelHeader.Create("材料金额", 1, 3, 12, 0));
        System.Collections.Generic.List <int> list2 = new System.Collections.Generic.List <int>();
        foreach (DataColumn dataColumn in dataTable.Columns)
        {
            if (dataColumn.Ordinal >= 6)
            {
                list2.Add(dataColumn.Ordinal);
            }
            if (dataColumn.Ordinal < 6)
            {
                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);
    }