protected void btnSignIn_Click(object sender, EventArgs e) { dbconnection dbconn = new dbconnection(); string query = "select * from SignUp where Email='" + txtMail.Text + "' and Password='******'"; string colname = "select Email,Password from SignUp"; if (dbconn.checkData(colname, query) == true) { Response.Write("<script LANGUAGE='JavaScript' >alert('You are loged in')</script>"); Response.Redirect("ClientHome.aspx"); } else { string quer = "select * from AddAdmin where Email='" + txtMail.Text + "' and Password='******'"; string colnam = "select Email,Password from Admin"; if (dbconn.checkData(colnam, quer) == true) { Response.Write("<script LANGUAGE='JavaScript' >alert('Welcome to the Website')</script>"); Response.Redirect("AdminHome.aspx"); } else { Response.Write("<script LANGUAGE='JavaScript' >alert('Wrong Email or Password')</script>"); } } }
protected void btnSignUp_Click(object sender, EventArgs e) { dbconnection dbconn = new dbconnection(); string querycheck = "Select * from SignUp where Email='" + txtEmail.Text + "'"; string colName = "select Email from SignUp"; if (dbconn.checkData(colName, querycheck) == true) { Response.Write("<script LANGUAGE='JavaScript' >alert('You already register with us\nPlease Sign In')</script>"); } else { if (txtPassword.Text == txtConfirmpass.Text) { string queryinsert = "insert into SignUp(Name,Email,Password) values ('" + txtFullName.Text + "','" + txtEmail.Text + "','" + txtPassword.Text + "')"; dbconn.iud(queryinsert); signUp(); } else { Response.Write("<script LANGUAGE='JavaScript' >alert('Please Rewrite Confirm Password')</script>"); } } }