Exemple #1
0
        protected void GetRatings()
        {
            int value, rejected;


            foreach (GridViewRow row in HistoryOfComissions.Rows)
            {
                value = Commissions.FillRatings(row.Cells[0].Text);
                if (value == -1)
                {
                    Response.Redirect("~/Error.aspx");
                }
                rejected = Commissions.IsRejected(row.Cells[0].Text);
                if (rejected == -1)
                {
                    Response.Redirect("~/Error.aspx");
                }

                if (value != -2)
                {
                    ((HtmlInputGenericControl)row.FindControl("starating")).Value = value.ToString();
                    ((HtmlInputGenericControl)row.FindControl("starating")).Attributes.Add("readonly", "true");
                    ((Button)row.FindControl("BtnSubmitRating")).Visible = false;
                    BadgeCountActiveComissions.Text = rejected.ToString();
                }
                if (rejected == 0)
                {
                    ((HtmlInputGenericControl)row.FindControl("starating")).Visible = false;
                    ((Label)row.FindControl("labelrejected")).Visible    = true;
                    ((Button)row.FindControl("BtnSubmitRating")).Visible = false;
                }
            }
        }