Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,SeriesName,StartDate,EndDate")] Series series)
        {
            if (id != series.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(series);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SeriesExists(series.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(series));
        }
Example #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,ArenaName,ArenaStreetAddress,ArenaZipCode,ArenaCounty,ArenaCountry")] Arena arena)
        {
            if (id != arena.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(arena);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ArenaExists(arena.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(arena));
        }
Example #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,FirstName,LastName,StreetAddress,ZipCode,County,Country,Ssn,PhoneNumber,Email,ClubId,ClubId1,RefereeStatusId,CoachStatusId,PlayerStatusId,StaffStatusId,PhoneNumber1")] Person person)
        {
            if (id != person.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(person);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonExists(person.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClubId"]          = new SelectList(_context.Set <Club>(), "Id", "ClubName", person.ClubId);
            ViewData["ClubId1"]         = new SelectList(_context.Set <Club>(), "Id", "ClubName", person.ClubId1);
            ViewData["CoachStatusId"]   = new SelectList(_context.Set <CoachStatus>(), "Id", "SCStatus", person.CoachStatusId);
            ViewData["PlayerStatusId"]  = new SelectList(_context.Set <PlayerStatus>(), "Id", "PStatus", person.PlayerStatusId);
            ViewData["RefereeStatusId"] = new SelectList(_context.Set <RefereeStatus>(), "Id", "RStatus", person.RefereeStatusId);
            ViewData["StaffStatusId"]   = new SelectList(_context.Set <StaffStatus>(), "Id", "SStatus", person.StaffStatusId);
            return(View(person));
        }
Example #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,FirstName,LastName,RefNumber,Ssn,RefereeTypeId,RefereeCategoryId,RefereeCategoryTypeId,RefereeDistrictId,ClubId,StreetAddress,ZipCode,County,Country,PhoneNumber1,PhoneNumber2,Email")] TSMRef tSMRef)
        {
            if (id != tSMRef.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tSMRef);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TSMRefExists(tSMRef.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClubId"]                = new SelectList(_context.Set <Club>(), "Id", "ClubName", tSMRef.ClubId);
            ViewData["RefereeCategoryId"]     = new SelectList(_context.Set <RefereeCategory>(), "Id", "RefereeCategoryName", tSMRef.RefereeCategoryId);
            ViewData["RefereeCategoryTypeId"] = new SelectList(_context.Set <RefereeCategoryType>(), "Id", "RefereeCategoryTypeName", tSMRef.RefereeCategoryTypeId);
            ViewData["RefereeDistrictId"]     = new SelectList(_context.Set <RefereeDistrict>(), "Id", "RefereeDistrictName", tSMRef.RefereeDistrictId);
            ViewData["RefereeTypeId"]         = new SelectList(_context.Set <RefereeType>(), "Id", "RefereeTypeName", tSMRef.RefereeTypeId);
            return(View(tSMRef));
        }