//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);
        }
示例#2
0
        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);
        }
示例#4
0
 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' ";
     }
 }
示例#5
0
 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);
            }
        }
示例#7
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            var result = await Service.GetAll();

            result.ForEach(x => Crews.Add(x));
            lastId = Crews.LastOrDefault().Id;
            LoadStewardesses();
            LoadPilots();
        }
示例#8
0
        public async void ListInit()
        {
            Crews.Clear();
            var collection = await service.GetCrewsAsync();

            foreach (var item in collection)
            {
                Crews.Add(item);
            }
        }
示例#9
0
 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();
 }
示例#10
0
        public async Task Search()
        {
            Crews.Clear();

            List <Crew> tempCrews = await CrewService.GetAll();

            foreach (var item in tempCrews)
            {
                Crews.Add(item);
            }
        }
示例#11
0
        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();
            }
        }
示例#12
0
        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}"
                });
            }
        }
示例#13
0
        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);
            }
        }
示例#14
0
        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);
            }
        }
示例#15
0
        private async void LoadCrews()
        {
            var result = await CrewService.GetAll();

            result.ForEach(x => Crews.Add(x));
        }