Esempio n. 1
0
 public EventViewModel(Event e)
 {
     this.EndDate = e.EndDate;
     this.EventId = e.EventId;
     this.EventName = e.EventName;
     this.QuestionList = e.QuestionList;
     this.StartDate = e.StartDate;
 }
Esempio n. 2
0
        public ActionResult AddEvent(Event model)
        {
            if (ModelState.IsValid)
            {
                using (var context = new LeadGenContext())
                {
                    context.Events.Add(model);
                    context.SaveChanges();
                }

                return RedirectToAction("EventDetails", "Admin", new { id = model.EventId });
            }
            return View(model);
        }