Example #1
0
        public List<RecipeEN> getRecipes(string identificador)
        {
            RecipeCAD recipes = new RecipeCAD();

            return recipes.getRecipes(identificador, this);
        }
Example #2
0
 public bool INSERT()
 {
     RecipeCAD u = new RecipeCAD();
     if (u.addRecipe(this))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Example #3
0
        public RecipeEN getRecipe(int id)
        {
            RecipeCAD recipe = new RecipeCAD();

            return recipe.getRecipe(id);
        }
Example #4
0
 public BookEN getBook()
 {
     RecipeCAD recipe = new RecipeCAD();
     return recipe.getBook(this);
 }
Example #5
0
 /*public bool UPDATE()
 {
     RecipeCAD u = new RecipeCAD();
     if (u.updateRecipe(this, id))
     {
         return true;
     }
     else
     {
         return false;
     }
 }*/
 public bool DELETE()
 {
     RecipeCAD u = new RecipeCAD();
     if (u.deleteRecipe(this))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Example #6
0
        public List<CommentEN> CommentsPerRecipe(RecipeEN recipe)
        {
            RecipeCAD receta = new RecipeCAD();

            return receta.getComments(recipe);
        }
Example #7
0
        // Returns a list with the recipes that a user have done
        public List<RecipeEN> RecipesUser(UserEN user)
        {
            List<RecipeEN> lista = new List<RecipeEN>();
            RecipeCAD recipeCad = new RecipeCAD();
            RecipeEN recipe;
            SqlConnection c = new SqlConnection(db);
            try
            {
                c.Open();
                SqlCommand com = new SqlCommand("SELECT Id FROM Recipe WHERE User = '******'", c);
                SqlDataReader dr = com.ExecuteReader();
                while (dr.Read())
                {
                    recipe = recipeCad.getRecipe(long.Parse(dr["Id"].ToString()));

                    lista.Add(recipe);
                }
                dr.Close();
            }
            catch (Exception ex) { }
            finally
            {
                c.Close();
            }
            return lista;
        }