public ActionResult Create() { var model = new EventViewModel(); model.GameList = new SelectList (_gameService.GetAll(), SelectLists.DataValueField, SelectLists.DataTextField, SelectLists.UnitializedSelectValue); return View(model); }
public ActionResult Create(EventViewModel model) { if (ModelState.IsValid) { var businessObject = new BOEvent(); Mapper.Map<EventViewModel, BOEvent>(model, businessObject); businessObject.Game = new BOGame(model.GameListID); _eventService.Save(businessObject); return RedirectToAction("Index"); } model.GameList = new SelectList (_gameService.GetAll(), SelectLists.DataValueField, SelectLists.DataTextField, SelectLists.UnitializedSelectValue); return View(model); }
public ActionResult EditProperties(EventViewModel model) { return PartialView("_event", model); }
public ActionResult Edit(EventViewModel model) { if (ModelState.IsValid) { BOEvent businessObject = _eventService.GetById(model.ID); Mapper.Map<EventViewModel, BOEvent>(model, businessObject); _eventService.Save(businessObject); return RedirectToAction("Index"); } return View(model); }