Esempio n. 1
0
        /// <summary>
        /// Raises the appearing event.
        /// </summary>
        protected override void OnAppearing()
        {
            base.OnAppearing();

            DoctorsDataManager.Instance.LoadDoctorsWithJson(Constants.Constants.JSON_DOCTORS);

            MessagingCenter.Subscribe <AppointmentCell, AppointmentModel> (this, Constants.Constants.MESSEGE_CENTER_OPEN_DOCTOR_PAGE, (sender, appointmentModel) => {
                //DoctorModel doctor = DoctorsDataManager.Instance.GetModelById(appointmentModel.DoctorId);
                var doctorPage      = new DoctorPage();
                doctorPage.DoctorId = appointmentModel.DoctorId;
                Navigation.PushAsync(doctorPage, true);
            });

            /// IF appointments are not already loaded
            if (!AppointmentsDataManager.Instance.IsAppointmentsLoaded)
            {
                // Load
                _activityIndicatorStack.IsVisible = true;
                _listView.IsVisible = false;

                Dictionary <string, string> networkParms = new Dictionary <string, string> ();
                networkParms.Add(Constants.Constants.PARAM_ID, Constants.Constants.USER_ID);
                _networkHandler = new NetworkHandler("users/{id}/appointments", networkParms, this, 1);
                _networkHandler.GetJsonData(true, Constants.Constants.JSON_APPOINTMENTS);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Raises the appearing event.
        /// </summary>
        protected override void OnAppearing()
        {
            base.OnAppearing();

            if (DoctorsDataManager.Instance.isDoctorAlreadyLoaded(_doctorId))
            {
                DoctorModel doctor = DoctorsDataManager.Instance.GetModelById(_doctorId);
                BindingContext = doctor;

                _dataStack.IsVisible = true;
                _activityIndicatorStack.IsVisible = false;
            }
            else
            {
                _dataStack.IsVisible = false;
                _activityIndicatorStack.IsVisible = true;

                Dictionary <string, string> networkParms = new Dictionary <string, string> ();
                networkParms.Add(Constants.Constants.PARAM_ID, _doctorId);
                _networkHandler = new NetworkHandler("doctors/{id}", networkParms, this, 1);
                _networkHandler.GetJsonData(true, Constants.Constants.JSON_DOCTORS);
            }
        }