private void GetList()
        {
            GetUserGridDetailsTableAdapter ug = new GetUserGridDetailsTableAdapter();
            DataTable dt = new DataTable();

            dt = ug.GetUserGridDetails(Session["UserLogin"].ToString());
            User_grd.DataSource = dt;
            User_grd.DataBind();
        }
        private void GetList()
        {
            GetDeptRejectedApplicationsTableAdapter ug = new GetDeptRejectedApplicationsTableAdapter();
            DataTable dt = new DataTable();

            dt = ug.GetDeptRejectedApplications(Session["DeptLogin"].ToString());
            User_grd.DataSource = dt;
            User_grd.DataBind();
        }
    protected void User_grd_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        User_grd.EditIndex = e.RowIndex;
        Id_hfd.Value       = User_grd.DataKeys[User_grd.EditIndex].Value.ToString();
        UpdateVoterTableAdapter VT = new UpdateVoterTableAdapter();
        object Chk = VT.DeleteCandidate(Id_hfd.Value);
        bool   chk = Convert.ToBoolean(Chk);

        if (chk == true)
        {
            User_grd.DataBind();
            ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('Voter deleted successfully.');window.location='EditRemoveCandidate.aspx';", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('Voter deletion Failed');window.location='EditRemoveCandidate.aspx';", true);
        }
    }
    public void GetUser()
    {
        GetCandidateListTableAdapter CT = new GetCandidateListTableAdapter();
        DataTable dt1 = new DataTable();

        dt1 = CT.GetCandidateList(State_ddl.SelectedValue, District_ddl.SelectedValue);
        if (dt1 != null)
        {
            if (dt1.Rows.Count > 0)
            {
                User_grd.DataSource = dt1;
                User_grd.DataBind();
            }
        }
        if (dt1.Rows.Count == 0)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('No User In Your selected State/District');window.location='EditRemoveCandidate.aspx';", true);
        }
    }
Пример #5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        UpdateVoterTableAdapter VT = new UpdateVoterTableAdapter();
        string   dateString        = DOBpnl_txt.Text;
        string   format            = "dd/mm/yyyy";
        DateTime dateTime          = DateTime.ParseExact(dateString, format, CultureInfo.InvariantCulture);
        string   strNewDate        = dateTime.ToString("yyyy-dd-mm");
        object   Chk   = VT.UpdateVoter(ID.Text, VoterName_txt.Text, VoterFname_txt.Text, VoterGender_txt.Text, strNewDate, Emailpnl_txt.Text, Contactpnl_txt.Text);
        bool     CHECK = Convert.ToBoolean(Chk);

        if (CHECK == true)
        {
            User_grd.DataBind();
            ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('Voter Updated successfully.');window.location='UserList.aspx';", true);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('Voter Updation Failed');window.location='UserList.aspx';", true);
        }
    }