public ActionResult PostReviewHelpful(int reviewId, bool good) { if (Session["userID"] == null) return RedirectToAction("Login", "User"); ReviewHelpful helpful = new ReviewHelpful(); helpful.userID = (int)Session["userID"]; helpful.reviewID = Convert.ToInt32(reviewId); helpful.isGood = good; if (ModelState.IsValid) helpful.Save(); return RedirectToAction("Profile", "User", new { id = Convert.ToInt32(Session["userID"]) }); }
/// <summary> /// Deprecated Method for adding a new object to the ReviewHelpfuls EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToReviewHelpfuls(ReviewHelpful reviewHelpful) { base.AddObject("ReviewHelpfuls", reviewHelpful); }
/// <summary> /// Create a new ReviewHelpful object. /// </summary> /// <param name="reviewHelpfulID">Initial value of the reviewHelpfulID property.</param> /// <param name="reviewID">Initial value of the reviewID property.</param> /// <param name="userID">Initial value of the userID property.</param> /// <param name="isGood">Initial value of the isGood property.</param> public static ReviewHelpful CreateReviewHelpful(global::System.Int32 reviewHelpfulID, global::System.Int32 reviewID, global::System.Int32 userID, global::System.Boolean isGood) { ReviewHelpful reviewHelpful = new ReviewHelpful(); reviewHelpful.reviewHelpfulID = reviewHelpfulID; reviewHelpful.reviewID = reviewID; reviewHelpful.userID = userID; reviewHelpful.isGood = isGood; return reviewHelpful; }