Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Hide 'posts'
- [AcceptVerbs(HttpVerbs.Post)]
- public ActionResult Hide (int id)
- {
- var post = db.tb_SH_Forum_Posts.Single(p => p.Post_ID == id);
- post.Private_ID = (post.Private_ID == 1) ? 2 : 1;
- db.SaveChanges();
- RedirectToAction("Details", new { id = post.Thread_ID });
- }
- @foreach
- (var post in Model.tb_SH_Forum_Posts.Where(w => w.Private_ID == 1).OrderBy(o => o.Post_Date))
- {
- using (Html.BeginForm("Hide", "Post", new { id = post.Post_ID }))
- {
- <input type="submit" name = "hidePosts" value="Hide" />
- }
- <div class ="post">
- <fieldset>
- <p class="post_details">At @post.Post_Date By @(post.Anon == true ? "Anonymous" : post.Username)
- </p>
- @post.Post_Desc
- </fieldset>
- </div>}
- return RedirectToAction("Details", new { id = post.Thread_ID })
Add Comment
Please, Sign In to add comment