public ActionResult Draft(ContentVideoDraftViewModel contentTextDraftViewModel) { try { if (ModelState.IsValid) { ContentVideo contentText = new ContentVideo(contentTextDraftViewModel); contentText.SaveChanges(contentTextDraftViewModel); } return(RedirectToAction("content", "pages", new { id = contentTextDraftViewModel.PageID })); } catch { return(View()); } }
public ActionResult Edit(ContentVideoViewModel data) { try { if (ModelState.IsValid) { ContentVideo contentText = new ContentVideo(data); contentText.SaveChanges(data); } return(RedirectToAction("edit", "pages", new { id = data.PageID })); } catch { ContentVideo ct = new ContentVideo(data.ContentID); ContentVideoViewModel contentText = new ContentVideoViewModel(ct); return(View(contentText)); } }