public List <Award> GetAllAwardsOfUser(User user) { try { List <Award> awardsList = new List <Award>(); using (SqlConnection connection = new SqlConnection(_connectionString)) { var stProc = "GetAllAwardsOfUser"; var command = new SqlCommand(stProc, connection) { CommandType = CommandType.StoredProcedure }; SqlParameter idParam = new SqlParameter("@id", user.id); command.Parameters.Add(idParam); connection.Open(); var reader = command.ExecuteReader(); while (reader.Read()) { awardsList.Add(awardsDao.GetAwardByID(Guid.Parse(reader["awardid"] as string))); } } return(awardsList); } catch (SqlException) { return(null); } }
public Award GetAwardByID(int ID) { return(_awardsDAO.GetAwardByID(ID)); }
public Award GetAwardByID(Guid id) => daoAwards.GetAwardByID(id);