public List <Food> GetAllFoodsByCategory(string categoryName) { CategoryDataAccess categoryDataAccess = new CategoryDataAccess(); int categoryId = categoryDataAccess.GetCategoryId(categoryName); this.foodDataAccess = new FoodDataAccess(); return(this.foodDataAccess.GetFoodsByCategoryId(categoryId)); }
public int AddNewFood(string foodName, double foodprice, string categoryName) { CategoryDataAccess categoryDataAccess = new CategoryDataAccess(); int categoryId = categoryDataAccess.GetCategoryId(categoryName); Food food = new Food() { FoodName = foodName, FoodPrice = foodprice, CategoryId = categoryId }; this.foodDataAccess = new FoodDataAccess(); return(this.foodDataAccess.AddFood(food)); }
public int UpdateExistingFood(int foodId, string foodName, double foodprice, string categoryName) { CategoryDataAccess categoryDataAccess = new CategoryDataAccess(); int categoryId = categoryDataAccess.GetCategoryId(categoryName); Food food = new Food() { FoodId = foodId, FoodName = foodName, FoodPrice = foodprice, CategoryId = categoryId }; this.foodDataAccess = new FoodDataAccess(); return(this.foodDataAccess.UpdateFood(food)); }
public int AddNewOrder(string customerName, int customerNumber, string orderdCategory, string orderdFood, int price, string DeliveryType, string categoryName) { CategoryDataAccess categoryDataAccess = new CategoryDataAccess(); int categoryId = categoryDataAccess.GetCategoryId(categoryName); Order order = new Order() { CustomerName = customerName, CustomerNumber = customerNumber, OrderdCategory = orderdCategory, OrderdFood = orderdFood, }; this.orderDataAccess = new OrderDataAccess(); return(this.orderDataAccess.AddOrder(order)); }