Пример #1
0
        public async Task <ActionResult> AddMatch(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "Error: GroupId is null...!!!"));
            }

            var group = await db.Groups.FindAsync(id);

            if (group == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "Error: Group is null...!!!"));
            }

            var match = new Match
            {
                DateTime      = DateTime.Today,
                GroupId       = group.GroupId,
                StatusMatchId = MethodsHelper.GetStatusMatchIdByName("Not Started", db),
            };

            //  Carga los ViewBag
            LoadViewBagsMatchTeams(match);

            return(View(match));
        }