Ejemplo n.º 1
0
 private void UpdateTableOrderRules(TableOrderRules tableOrderRules, UpdateTableOrderRulesCommand command)
 {
     tableOrderRules.FirstRule  = command.FirstRule;
     tableOrderRules.SecondRule = command.SecondRule;
     tableOrderRules.ThirdRule  = command.ThirdRule;
     tableOrderRules.FourthRule = command.FourthRule;
     tableOrderRules.FifthRule  = command.FifthRule;
 }
Ejemplo n.º 2
0
        public void Handle(UpdateTableOrderRulesCommand command)
        {
            // TODO validate

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

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

                UpdateTableOrderRules(league.Regulations.TableOrderRules, command);
                dbContext.SaveChanges();
            }
        }
Ejemplo n.º 3
0
        public ActionResult UpdateTableOrderRules(UpdateTableOrderRulesCommand command)
        {
            HandleCommand(command, Json("League regulations updated"));

            return(RedirectToAction("Index"));
        }