Example #1
0
        public ActionResult Create()
        {
            UserSettings userSettings = SessionWrapper.UserSettings;
            var TeamVM = new TeamVM { ProjectID = userSettings.workingProject };

            return View("Create", TeamVM);
        }
Example #2
0
        public ActionResult Create(TeamVM teamVM)
        {
            var team = Mapper.Map<TeamVM, Team>(teamVM);
            db.Teams.Add(team);
            db.SaveChanges();

            return RedirectToAction("Index");
        }
Example #3
0
        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");
        }