public ReciepeWindow(Reciepe reciepe) { InitializeComponent(); VM = new ReciepeVM2(); VM.Reciepe = reciepe; DataContext = VM; }
public ChangeReciepeWindow(Reciepe selectedReciepe) { InitializeComponent(); VM = new ChangeReciepeVM(); VM.Name = selectedReciepe.ReciepeName; VM.SelectedReciepetype = selectedReciepe.ReciepeType; VM.PhotoPath = selectedReciepe.PhotoPath; VM.SelectedCuisine = selectedReciepe.Cuisine; VM.Cookingtime = selectedReciepe.CookingTime; VM.Raiting = selectedReciepe.Rating; VM.Calories = selectedReciepe.Calories; VM.Components = selectedReciepe.Ingredients; VM.ReciepeText = selectedReciepe.Instruction; VM.Id = selectedReciepe.Id; DataContext = VM; for (int i = 1; i < 11; i++) { comboBoxRating.Items.Add(i); } }
public Order(Order o) { this.priority = o.priority; this.number = o.number; this.reciepe = reciepe; }
public GameLogik() { map = new Map(); teams = new HashSet <Team>(); recipes = new Dictionary <Products, Reciepe>(); Reciepe r; r = new Reciepe(); r.product = Products.Ironore; r.factory = Factories.IronMine; r.ingredents = new Dictionary <Products, int>(); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.Iron; r.factory = Factories.MetalFactory; r.ingredents = new Dictionary <Products, int>(); r.ingredents.Add(Products.Ironore, 1); r.ingredents.Add(Products.Coal, 1); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.Coal; r.factory = Factories.CoalMine; r.ingredents = new Dictionary <Products, int>(); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.CopperOre; r.factory = Factories.CopperMine; r.ingredents = new Dictionary <Products, int>(); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.Copper; r.factory = Factories.MetalFactory; r.ingredents = new Dictionary <Products, int>(); r.ingredents.Add(Products.CopperOre, 1); r.ingredents.Add(Products.Coal, 1); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.LeadOre; r.factory = Factories.LeadMine; r.ingredents = new Dictionary <Products, int>(); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.Lead; r.factory = Factories.MetalFactory; r.ingredents = new Dictionary <Products, int>(); r.ingredents.Add(Products.LeadOre, 1); r.ingredents.Add(Products.Coal, 1); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.Steel; r.factory = Factories.MetalFactory; r.ingredents = new Dictionary <Products, int>(); r.ingredents.Add(Products.Iron, 1); r.ingredents.Add(Products.Coal, 2); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); }
static void Main(string[] args) { using (var context = new Context()) { var department1 = new Department() { Title = "Produce" }; var department2 = new Department() { Title = "Dairy" }; var reciepe1 = new Reciepe() { Name = "Mac&Cheese" }; var reciepe2 = new Reciepe() { Name = "Fruit Salad" }; var reciepe3 = new Reciepe() { Name = "PB&J" }; var role1 = new Role() { Name = "Dinner" }; var role2 = new Role() { Name = "Lunch" }; var role3 = new Role() { Name = "Breakfast" }; var foodItem1 = new FoodItem() { Department = department1, FoodName = "Banana", ItemNumber = 1, PublishedOn = DateTime.Today }; foodItem1.AddReciepe(reciepe1, role1); foodItem1.AddReciepe(reciepe2, role2); var foodItem2 = new FoodItem() { Department = department2, FoodName = "Orange", ItemNumber = 2, PublishedOn = DateTime.Today }; foodItem2.AddReciepe(reciepe1, role1); foodItem2.AddReciepe(reciepe2, role2); var foodItem3 = new FoodItem() { Department = department1, FoodName = "Bread", ItemNumber = 3, PublishedOn = DateTime.Today }; foodItem3.AddReciepe(reciepe1, role1); foodItem3.AddReciepe(reciepe3, role2); context.FoodItems.Add(foodItem1); context.FoodItems.Add(foodItem2); context.FoodItems.Add(foodItem3); context.SaveChanges(); var foodItems = context.FoodItems .Include(fi => fi.Department) .Include(fi => fi.Reciepes.Select(a => a.Reciepe)) .Include(fi => fi.Reciepes.Select(a => a.Role)) .ToList(); foreach (var foodItem in foodItems) { var reciepeRoleNames = foodItem.Reciepes .Select(a => $"{a.Reciepe.Name} - {a.Role.Name}").ToList(); var reciepeRolesDisplayText = string.Join(", ", reciepeRoleNames); Console.WriteLine(foodItem.DisplayText); Console.WriteLine(reciepeRolesDisplayText); } Console.ReadLine(); } }
public GameLogik() { map = new Map(); teams = new HashSet<Team>(); recipes = new Dictionary<Products, Reciepe>(); Reciepe r; r = new Reciepe(); r.product = Products.Ironore; r.factory = Factories.IronMine; r.ingredents = new Dictionary<Products, int>(); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.Iron; r.factory = Factories.MetalFactory; r.ingredents = new Dictionary<Products, int>(); r.ingredents.Add(Products.Ironore, 1); r.ingredents.Add(Products.Coal, 1); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.Coal; r.factory = Factories.CoalMine; r.ingredents = new Dictionary<Products, int>(); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.CopperOre; r.factory = Factories.CopperMine; r.ingredents = new Dictionary<Products, int>(); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.Copper; r.factory = Factories.MetalFactory; r.ingredents = new Dictionary<Products, int>(); r.ingredents.Add(Products.CopperOre, 1); r.ingredents.Add(Products.Coal, 1); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.LeadOre; r.factory = Factories.LeadMine; r.ingredents = new Dictionary<Products, int>(); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.Lead; r.factory = Factories.MetalFactory; r.ingredents = new Dictionary<Products, int>(); r.ingredents.Add(Products.LeadOre, 1); r.ingredents.Add(Products.Coal, 1); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); r = new Reciepe(); r.product = Products.Steel; r.factory = Factories.MetalFactory; r.ingredents = new Dictionary<Products, int>(); r.ingredents.Add(Products.Iron, 1); r.ingredents.Add(Products.Coal, 2); r.difficulty = 0; r.time = 1000; recipes.Add(r.product, r); }