Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        public ActionResult _AddComments(podcast_comments podcast_comments)
        {
            if (ModelState.IsValid)
            {
                if (podcast_comments.comment != null)
                {
                    podcast_comments.commentDate = DateTime.Now;
                    podcast_comments.username    = User.Identity.Name;
                    db.podcast_comments.Add(podcast_comments);
                    db.SaveChanges();
                    return(RedirectToAction("Details/" + podcast_comments.podcast_id));
                }
                else
                {
                    TempData["Message"] = "Please enter a comment";
                    return(RedirectToAction("Details/" + podcast_comments.podcast_id));
                }
            }

            return(PartialView(podcast_comments));
        }