public FindInstructorPage()
        {
            InitializeComponent();

            apiService = new AccountService();

            Courses = new ObservableCollection <CourseModel>();
            Cities  = new ObservableCollection <CityModel>();
        }
Example #2
0
 private async void BtnSend_OnClicked(object sender, EventArgs e)
 {
     apiService = apiService ?? new MockupService();
     var response = await apiService.PasswordRecovery(EntEmail.Text);
     if (response)
     {
         await DisplayAlert("Hi", "A new password has been sent to your email. Kindly type new password", "Alright");
         await Navigation.PopToRootAsync();
     }
     else
     {
         await DisplayAlert("Ooops", "Something wrong", "Cancel");
     }
 }
        private async void BtnChangePassword_OnClicked(object sender, EventArgs e)
        {
            serviceApi = serviceApi ?? new MockupService();
            var response = await serviceApi.ChangePassword(EntOldPassword.Text, EntNewPassword.Text,
                                                           EntConfirmPassword.Text);

            if (response)
            {
                await DisplayAlert("Password Changed", "Kindly login with the new password", "Alright");

                Application.Current.MainPage = new NavigationPage(new LoginPage());
            }
            else
            {
                await DisplayAlert("Oops", "Something wrong", "Cancel");
            }
        }
Example #4
0
        private async void BtnLogin_Clicked(object sender, EventArgs e)
        {
            apiService = apiService ?? new MockupService();

            var response = await apiService.GetToken(EntEmail.Text, EntPassword.Text);

            if (string.IsNullOrEmpty(response.AccessToken))
            {
                await DisplayAlert("Error", "Something wrong", "Alright");
            }
            else
            {
                Preferences.Set(Constants.Access_Token, response.AccessToken);
                Preferences.Set(Constants.Password, EntPassword.Text);
                Preferences.Set(Constants.Email, EntEmail.Text);
                Application.Current.MainPage = new MasterPage();
            }
        }
Example #5
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            if (FirstAppearing)
            {
                apiService = apiService ?? new MockupService();
                var instructors = await apiService.SearchInstructors(_course, _city, _gender);

                foreach (var instructor in instructors)
                {
                    Instructors.Add(instructor);
                }

                LvInstructors.ItemsSource = Instructors;
            }

            FirstAppearing = false;
        }
        private async void GetInstructor(int instructorId)
        {
            apiService = apiService ?? new MockupService();
            var instructor = await apiService.GetInstructor(instructorId);

            ImgProfile.Source          = instructor.ImageLogo;
            LblCity.Text               = instructor.City;
            LblLanguage.Text           = instructor.Language;
            LblNationality.Text        = instructor.Nationality;
            LblSpecialization.Text     = instructor.CourseDomain;
            LblExperience.Text         = instructor.Experience;
            LblName.Text               = instructor.Name;
            LblOnelineDescription.Text = instructor.OneLineTitle;
            LblHourlyRate.Text         = instructor.HourlyRate;
            LblDescription.Text        = instructor.Description;
            number = instructor.Phone;
            email  = instructor.Email;
        }