Ejemplo n.º 1
0
        public IList <GroceryListItemEditVM> GenerateList(GroceryListRequest request)
        {
            var client = new HttpClientServiceBase <IList <GroceryListItemEditVM> >();

            return(client.Get(string.Format("api/GroceryList/GenerateToApp?UserIdentifier={0}&Start={1}&Finish={2}",
                                            request.UserIdentifier, request.Start, request.Finish)));
        }
Ejemplo n.º 2
0
        public IList <RecipeViewModel> Recipes(RecipeSearchQuery query)
        {
            List <RecipeViewModel> recipes = new List <RecipeViewModel>();

            var client = new HttpClientServiceBase <List <RecipeViewModel> >();

            string path =
                string.Format("api/recipesearch/getbyfilter?keyword={0}&category={1}",
                              query.Keyword, query.Category);

            return(client.Get(path));


            //recipes.Add(new RecipeViewModel { Id = Guid.NewGuid(), RecipeTypeName = "Peixes e Frutos do Mar", Title = "Filé de Peixe Assado", RecipeImage = "https://dummyimage.com/500x350/000/fff&text=Peixe" });
            //recipes.Add(new RecipeViewModel { Id = Guid.NewGuid(), RecipeTypeName = "Peixes e Frutos do Mar", Title = "Paella Valenciana", RecipeImage = "https://dummyimage.com/500x350/000/fff&text=Paella" });
            //recipes.Add(new RecipeViewModel { Id = Guid.NewGuid(), RecipeTypeName = "Peixes e Frutos do Mar", Title = "Cação ao Molho Vermelho", RecipeImage = "https://dummyimage.com/500x350/000/fff&text=Cação" });

            //recipes.Add(new RecipeViewModel { Id = Guid.NewGuid(), RecipeTypeName = "Carnes", Title = "BIFE A MILANESA", RecipeImage = "https://dummyimage.com/500x350/000/fff&text=Bife" });
            //recipes.Add(new RecipeViewModel { Id = Guid.NewGuid(), RecipeTypeName = "Carnes", Title = "VACA ATOLADA", RecipeImage = "https://dummyimage.com/500x350/000/fff&text=Vaca" });
            //recipes.Add(new RecipeViewModel { Id = Guid.NewGuid(), RecipeTypeName = "Carnes", Title = "BIFE A ROLÊ", RecipeImage = "https://dummyimage.com/500x350/000/fff&text=BifeARolê" });


            //if (query.Keyword != null)
            //{
            //    recipes = recipes
            //        .Where(x =>
            //        x.Title.Contains(query.Keyword) ||
            //        x.RecipeTypeName.Contains(query.Keyword)).ToList();
            //}

            //return recipes;
        }
Ejemplo n.º 3
0
        public RecipeViewModel GetRecipe(Guid id)
        {
            RecipeViewModel recipeViewModel = new RecipeViewModel();

            var client = new HttpClientServiceBase <RecipeViewModel>();

            return(client.Get(string.Format("api/recipesearch/getbyid?id={0}", id)));

            //recipeViewModel.Title = "Massa de panqueca";

            //recipeViewModel.Steps.Add(new MethodOfPreparationViewModel { Step = "1", Description = "Bata todos os ingredientes no liquidificador por 2 minutos" });
            //recipeViewModel.Steps.Add(new MethodOfPreparationViewModel { Step = "2", Description = "Em seguida desligue e, com uma colher, misture a farinha que grudou no copo do liquidificador" });
            //recipeViewModel.Steps.Add(new MethodOfPreparationViewModel { Step = "3", Description = "Bata novamente só para misturar, reserve" });
            //recipeViewModel.Steps.Add(new MethodOfPreparationViewModel { Step = "4", Description = "Unte a frigideira com um fio de óleo e leve ao fogo até aquecer" });
            //recipeViewModel.Steps.Add(new MethodOfPreparationViewModel { Step = "5", Description = "Com o auxílio de uma concha, pegue uma porção de massa e coloque na frigideira, gire a frigideira para espalhar bem a massa" });
            //recipeViewModel.Steps.Add(new MethodOfPreparationViewModel { Step = "6", Description = "Abaixe o fogo e deixe dourar por baixo, em seguida vire do outro lado e deixe dourar, repita o processo com toda a massa" });


            //recipeViewModel.Ingredients.Add(new IngredientViewModel
            //{
            //    ProductName = "Farinha de Trigo",
            //    Observation = "",
            //    UnitName = "xícaras(chá)",
            //    Quantity = 2
            //});

            //recipeViewModel.Ingredients.Add(new IngredientViewModel
            //{
            //    ProductName = "Leite",
            //    Observation = "",
            //    UnitName = "xícaras(chá)",
            //    Quantity = 2
            //});

            //recipeViewModel.Ingredients.Add(new IngredientViewModel
            //{
            //    ProductName = "Ovos",
            //    Observation = "",
            //    UnitName = "unidade",
            //    Quantity = 3
            //});

            //recipeViewModel.Ingredients.Add(new IngredientViewModel
            //{
            //    ProductName = "Sal",
            //    Observation = "",
            //    UnitName = "pitada",
            //    Quantity = 1
            //});

            //return recipeViewModel;
        }
Ejemplo n.º 4
0
        public DayOfWeekItemViewModel GetDay(PlanWeekQuery filter)
        {
            try
            {
                var client = new HttpClientServiceBase <DayOfWeekItemViewModel>();

                return(client.Get(string.Format("api/planweek/GetByDate?datefilter={0}&userEmail={1}", filter.DateFilter, filter.UserEmail)));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 5
0
        public void SaveDayPlan(SaveDayPlanRequest request)
        {
            var httpClient = new HttpClientServiceBase <SaveDayPlanRequest>();

            httpClient.Post("api/mealsplan/save", request);
        }