Пример #1
0
 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));
 }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }
Пример #4
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));
        }
Пример #5
0
        // 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));
        }