private void functionDelbyAge(int getIndex)
        {
            if (drpAgency.SelectedIndex != 0 && drpProgramDetails.SelectedIndex != 0)
            {
                int delError = objNomDetails.deleteCandidateDetails(getIndex,
                                                                    int.Parse(drpAgency.SelectedValue.ToString()), ((UserDetails)Session[clsConstant.TOKEN]).UserID, int.Parse(drpProgramDetails.SelectedValue.ToString()));

                if (delError == 0)
                {
                    modPopDelMsg.Show();
                    lblMsgDel.Text = "Your are not Athuroized to delete the Participant !!";
                    lblMsgDel.Focus();
                }
                else
                {
                    modPopDelMsg.Show();
                    lblMsgDel.Text = "Participant Deleted Successfully !!";
                    lblMsgDel.Focus();
                }
            }
            else
            {
                modPopDelMsg.Show();
                lblMsgDel.Text = "Please Choose Agency And Program Details To Delete User From !!";
                lblMsgDel.Focus();
            }
        }
        protected void btnDel_Click(object sender, EventArgs e)
        {
            try
            {
                objNomDetails = new NominationDetails();

                int getUserID = int.Parse(Session["RowIndex"].ToString());

                int delError = objNomDetails.deleteCandidateDetails(getUserID, -1, ((UserDetails)Session[clsConstant.TOKEN]).UserID, -1, 1);  //

                if (delError == 1)
                {
                    modPopDelMsg.Show();
                    lblMsgDel.Text = "Participant Deleted Successfully !!";
                    btnDel.Visible = false;
                    btnYes.Text    = "ok";
                }
                else
                {
                    modPopDelMsg.Show();
                    lblMsgDel.Text = "Error: Unable to Delete User";
                    btnDel.Visible = false;
                    btnYes.Text    = "ok";
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
        }
        protected void grdUserlist_RowDeleting1(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                int getIndex = 0;


                if (grdUserlist.DataKeys[e.RowIndex].Value.ToString() != "" && grdUserlist.Rows[e.RowIndex].Cells[10].Text != " ") // This means user is not nominated for any workshop can be deleted directly
                {
                    getIndex = (int)grdUserlist.DataKeys[e.RowIndex].Value;

                    objNomDetails = new NominationDetails();

                    if ((((UserDetails)Session[clsConstant.TOKEN]).SuperUser) == true)
                    {
                        int delError = objNomDetails.deleteCandidateDetails(getIndex,
                                                                            int.Parse(drpAgency.SelectedValue.ToString()), ((UserDetails)Session[clsConstant.TOKEN]).UserID, int.Parse(drpProgramDetails.SelectedValue.ToString()));

                        if (delError == 0)
                        {
                            modPopDelMsg.Show();
                            lblMsgDel.Text = "Your are not Athuroized to delete the Participant !!";
                            lblMsgDel.Focus();
                        }
                        else
                        {
                            modPopDelMsg.Show();
                            lblMsgDel.Text = "Participant Deleted Successfully !!";
                            lblMsgDel.Focus();
                        }
                    }
                    else
                    {
                        this.functionDelbyAge(getIndex);
                    }
                }
                else
                {
                    if ((((UserDetails)Session[clsConstant.TOKEN]).SuperUser) == true)
                    {
                        modPopDelMsg.Show();
                        btnDel.Visible = true;
                        btnYes.Text    = "No";
                        lblMsgDel.Text = "Do you want to delete this user permanently and corresponding information from the database ?";
                        btnYes.Focus();
                        Session["RowIndex"] = grdUserlist.Rows[e.RowIndex].Cells[1].Text;
                    }
                    else if ((((UserDetails)Session[clsConstant.TOKEN]).SuperUser) != true)
                    {
                        modPopDelMsg.Show();
                        lblMsgDel.Text = "This user is aleready deleted from the workshop !";
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
        }