public IActionResult Index() { var rookie = new RookieViewModel { Positions = Enum.GetValues(typeof(PositionValue)).Cast <PositionValue>() }; return(View(rookie)); }
public IActionResult Edit(RookieViewModel player) { var toEdit = _context.Players.Single(r => r.ID == player.ID); //new PlayerAttributeViewModel toEdit.PlayerName = player.PlayerName; toEdit.Position = player.Position; toEdit.Age = player.Age; toEdit.Height = player.Height; toEdit.Weight = player.Weight; toEdit.Development = player.Development; toEdit.OVR = player.OVR; toEdit.SPD = player.SPD; toEdit.ACC = player.ACC; toEdit.STR = player.STR; toEdit.AGI = player.AGI; toEdit.ELU = player.ELU; toEdit.BCV = player.BCV; toEdit.CAR = player.CAR; toEdit.JKM = player.JKM; toEdit.SPM = player.SPM; toEdit.SFA = player.SFA; toEdit.TRK = player.TRK; toEdit.CTH = player.CTH; toEdit.CIT = player.CIT; toEdit.SPC = player.SPC; toEdit.RTE = player.RTE; toEdit.RLS = player.RLS; toEdit.JMP = player.JMP; toEdit.THP = player.THP; toEdit.SAC = player.SAC; toEdit.MAC = player.MAC; toEdit.DAC = player.DAC; toEdit.RUN = player.RUN; toEdit.PAC = player.PAC; toEdit.RBK = player.RBK; toEdit.PBK = player.PBK; toEdit.IBL = player.IBL; toEdit.TAK = player.TAK; toEdit.POW = player.POW; toEdit.BSH = player.BSH; toEdit.FMV = player.FMV; toEdit.PMV = player.PMV; toEdit.MCV = player.MCV; toEdit.ZCV = player.ZCV; toEdit.PRS = player.PRS; toEdit.PRC = player.PRC; toEdit.PUR = player.PUR; _context.SaveChanges(); return(RedirectToAction("Position", new { position = player.Position })); }
public IActionResult About() { ViewData["Message"] = "Your application description page."; var Rookies = _context.Player.ToList(); var vm = new RookieViewModel() { //Rookies = Rookies.Select(r => new RookieViewModel //{ //}) }; return(View()); }