Ejemplo n.º 1
0
        public IActionResult Index(Jake j, string calculate, string save)
        {
            if (calculate == "calc")
            {
                j.GameScore = j.Damage + (j.Kills * 75) + (j.Revives * 50) + (j.Respawns * 150) - (j.Revived * 50);

                return(View(j));
            }

            else if (save == "save")
            {
                _context.Jake.Add(j);
                _context.SaveChanges();
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }
Ejemplo n.º 2
0
        public IActionResult Index(Brandon b, string calculate, string save)
        {
            if (calculate == "calc")
            {
                b.GameScore = b.Damage + (b.Kills * 75) + (b.Revives * 50) + (b.Respawns * 150) - (b.Revived * 50);

                return(View(b));
            }

            else if (save == "save")
            {
                _context.Brandon.Add(b);
                _context.SaveChanges();
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }
Ejemplo n.º 3
0
        public IActionResult Index(Aaron a, string calculate, string save)
        {
            if (calculate == "calc")
            {
                a.GameScore = a.Damage + (a.Kills * 75) + (a.Revives * 50) + (a.Respawns * 150) - (a.Revived * 50);

                return(View(a));
            }

            else if (save == "save")
            {
                _context.Aaron.Add(a);
                _context.SaveChanges();
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }