Exemplo n.º 1
0
        protected void btnLogIn_Click(object sender, EventArgs e)
        {
            FormGeneratorData data = new FormGeneratorData();

            string encryptedUsername = Crypto.Encrypt(txtUserName.Text);
            string encryptedPassword = Crypto.Encrypt(txtPassword.Text);

            string admin_ID = data.Login(encryptedUsername, encryptedPassword);

            if (admin_ID != "0")
            {
                pnlLogin.Visible = false;
                pnlAdmin.Visible = true;
                Session["ID"] = admin_ID.ToString();

                data.LogAction(admin_ID, "Logged In.");
            }
            else
            {
                pnlLogin.Visible = true;
                pnlAdmin.Visible = false;
                Session["ID"] = "";
                data.LogAction(admin_ID, "Login Fail.");
            }
        }