public static void AddPhoneOrder(string operatorName, string logoImages, string phoneNumber)
 {
     PizzaVikiCategoriesEntities pizzaVikiDB = new PizzaVikiCategoriesEntities();
     pizzaVikiDB.PhoneOrders.AddObject(new PhoneOrder()
     {
         OperatorName = operatorName,
         LogoImage = logoImages,
         PhoneNumber = phoneNumber
     });
 }
        public static CategoryViewStyle GetCategoryViewStyles(string categoryName)
        {
            PizzaVikiCategoriesEntities pizzaVikiDB = new PizzaVikiCategoriesEntities();

            int categoryID = pizzaVikiDB.Categories.Single(x => x.Name.Equals(categoryName)).id;

            CategoryViewStyle catViewStyle = pizzaVikiDB.CategoriesViewStyles.Single(x => x.CategoryID == categoryID);

            return catViewStyle;
        }
        public static void AddCategory(string name, string backgroundImagePath, string link, string title)
        {
            PizzaVikiCategoriesEntities pizzaVikiDB = new PizzaVikiCategoriesEntities();
            pizzaVikiDB.Categories.AddObject(new Category()
            {
                Name = name,
                BackgroundImagePath = backgroundImagePath,
                Link = link,
                Title = title
            });

            pizzaVikiDB.SaveChanges();
        }
        public static List<Product> GetProductsByCategory(string categoryName)
        {
            PizzaVikiCategoriesEntities pizzaVikiDB = new PizzaVikiCategoriesEntities();

            int categoryID = pizzaVikiDB.Categories.Single(x => x.Name.Equals(categoryName)).id;

            var products =
                from product in pizzaVikiDB.Products
                where product.CategoryID == categoryID
                select product;

            return products.ToList();
        }
        public static void AddProduct(
            string categoryName, string productName, 
            string backgroundImagePath, string ingredients,
            string lowestPrice, string averagePrice,
            string highestPrice, float? weight)
        {
            PizzaVikiCategoriesEntities pizzaVikiDB = new PizzaVikiCategoriesEntities();

            int categoryID = pizzaVikiDB.Categories.Single(x => x.Name.Equals(categoryName)).id;

            pizzaVikiDB.Products.AddObject(new Product()
            {
                CategoryID = categoryID,
                Name = productName,
                BackgroundImagePath = backgroundImagePath,
                Ingredients = ingredients,
                LowestPrice = lowestPrice,
                AveragePrice = averagePrice,
                HighestPrice = highestPrice,
                Weight = weight,
            });

            pizzaVikiDB.SaveChanges();
        }
        public static List<Category> GetCategories()
        {            
            PizzaVikiCategoriesEntities pizzaVikiDB = new PizzaVikiCategoriesEntities();

            return pizzaVikiDB.Categories.ToList();
        }
        public static List<SubArea> GetSubAreas()
        {
            PizzaVikiCategoriesEntities pizzaVikiDB = new PizzaVikiCategoriesEntities();

            return pizzaVikiDB.SubAreas.ToList();            
        }
        public static List<PhoneOrder> GetPhoneOrders()
        {
            PizzaVikiCategoriesEntities pizzaVikiDB = new PizzaVikiCategoriesEntities();

            return pizzaVikiDB.PhoneOrders.ToList();
        }