Ejemplo n.º 1
0
 public void addReplyPost(ReplyPost replypost)
 {
     replypost.ReplyTime   = DateTime.Now;
     replypost.ReplyPraise = 1;
     db.ReplyPost.Add(replypost);
     db.SaveChanges();
 }
Ejemplo n.º 2
0
        // Editting Reply Post
        public void EditReplyPost(ReplyPost rp)
        {
            ReplyPost replyPost = this.GetReplyPost(rp.ReplyPostId);

            replyPost.Description = rp.Description;
            db.SaveChanges();
        }
Ejemplo n.º 3
0
        public void DeleteReply(int id)
        {
            ReplyPost repli = db.ReplyPost.Single(p => p.ReplyPost_id == id);

            db.ReplyPost.Remove(repli);
            db.SaveChanges();
        }
Ejemplo n.º 4
0
        public void DeleteReplyPost(int id)
        {
            ReplyPost rp = this.GetReplyPost(id);

            db.ReplyPosts.Remove(rp);
            db.SaveChanges();
        }
Ejemplo n.º 5
0
        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));
        }
Ejemplo n.º 6
0
        public ActionResult DeleteConfirmed(int id)
        {
            ReplyPost replyPost = db.ReplyPost.Find(id);

            db.ReplyPost.Remove(replyPost);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 7
0
        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 }));
        }
Ejemplo n.º 8
0
        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 }));
        }
Ejemplo n.º 9
0
 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));
 }
Ejemplo n.º 10
0
        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));
        }
Ejemplo n.º 11
0
        // 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));
        }
Ejemplo n.º 12
0
        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());
        }
Ejemplo n.º 13
0
        // 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));
        }
Ejemplo n.º 14
0
        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");
            }
        }
Ejemplo n.º 15
0
        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 }));
        }
Ejemplo n.º 16
0
 // Add a new Reply Post
 public void AddReplyPost(ReplyPost rp)
 {
     db.ReplyPosts.Add(rp);
     db.SaveChanges();
 }
Ejemplo n.º 17
0
 public void UpdateRely(ReplyPost replypost)
 {
     db.Entry <ReplyPost>(replypost).State = System.Data.Entity.EntityState.Modified;
     db.SaveChanges();
 }
Ejemplo n.º 18
0
 public static void UpdateRely(ReplyPost replypost)
 {
     pos.UpdateRely(replypost);
 }
Ejemplo n.º 19
0
 public static void addReplyPost(ReplyPost replypost)
 {
     pos.addReplyPost(replypost);
 }