public TaiKhoan DuLieuGV(string ten) { DataSet ds = GVData.LayDLMotDong(ten); TaiKhoan gv = new TaiKhoan(); gv.TenDangNhap = ds.Tables[0].Rows[0]["TenDangNhap"].ToString(); gv.MatKhau = ds.Tables[0].Rows[0]["MatKhau"].ToString(); gv.MaGV = ds.Tables[0].Rows[0]["MaTaiKhoan"].ToString().ToString(); gv.TenGV = ds.Tables[0].Rows[0]["HoVaTen"].ToString(); gv.Gioitinh = (bool)ds.Tables[0].Rows[0]["GioiTinh"]; gv.SDT = ds.Tables[0].Rows[0]["SDT"].ToString(); gv.Email = ds.Tables[0].Rows[0]["Email"].ToString(); gv.Ngaysinh = DateTime.Parse(ds.Tables[0].Rows[0]["NgaySinh"].ToString()); gv.Diachi = ds.Tables[0].Rows[0]["DiaChi"].ToString(); gv.Loaitaikhoan = Convert.ToInt32(ds.Tables[0].Rows[0]["LoaiTaiKhoan"]); return(gv); }
public TaiKhoan DuLieuGV(string ten) { DataSet ds = taikhoan.LayDLMotDong(ten); TaiKhoan tk = new TaiKhoan(); tk.MaTK = ds.Tables[0].Rows[0]["MaTK"].ToString(); tk.HoTen = ds.Tables[0].Rows[0]["HoTenTK"].ToString(); tk.Gioitinh = (bool)(ds.Tables[0].Rows[0]["GioiTinh"]); tk.SDT = ds.Tables[0].Rows[0]["SDT"].ToString(); tk.NgaySinh = DateTime.Parse(ds.Tables[0].Rows[0]["NgaySinh"].ToString()); tk.Diachi = ds.Tables[0].Rows[0]["DiaChi"].ToString(); tk.Maquyen = Convert.ToInt32(ds.Tables[0].Rows[0]["LoaiTaiKhoan"]); tk.Cmnd = ds.Tables[0].Rows[0]["CMND"].ToString(); tk.Username = ds.Tables[0].Rows[0]["UserName"].ToString(); tk.Password = ds.Tables[0].Rows[0]["PassWord"].ToString(); return(tk); }