public ActionResult Details(Guid id) { var feedbackDetails = feedbackService.Find(id); if (feedbackDetails == null) { return(HttpNotFound()); } return(View(feedbackDetails)); }
public ActionResult AddFeedback(FeedbackViewModel model) { if (ModelState.IsValid) { IEnumerable <Feedback> checkFeedback = feedbackService.Find(m => m.OrderId == model.OrderId && m.ProviderProfileId == User.Identity.GetUserId()); if (!checkFeedback.Any()) { Feedback feedback = model.GetFeedback(); feedback.ProviderProfileId = User.Identity.GetUserId(); feedback.CreateDate = DateTime.Now; feedbackService.Add(feedback); return(RedirectToAction($"Details/{model.OrderId}")); } return(RedirectToAction("Error", "Home")); } return(View(model)); }