Пример #1
0
        protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            Details d   = new Details();
            long    det = d.smedet(Session["adminlogin"].ToString());

            if (e.CommandName == "Select")
            {
                SmeDao smeNomCount = new SmeDaoSqlImpl();
                int    check       = smeNomCount.getSmeNominationsCount(det);
                if (check < 3)
                {
                    int                  rowindex      = Int32.Parse(e.CommandArgument.ToString());
                    GridViewRow          row           = GridView2.Rows[rowindex];
                    long                 requestId     = long.Parse(row.Cells[0].Text);
                    RequestManagementDao addNomination = new RequestManagementSql();
                    addNomination.addSmeNomination(requestId, det);
                    bindgrid2();
                    Label4.Visible = true;
                    Label4.Text    = "Request Accepted";
                }
                else
                {
                    GridView1.Visible = false;
                    GridView2.Visible = false;
                    Label1.Text       = "You already nominated for 3 requests. Please wait for Admin Action";
                    Label2.Visible    = false;
                    Label3.Visible    = false;
                    Label1.Visible    = true;
                }
            }
        }
Пример #2
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            Details d   = new Details();
            long    det = d.smedet(Session["adminlogin"].ToString());

            if (e.CommandName == "Select")
            {
                if (e.CommandName == "Select")
                {
                    SmeDao smeNomCount = new SmeDaoSqlImpl();
                    int    check       = smeNomCount.getSmeNominationsCount(det);
                    if (check < 3)
                    {
                        int                  rowindex      = Int32.Parse(e.CommandArgument.ToString());
                        GridViewRow          row           = GridView1.Rows[rowindex];
                        long                 requestId     = long.Parse(row.Cells[0].Text);
                        RequestManagementDao addNomination = new RequestManagementSql();
                        addNomination.addSmeNomination(requestId, det);
                        bindgrid();
                        LinkButton btnnominate = row.FindControl("LinkButton1") as LinkButton;
                        btnnominate.Enabled = false;
                        //TextBox myTextBox = row.FindControl("MyTextBoxId") as TextBox;
                        Label5.Visible = true;
                        Label5.Text    = "Nominated Successfully";
                    }
                    else
                    {
                        GridView1.Visible = false;
                        GridView2.Visible = false;
                        Label1.Visible    = true;
                        Label1.Text       = "You already nominated for 3 requests. Please wait for Admin Action";
                        Label2.Visible    = false;
                        Label3.Visible    = false;
                    }
                }
            }
        }