示例#1
0
        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()));
            }
        }
示例#2
0
 public void UpdateEvent(string id, EventDetails eventDetails)
 {
     _eventRepo.Update(id, eventDetails);
 }