Esempio n. 1
0
        public static void InsertSeason(string name, DateTime startDate, DateTime endDate, bool isActive)
        {
            if (endDate < DateTime.Now || string.IsNullOrEmpty(name))
            {
                throw new ExceptionWithHttpStatus(System.Net.HttpStatusCode.BadRequest, Messages.OBRIGATORY_DATA_MISSING);
            }

            SeasonRepository.Get().InsertSeason(name, startDate, endDate, isActive);
        }
Esempio n. 2
0
        public static SeasonEntity GetCurrentSeason()
        {
            var season = SeasonRepository.Get().GetCurrentSeason();

            if (season == null)
            {
                throw new ExceptionWithHttpStatus(System.Net.HttpStatusCode.BadRequest, Messages.NO_SEASONS_REGISTERED);
            }

            return(season);
        }
Esempio n. 3
0
 public static SeasonEntity GetSeasonById(Guid seasonId)
 {
     return(SeasonRepository.Get().GetSeasonById(seasonId));
 }