public void ChangeStringSpaces()
 {
     foreach (Comment comment in this.commentsList)
     {
         comment.UserComment = ReadStringConverter.ChangeGetString(comment.UserComment);
     }
 }
Пример #2
0
 public void ChangeStringSpaces()
 {
     foreach (Notification notification in this.notificationsList)
     {
         notification.MessageType = ReadStringConverter.ChangeGetString(notification.MessageType);
     }
 }
        public void ChangeStringSpaces(byte option)
        {
            switch (option)
            {
            case 1:
                foreach (User user in this.usersList)
                {
                    user.Name = ReadStringConverter.ChangeGetString(user.Name);
                }

                break;

            case 2:
                foreach (Recipe recipe in this.recipesList)
                {
                    recipe.Name        = ReadStringConverter.ChangeGetString(recipe.Name);
                    recipe.CookingSpan = ReadStringConverter.ChangeGetString(recipe.CookingSpan);
                    recipe.EatingTime  = ReadStringConverter.ChangeGetString(recipe.EatingTime);
                    recipe.Ingredients = ReadStringConverter.ChangeGetString(recipe.Ingredients);
                    recipe.Steps       = ReadStringConverter.ChangeGetString(recipe.Steps);
                    recipe.Tags        = ReadStringConverter.ChangeGetString(recipe.Tags);
                }
                break;
            }
        }
Пример #4
0
 public void ChangeStringSpaces()
 {
     foreach (Recipe recipe in this.recipesList)
     {
         recipe.Name        = ReadStringConverter.ChangeGetString(recipe.Name);
         recipe.CookingSpan = ReadStringConverter.ChangeGetString(recipe.CookingSpan);
         recipe.EatingTime  = ReadStringConverter.ChangeGetString(recipe.EatingTime);
         recipe.Ingredients = ReadStringConverter.ChangeGetString(recipe.Ingredients);
         recipe.Steps       = ReadStringConverter.ChangeGetString(recipe.Steps);
         recipe.Tags        = ReadStringConverter.ChangeGetString(recipe.Tags);
     }
 }
Пример #5
0
        private async Task <Response> LoadCompanyData()
        {
            //Check internet connection
            var connection = await ApiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert(
                    "Error",
                    connection.Message,
                    "Accept");

                return(null);
            }

            //Creates the url needed to getthe information
            var url = "/companies/" + this.Email;

            //Asks the server for the list of recipes
            var response = await ApiService.Get <Company>(
                "http://localhost:8080/CookTime.BackEnd",
                "/api",
                url);

            if (!response.IsSuccess)
            {
                this.IsRefreshing = false;
                await Application.Current.MainPage.DisplayAlert( //if something goes wrong the page displays a message
                    "Welcome to CookTime",
                    "Add new recipes to have a complete MyMenu",
                    "Accept");

                return(null);
            }

            //Copies the list loaded from the server

            this.loggedCompany = (Company)response.Result;
            this.ServiceHours  = "Service Hours: " + ReadStringConverter.ChangeGetString(this.loggedCompany.ServiceSchedule);
            this.ContactMethod = "Contact Method: " + ReadStringConverter.ChangeGetString(this.loggedCompany.Contact);
            this.Latitud       = this.loggedCompany.Location[0];
            this.Longitud      = this.loggedCompany.Location[1];
            this.Admins        = this.loggedCompany.Admins;

            return(null);
        }