Examples of Ingredient4Recipe


Examples of adios.model.Ingredient4Recipe

    if(ingredientTableList != null){
      Iterator<TableRecipeIngredient> it = ingredientTableList.iterator();
      TableRecipeIngredient tab=null;
      Ingredient i =null;
      while(it.hasNext()){
        Ingredient4Recipe i4rResult = new Ingredient4Recipe();
        tab = it.next();
        i = ingredientDao.getIngredientForId(tab.getIngredientId());
        i4rResult.setName(i.getName());
        i4rResult.setQuantity(tab.getIngQuantity());
        i4rResult.setUnit(tab.getIngUnit());
       
        i4rList.add(i4rResult);
      }
    }
   
View Full Code Here

Examples of adios.model.Ingredient4Recipe

    ArrayList<Ingredient> ingList = ingredientDao.getMostUsedIng();
    Iterator<Ingredient> it =  ingList.iterator();
    Ingredient i =null;
   
    while(it.hasNext()){
      Ingredient4Recipe i4rResult = new Ingredient4Recipe();
      i = it.next();     
      i4rResult.setName(i.getName());
      i4rResult.setIngrdientId(i.getIngredientId());
      i4rList.add(i4rResult);
    }
   
    return i4rList; 
  }
View Full Code Here

Examples of adios.model.Ingredient4Recipe

          Log.info("/receta/{recipeId}.html");
         
          Recipe r=new Recipe();
          r.setRecipeId(recipeId);
         
          Ingredient4Recipe i4r = new Ingredient4Recipe();
          i4r.setRecipeId(r.getRecipeId());
         
          ArrayList<Ingredient4Recipe> i4rList =  ingredientService.getIngredientsForRecipe(i4r);
         
        ModelAndView view = new ModelAndView("html/recipePage");
        view.addObject("recipe", recipeService.getRecipe(recipeId));
View Full Code Here

Examples of adios.model.Ingredient4Recipe

            while(recipesIdIter.hasNext()){
              Integer i =recipesIdIter.next();
              Recipe r = recipeService.getRecipe(i.intValue());
              rList.add(r);
         
          Ingredient4Recipe i4r = new Ingredient4Recipe();
              i4r.setRecipeId(r.getRecipeId());
              ArrayList<Ingredient4Recipe> i4rList =  ingredientService.getIngredientsForRecipe(i4r);
          Iterator<Ingredient4Recipe> i4rIter = i4rList.iterator();
              while (i4rIter.hasNext()){
                i4r = i4rIter.next();
                if(ingHT.containsKey(i4r.getName())){
                  Ingredient4Recipe i4rTmp = (Ingredient4Recipe) ingHT.get(i4r.getName());
                  i4rTmp.setQuantity(i4rTmp.getQuantity()+i4r.getQuantity());
                  ingHT.put(i4rTmp.getName(), i4rTmp);                                   
                }else{
                  ingHT.put(i4r.getName(), i4r);                 
                }
               
              }
View Full Code Here

Examples of adios.model.Ingredient4Recipe

         
         
          Recipe r = recipeService.getRecipe(recipeId);
         
          Ingredient4Recipe i4r = new Ingredient4Recipe();
          i4r.setRecipeId(r.getRecipeId());
         
          ArrayList<Ingredient4Recipe> i4rList =  ingredientService.getIngredientsForRecipe(i4r);
         
        ModelAndView view = new ModelAndView("html/recipePage");
        view.addObject("recipe", recipeService.getRecipe(recipeId));
View Full Code Here

Examples of adios.model.Ingredient4Recipe

          String ingName = request.getParameter("name");
          String ingUnit = request.getParameter("unit");
          String ingQuantity = request.getParameter("quantity");
          try{
            Recipe r = (Recipe)request.getSession().getAttribute("recipe");
            Ingredient4Recipe i = new Ingredient4Recipe();
            i.setQuantity(Integer.parseInt(ingQuantity));
            i.setName(ingName);
            i.setRecipeId(r.getRecipeId());
            i.setUnit(ingUnit);
           
            ingredientService.addIngredient(i);
           
            request.getSession().setAttribute("recipe", r);
          }catch(Exception e){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.