public void ProcessLogin() { if (txtID.Text.Trim().Length == 0 || txtPassword.Text.Trim().Length == 0) { DisplayNotify( "Lỗi ! Nhập sai mã nhân viên hoặc sai mật khẩu...",-1); } else { try { if (d.CheckDangNhap(txtID.Text, txtPassword.Text)) { DisplayNotify("Đăng nhập thành công.!", 1); //new Thread(new ThreadStart(showForm)).Start(); List<string>arr = d.GetFuntionByEmployeeID(txtID.Text); frmMainForm form = new frmMainForm(txtID.Text, arr); this.Hide(); form.ShowDialog(); this.Show(); txtID.Clear(); txtPassword.Clear(); } else { DisplayNotify("Lỗi ! Nhập sai mã nhân viên hoặc sai mật khẩu...", -1); } } catch(Exception ex) { DisplayNotify("Lỗi !Không thể đọc dữ liệu từ CSDL, mã lỗi:" + ex.Message, -1); } } }
public frmEmployee(frmMainForm main,string manv) { Main = main; InitializeComponent(); }