예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] ResourceList resourceList)
        {
            if (id != resourceList.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(resourceList);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ResourceListExists(resourceList.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(resourceList));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("RentedBookID,StudentID,BookID,RentDate,ReturnDate")] RentedBook rentedBook)
        {
            if (id != rentedBook.RentedBookID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rentedBook);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RentedBookExists(rentedBook.RentedBookID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BookID"]    = new SelectList(_context.Books, "BookID", "BookID", rentedBook.BookID);
            ViewData["StudentID"] = new SelectList(_context.Students, "StudentID", "StudentID", rentedBook.StudentID);
            return(View(rentedBook));
        }
예제 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,FeedUrl,LearningResourceId")] ContentFeed contentFeed)
        {
            if (id != contentFeed.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(contentFeed);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ContentFeedExists(contentFeed.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LearningResourceId"] = new SelectList(_context.LearningResources, "Id", "Id", contentFeed.LearningResourceId);
            return(View(contentFeed));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,TagValue")] TopicTag topicTag)
        {
            if (id != topicTag.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(topicTag);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TopicTagExists(topicTag.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(topicTag));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description,Phase,ReleaseDate")] CinematicItem cinematicItem)
        {
            if (id != cinematicItem.Id)
            {
                return(NotFound());
            }

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