/// <summary>
        /// Display a PopUp and perform an action depending on the chosen option
        /// </summary>
        /// <param name="DrivingLessonInstructor"></param>
        private async void ShowExitDialog(DrivingLessonInstructor DrivingLessonInstructor)
        {
            int      id         = DrivingLessonInstructor.DrivingLessonId;
            TimeSpan difference = DrivingLessonInstructor.DateTime - DateTime.Now;

            // If the course takes place in 3 days or more
            if (difference.Days >= 3)
            {
                var answer = await Application.Current.MainPage.DisplayAlert("Confirmation de désinscription", "Êtes vous sûr de vouloir vous désinscrire à la leçon du \n" + DrivingLessonInstructor.DateTime + "? \n\nInstructeur : " + DrivingLessonInstructor.InstructorFirstName + " " + DrivingLessonInstructor.InstructorLastName, "Oui", "Non");

                // If the user responds positively
                if (answer)
                {
                    // The driving lesson loses the id of the user
                    int updateLessonId = DrivingLessonService.UpdateUserIdForDrivingLesson(id, 0);

                    ListeDrivingLessons = DrivingLessonService.GetMyDrivingLessonsByUserId(int.Parse(Application.Current.Properties["UserId"].ToString()), true);

                    if (ListeDrivingLessons != null)
                    {
                        // The lesson is removed from the table
                        Items.Remove(DrivingLessonInstructor);
                    }

                    // Informations of this lesson are sent to the page containing all available lessons
                    _ea.GetEvent <DrivingSentEventUnregister>().Publish(updateLessonId);

                    if (updateLessonId != 0)
                    {
                        // Deleting notifications for canceled lesson
                        InitializeItems();
                        NotificationCenter.Current.Cancel(int.Parse(DrivingLessonInstructor.DrivingLessonId.ToString() + "1"));
                        NotificationCenter.Current.Cancel(int.Parse(DrivingLessonInstructor.DrivingLessonId.ToString() + "3"));
                    }
                    else
                    {
                        await Application.Current.MainPage.DisplayAlert("Erreur", "Une erreur est survenue pendant l'annulation de l'inscription à la séssion. Veuillez réésayer. Si le problème persiste, veuillez contacter l'auto école.", "Ok");
                    }
                }
            }
            // Otherwise, the user can not cancel the course
            else
            {
                await Application.Current.MainPage.DisplayAlert("Erreur", "Vous ne pouvez pas supprimer une session qui est prévue pour dans moins de 72h.", "Ok");
            }
        }
        /// <summary>
        /// Popup to validate or not a registration to a driving court
        /// </summary>
        /// <param name="DrivingLessonInstructor"></param>
        private async void ShowExitDialog(DrivingLessonInstructor DrivingLessonInstructor)
        {
            int id     = DrivingLessonInstructor.DrivingLessonId;
            int userId = int.Parse(Application.Current.Properties["UserId"].ToString());

            bool answer = await Application.Current.MainPage.DisplayAlert("Confirmation d'inscription", "Êtes-vous sûr de vouloir vous inscrire à la leçon du \n" + DrivingLessonInstructor.DateTime + " ?\n \nInstructeur : \n" + DrivingLessonInstructor.InstructorFirstName + " " + DrivingLessonInstructor.InstructorLastName, "Oui", "Non");

            // If the user responds positively to the popup
            if (answer)
            {
                int drivingLessonId = DrivingLessonService.UpdateUserIdForDrivingLesson(id, userId);

                ListeDrivingLessons = DrivingLessonService.GetDrivingLessonsByUserId(userId);

                if (ListeDrivingLessons != null)
                {
                    // Actualization of table
                    Items.Clear();
                    foreach (DrivingLessonInstructor item in ListeDrivingLessons)
                    {
                        Items.Add(item);
                    }
                }

                if (drivingLessonId != 0)
                {
                    // Notification one hour before class
                    var notification = new NotificationRequest
                    {
                        NotificationId = int.Parse(DrivingLessonInstructor.DrivingLessonId.ToString() + "1"),
                        Title          = "Seance de conduite",
                        Description    = "Attention, vous avez une leçon de conduite à " + DrivingLessonInstructor.DateTime.Hour + "h et " + DrivingLessonInstructor.DateTime.Minute + "m.",
                        ReturningData  = "Dummy data", // Returning data when tapped on notification.
                        NotifyTime     = DrivingLessonInstructor.DateTime.AddHours(-1)
                    };
                    NotificationCenter.Current.Show(notification);

                    DateTime dateLecon = new DateTime(DrivingLessonInstructor.DateTime.Year, DrivingLessonInstructor.DateTime.Month, DrivingLessonInstructor.DateTime.Day);
                    DateTime dateJour  = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);

                    // If the lesson goes well in at least a day
                    if (dateLecon > dateJour)
                    {
                        // Notification one day before class
                        notification = new NotificationRequest
                        {
                            NotificationId = int.Parse(DrivingLessonInstructor.DrivingLessonId.ToString() + "3"),
                            Title          = "Seance de conduite",
                            Description    = "Attention, vous avez une leçon de conduite demain à " + DrivingLessonInstructor.DateTime.Hour + "h et " + DrivingLessonInstructor.DateTime.Minute + "m.",
                            ReturningData  = "Dummy data", // Returning data when tapped on notification.
                            NotifyTime     = DrivingLessonInstructor.DateTime.AddDays(-1)
                        };
                        NotificationCenter.Current.Show(notification);
                    }

                    // Registration information for this lesson is sent to the page containing all my lessons
                    _ea.GetEvent <DrivingSentEvent>().Publish(drivingLessonId);
                    await Application.Current.MainPage.DisplayAlert("Validation", "Vous êtes désormais inscrit à la session du : " + DrivingLessonInstructor.DateTime, "Ok");
                }
                else
                {
                    await Application.Current.MainPage.DisplayAlert("Erreur", "Une erreur est survenue pendant l'inscription à la séssion. Veuillez réésayer. Si le problème persiste, veuillez contacter l'auto école.", "Ok");
                }
            }
        }