public GIAOVIEN get_unique(int id) { DataTable dt = dao_GiaoVien.get_unique(id); int countrows = dt.Rows.Count; if (countrows <= 0) { return(null); //data chưa có dòng nào, return } DataRow row = dt.Rows[0]; return(new GIAOVIEN() { maNguoiDung = (row["maNguoiDung"] == DBNull.Value) ? (-1) : (int)row["maNguoiDung"], monDay = (row["monDay"] == DBNull.Value) ? (-1) : (int)row["monDay"], }); }