//Loading the view along with the data to be displayed public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state) { int id = 0; if (parameter != null) { id = (int)parameter; } var service = new MovieService(); Movie = await service.GetMovieAsync(id); var credits = await service.GetMovieCastAndCrewAsync(id); foreach (Cast c in credits.cast) { Casts.Add(c); } foreach (Crew c in credits.crew) { Crews.Add(c); } await base.OnNavigatedToAsync(parameter, mode, state); }
public void Publish(Message e, string topicName) { if (e != null) { if (topicName.CompareTo(EntityType.CrewMember.ToString()) == 0) { CrewMembers.Clear(); foreach (IdentifiedObject item in e.IdObjCollection) { CrewMembers.Add(item as CrewMember); } return; } if (topicName.CompareTo(EntityType.Crew.ToString()) == 0) { Crews.Clear(); foreach (IdentifiedObject item in e.IdObjCollection) { Crews.Add(item as Crew); } return; } } }
//Loading the view along with the data to be displayed public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> state) { int id = 0; if (parameter != null) { id = (int)parameter; } var service = new MovieService(); Series = await service.GetSeriesAsync(id); var credits = await service.GetSeriesCastAndCrewAsync(id); foreach (Cast c in credits.cast) { Casts.Add(c); } foreach (Crew c in credits.crew) { Crews.Add(c); } for (int i = 0; i < Series.number_of_seasons; i++) { var season = await service.GetSeasonEpisodesAsync(id, i); Seasons.Add(season); } await base.OnNavigatedToAsync(parameter, mode, state); }
private async void BtnCreate_OnClick(object sender, RoutedEventArgs e) { Canvas.Visibility = Visibility.Collapsed; if (isCreate) { var pilot = ReadTextBoxesData(); if (pilot != null) { try { await Service.Create(pilot); } catch { Info.Text = "Server error!"; } lastId++; pilot.Id = lastId; Crews.Add(pilot); isCreate = false; CreateInfo(); Info.Text = "Choose new action!"; } } else { CreateInfo(); isCreate = true; Info.Text = "Info : Input data and press 'Create' "; } }
public void SubscribeAddCrew() { MessagingCenter.Subscribe <AddCrewPageViewModel, Crew>(this, "addCrew", (s, param) => { param.firstName = param.firstName + " " + param.lastName; Crews.Add(param); SetCrewImage(); }); }
private async void FillCrewsCollection() { var temp = await service.GetEntities(); foreach (var item in temp) { Crews.Add(item); } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { var result = await Service.GetAll(); result.ForEach(x => Crews.Add(x)); lastId = Crews.LastOrDefault().Id; LoadStewardesses(); LoadPilots(); }
public async void ListInit() { Crews.Clear(); var collection = await service.GetCrewsAsync(); foreach (var item in collection) { Crews.Add(item); } }
private void AddEntityCommand_Execute(object parameter) { crew.Members.AddRange((from item in CrewMembers select item.GlobalId).ToList()); Client.AddEntity(crew); Crews.Add(crew); crew = new Crew(); CrewName = string.Empty; CrewMembers.Clear(); }
public async Task Search() { Crews.Clear(); List <Crew> tempCrews = await CrewService.GetAll(); foreach (var item in tempCrews) { Crews.Add(item); } }
void GetCrews() { var r = App.Database.GetCrewItemsAsync().Result; if (r != null) { foreach (var item in r) { item.firstName = item.firstName + " " + item.lastName; Crews.Add(item); } SetCrewImage(); } }
private void GenerateCrews() { var rand = new System.Random(); for (int i = 1; i < 15; i++) { var PIN = rand.Next(1000, 9999); var leader = Employees[i * 2]; Crews.Add(new Crew() { Id = i, Name = $"{PIN} {leader.Name}" }); } }
public void RequestDetails() { var databaseService = ServiceLocator.Current.GetInstance <DatabaseService>(); using (var connection = databaseService.Connect()) { Slot = connection.Slots.Single(w => w.SlotId == _model.SlotId); var firstEpisode = Slot.Episodes.First(); firstEpisode.Casts.ToList().ForEach(w => Casts.Add(w.Name)); firstEpisode.Crews.ToList().ForEach(w => Crews.Add(w.Name)); ProgramId = firstEpisode.EpisodeId; Channel = Slot.Channel; Series = firstEpisode.Series; if (CanSlotReservation) { CanSlotReservation = !connection.SlotReservations.Any(w => w.Slot.SlotId == _model.SlotId); } CanSeriesReservation = !connection.SeriesReservations.Any(w => w.Series.SeriesId == Series.SeriesId); } }
private async void FillAdditionalCollections() { var flights = await FService.GetEntities(); foreach (var item in flights) { Flights.Add(item); } var crews = await CService.GetEntities(); foreach (var item in crews) { Crews.Add(item); } var planes = await PService.GetEntities(); foreach (var item in planes) { Planes.Add(item); } }
private async void LoadCrews() { var result = await CrewService.GetAll(); result.ForEach(x => Crews.Add(x)); }