Ejemplo n.º 1
0
        /// <summary>
        /// GET: /Prize/PrizeTop/ 
        /// </summary>
        public ActionResult Index()
        {
            var prizeTopViewModel = new PrizeTopViewModel();

            if (UserService.IsLogined(Session))
            {
                var pointInfoService = new PointInfoService(ComEntities);

                prizeTopViewModel.AvailablePoint = pointInfoService.GetAvailablePointByMemberId(UserService.GetMemberIdAtLong(Session));
            }

            var prizeEntities = new PrizeEntities();

            var rallyService = new RallyService(prizeEntities);

            prizeTopViewModel.RallyViewModel = rallyService.GetRallyViewModelByToday(DateTime.Now);

            if (prizeTopViewModel.RallyViewModel == null)
            {
                //大会情報期間外パターン
                return View("RallyNotFound");
            }
            else
            {
                prizeTopViewModel.RallyGoodsModel = rallyService.GetRallyGoodsViewModelsByRallyId(prizeTopViewModel.RallyViewModel.RallyId);

                //過去大会履歴リスト(一旦非表示らしいので、コメントアウト。処理は作成済)
                //prizeTopViewModel.RallyHistories = rallyService.GetRallyViewModelAtPrevious(prizeTopViewModel.RallyViewModel.RallyId);

                return View(prizeTopViewModel);
            }
        }
Ejemplo n.º 2
0
 public RallyService(PrizeEntities prizeEntities, ComEntities comEntities = null)
 {
     PrizeEntities = prizeEntities;
     if (comEntities != null)
     {
         ComEntities = comEntities;
     }
 }