public List <LopHocPhanModel> KiemTra() { List <LopHocPhanModel> list = new List <LopHocPhanModel>(); Object[] par = { new SqlParameter("@mSLOPHOCPHAN", DBNull.Value), new SqlParameter("@mSHOCKY", MSHOCKY), new SqlParameter("@mSHOCPHAN", DBNull.Value), new SqlParameter("@mALOPHOCPHAN", MALOPHOCPHAN), new SqlParameter("@tENLOPHOCPHAN", TENLOPHOCPHAN), new SqlParameter("@sISO", DBNull.Value), new SqlParameter("@lOAILOPHOCPHAN", DBNull.Value), new SqlParameter("@kEY", DBKey.CHECK), }; DataTable dt = DBConnect.SqlStoredProcedure("sp_LopHocPhan", par); foreach (DataRow item in dt.Rows) { LopHocPhanModel lhp = new LopHocPhanModel(); MSLOPHOCPHAN = int.Parse(item["MSLOPHOCPHAN"].ToString()); MALOPHOCPHAN = item["MALOPHOCPHAN"].ToString(); TENLOPHOCPHAN = item["MALOPHOCPHAN"].ToString(); SISO = int.Parse(item["MSLOPHOCPHAN"].ToString()); LOAILOPHOCPHAN = int.Parse(item["MSLOPHOCPHAN"].ToString()); MSHOCPHAN = int.Parse(item["MSLOPHOCPHAN"].ToString()); TENHOCPHAN = item["MALOPHOCPHAN"].ToString(); LYTHUYET = int.Parse(item["MSLOPHOCPHAN"].ToString()); THUCHANH = int.Parse(item["MSLOPHOCPHAN"].ToString()); MSHOCKY = int.Parse(item["MSLOPHOCPHAN"].ToString()); TENHOCKY = item["MALOPHOCPHAN"].ToString(); list.Add(lhp); } return(list); }
public List <LopHocPhanModel> DanhSach() { List <LopHocPhanModel> list = new List <LopHocPhanModel>(); Object[] par = { new SqlParameter("@mSLOPHOCPHAN", DBNull.Value), new SqlParameter("@mSHOCKY", MSHOCKY), new SqlParameter("@mSHOCPHAN", MSHOCPHAN), new SqlParameter("@mALOPHOCPHAN", DBNull.Value), new SqlParameter("@tENLOPHOCPHAN", DBNull.Value), new SqlParameter("@sISO", DBNull.Value), new SqlParameter("@lOAILOPHOCPHAN", DBNull.Value), new SqlParameter("@kEY", DBKey.SELECT), }; DataTable dt = DBConnect.SqlStoredProcedure("sp_LopHocPhan", par); foreach (DataRow item in dt.Rows) { LopHocPhanModel lhp = new LopHocPhanModel(); lhp.MSLOPHOCPHAN = int.Parse(item["MSLOPHOCPHAN"].ToString()); lhp.MALOPHOCPHAN = item["MALOPHOCPHAN"].ToString(); lhp.TENLOPHOCPHAN = item["TENLOPHOCPHAN"].ToString(); lhp.SISO = int.Parse(item["SISO"].ToString()); lhp.LOAILOPHOCPHAN = int.Parse(item["LOAILOPHOCPHAN"].ToString()); lhp.MSHOCPHAN = int.Parse(item["MSHOCPHAN"].ToString()); lhp.TENHOCPHAN = item["TENHOCPHAN"].ToString(); lhp.LYTHUYET = int.Parse(item["LYTHUYET"].ToString()); lhp.THUCHANH = int.Parse(item["THUCHANH"].ToString()); lhp.MSHOCKY = int.Parse(item["MSHOCKY"].ToString()); lhp.TENHOCKY = item["TENHOCKY"].ToString(); lhp.NGAYBATDAU = DateTime.ParseExact(item["NGAYBATDAU"].ToString(), "dd/MM/yyyy", null); lhp.NGAYKETTHUC = DateTime.ParseExact(item["NGAYKETTHUC"].ToString(), "dd/MM/yyyy", null); lhp.THOIGIANBATDAUDUTRU = DateTime.ParseExact(item["THOIGIANBATDAUDUTRU"].ToString(), "dd/MM/yyyy", null); lhp.THOIGIANKETTHUCDUTRU = DateTime.ParseExact(item["THOIGIANKETTHUCDUTRU"].ToString(), "dd/MM/yyyy", null); list.Add(lhp); } return(list); }