/// <summary>
        /// Saves the Appointment with the data into the database
        /// </summary>
        public void SaveAppointment()
        {
            IsInWeekAppointments.Clear();
            DaysOfVisit = DateCalculator.getDays(LeavingDay, ArrivingDay);

            AppointmentModel.dogFromCustomer = SelectedDog;
            AppointmentModel.date_from       = ArrivingDay;
            AppointmentModel.date_to         = LeavingDay;
            AppointmentModel.isdailyguest    = Convert.ToInt32(IsDailyGuest);
            AppointmentModel.days            = DaysOfVisit;
            AppointmentModel.dogID           = SelectedDog.Id;
            AppointmentModel.isActive        = true;


            if (GlobalConfig.Connection.IsAppointmentInDataStore(AppointmentModel))
            {
                ErrorMessages.AppointmentIsAlreadyInDatabaseError(AppointmentModel);
            }
            else if (GlobalConfig.Connection.IsDogInTimeSpanAlreadyInDataStore(AppointmentModel))
            {
                ErrorMessages.DogIsInThisTimespanAlreadyInDatabaseError(AppointmentModel);
            }
            else
            {
                AppointmentModel = GlobalConfig.Connection.AddAppointmentToDataStore(AppointmentModel);
                SuccessMessages.AppointmentCreatedSuccess();
                AvailableAppointments = new BindableCollection <AppointmentModel>(GlobalConfig.Connection.GetAppointments());
            }

            foreach (AppointmentModel model in AvailableAppointments)
            {
                AppointmentsInCurrentWeek(model);
            }
            IsInWeekAppointments.OrderBy(x => x.date_from);
            ArrivingDay       = DateTime.Today;
            LeavingDay        = DateTime.Today;
            IsDailyGuest      = false;
            DatePickerForWeek = DateTime.Parse(FirstDayOfWeek);
        }