Exemplo n.º 1
0
    private void BindData()
    {
        bool flag = false;
        inputReceiptReportCollectin reportInfo = inputReceiptAction.GetReportInfo(this.PlanNo, out this.PlanYear);

        this.lbPlanYear.Text = this.PlanYear;
        foreach (inputReceiptReportInfo inputReceiptReportInfo in reportInfo)
        {
            if (!inputReceiptReportInfo.IsProject)
            {
                this.CreateDpm(inputReceiptReportInfo, false);
            }
            else
            {
                if (!flag)
                {
                    flag = true;
                    this.CreateDpm(new inputReceiptReportInfo
                    {
                        PrjName           = "项目经理部",
                        InputAmount       = reportInfo.GetPrjInputAmount(),
                        InputCompAmount   = reportInfo.GetPrjInputCompAmount(),
                        ReceiptAmount     = reportInfo.GetPrjReceiptAmount(),
                        ReceiptCompAmount = reportInfo.GetPrjReceiptCompAmount()
                    }, true);
                    this.CreateAllPrjRows(reportInfo);
                }
            }
        }
        HtmlTableRow htmlTableRow = new HtmlTableRow();

        this.iIndex++;
        HtmlTableCell htmlTableCell = new HtmlTableCell();

        htmlTableCell.ColSpan   = 3;
        htmlTableCell.InnerText = "合计:" + reportInfo.GetAllReceiptAmount().ToString();
        htmlTableRow.Style.Add("FONT-WEIGHT", "bold");
        htmlTableRow.Cells.Add(htmlTableCell);
        HtmlTableCell htmlTableCell2 = new HtmlTableCell();

        htmlTableCell2.InnerText = reportInfo.GetAllReceiptCompAmount().ToString();
        htmlTableRow.Cells.Add(htmlTableCell2);
        HtmlTableCell htmlTableCell3 = new HtmlTableCell();

        if (reportInfo.GetAllReceiptAmount() != 0m)
        {
            htmlTableCell3.InnerText = Convert.ToString(decimal.Round(reportInfo.GetAllReceiptCompAmount() / reportInfo.GetAllReceiptAmount() * 100m, 2));
        }
        else
        {
            htmlTableCell3.InnerText = "0";
        }
        htmlTableRow.Cells.Add(htmlTableCell3);
        HtmlTableCell htmlTableCell4 = new HtmlTableCell();

        htmlTableCell4.InnerText = reportInfo.GetAllInputAmount().ToString();
        htmlTableRow.Cells.Add(htmlTableCell4);
        HtmlTableCell htmlTableCell5 = new HtmlTableCell();

        htmlTableCell5.InnerText = reportInfo.GetAllInputCompAmount().ToString();
        htmlTableRow.Cells.Add(htmlTableCell5);
        HtmlTableCell htmlTableCell6 = new HtmlTableCell();

        if (reportInfo.GetAllInputAmount() != 0m)
        {
            htmlTableCell6.InnerText = Convert.ToString(decimal.Round(reportInfo.GetAllInputCompAmount() / reportInfo.GetAllInputAmount() * 100m, 2));
        }
        else
        {
            htmlTableCell6.InnerText = "0";
        }
        htmlTableRow.Cells.Add(htmlTableCell6);
        htmlTableRow.Height = "22";
        this.tbReport.Rows.Add(htmlTableRow);
    }