public ActionResult Create([Bind(Include = "teamPracticeId,practiceLocation,practicePrice,indoor,outdoor,practiceTime")] TeamPractice teamPractice)
        {
            if (ModelState.IsValid)
            {
                LatLong latlong = APIController.GoogleCall(teamPractice.practiceLocation);
                teamPractice.lat = latlong.lat;
                teamPractice.lng = latlong.lng;
                db.TeamPractices.Add(teamPractice);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(teamPractice));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "tournamentId,tournamentLocation,tournamentTime,tournamentPrice,tournamentHotel")] Tournament tournament)
        {
            if (ModelState.IsValid)
            {
                LatLong latlong = APIController.GoogleCall(tournament.tournamentLocation);
                tournament.lat = latlong.lat;
                tournament.lng = latlong.lng;
                db.Tournaments.Add(tournament);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tournament));
        }