Esempio n. 1
0
        private async void ShowResultsAlert()

        {
            ShowEndPopup       = true;
            RunningEvent.IsRan = true;
            await EventServices.UpdateEvent(RunningEvent);
        }
        public ActionResult Edit(EventEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(new { success = false, message = ModelState.GetErrors() }));
            }

            var eventEntity = Mapper.Map <EventEditModel, EventEntity>(model);
            var success     = EventServices.UpdateEvent(model.EventId, eventEntity, CurrentCedUser.CurrentUser.UserId);

            if (!success)
            {
                return(Json(new { success = false, message = "Update failed!" }));
            }

            return(Json(new { success = true, message = "You updated the event!" }));
        }