Beispiel #1
0
 public void UpdateSportsHall(SportsHall sportsHall, UpdateSportsHallCommand command)
 {
     sportsHall.City     = command.City;
     sportsHall.Streat   = command.Streat;
     sportsHall.Number   = command.Number;
     sportsHall.Phone    = command.Phone;
     sportsHall.Email    = command.Email;
     sportsHall.PostCode = command.PostCode;
 }
Beispiel #2
0
        public void Handle(UpdateSportsHallCommand command)
        {
            // TODO validate

            using (var dbContext = new ManagementDataContext())
            {
                League league = dbContext.Leagues.SingleOrDefault(l => l.Id == command.LeagueId);

                if (league == null || league.SportsHall == null)
                {
                    throw new ServerSideException("Ups, something went wrong! Refresh page and try agine");
                }

                UpdateSportsHall(league.SportsHall, command);
                dbContext.SaveChanges();
            }
        }
Beispiel #3
0
        public ActionResult UpdateSportsHall(UpdateSportsHallCommand command)
        {
            HandleCommand(command, Json("League address updated"));

            return(RedirectToAction("Index"));
        }