Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            t_PostVotes t_PostVotes = db.t_PostVotes.Find(id);

            db.t_PostVotes.Remove(t_PostVotes);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "VoteID,UserID,PostID,IsUpvote")] t_PostVotes t_PostVotes)
 {
     if (ModelState.IsValid)
     {
         db.Entry(t_PostVotes).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PostID = new SelectList(db.t_Posts, "PostID", "Text", t_PostVotes.PostID);
     ViewBag.UserID = new SelectList(db.t_Users, "UserID", "Username", t_PostVotes.UserID);
     return(View(t_PostVotes));
 }
Exemplo n.º 3
0
        // GET: PostVotes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            t_PostVotes t_PostVotes = db.t_PostVotes.Find(id);

            if (t_PostVotes == null)
            {
                return(HttpNotFound());
            }
            return(View(t_PostVotes));
        }
Exemplo n.º 4
0
        // GET: PostVotes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            t_PostVotes t_PostVotes = db.t_PostVotes.Find(id);

            if (t_PostVotes == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PostID = new SelectList(db.t_Posts, "PostID", "Text", t_PostVotes.PostID);
            ViewBag.UserID = new SelectList(db.t_Users, "UserID", "Username", t_PostVotes.UserID);
            return(View(t_PostVotes));
        }