Exemple #1
0
        public ActionResult Create([Bind(Include = "TEAM_ID,TEAM_NAME,TEAM_CITY,TEAM_SPONSER")] TEAM tEAM)
        {
            if (ModelState.IsValid)
            {
                db.TEAMS.Add(tEAM);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tEAM));
        }
        public ActionResult Create([Bind(Include = "JERSEY_NUMBER,PLAYER_NAME,POINTS_PER_GAME,REBOUNDS_PER_GAME,ASSISTS_PER_GAME,TEAM_ID")] PLAYER pLAYER)
        {
            if (ModelState.IsValid)
            {
                db.PLAYERS.Add(pLAYER);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.TEAM_ID = new SelectList(db.TEAMS, "TEAM_ID", "TEAM_NAME", pLAYER.TEAM_ID);
            return(View(pLAYER));
        }