Esempio n. 1
0
        protected void loginButton_Click(object sender, EventArgs e)
        {
            string userName = userNameTextBox.Text;
            string password = passwordTextBox.Text;

            if (userName != "")
            {
                if (password != "")
                {
                    bool check = logInManager.LogIn(userName, password);
                    if (check)
                    {
                        Session["LogIn"] = userName;
                        Response.Redirect("IndexUI.html");
                    }
                    else
                    {
                        userNameLabel.Text   = "";
                        passwordLabel.Text   = "";
                        logInLabel.Text      = "Incorrect User Name and Password";
                        logInLabel.ForeColor = Color.Orange;
                    }
                }
                else
                {
                    userNameLabel.Text      = "";
                    passwordLabel.Text      = "Enter Your Password";
                    passwordLabel.ForeColor = Color.Red;
                }
            }
            else
            {
                userNameLabel.Text      = "Please Enter User Name";
                userNameLabel.ForeColor = Color.Red;
            }
        }