public fHangHoa(fMain main) { InitializeComponent(); LoadData(); ChangeHeader(); LoadFirstCell(); this.main = main; }
private void btDangNhap_Click(object sender, EventArgs e) { if (txbTenDangNhap.Text == "admin" && txbMatKhau.Text == "admin") { fMain f = new fMain(); this.Hide(); f.ShowDialog(); this.Show(); } }
private void BtnLogin_Click(object sender, EventArgs e) { LoginBUS login = new LoginBUS(); if (string.IsNullOrWhiteSpace(txtUsername.Text) || string.IsNullOrWhiteSpace(txtPassword.Text)) { MessageBox.Show("Hay nhap day du thong tin"); return; } int status = login.CheckLogin(txtUsername.Text, txtPassword.Text); if (status == 1) { fMain fmain = new fMain(login.getType(txtUsername.Text), txtUsername.Text, txtPassword.Text); this.Hide(); fmain.ShowDialog(); } else { MessageBox.Show("Tên tài khoản hoặc mật khẩu không đúng", "Lỗi Đăng Nhập"); } }