public void SumTotal()
    {
        DataTable contrast = CostApply.GetContrast(base.Request["ic"]);

        if (contrast.Rows.Count > 0)
        {
            System.Collections.Generic.Dictionary <string, decimal> dictionary = new System.Collections.Generic.Dictionary <string, decimal>();
            string  text  = "ThisAmount";
            decimal value = decimal.Parse(contrast.Compute("sum(" + text + ")", "1=1").ToString());
            dictionary.Add(text, value);
            DataTable dataTable = contrast.Clone();
            int       num       = -1;
            foreach (DataRow dataRow in contrast.Rows)
            {
                num++;
                if (num <= 0 || !(dataRow["CBSCode"].ToString() == contrast.Rows[num - 1]["CBSCode"].ToString()))
                {
                    DataRow dataRow2 = dataTable.NewRow();
                    dataRow2.ItemArray = dataRow.ItemArray;
                    dataTable.Rows.Add(dataRow2);
                }
            }
            decimal value2 = decimal.Parse((dataTable.Compute("SUM(MonthAmount)", "1=1") == null) ? 0m.ToString() : dataTable.Compute("SUM(MonthAmount)", "1=1").ToString());
            dictionary.Add("MonthAmount", value2);
            decimal value3 = decimal.Parse(dataTable.Compute("SUM(PrjAmount)", "1=1").ToString());
            dictionary.Add("PrjAmount", value3);
            decimal value4 = decimal.Parse(dataTable.Compute("SUM(PrjAlreadyAmount)", "1=1").ToString());
            dictionary.Add("PrjAlreadyAmount", value4);
            this.ViewState["sum"] = dictionary;
        }
    }
    protected void BindRptContrast()
    {
        DataTable contrast = CostApply.GetContrast(base.Request["ic"]);

        this.rptContrast.DataSource = contrast;
        this.rptContrast.DataBind();
        if (contrast.Rows.Count == 0)
        {
            base.RegisterScript("$('#rptContrast tr:last-child').remove();");
        }
    }