public ActionResult Create([Bind(Include = "ID,ZIPCODE,LOCATION,FORECAST,TEMPERATURE")] Weather weather)
        {
            if (ModelState.IsValid)
            {
                db.Weathers.Add(weather);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(weather));
        }
Пример #2
0
        public ActionResult Create([Bind(Include = "Id,Location,Day,Hour,Velocity")] WindSpeed windSpeed)
        {
            if (ModelState.IsValid)
            {
                db.Winds.Add(windSpeed);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(windSpeed));
        }
        public ActionResult Create([Bind(Include = "Id,Location,Day,Hour,DegreeTemperature,DewPoint")] Temperature temperature)
        {
            if (ModelState.IsValid)
            {
                db.Temperatures.Add(temperature);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(temperature));
        }
Пример #4
0
        public ActionResult Create([Bind(Include = "Id,Location,Day,SkyCondition,CurrentTemp,DewPoint")] FogCalculation fogCalculation)
        {
            if (ModelState.IsValid)
            {
                db.Fahrenheits.Add(fogCalculation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fogCalculation));
        }
        public ActionResult Create([Bind(Include = "Id,Location,Day,ChillSpeed,Degree_Id")] Humidity humidity)
        {
            if (ModelState.IsValid)
            {
                db.Humidities.Add(humidity);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Degree_Id = new SelectList(db.Temperatures, "Id", "Location", humidity.Degree_Id);
            return(View(humidity));
        }