protected void dgProject_OnRowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            ManageCookie mgCookie = new ManageCookie();
            users        ck       = mgCookie.ReadCookies();

            gUtilities gutil   = new gUtilities();
            double     dbTotal = gutil.getReportQSETTotal(ck.p_id);

            if (dbTotal > 70)
            {
                e.Row.Cells[4].Text = "ต่ำ";
            }
            else if (dbTotal <= 70 && dbTotal > 30)
            {
                e.Row.Cells[4].Text = "กลาง";
            }
            else
            {
                e.Row.Cells[4].Text = "สูง";
            }

            //if ((e.Row.Cells[5].Text == "ใช่" && e.Row.Cells[6].Text == "ใช่" && e.Row.Cells[7].Text == "ใช่") || e.Row.Cells[8].Text == "ใช่")
            //{
            //    e.Row.Cells[4].Text = "อยู่ในเกณฑ์การประเมิน";
            //}
            //else
            //{
            //    e.Row.Cells[4].Text = "ไม่อยู่ในเกณฑ์การประเมิน";
            //}
        }
    }
Exemple #2
0
    protected void GridView1_OnRowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            gUtilities gutil   = new gUtilities();
            double     dbTotal = gutil.getReportQSETTotal(this.GridView1.DataKeys[e.Row.RowIndex].Value.ToString());

            if (dbTotal > 70)
            {
                e.Row.Cells[4].Text      = "ต่ำ";
                e.Row.Cells[4].BackColor = System.Drawing.Color.Green;
            }
            else if (dbTotal <= 70 && dbTotal > 30)
            {
                e.Row.Cells[4].Text      = "กลาง";
                e.Row.Cells[4].BackColor = System.Drawing.Color.Yellow;
            }
            else if (dbTotal == -1.0)
            {
                e.Row.Cells[4].Text = "-";
            }
            else
            {
                e.Row.Cells[4].Text      = "สูง";
                e.Row.Cells[4].BackColor = System.Drawing.Color.Red;
            }
        }
    }