示例#1
0
        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            clsNV clsNV = new clsNV();
            clsNV.TenDangNhap = txtTenDangNhap.Text;
            clsNV.MatKhau = txtMK.Text;
            if (KiemTraDangNhap(txtTenDangNhap.Text, txtMK.Text,clsNV) == true)
            {
                clsNV.LayThongTin();
                frmThongTinUser.HoTen = clsNV.HoTen;
                frmThongTinUser.TenDangNhap = clsNV.TenDangNhap;
                frmThongTinUser.MatKhau = clsNV.MatKhau;
                frmThongTinUser.GioiTinh = clsNV.GioiTinh;
                frmThongTinUser.NgaySinh = clsNV.NgaySinh;
                frmThongTinUser.TrinhDo = clsNV.TrinhDo;
                frmThongTinUser.ChucVu = clsNV.ChucVu;
                frmThongTinUser.Email = clsNV.Email;
                frmThongTinUser.Tel = clsNV.Tel;
                frmThongTinUser.ThongTinThem = clsNV.ThongTinThem;

                ((frmmain)this.ParentForm).LoginSuccess();
                this.Close();
            }
            else
            {
                MessageBox.Show("TÊN ĐĂNG NHẬP HOẶC MẬT KHẨU KHÔNG CHÍNH XÁC");
            }
        }
示例#2
0
 private bool KiemTraDangNhap(string p1, string p2, clsNV clsNV)
 {
     if(clsNV.CheckLogin()==true)
     {
         return true;
     }
     return false;
 }