Exemple #1
0
        private async Task PopulateDetails(PlaceModel selected)
        {
            try
            {
                var model = await PlaceService.GetPlaceAsync(selected.PlaceID);

                selected.Merge(model);
            }
            catch (Exception ex)
            {
                LogException("Places", "Load Details", ex);
            }
        }
Exemple #2
0
        public async Task <int> UpdatePlaceAsync(PlaceModel model)
        {
            long id = model.PlaceID;

            using (var dataService = DataServiceFactory.CreateDataService())
            {
                var place = id > 0 ? await dataService.GetPlaceAsync(model.PlaceID) : new Place();

                if (place != null)
                {
                    UpdatePlaceFromModel(place, model);
                    await dataService.UpdatePlaceAsync(place);

                    model.Merge(await GetPlaceAsync(dataService, place.place_id));
                }
                return(0);
            }
        }