public ActionResult Edit([Bind(Include = "ID,podcastName,Description,imagePath,audioPath,releaseDate")] podcastinfo podcastinfo) { if (ModelState.IsValid) { db.Entry(podcastinfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(podcastinfo)); }
public ActionResult Create([Bind(Include = "ID,podcastName,Description,imagePath,audioPath,releaseDate")] podcastinfo podcastinfo) { if (ModelState.IsValid) { db.podcastinfoes.Add(podcastinfo); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(podcastinfo)); }
public ActionResult Edit(int?id) { if (id == null || User.Identity.Name != userAdmin) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } podcastinfo podcastinfo = db.podcastinfoes.Find(id); if (podcastinfo == null || User.Identity.Name != userAdmin) { return(HttpNotFound()); } return(View(podcastinfo)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } podcastinfo info = db.podcastinfoes.Find(id); podcast_comments comment = db.podcast_comments.Find(id); if (info == null) { return(HttpNotFound()); } return(View(info)); }
// GET: podcastinfo/Create //[HttpPost] //[ValidateAntiForgeryToken] public PartialViewResult _DiplayComments(int?id) { podcastinfo info = db.podcastinfoes.Find(id); var queryTwo = (from pc in db.podcast_comments join pn in db.podcastinfoes on pc.podcast_id equals pn.ID where pn.ID == info.ID select new BlogViewModel() { commentsView = pc.comment, commentDateView = pc.commentDate, usernameView = pc.username }).ToList(); return(PartialView("_DiplayComments", queryTwo)); }