Exemplo 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);
            }
        }
Exemplo n.º 2
0
        public JsonResult EntryPrize(int rallyGoodId, int entryCount,short entryMethod)
        {
            long memberId = UserService.GetMemberIdAtLong(Session);

            var prizeInfoService = new RallyService(prize, com);

            bool result = prizeInfoService.EntryPrizeCompetition(memberId, rallyGoodId, entryCount,entryMethod);

            return Json(result, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 3
0
        /// <summary>
        ///  GET: /prize/{YYYYMM}/
        /// </summary>
        /// <param name="targetYearMonth"></param>
        /// <param name="rallyGoodsId"></param>
        /// <returns></returns>
        public ActionResult Index(string targetYearMonth, long rallyGoodsId)
        {
            var prizeInfoService = new RallyService(prize,com);
            var pointInfoService = new PointInfoService(com);
            long memberId;

            PrizeGoodViewModel prizeGoods = new PrizeGoodViewModel();

            prizeGoods.RallyGoods = prizeInfoService.GetRallyGoodsViewModelByRallyGoodsId(rallyGoodsId);
            prizeGoods.RallyGoodsRemarks = prizeInfoService.GetRallyGoodsRemarksViewModel(rallyGoodsId);
            prizeGoods.RallyGoodsRemarksText = prizeInfoService.GetRallyGoodsRemarksTextViewModel(rallyGoodsId);
            prizeGoods.RallyGoodsRemarksLink = prizeInfoService.GetRallyGoodsRemarksLinkViewModel(rallyGoodsId);
            // ログインチェックとメンバーID取得
            prizeGoods.IsLogined = UserService.IsLogined(Session);
            if (prizeGoods.IsLogined)
            {
                memberId = UserService.GetMemberIdAtLong(Session);
                prizeGoods.AvailablePoint = pointInfoService.GetAvailablePointByMemberId(memberId);
                prizeGoods.EntryCount = prizeInfoService.GetEntryCount(memberId, rallyGoodsId);
            }

            return View(prizeGoods);
        }
Exemplo n.º 4
0
        public JsonResult IsEntry(int rallyGoodId,string entryCount)
        {
            long memberId = UserService.GetMemberIdAtLong(Session);

            var rallyService = new RallyService(prize, com);

            string result = rallyService.IsEntryPrizeCompetition(memberId, rallyGoodId, entryCount);

            return Json(result, JsonRequestBehavior.AllowGet);
        }