protected void Button1_Click(object sender, EventArgs e) { using (ChasierCRUD chasierCRUD = new ChasierCRUD()) { string fname = TextName.Text; string pass = TextPassword.Text; string passconf = TextPassConf.Text; string email = TextEmail.Text; string tipe = gender.SelectedItem.ToString(); Chasier chasier = new Chasier(); chasier.Password = pass; chasier.Email = email; chasierCRUD.CalEmail(chasier); chasierCRUD.Encrypt(chasier); string passEncrypt = chasier.EncryptPass.ToString(); Response.Write(chasier.EncryptPass); if (chasier.TotalEmail != 0) { ClientScript.RegisterStartupScript(this.GetType(), "random", "Fail()", true); } if (chasier.TotalEmail == 0) { chasierCRUD.Register(new Chasier { Fname = fname, Password = chasier.EncryptPass, Email = email, Gender = tipe }); ClientScript.RegisterStartupScript(this.GetType(), "random", "Berhasil()", true); } Response.Write(chasier.Password); }; }
protected void Login_btn_Click(object sender, EventArgs e) { using (ChasierCRUD chasierCRUD = new ChasierCRUD()) { string email = TextEmail.Text; string pass = Password.Text; Chasier chasier = new Chasier(); chasier.Email = email; chasier.Password = pass; chasierCRUD.Encrypt(chasier); Response.Write(chasier.EncryptPass); chasierCRUD.CalEmail(chasier); chasierCRUD.Login(chasier); if (chasier.TotalEmail != 0) { if (chasier.CekPassword == true) { Session["UserLogin"] = TextEmail.Text; ClientScript.RegisterStartupScript(this.GetType(), "random", "Berhasil()", true); } else if (chasier.CekPassword == false) { //Response.Write(chasier.CekPassword); //Response.Write("Login Gagal"); ClientScript.RegisterStartupScript(this.GetType(), "random", "PassFail()", true); } } else { //Response.Write("Email Belum Terdaftar"); ClientScript.RegisterStartupScript(this.GetType(), "random", "EmailFail()", true); } TextEmail.Text = string.Empty; Password.Text = string.Empty; chasier.Password = string.Empty; chasier.Email = string.Empty; } }
public void load(string email) { using (ChasierCRUD chasierCRUD = new ChasierCRUD()) { Chasier chasier = new Chasier(); string password = textPasswor.Value; email = textEmail.Value; chasier.Email = email; chasier.Password = password; chasierCRUD.CalEmail(chasier); chasierCRUD.Login(chasier); if (chasier.TotalEmail != 0) { if (chasier.CekPassword == true) { Session["UserLogin"] = email; ClientScript.RegisterStartupScript(this.GetType(), "random", "Berhasil()", true); } else if (chasier.CekPassword == false) { ClientScript.RegisterStartupScript(this.GetType(), "random", "PassFail()", true); } } else { //Response.Write("Email Belum Terdaftar"); Response.Write(email); ClientScript.RegisterStartupScript(this.GetType(), "random", "EmailFail()", true); } textEmail.Value = string.Empty; textPasswor.Value = string.Empty; chasier.Password = string.Empty; chasier.Email = string.Empty; } }
protected void btnLogin_Click(object sender, EventArgs e) { using (ChasierCRUD chasierCRUD = new ChasierCRUD()) { string email = textEmail.Value; string pass = textPassword.Value; Chasier chasier = new Chasier(); chasier.Email = email; chasier.Password = pass; chasierCRUD.Encrypt(chasier); Response.Write(chasier.EncryptPass); chasierCRUD.CalEmail(chasier); chasierCRUD.Login(chasier); if (chasier.TotalEmail != 0) { if (chasier.CekPassword == true) { Session["UserLogin"] = email; ClientScript.RegisterStartupScript(this.GetType(), "random", "Berhasil()", true); } else if (chasier.CekPassword == false) { ClientScript.RegisterStartupScript(this.GetType(), "random", "PassFail()", true); } } else { ClientScript.RegisterStartupScript(this.GetType(), "random", "EmailFail()", true); } textEmail.Value = string.Empty; textPassword.Value = string.Empty; chasier.Password = string.Empty; chasier.Email = string.Empty; } }