Example #1
0
        public override async void OnNavigatedTo(NavigationParameters parameters)
        {
            Title = "Επίπεδα Πιστοποίησης";
            //TODO: Get Language from parameters
            //var language = parameters["language"];
            var language = "el";

            try
            {
                EducationalLevels.Clear();
                var educationalLevels = EducationalLevelAppService.GetEducationalLevels(language);
                foreach (var ed in educationalLevels)
                {
                    EducationalLevels.Add(ed);
                }

                base.OnNavigatedTo(parameters);
            }
            catch (Exception e)
            {
                //TODO: Find how to properly handle Exceptions
                await App.Current.MainPage.DisplayAlert("Error",
                                                        $"Application was not able to retrieve Educational Levels: {e.Message}", "OK");
            }
        }
Example #2
0
        public override async void OnNavigatedTo(NavigationParameters parameters)
        {
            var language = "el";

            try
            {
                if (EducationalLevels == null)
                {
                    EducationalLevels = new ObservableCollection <EducationalLevel>();
                }
                if (EducationalSectors == null)
                {
                    EducationalSectors = new ObservableCollection <EducationalSector>();
                }
                if (QualificationTypes == null)
                {
                    QualificationTypes = new ObservableCollection <QualificationType>();
                }
                if (AwardingBodies == null)
                {
                    AwardingBodies = new ObservableCollection <AwardingBody>();
                }


                //EducationalLevels
                if (EducationalLevels != null && EducationalLevels.Count == 0)
                {
                    EducationalLevels.Clear();
                    var educationalLevels = EducationalLevelAppService.GetEducationalLevels(language);
                    foreach (var ed in educationalLevels)
                    {
                        EducationalLevels.Add(ed);
                    }
                }

                //EducationalSectors
                if (EducationalSectors != null && EducationalSectors.Count == 0)
                {
                    EducationalSectors.Clear();
                    var educationalSectors = EducationalSectorAppService.GetEducationalSectors(language);
                    foreach (var es in educationalSectors)
                    {
                        EducationalSectors.Add(es);
                    }
                }

                //QualificationTypes
                if (QualificationTypes != null && QualificationTypes.Count == 0)
                {
                    QualificationTypes.Clear();
                    var qualificationTypes = QualificationTypeAppService.GetQualificationTypes(language);
                    foreach (var qt in qualificationTypes)
                    {
                        QualificationTypes.Add(qt);
                    }
                }

                //AwardingBodies
                if (AwardingBodies != null && AwardingBodies.Count == 0)
                {
                    AwardingBodies.Clear();
                    var awardingBodies = AwardingBodyAppService.GetAwardingBodies(language);
                    foreach (var ab in awardingBodies)
                    {
                        AwardingBodies.Add(ab);
                    }
                }

                base.OnNavigatedTo(parameters);
            }
            catch (Exception e)
            {
                //TODO: Find how to properly handle Exceptions
                await App.Current.MainPage.DisplayAlert("Error",
                                                        $"Application was not able to retrieve : {e.Message}", "OK");
            }
        }