public ActionResult LeaveFeedback(Int64? id) { var feedback = new Feedback(); if (id.HasValue) { feedback.eventBriteId = id.Value.ToString(); } return View(feedback); }
public ActionResult LeaveFeedback(Feedback feedback) { if (ModelState.IsValid) { _service.saveFeedback(feedback); return RedirectToAction("Thanks", "Feedback"); } else { return View(feedback); } }
public ActionResult LeaveFeedback(Int64? id) { var feedback = new Feedback(); if (id.HasValue) { feedback.eventBriteId = id.Value.ToString(); feedback.FeedbackLeft = DateTime.Today; feedback.Approved = false; } return View(feedback); }
public ActionResult LeaveFeedback(Feedback feedback, string eventBriteId) { feedback.FeedbackLeft = DateTime.Today; feedback.Approved = false; feedback.eventBriteId = eventBriteId; if (ModelState.IsValid) { _service.saveFeedback(feedback); return RedirectToAction("Thanks", "Feedback"); } else { return View(feedback); } }
public void saveFeedback(Feedback feedback) { _context.Feedback.Add(feedback); _context.SaveChanges(); _context.Dispose(); }