Beispiel #1
0
        public ActionResult Delete(int id)
        {
            var eventToDelete = this.LoadEvent(id);

            if (eventToDelete == null)
            {
                this.AddNotification("Cannot delete event #" + id, NotificationType.ERROR);
                return(this.RedirectToAction("My"));
            }

            var model = EventViewModel.CreateFromEvent(eventToDelete);

            return(this.View(model));
        }
Beispiel #2
0
        public ActionResult Delete(int?Id)
        {
            if (Id == null)
            {
                this.AddNotification("Cannot delete event # " + Id, NotificationType.ERROR);
                return(RedirectToAction("My"));
            }
            Event e = LoadEvent(Id.Value);

            if (e == null)
            {
                this.AddNotification("Cannot delete event # " + Id, NotificationType.ERROR);
                return(RedirectToAction("My"));
            }



            var model = EventViewModel.CreateFromEvent(e);

            return(View(model));
        }