Exemplo 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));
        }
Exemplo 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));
        }
Exemplo 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));
        }