// [ValidateAntiForgeryToken]
        public async Task <IActionResult> Edit(int id, [Bind("ID,ContactDetailID,Location,Name,Description,PhotoURL")] LaunchSite launchSite)
        {
            if (id != launchSite.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(launchSite);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LaunchSiteExists(launchSite.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(launchSite));
        }
Exemplo n.º 2
0
        // [ValidateAntiForgeryToken]
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Description")] EventType eventType)
        {
            if (id != eventType.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(eventType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EventTypeExists(eventType.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(eventType));
        }
        // [ValidateAntiForgeryToken]
        public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Description,DatePublished,DateModified,IsVisible")] Page page)
        {
            if (id != page.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(page);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PageExists(page.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(page));
        }
Exemplo n.º 4
0
        // [ValidateAntiForgeryToken]
        public async Task <IActionResult> Edit(int id, [Bind("ID,LaunchSiteID,Title,IsVisible,StartDateTime,EndDateTime,Description,EventUserMaxCapacity")] Event @event)
        {
            if (id != @event.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(@event);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EventExists(@event.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(@event));
        }
Exemplo n.º 5
0
        // [ValidateAntiForgeryToken]
        public async Task <IActionResult> Edit(int id, [Bind("Lat,Long,IsLunarLocation,ContactDetail,ID,LocationName,BuildingNO,StreetAddress,Locality,Region,PostCode,CountryCode")] EventLocation eventLocation)
        {
            if (id != eventLocation.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(eventLocation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EventLocationExists(eventLocation.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(eventLocation));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ContactName,ID,IsPrimary,Mobile,Landline,Email")] EventLocationContactDetail eventLocationContactDetail)
        {
            if (id != eventLocationContactDetail.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(eventLocationContactDetail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EventLocationContactDetailExists(eventLocationContactDetail.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(eventLocationContactDetail));
        }