private void btnDangNhap_Click(object sender, EventArgs e) { //aa DBConnect cn = new DBConnect(); string txtID = txtId.Text; string txtPass = txtPASS.Text; EmployeeManagement employee = new EmployeeManagement(); cn.conn.Open(); if (employee.CheckLogin(txtID, txtPass) == 3) { frmNhanVien NV = new frmNhanVien(); NV.Show(); } else if (employee.CheckLogin(txtID, txtPass) == 0) { MessageBox.Show("Dữ liệu không hợp lệ"); } else { frmQuanLi QL = new frmQuanLi(); QL.Show(); } cn.conn.Close(); }
private void quanLiToolStripMenuItem_Click(object sender, EventArgs e) { TatFormCon(); frmQuanLi f = new frmQuanLi(); f.MdiParent = this; f.Show(); }
private void btnDangNhap_Click(object sender, EventArgs e) { NhanVien_BUS nv_bus = new NhanVien_BUS(); if (nv_bus.DangNhap(txtUser.Text, txtPass.Text)) { BienToanCuc.nvDangNhap = nv_bus.LayNV(txtUser.Text); frmQLBG frmQLBG = (this.MdiParent as frmQLBG); if (BienToanCuc.nvDangNhap.loaiNhanVien == "Kho") { frmQLBG.LoadKhoDaDangNhap(); frmQLKho frmQLKho = new frmQLKho(); frmQLKho.MdiParent = this.MdiParent; frmQLKho.Show(); } else if (BienToanCuc.nvDangNhap.loaiNhanVien == "Thu Ngân") { frmQLBG.LoadTNDaDangNhap(); frmBanHang frmBanHang = new frmBanHang(); frmBanHang.MdiParent = this.MdiParent; frmBanHang.Show(); } else { frmQLBG.LoadQLDaDangNhap(); frmQuanLi frmQuanLi = new frmQuanLi(); frmQuanLi.MdiParent = this.MdiParent; frmQuanLi.Show(); } this.Close(); } else { MessageBox.Show("Đăng nhập thất bại.", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }