public ActionResult Edit(Event item) { try { if (User.IsInRole("Admin")) { if (ModelState.IsValid) { if (item.EventId > 0) { var updatedRecord = _repo.Update(item); if (updatedRecord.EventId < 1) { return(RedirectToAction("Error404", "Home")); } return(RedirectToAction("Index", "Events")); } } } return(RedirectToAction("Login", "Account")); } catch (Exception ex) { return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, ex.ToString())); } }
public void UpdateEvent(string id, EventDetails eventDetails) { _eventRepo.Update(id, eventDetails); }