Пример #1
0
    protected void Update_Click(object sender, EventArgs e)
    {
        long   max_autono = mc.GetMaxAutono();
        string userid     = Session["Userid"].ToString();
        string query      = "update USER_DETAILS set autono=" + max_autono + ",name='" + Name.Text + "',email='" + Email.Text + "',mob='" + Mobile.Text + "',address='" + Address.Text + "',city='" + City.Text + "',pin='" + Pin.Text + "',aadhar='" + Aadhar.Text + "',gender='" + Gender.Text + "',dob='" + DOB.Text + "',religion='" + Religion.SelectedValue.ToString() + "',qualification='" + Education.SelectedValue.ToString() + "' where userid='" + userid + "'";

        try
        {
            con.ExecuteNonQuery(query);
            mc.Update_ACTIVITIES("UPDATE");
            Response.Redirect("Default.aspx");
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Registration", "alert('Error');", true);
        }
    }
Пример #2
0
    protected void BtnRegis_Click(object sender, EventArgs e)
    {
        long   max_autono = mc.GetMaxAutono() + 1;
        string query      = "insert into USER_DETAILS values('" + max_autono + "','" + UserId.Text + "','" + Name.Text + "','" + Password.Text + "','" + Email.Text + "','" + Contact.Text + "','" + Address.Text + "','" + City.Text + "','" + Pin.Text + "','" + Aadhar.Text + "','" + Gender.Text + "','" + DOB.Text + "','" + Religion.SelectedValue.ToString() + "','" + Education.SelectedValue.ToString() + "','NORMALUSER')";

        try
        {
            con.ExecuteNonQuery(query);
            Session["UserId"] = UserId.Text;
            mc.Update_ACTIVITIES("REGISTRATION");
            //ClientScript.RegisterStartupScript(this.GetType(), "Registration", "alert('Data Inserted Successfully');", true);
            Response.Redirect("Login.aspx");
            // ClientScript.RegisterStartupScript(this.GetType(), "Registration", "alert('Data Inserted Successfully');", true);
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Registration", "alert(" + ex.Message + ");", true);
            UserId.Focus();
        }
    }