public ActionResult Edit(int id, [Bind("StoryId,Title")] Story story)
        {
            if (id != story.StoryId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(story);
                    _context.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StoryExists(story.StoryId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(story));
        }
示例#2
0
        public ActionResult Edit(int id, [Bind("Id,Title,StartTime,EndTime,ShowId,Active")] Rundown rundown)
        {
            if (id != rundown.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    db.Update(rundown);
                    db.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RundownExists(rundown.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Show"] = new SelectList(db.Shows, "Id", "Title", rundown.ShowId);
            return(View(rundown));
        }
示例#3
0
        public ActionResult Edit(int id, [Bind("SegmentId,Type,Reader,EstimatedReadTime,ActualReadTime,StoryId")] Segment segment)
        {
            if (id != segment.SegmentId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(segment);
                    _context.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SegmentExists(segment.SegmentId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["StoryId"] = new SelectList(_context.Stories, "StoryId", "StoryId", segment.StoryId);
            return(View(segment));
        }
示例#4
0
        public ActionResult Edit(int id, [Bind("Id,Title,Active,Color")] Show show)
        {
            if (id != show.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(show);
                    _context.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShowExists(show.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(show));
        }