async private void SaveItinerary() { UserTripDataManager userTripManager = new UserTripDataManager(); iOSLoginManager loginManager = iOSLoginManager.Instance; string origin = Criteria.GetStartLocationString(); string destination = Criteria.GetEndLocationString(); string prioritycode = "1"; bool isWheelchair = false; bool isBike = false; int travelerId = loginManager.GetTravelerId(); bool didSave = await userTripManager.SaveTripForUser(travelerId, ItineraryToShow, origin, destination, prioritycode, isWheelchair, isBike); GAI.SharedInstance.DefaultTracker.Send(GAIDictionaryBuilder.CreateEvent("ui_action", "save trip", "save trip", didSave).Build()); if (didSave) { this.NavigationController.PopToRootViewController(false); } else { UIAlertView alert = new UIAlertView("Not Saved", "Error saving trip. Please try again.", null, "OK", null); alert.Show(); } }
public SearchPresenter(BaseActivity activity, Bundle extras) { this.activity = activity; this.view = new SearchView(activity, this); UserTripDataManager dataManager = new UserTripDataManager(); searchIntent = new SearchIntent(extras); SearchAndDisplayResults(searchIntent); }
public async void SearchAndDisplayResults() { UserTripDataManager dataManager = new UserTripDataManager(); AndroidLoginManager loginManager = AndroidLoginManager.Instance(activity.ApplicationContext); int travelerId = loginManager.GetTravelerId(); List <Trip> tripsInHistory = await dataManager.GetPastTrips(travelerId, 100); this.view.ShowTrips(tripsInHistory); this.view.ShowBusy(false); }
public async Task <TripSearchResult> Search() { TripSearchResult searchResult = new TripSearchResult(); if (_isSearchable) { UserTripDataManager dataManager = new UserTripDataManager(); searchResult = await dataManager.SearchForTrips(_startLocation, _endLocation, _maxWalkDistance, _date, _isDeparture, _cityString, _stateString); } return(searchResult); }
public override void ViewDidLoad() { base.ViewDidLoad(); mUserTripDataManager = new UserTripDataManager(); mLocationManager = new CLLocationManager(); mLocationManager.DesiredAccuracy = 100; mLocationManager.LocationsUpdated += (object sender, CLLocationsUpdatedEventArgs e) => { mCurrentLocationUpdateCounter++; EnableCurrentLocation(); CLLocation location = e.Locations[e.Locations.Length - 1]; mCurrentLocation = e.Locations[e.Locations.Length - 1].Coordinate; mCityString = ""; mStateString = ""; var geocoder = new CLGeocoder(); geocoder.ReverseGeocodeLocation(location, (CLPlacemark[] placemarks, NSError error) => { if ((placemarks != null) && (placemarks.Length > 0)) { mStateString = placemarks[0].AdministrativeArea; mCityString = placemarks[0].Locality; } }); if (mCurrentLocationUpdateCounter > 5) { mLocationManager.StopUpdatingLocation(); } }; txtStartLocation.ShouldReturn += (textField) => { txtEndLocation.BecomeFirstResponder(); return(true); }; txtEndLocation.ShouldReturn += (textField) => { textField.ResignFirstResponder(); return(true); }; setupConnectorView(); txtDate.Text = DateTime.Now.AddMinutes(5).ToString("g"); }
async private void CancelTrip() { UserTripDataManager userTripManager = new UserTripDataManager(); iOSLoginManager loginManager = iOSLoginManager.Instance; int travelerId = loginManager.GetTravelerId(); bool didSave = await userTripManager.CancelTripForUser(travelerId, TripToShow); GAI.SharedInstance.DefaultTracker.Send(GAIDictionaryBuilder.CreateEvent("ui_action", "cancel trip", "cancel trip", didSave).Build()); if (didSave) { UIAlertView alert = new UIAlertView("Canceled", "Trip Canceled", null, "OK", null); alert.Show(); btnSaveCancel.Hidden = true; } else { UIAlertView alert = new UIAlertView("Not Canceled", "Error canceling trip. Please try again.", null, "OK", null); alert.Show(); } }
public UpcomingPresenter(Activity activity) { this.activity = activity; this.view = new UpcomingView(activity, this); UserTripDataManager dataManager = new UserTripDataManager(); }
public override void ViewDidLoad() { base.ViewDidLoad(); mUserTripManager = new UserTripDataManager(); setupConnectorView(); }
public HomeViewController(IntPtr handle) : base(handle) { mHomeDataManager = new HomeDataManager(); mUserTripManager = new UserTripDataManager(); }
public HistoryPresenter(Activity activity) { this.activity = activity; this.view = new HistoryView(activity, this); UserTripDataManager dataManager = new UserTripDataManager(); }