Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
        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;
            }
        }
Beispiel #3
0
        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;
            }
        }