public ActionResult AddEvent(AddEventViewModel model) { if (ModelState.IsValid) { _service.AddEvent(model.Group, new EPEvent() { Summary = model.Name, Start = model.Start, End = model.End }); if (_service.GetCalendar(model.Group).IsGroup) return RedirectToAction("Group", new { groupId = model.Group }); else return RedirectToAction("Index"); } else { var newModel = new AddToGroupInputViewForm(); newModel.Group = model.Group; return View(newModel); } }
public ActionResult AddToGroup(AddToGroupInputViewForm model) { return View(model); }
public ActionResult AddToGroup(AddToGroupViewModel model) { if (ModelState.IsValid && _service.UserExists(model.Name)) { _service.AddGroup(model.Name, model.Group); return RedirectToAction("Group", new { groupId = model.Group }); } else { var newModel = new AddToGroupInputViewForm(); newModel.Group = model.Group; return View(newModel); } }