Esempio n. 1
0
        public ActionResult Competition(long id)
        {
            S_Challenge challenge = ChallengeManager.GetChallenge(id);

            ObservableCollection <CompetitionGridModel> competitionModelList = new ObservableCollection <CompetitionGridModel>();

            List <S_Competition> competitionList;

            competitionList = CompetitionManager.GetCompetitionsByChallengeId(id);

            foreach (S_Competition competition in competitionList)
            {
                CompetitionGridModel cgm = new CompetitionGridModel();
                cgm.Id          = competition.id;
                cgm.challenge   = challenge.name;
                cgm.challengeId = id;
                cgm.description = competition.description;
                cgm.EndDate     = competition.enddate;
                cgm.Id          = competition.id;
                cgm.price       = competition.price;
                cgm.StartDate   = competition.startdate;

                competitionModelList.Add(cgm);
            }

            ViewBag.challengeid = id;

            return(View(competitionModelList));
        }