private async void OnDeleteClick(WpfLocation location) { if (location == null) { return; } var locationToDb = RestproMapper.MapWpfLocationToLocation(location); string errorMessage = null; try { Locations.Remove(location); if (location.LocationId != null) { _unitOfWork.Locations.FakeDelete(locationToDb); } await dialogCoordinator.ShowMessageAsync(this, "Success", "Raw Material Deleted Successfully. Good Bye :("); } catch (Exception e) { Debug.WriteLine(e); errorMessage = e.Message; } if (errorMessage == null) { return; } await dialogCoordinator .ShowMessageAsync(this, "Error" , "Fatal Error Occured. You're Screwed!\n" + errorMessage); }
public void UpdateLocation( WpfLocation location ) { _context.UpdateLocation( new ServiceLocations.Location() { Id = location.Id, Name = location.Name, Description = location.Description, Latitude = location.Coordinates.Latitude, Longitude = location.Coordinates.Longitude, Altitude = location.Coordinates.Altitude } ); }
public int AddLocation( WpfLocation location ) { return _context.AddLocation(new ServiceLocations.Location() { Name = location.Name, Description = location.Description, Latitude = location.Coordinates.Latitude, Longitude = location.Coordinates.Longitude, Altitude = location.Coordinates.Altitude }); }