Beispiel #1
0
        public async Task <bool> ValidateFormDetailsAndSave()
        {
            if (App.SelectedItem != null &&
                !string.IsNullOrWhiteSpace(App.SelectedItem.Title) &&
                !string.IsNullOrWhiteSpace(App.SelectedItem.Description) &&
                !string.IsNullOrWhiteSpace(App.SelectedItem.ImageUrl))
            {
                // save to database or model
                if (IsProcessBusy)
                {
                    return(false);
                }

                IsProcessBusy = true;

                await AzureDatabase.SaveWalkEntry(App.SelectedItem, isAdding);

                IsProcessBusy = false;
            }
            else
            {
                IsProcessBusy = false;
                return(false);
            }

            IsProcessBusy = false;
            return(true);
        }
Beispiel #2
0
        // Checks to see if we have provided a Title and Description
        public async Task <bool> ValidateFormDetailsAndSave()
        {
            if (App.SelectedItem != null &&
                !string.IsNullOrEmpty(App.SelectedItem.Title) &&
                !string.IsNullOrEmpty(App.SelectedItem.Description) &&
                !string.IsNullOrEmpty(App.SelectedItem.ImageUrl))
            {
                // Check our IsProcessBusy property to see if we are already processing
                if (IsProcessBusy)
                {
                    return(false);
                }

                // If we aren't processing, we need to set our IsProcessBusy property to true
                IsProcessBusy = true;

                // Save our Walk Entry details to our Microsoft Azure Database
                await AzureDatabase.SaveWalkEntry(App.SelectedItem, isAdding);

                IsProcessBusy = false;
            }
            else
            {
                // Initialise our IsProcessBusy property to false
                IsProcessBusy = false;
                return(false);
            }
            // Initialise our IsProcessBusy property to false
            IsProcessBusy = false;
            return(true);
        }