예제 #1
0
        public MarketingYearModel GetMarketingYearModel(int marketingYearId)
        {
            MarketingYearDto marketingYearDto = _marketingYearDao.GetById(marketingYearId);

            return(new MarketingYearModel
            {
                Id = marketingYearDto.Id,
                Start = marketingYearDto.Start,
                End = marketingYearDto.End
            });
        }
예제 #2
0
        public IList <HuntViewModel> GetByMarketingYearId(int marketingYearId)
        {
            MarketingYearDto     marketingYear  = _marketingYearDao.GetById(marketingYearId);
            List <HuntViewModel> huntViewModels =
                (
                    from hunt in Hunts
                    join huntsman in Huntsmans on hunt.HuntsmanId equals huntsman.Id
                    join huntedGame in HuntedGames on hunt.HuntedGameId equals huntedGame.Id
                    join game in Games on huntedGame.GameId equals game.Id
                    join region in Regions on hunt.RegionId equals region.Id
                    where hunt.Date >= marketingYear.Start && hunt.Date <= marketingYear.End
                    select new HuntViewModel
            {
                HuntsmanName = huntsman.Name,
                HuntsmanLastName = huntsman.LastName,
                HuntedGameId = huntedGame.Id,
                GameKindName = game.KindName,
                GameSubKindName = GetSubKindName(game.SubKindName),
                GameClass = GetGameClass(huntedGame.GameClass),
                GameWeight = GetGameWeight(huntedGame.GameWeight),
                City = region.City,
                Circuit = region.Circuit,
                District = region.District,
                Shots = hunt.Shots,
                Date = hunt.Date
            }
                ).ToList();

            return(huntViewModels);
        }