public TKCustomMapBindingsViewModel() { mapCenter = new Position(-33.311836, 26.520642); pins = new ObservableCollection <TKCustomMapPin>(); circles = new ObservableCollection <TKCircle>(); db = new RealmDataBase(); }
public AddRouteViewModel(ObservableCollection <TKRoute> routes, ObservableCollection <TKCustomMapPin> pins, TK.CustomMap.MapSpan bounds) { this.Routes = routes; this.Pins = pins; this.Bounds = bounds; db = new RealmDataBase(); }
public GetDirectionsPopUp() { InitializeComponent(); db = new RealmDataBase(true); autoComplete.DataSource = db.GetVenues(); autoComplete.SuggestionMode = Syncfusion.SfAutoComplete.XForms.SuggestionMode.Contains; model = new MapsNewViewModel(); vm = new TKCustomMapViewModel(); BindingContext = new TKCustomMapBindingsViewModel(); main.Children.Add(model.GetCustomMap()); }
public TimeTableGetter(string studentNumber) { db = new RealmDataBase(); try { IntermediateCall(studentNumber); } catch (TimeTableException e) { UserDialogs.Instance.Alert(e.Message); } }
//public IEnumerable<Subject> Subjects { get; private set; } /// <summary> /// Initializes a new instance of the <see cref="T:RUTimetable.DayViewModel"/> class. /// </summary> /// <param name="day">Day.</param> /// <param name="semester">Semester.</param> public DayViewModel(string day, int semester) { db = new RealmDataBase(); var Day = db.GetDay(day, semester); Subjects = new ObservableCollection <Subject>() { }; subjects = new ObservableCollection <Subject>() { }; this.day = day; ChangeHandler = new SemesterChangeHandler(); this.semester = semester; Populate(); }
async void Save_Clicked(object sender, System.EventArgs e) { RealmDataBase db = new RealmDataBase(); var student = db.GetStudent(); if (student != null && !string.IsNullOrEmpty(Subject.Text) && !string.IsNullOrEmpty(day) && period > 0 && semester > 0) { UserDialogs.Instance.ShowLoading("Saving Please Wait", MaskType.Black); await Loading(); db.Write(Subject.Text, period.ToString(), new TimeProvider().GetPeriodTime(period.ToString()), semester, day); UserDialogs.Instance.HideLoading(); } else { await DisplayAlert("N***a is you dumb?", "N***a is you dumb? fill all the required information yesses!!", "Cancel"); } }
/// <summary> /// Views Subject Venue location on Campus Map. /// This feature is still under development not really it works /// just xamarin forms hasnt fixed the issue with google maps not /// working on their latest version /// Im till trying to move this into a ViewModel /// </summary> public async void ViewOnCampusMap(object sender, EventArgs e) { var subject = Name.Text; GeoLocationProvider loc = new GeoLocationProvider(); loc.GetLocation(); var currentLocation = loc.GetLatLong(); var db = new RealmDataBase(); var venue = db.GetVenueLocationBySubject(subject); db.SaveDirections(new DirectionsRequest { A = new CustomPosition { Name = "You", Lat = currentLocation.Latitude, Long = currentLocation.Longitude }, B = new CustomPosition { Name = venue.Name, Lat = venue.Lat, Long = venue.Long } }); await Navigation.PushPopupAsync(new ViewOnCampusMapPopUp()); }
async void Save_Clicked(object sender, System.EventArgs e) { RealmDataBase db = new RealmDataBase(); var student = db.GetStudent(); if (student == null) { UserDialogs.Instance.Alert("Please add your timetable using your student number in the Add timetable screen before proceeding with \n adding any addittional subjects, the application only works for undergraduate \n students whos timetable is stored on the universities timetable database."); return; } if (student != null && !string.IsNullOrEmpty(Subject.Text) && !string.IsNullOrEmpty(day) && period > 0 && semester > 0) { UserDialogs.Instance.ShowLoading("Saving Please Wait", MaskType.Black); await Loading(); db.Write(Subject.Text, period.ToString(), new TimeProvider().GetPeriodTime(period.ToString()), semester, day); UserDialogs.Instance.HideLoading(); } else { await DisplayAlert("Error!", "Please fill all the required information!!", "OK"); } }
public List <string> GetAcronyms() { var myList = new List <string>(); RealmDataBase db = new RealmDataBase(); var subs = db.GetStudentSubjectLists(); foreach (List <Day> daySubs in subs) { foreach (Day specificDay in daySubs) { foreach (Subject sub in specificDay.Subjects) { var temp = sub.Name.Split(' '); var accr = temp[0] + ' ' + temp[1]; if (!myList.Contains(accr) && !sub.Name.Contains("PRACTICAL") && !sub.Name.Contains("TUTORIAL")) { myList.Add(accr); } } } } return(myList); }
public SemesterChangeHandler() { db = new RealmDataBase(); }
public MapsNewViewModel() { db = new RealmDataBase(); SetUpMap(); }
public ReminderHelper() { db = new RealmDataBase(); helper = new NotificationHelper(); }
public DaySummaryViewModel() { db = new RealmDataBase(); summary = new ObservableCollection <Subject>(); Summary = new ObservableCollection <Subject>(); }
public GEOJSONTOJSONParser(GeoJSONData dat, List <VenueLocation> ven) { data = dat; db = new RealmDataBase(); LocationsWithAssociatedHostedSubjects = ven; }