public static Boolean Login(string email, string password) { //if (email != "" && password != "")//* Email & pswd cannot be empty. //{ if (DataUser.Login(email, password) == false) { Debug.WriteLine("Email: " + email + "or password are incorrect"); return(false); } Debug.WriteLine("User: "******" logged in successfully."); return(true); //} //return false; }
private void Ok_Click(object sender, EventArgs e) { if (DataUser.Login(Login_Access.Text, Pass_Access.Text, out DataUser listUser)) { if (listUser.access_level == 1) { Connection f_con = new Connection(); f_con.Show(); } else { MessageBox.Show("Ваш пользователь не имеет доступа!"); } } else { MessageBox.Show("Неверный логин или пароль!"); } }
private void Ok_Autorization_Click(object sender, EventArgs e) { if (DataUser.Login(tb_login.Text, tb_password.Text, out DataUser listUser)) { if (listUser.access_level == 1) { Home_page f_hp = new Home_page(); f_hp.Show(); Hide(); } else { Student_access f_sa = new Student_access(); f_sa.Show(); Hide(); } } else { MessageBox.Show("Неверный логин или пароль!"); } }
public bool LoginUser(string user, string pass) { return(userDAO.Login(user, pass)); }