コード例 #1
0
        public ActionResult ConfirmRemove(int id)
        {
            Group groupToBeInactive = _db.Groups.FirstOrDefault(x => x.GroupId == id);

            groupToBeInactive.Active           = 0;
            _db.Entry(groupToBeInactive).State = EntityState.Modified;
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        // public Task<ActionResult> Edit(int id )
        // {
        //   Roster r = _db.Rosters.Where(x => x.RosterId).FirstOrDefault();
        //   View(r);
        // }

        // [HttpPost]//may need to be a put
        // [Authorize(Roles = "Administrator")]
        public ActionResult Edit(int id)
        {
            var roster = _db.Rosters.FirstOrDefault(x => x.RosterId == id);

            if (roster.Position == "bench")
            {
                roster.Position = roster.FootballPosition;
            }
            else
            {
                roster.Position = "bench";
            }

            _db.Entry(roster).State = EntityState.Modified;
            _db.SaveChanges();
            return(RedirectToAction("Index", new { id = roster.GroupId }));
        }
コード例 #3
0
 public ActionResult Edit(League league)
 {
     _db.Entry(league).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Details", new { id = league.LeagueId }));
 }
コード例 #4
0
 public ActionResult Edit(Schedule schedule)
 {
     _db.Entry(schedule).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Details", new { id = schedule.ScheduleId }));
 }
コード例 #5
0
 public ActionResult Edit(Tracker Tracker)
 {
     _db.Entry(Tracker).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Details", new { id = Tracker.TrackerId }));
 }