コード例 #1
0
 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);
     }
 }
コード例 #2
0
 public ActionResult AddToGroup(AddToGroupInputViewForm model)
 {
     return View(model);
 }
コード例 #3
0
 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);
     }
 }