Esempio n. 1
0
        public ActionResult Create([Bind(Include = "EventId,TypeId,EventName,EventDescription,EventType,EventStart,EventEnd,MaxTickets,AvailableTickets,OrganizerName,Location")] Event @event)
        {
            if (ModelState.IsValid)
            {
                db.Events.Add(@event);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(@event));
        }
Esempio n. 2
0
        public ActionResult Create([Bind(Include = "EventTypeID,Type")] EventType eventType)
        {
            if (ModelState.IsValid)
            {
                db.EventTypes.Add(eventType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(eventType));
        }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "EventID,EventTypeID,Title,Description,StartDate,EndDate,Organizer,ContactInfo,City,State,MaxTickets,AvailTickets")] Event @event)
        {
            if (ModelState.IsValid)
            {
                db.Events.Add(@event);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.EventTypeID = new SelectList(db.EventTypes, "EventTypeID", "Type", @event.EventTypeID);
            return(View(@event));
        }