public ActionResult Index()
        {
            User            user  = membershipService.GetLoggedInUser();
            MyTeamViewModel model = new MyTeamViewModel();

            model.Team       = teamService.Get(user.Team.Id);
            model.DaysOfWeek = new SelectList(dayOfWeekService.Get(), "Id", "Day", model.Team.GameDay.Id);

            return(View(model));
        }
        public ActionResult Create(MyTeamViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (model.DayOfWeekId.HasValue)
                {
                    model.Team.GameDay = dayOfWeekService.Get(model.DayOfWeekId.Value);
                }

                // TODO FIX GameeDay is NOT being saved
                teamService.Save(model.Team);
                teamService.Commit();

                SuccessMessage(FormMessages.SaveSuccess);
                return(RedirectToAction("Index"));
            }

            PopulateStaticDate(model);

            return(View(model));
        }
Example #3
0
 public ActionResult View(int id)
 {
     Basketball.Domain.Entities.DayOfWeek @dayOfWeek = dayOfWeekService.Get(id);
     return(View(@dayOfWeek));
 }