Esempio n. 1
0
    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);
    }