Exemple #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"));
        }
Exemple #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 }));
        }
 public ActionResult Edit(League league)
 {
     _db.Entry(league).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Details", new { id = league.LeagueId }));
 }
 public ActionResult Edit(Schedule schedule)
 {
     _db.Entry(schedule).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Details", new { id = schedule.ScheduleId }));
 }
 public ActionResult Edit(Tracker Tracker)
 {
     _db.Entry(Tracker).State = EntityState.Modified;
     _db.SaveChanges();
     return(RedirectToAction("Details", new { id = Tracker.TrackerId }));
 }