public ActionResult CreateTeam() { ViewBag.Managers = _personRepository.Get(m => m.personTypeId).OrderBy(m => m.firstName).ThenBy(m => m.lastName); var t = new Team { active = true, deleted = false }; return View(t); }
public ActionResult CreateTeam(Team team, int managers) { team.createdAt = DateTime.Now; team.updatedAt = DateTime.Now; team.teamManagerId = managers; _teamRepository.SaveOrUpdate(team); ActionResult result = RedirectToAction("Index"); return result; }
public ActionResult EditTeam(Team team, int managers) { team.updatedAt = DateTime.Now; team.teamManagerId = managers; var t = new Team { id = team.id, name = team.name, description = team.description, teamManagerId = team.teamManagerId, active = team.active, deleted = team.deleted, createdAt = team.createdAt, updatedAt = team.updatedAt }; _teamRepository.SaveOrUpdate(t); return RedirectToAction("Index"); }