public bool AddFeedback(CropsFeedback feedback) { context.CropsFeedbacks.Add(feedback); context.SaveChanges(); return(true); }
public ActionResult Add(IFormCollection form) { var comment = form["Comment"].ToString(); var cropId = int.Parse(form["ArticleId"]); var rating = int.Parse(form["Rating"]); CropsFeedback artComment = new CropsFeedback() { CropId = cropId, Feedback = comment, Rating = rating, ThisDateTime = DateTime.Now }; repository.AddFeedback(artComment); return(RedirectToAction("Crop", "Home", new { cropID = artComment.CropId })); }