public ActionResult Create() { UserSettings userSettings = SessionWrapper.UserSettings; var TeamVM = new TeamVM { ProjectID = userSettings.workingProject }; return View("Create", TeamVM); }
public ActionResult Create(TeamVM teamVM) { var team = Mapper.Map<TeamVM, Team>(teamVM); db.Teams.Add(team); db.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Edit(TeamVM teamVM) { var team = db.Teams.Find(teamVM.TeamID); if (team == null) return HttpNotFound(); db.Entry(team).CurrentValues.SetValues(teamVM); db.SaveChanges(); return RedirectToAction("Index"); }