public ucHeThong(UserModel um) { InitializeComponent(); this.um = um; dnDAO = new DangNhapBAL(um.getDataSource(), um.getUid(), um.getPwd()); }
public UserModel(string uid, string pwd) { this.uid = uid; this.pwd = pwd; nvDAO = new NhanVienDAO(datasource, uid, pwd); dn = new DangNhapBAL(datasource, uid, pwd); System.Data.DataTable dt = new System.Data.DataTable(); dt = nvDAO.getNhanVien(dn.getMaNV_DN(uid)).Tables[0]; this.manv = dt.Rows[0]["MaNV"].ToString(); this.chucvu = dt.Rows[0]["ChucVu"].ToString(); this.hoten = dt.Rows[0]["HoTen"].ToString(); }
private void loginMethod(ucLogin.mLogin sender, EventArgs e) { string username = "******"; string password = "******"; string datasource = ".\\SQLEXPRESS"; um = new UserModel(username, password); um.setDataSource(datasource); MessageBox.Show(username + password + datasource); login = new DangNhapBAL(um.getDataSource(), um.getUid(), um.getPwd()); if (login.ISLOGINED().Equals("yes")) { this.Hide(); new FrmMain(um).ShowDialog(); this.Close(); return; } MessageBox.Show("failse"); }