public void addReplyPost(ReplyPost replypost) { replypost.ReplyTime = DateTime.Now; replypost.ReplyPraise = 1; db.ReplyPost.Add(replypost); db.SaveChanges(); }
// Editting Reply Post public void EditReplyPost(ReplyPost rp) { ReplyPost replyPost = this.GetReplyPost(rp.ReplyPostId); replyPost.Description = rp.Description; db.SaveChanges(); }
public void DeleteReply(int id) { ReplyPost repli = db.ReplyPost.Single(p => p.ReplyPost_id == id); db.ReplyPost.Remove(repli); db.SaveChanges(); }
public void DeleteReplyPost(int id) { ReplyPost rp = this.GetReplyPost(id); db.ReplyPosts.Remove(rp); db.SaveChanges(); }
public IActionResult EditReplyPost(int GroupId, int ReplyPostId) { ViewBag.Me = userService.GetPersonBasedOnId(User.Identity.GetPersonId()); ViewBag.GroupId = GroupId; ReplyPost rp = wallService.GetReplyPost(ReplyPostId); return(View("_EditReplyPostPartial", rp)); }
public ActionResult DeleteConfirmed(int id) { ReplyPost replyPost = db.ReplyPost.Find(id); db.ReplyPost.Remove(replyPost); db.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult AddReplyPost(int id, ReplyPost rp) { rp.PosterId = User.Identity.GetPersonId(); rp.PosterName = User.Identity.GetName(); rp.DatePosted = DateTime.Now; wallService.AddReplyPost(rp); return(RedirectToAction(nameof(Index), new { id = rp.PosterId })); }
public IActionResult AddReplyPost(int GroupId, ReplyPost rp) { rp.PosterId = User.Identity.GetPersonId(); rp.PosterName = User.Identity.GetName(); rp.DatePosted = DateTime.Now; wallService.AddReplyPost(rp); return(RedirectToAction("ViewGroup", new { GroupId = GroupId })); }
public ActionResult Edit([Bind(Include = "ReplyPostID,UserID,PostCommentID,ReplyContent,ReplyPostTime")] ReplyPost replyPost) { if (ModelState.IsValid) { db.Entry(replyPost).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PostCommentID = new SelectList(db.PostComments, "PostCommentID", "PostCommentContent", replyPost.PostCommentID); ViewBag.UserID = new SelectList(db.Users, "UserID", "UserName", replyPost.UserID); return(View(replyPost)); }
public IActionResult EditReplyPost(int GroupId, int ReplyPostId, ReplyPost rp) { ViewBag.Me = userService.GetPersonBasedOnId(User.Identity.GetPersonId()); if (ModelState.IsValid) { rp.ReplyPostId = ReplyPostId; wallService.EditReplyPost(rp); return(RedirectToAction(nameof(ViewGroup), new { GroupId = GroupId })); } return(View("_EditReplyPostPartial", rp)); }
// GET: ReplyPostsManagement/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ReplyPost replyPost = db.ReplyPost.Find(id); if (replyPost == null) { return(HttpNotFound()); } return(View(replyPost)); }
public IHttpActionResult ReplyPost([FromBody] ReplyPost replypostmodel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } response = dbupdates.addReplytoPost(replypostmodel.PostId, replypostmodel.PostAuthor, replypostmodel.PostDescription, replypostmodel.PostDate); if (!response.isSuccess) { return(GetErrorResult(response)); } return(Ok()); }
// GET: ReplyPostsManagement/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ReplyPost replyPost = db.ReplyPost.Find(id); if (replyPost == null) { return(HttpNotFound()); } ViewBag.PostCommentID = new SelectList(db.PostComments, "PostCommentID", "PostCommentContent", replyPost.PostCommentID); ViewBag.UserID = new SelectList(db.Users, "UserID", "UserName", replyPost.UserID); return(View(replyPost)); }
public string AddPostReply(ReplyPost replypso, string content, int id, string buser) { var userid = Convert.ToInt32(Session["User_id"]); if (!String.IsNullOrEmpty(content)) { replypso.Content = content; replypso.User_id = userid; replypso.CommentUsername = buser; replypso.CommentPost_id = id; PostManage.addReplyPost(replypso); return("ok"); } else { return("no"); } }
public ActionResult RlyPosts(ReplyPost rlypost, int PostCommentID) { int userid = Convert.ToInt32(Session["UserID"]); int PostID = int.Parse(Session["PostID"].ToString()); rlypost.UserID = Convert.ToInt32(Session["UserID"]); rlypost.PostCommentID = PostCommentID; rlypost.ReplyPostTime = DateTime.Now; rlypost.ReplyContent = Request.Form["RlyPosts.ReplyContent"]; db.ReplyPost.Add(rlypost); db.Configuration.ValidateOnSaveEnabled = false; db.SaveChanges(); db.Configuration.ValidateOnSaveEnabled = true; int Lev = PostM.GetUserPotLev(Convert.ToInt32(Session["UserID"])); if (Lev != 0) { potsmanager.UpdateExperience(userid, 2); } return(RedirectToAction("PostsDetails", "Tribune", new { PostID = PostID })); }
// Add a new Reply Post public void AddReplyPost(ReplyPost rp) { db.ReplyPosts.Add(rp); db.SaveChanges(); }
public void UpdateRely(ReplyPost replypost) { db.Entry <ReplyPost>(replypost).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }
public static void UpdateRely(ReplyPost replypost) { pos.UpdateRely(replypost); }
public static void addReplyPost(ReplyPost replypost) { pos.addReplyPost(replypost); }