Exemple #1
0
        public async Task <CounselDto> RegisterCounsel(CounselDto counsel)
        {
            string endpoint = endpointResolver.ResolveUrl("InsProfesorMateriaApp", "ProfesorMateria");
            IHttpClientResponse clientResponse = await httpClient.Post(endpoint, counsel);

            return(clientResponse.GetContentAsObject <CounselDto>());
        }
Exemple #2
0
        public async Task <StudentCounselDto> SignupToCounsel(UserDto student, CounselDto counsel)
        {
            string endpoint = endpointResolver.ResolveUrl("InsProfesorMateriaApp", "AlumnoMateria")
                              + "?idAlumno=" + student.UserId + "&idProfesorMateria=" + counsel.TeacherSubjectId;

            IHttpClientResponse clientResponse = await httpClient.Post(endpoint, new { });

            return(clientResponse.GetContentAsObject <StudentCounselDto>());
        }
 protected override void OnAppearing()
 {
     try
     {
         CounselDto counsel = counselSignupViewModel.Counsel;
         mapInitializer.Initialize(ref CounselMap, counsel.Latitude, counsel.Longitude, 0.3f);
     }
     catch (Exception ex)
     {
         exceptionHandler.HandleException(this, ex);
     }
 }
        public CounselSignupPage(CounselDto counsel)
        {
            InitializeComponent();

            counselService         = App.LogicContext.CounselService;
            alertDisplayer         = App.LogicContext.AlertDisplayer;
            mapInitializer         = App.LogicContext.MapInitializer;
            exceptionHandler       = App.LogicContext.ExceptionHandler;
            counselSignupViewModel = new CounselSignupPageViewModel {
                Counsel = counsel
            };

            BindingContext = counselSignupViewModel;
            Title          = counsel.SubjectName;
        }
Exemple #5
0
        private async Task SaveButton_Clicked(object sender, EventArgs e)
        {
            try
            {
                registerCounselViewModel.IsBusy = true;

                CounselDto counsel         = buildCounsel();
                CounselDto responseCounsel = await counselService.RegisterCounsel(counsel);

                if (responseCounsel != null)
                {
                    await alertDisplayer.DisplayAlert(this, "Asesoría", "Asesoría registrada exitosamente!", "Ok");

                    App.Current.MainPage = new Dashboard.DashboardPage();
                }
            }
            catch (Exception ex)
            {
                exceptionHandler.HandleException(this, ex);
            }
            finally { registerCounselViewModel.IsBusy = false; }
        }