public ActionResult NoteAdd(string id)
        {
            string _address = "http://demo.places.nlp.nokia.com/places/v1/places/" + id + "?app_id=EOXbMEWYAllPhQnAQsmn&app_code=9TIppnJDB9PHy8-ckJLWXA";
            SaltedButterViewModel place = new SaltedButterViewModel();
            HttpClient client = new HttpClient();
            client.DefaultRequestHeaders.Add("Accept", "application/json");

            // Send a request asynchronously continue when complete
            var taskGet = client.GetAsync(_address).ContinueWith(
            (requestTask) =>
            {
                // Get HTTP response from completed task.
                HttpResponseMessage response = requestTask.Result;

                // Check that response was successful or throw exception
                response.EnsureSuccessStatusCode();

                response.Content.ReadAsAsync(typeof(NokiaPlace)).ContinueWith(
                (readTask) =>
                {
                    // Mapping information provided by API
                    NokiaPlace nokiaPlace = (NokiaPlace)readTask.Result;
                    place.AddressText = nokiaPlace.Location.Address["text"];
                    place.PlaceId = nokiaPlace.PlaceId;
                    place.Name = nokiaPlace.Name;
                    place.Latitude = nokiaPlace.Location.Position[0];
                    place.Longitude = nokiaPlace.Location.Position[1];
                });

            });

            taskGet.Wait();
            return PartialView(place);
        }
        public ActionResult Create(SaltedButterViewModel submittedPlace)
        {
            if (ModelState.IsValid)
            {
                Models.Place place = new Models.Place();
                string _address = "http://demo.places.nlp.nokia.com/places/v1/places/" + submittedPlace.PlaceId + "?app_id=EOXbMEWYAllPhQnAQsmn&app_code=9TIppnJDB9PHy8-ckJLWXA";
                HttpClient client = new HttpClient();
                client.DefaultRequestHeaders.Add("Accept", "application/json");

                // Send a request asynchronously continue when complete
                var taskGet = client.GetAsync(_address).ContinueWith(
                (requestTask) =>
                {
                    // Get HTTP response from completed task.
                    HttpResponseMessage response = requestTask.Result;

                    // Check that response was successful or throw exception
                    response.EnsureSuccessStatusCode();

                    response.Content.ReadAsAsync(typeof(NokiaPlace)).ContinueWith(
                    (readTask) =>
                    {
                        // Mapping information provided by API
                        NokiaPlace nokiaPlace = (NokiaPlace)readTask.Result;
                        place.Address1 = nokiaPlace.Location.Address["street"];
                        place.City = nokiaPlace.Location.Address["city"];
                        place.PostalCode = nokiaPlace.Location.Address["postalCode"];
                        place.Country = nokiaPlace.Location.Address["country"];
                        place.Latitude = nokiaPlace.Location.Position[0];
                        place.Longitude = nokiaPlace.Location.Position[1];
                    });

                });

                place.Name = submittedPlace.Name;

                Models.User user = new Models.User(){
                    Email = submittedPlace.Email,
                    Username = submittedPlace.UserName,
                    CreationDate = DateTime.Now
                };

                Models.SaltedButter saltedButter = new Models.SaltedButter()
                {
                    Salted = Convert.ToBoolean(submittedPlace.Status),
                    Comment = submittedPlace.Comment
                };

                taskGet.Wait();

                Models.Action action = new Models.Action()
                {
                    Place = place,
                    SaltedButter = saltedButter,
                    User = user,
                    CreationDate = DateTime.Now,
                    StatusId = 1,
                    CategoryId = 1
                };

                _dataContext.Actions.InsertOnSubmit(action);

                _dataContext.SubmitChanges();

                MapViewModel map = new MapViewModel()
                {
                    Latitude = place.Latitude,
                    Longitude = place.Longitude
                };

                //_dataContext.Places.InsertOnSubmit(place);
                TempData["success"] = "ok"; // Indicating to display ok notification after redirection
                return RedirectToAction("Index", "Map", map);

            }

            return PartialView("NoteAdd",submittedPlace);
        }
        public ActionResult Note(int id)
        {
            var saltedButterPlace = (from action in _dataContext.Actions
                                        where action.CategoryId == 1 && action.ID == id
                                        select action).Single();

            var saltedButterViewModel = new SaltedButterViewModel()
            {
                Plate = saltedButterPlace.SaltedButter.Plate,
                UserName = saltedButterPlace.User.Username,
                Comment = saltedButterPlace.SaltedButter.Comment,
                Interval = GetInterval(saltedButterPlace.CreationDate),
                Name = saltedButterPlace.Place.Name,
                Status = saltedButterPlace.SaltedButter.Salted.ToString()
            };

            saltedButterViewModel.AddressText = saltedButterViewModel.GetFrenchAddressFormat(saltedButterPlace.Place);

            return PartialView(saltedButterViewModel);
        }