Example #1
0
        public ActionResult AssignPlayer(AssignPlayerVM model)
        {
            EventCountry EC = db.GetEventCountry(model.EventCountry.id);

            try
            {
                db.AllocateCountryToPlayer(model.EventCountry.id, model.PlayerGuid);
                return(RedirectToAction("EventDetails", new { id = EC.Event.Year }));
            }
            catch (Exception ex)
            {
                model.EventCountry = EC;
                model.Players      = new SelectList(db.GetPlayersForYear(model.EventCountry.Event.Year), "id", "Name");
                return(View(model));
            }
        }