void OnFinish() { this.Hide(); Form_Dashboard fd = new Form_Dashboard(); fd.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { using (Form_Dashboard fd = new Form_Dashboard()) { fd.ShowDialog(); } }
private void btnLogin_Click(object sender, EventArgs e) { string username = txtUserName.Text; string password = txtPassword.Text; try { if (Auth.Instance.Login(username, password)) { txtUserName.Text = ""; txtPassword.Text = ""; Alert.Create("Logged in successfully.", Alert.Type.Success); using (Form_Dashboard fd = new Form_Dashboard()) { fd.ShowDialog(); } } else { Alert.Create("Username or Password is wrong.", Alert.Type.Error); } } catch (Exception) { Alert.Create("Couldn't connect to database.", Alert.Type.Error); } }
private void button1_Click(object sender, EventArgs e) { dbConnect dbCon = new dbConnect(); string log = textBox2.Text; string pass = textBox1.Text; if (count <= 3) { if (dbCon.ReadData($"SELECT * FROM users WHERE login='******' AND password ='******'") == 1) { using (Forms.Form_Dashboard fd = new Form_Dashboard()) { fd.ShowDialog(); } } else { count2--; label4.Text = $"Incorrect username or password. {count2} - attempts left"; count++; } } else { label4.Text = "No attempts!"; } }
private void btnLogin_Click(object sender, EventArgs e) { if (isFormVal()) { if (checkLogin()) { using (Form_Dashboard fd = new Form_Dashboard()) { fd.ShowDialog(); } } } }
private void btnLogin_Click_1(object sender, EventArgs e) { ID_Manager = DAO.LoginDAO.Instance.getID(txtAccount.text, MaHoaMD5(txtPassword.text)); if (ID_Manager != "") // Đăng nhập thành công { if (radioBtnAdmin.Checked == true) // kiểm tra xem có phải đăng nhập với tư cách admin { name_Permission = DAO.LoginDAO.Instance.getName_Permission(DAO.LoginDAO.Instance.getID_Permission(ID_Manager)); foreach (var name in name_Permission) { if (name == "admin") { Form_Dashboard gui_admin = new Form_Dashboard(); this.Hide(); gui_admin.ShowDialog(); this.Show(); } else if (name == "employee") { MessageBox.Show("Bạn không đủ quyền truy cập"); } } } else // Ngược lại, kiểm tra đăng nhập với tư cách nhân viên { name_Permission = DAO.LoginDAO.Instance.getName_Permission(DAO.LoginDAO.Instance.getID_Permission(ID_Manager)); foreach (var name in name_Permission) { if (name == "admin" || name == "employee") { GUI gui = new GUI(); this.Hide(); gui.Show(); } else { MessageBox.Show("Bạn không đủ quyền truy cập"); } } } } else // Đăng nhập thất bại { txtAccount.text = ""; txtPassword.text = ""; txtAccount.Focus(); MessageBox.Show("Tên đăng nhập không chính xác"); } }
private void btnLogin_Click(object sender, EventArgs e) { Form_Dashboard db = new Form_Dashboard(); db.ShowDialog(); }