Exemplo n.º 1
0
        public async Task <IHttpActionResult> PutWeatherForm(int id, WeatherForm weatherForm)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != weatherForm.Id)
            {
                return(BadRequest());
            }

            db.Entry(weatherForm).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!WeatherFormExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 2
0
        public bool DeleteWeatherForm(WeatherForm p)
        {
            string uri = baseuri + p.Id;

            using (HttpClient client = new HttpClient())
            {
                Task <HttpResponseMessage> response = client.DeleteAsync(uri);
                return(response.Result.IsSuccessStatusCode);
            }
        }
Exemplo n.º 3
0
        public async Task <IHttpActionResult> GetWeatherForm(int id)
        {
            WeatherForm weatherForm = await db.WeatherForms.FindAsync(id);

            if (weatherForm == null)
            {
                return(NotFound());
            }

            return(Ok(weatherForm));
        }
Exemplo n.º 4
0
        public async Task <IHttpActionResult> PostWeatherForm(WeatherForm weatherForm)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.WeatherForms.Add(weatherForm);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = weatherForm.Id }, weatherForm));
        }
Exemplo n.º 5
0
        public bool PostWeatherForm(WeatherForm p)
        {
            string uri = baseuri;

            using (HttpClient client = new HttpClient())
            {
                string        pro   = JsonConvert.SerializeObject(p);
                StringContent frame = new StringContent(pro, Encoding.UTF8, "Application/json");
                Task <HttpResponseMessage> response = client.PostAsync(uri, frame);

                return(response.Result.IsSuccessStatusCode);
            }
        }
Exemplo n.º 6
0
        public async Task <IHttpActionResult> DeleteWeatherForm(int id)
        {
            WeatherForm weatherForm = await db.WeatherForms.FindAsync(id);

            if (weatherForm == null)
            {
                return(NotFound());
            }

            db.WeatherForms.Remove(weatherForm);
            await db.SaveChangesAsync();

            return(Ok(weatherForm));
        }
Exemplo n.º 7
0
        protected override void HandleKeyboardState()
        {
            if (Game.IsKeyDown(Keys.O))
            {
                var gameplayCameraValues = Utility.GetGameplayCameraValues();
                Scenario.CameraSettings.Cameras.Add(gameplayCameraValues);
            }

            if (Game.IsKeyDown(Keys.K))
            {
                var gwenForm = new WeatherForm(Scenario);
                ShowForm(gwenForm);
            }

            if (Game.IsKeyDown(Keys.J))
            {
                Camera.DeleteAllCameras();
            }

            if (Game.IsKeyDown(Keys.NumPad7))
            {
                var gwenForm = new ScenarioForm(Scenario, DatasetAnnotator.RootScenariosDirectory);
                ShowForm(gwenForm);
            }
            if (Game.IsKeyDown(Keys.NumPad9))
            {
                var gwenForm = new CameraForm(Scenario);
                ShowForm(gwenForm);
            }

            if (Game.IsKeyDown(Keys.NumPad1))
            {
                var gwenForm = new PedsForm(Scenario);
                ShowForm(gwenForm);
            }

            if (Game.IsKeyDown(Keys.NumPad3))
            {
                var gwenForm = new PlaceForm(Scenario);
                ShowForm(gwenForm);
            }

            if (Game.IsKeyDown(Keys.NumPad4))
            {
                var gwenForm = new TimeForm(Scenario);
                ShowForm(gwenForm);
            }
        }
Exemplo n.º 8
0
        public void RunTest()
        {
            MainForm mainForm = new MainForm();

            Log.Step(1);
            mainForm.ClickWeatherMenu();

            Log.Step(2);
            WeatherForm weatherPage = new WeatherForm();

            Log.Step(3);
            weatherPage.OpenWeatherCityList();
            weatherPage.SelectCity(_weatherCity);

            Log.Step(4, "The city is selected in the list of cities");
            weatherPage.AssertCity(_weatherCity);
        }
Exemplo n.º 9
0
        public void CheckDetailsWeatherForecastInCity()
        {
            Log.Step();
            var homeTutByForm = new TutByHomePageForm();

            Log.Step();
            homeTutByForm.GoToWeatherViaWidjet();

            var weatherForm = new WeatherForm();

            Log.Step();
            weatherForm.SearchFor(City);

            Log.Step();
            weatherForm.GoToDetail();

            Log.Info("End of test");
        }