/// <summary>
        /// Ajout ou modification d'une photo
        /// </summary>
        public void AddEditPhoto()
        {
            // If the form is not valid, a notification will appear
            if (ValidationErrorsHandler.IsValid(_validator, Picture))
            {
                _isFormValid = true;

                if (NoneCheck)
                {
                    Picture.PointOfInterest = null;
                }

                if (Mode == Mode.add)
                {
                    AddPictureInDB();
                }
                else if (Mode == Mode.edit)
                {
                    UpdateExistingPicture();
                }

                EditableObject.EndEdit();
            }
            else
            {
                _isFormValid = false;
            }
        }
        /// <summary>
        /// Ajouter ou modifier une note
        /// </summary>
        public void AddEditNote()
        {
            // If the form is not valid, a notification will appear
            if (ValidationErrorsHandler.IsValid(_validator, Note))
            {
                _isFormValid = true;

                if (NoneCheck)
                {
                    Note.PointOfInterest = null;
                }

                if (Mode == Mode.add)
                {
                    AddNoteInDB();
                }
                else if (Mode == Mode.edit)
                {
                    UpdateExistingNote();
                    Messenger.Default.Send <int, NoteViewModel>(Note.Id);
                }

                EditableObject.EndEdit();
            }
            else
            {
                _isFormValid = false;
            }
        }
        public void AddEditTrip()
        {
            // If the form is not valid, a notification will appear
            if (ValidationErrorsHandler.IsValid(_validator, Trip))
            {
                _isFormValid    = true;
                Trip.FriendList = Utils.Utility.FriendToString(FriendList);
                // Adding a Trip
                if (Mode == Mode.add)
                {
                    AddTripInDB();
                    Messenger.Default.Send <string, MainViewModel>("");
                }
                else if (Mode == Mode.edit)
                {
                    UpdateExistingTrip();
                }

                EditableObject.EndEdit();
            }
            else
            {
                _isFormValid = false;
            }
        }
Exemplo n.º 4
0
 public void FinishTrip()
 {
     if (ValidationErrorsHandler.IsValid(_validator, Trip))
     {
         _isFormValid = true;
         DataServiceTrip dsTrip = new DataServiceTrip();
         dsTrip.UpdateTrip(Trip);
     }
     else
     {
         _isFormValid = false;
     }
 }
        /// <summary>
        /// Ajout d'un point d'intérêt
        /// </summary>
        public void AddPOI()
        {
            if (ValidationErrorsHandler.IsValid(_validator, PointOfInterest))
            {
                _isFormValid = true;
                // Adding a poi
                if (Mode == Mode.add || Mode == Mode.addFromExisting)
                {
                    AddPoiInDB();
                }
                else
                {
                    UpdateExistingPOI();
                }

                EditableObject.EndEdit();
            }
            else
            {
                _isFormValid = false;
            }
        }