Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "LocationID,NLocation,MeetDate")] MeetLocation meetLocation)
        {
            if (ModelState.IsValid)
            {
                db.MeetLocations.Add(meetLocation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(meetLocation));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "AthleteId,AthleteName,AthleteGender,TeamID")] Athlete athlete)
        {
            if (ModelState.IsValid)
            {
                db.Athletes.Add(athlete);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.TeamID = new SelectList(db.Teams, "TeamID", "TeamName", athlete.TeamID);
            return(View(athlete));
        }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "ID,DISTANCE,LOCATIONID,ATHLETEID,RACETIME")] RACEEVENT rACEEVENT)
        {
            if (ModelState.IsValid)
            {
                db.RACEEVENTs.Add(rACEEVENT);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ATHLETEID  = new SelectList(db.Athletes, "AthleteId", "AthleteName", rACEEVENT.ATHLETEID);
            ViewBag.LOCATIONID = new SelectList(db.MeetLocations, "LocationID", "NLocation", rACEEVENT.LOCATIONID);
            return(View(rACEEVENT));
        }