public Core.Business.UserEducation Select(Guid id) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@EducationID", SqlDbType.UniqueIdentifier, id); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectUserEducation"); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.UserEducation userEducation = new Core.Business.UserEducation(); if (!reader.IsDBNull(0)) userEducation.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) userEducation.EducationName = reader.GetString(1); reader.Close(); return userEducation; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }
public IList<Core.Business.UserEducation> GetAllUserEducation() { IList<Core.Business.UserEducation> userEducationlist = new List<Core.Business.UserEducation>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectUserEducationsAll"); if(reader != null) { while(reader.Read()) { Core.Business.UserEducation userEducation = new Core.Business.UserEducation(); if (!reader.IsDBNull(0)) userEducation.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) userEducation.EducationName = reader.GetString(1); userEducation.MarkOld(); userEducationlist.Add(userEducation); } reader.Close(); } return userEducationlist; }