//public Image Photo { get; set; } #endregion /// <summary> /// Initializes a new instance of the Dish class to the value indicated /// by the given parameters. /// </summary> /// /// <param name="name">Dish's name</param> /// <param name="size">Dish's size</param> /// <param name="price">Dish's price</param> /// <param name="kosher">Dish's kashrut</param> public Dish(string name, string description, SIZE size, double price = 0, KOSHER kosher = KOSHER.Rabanut, DISH_TYPE dishType = DISH_TYPE.Fish) { Name = name; Description = description; Size = size; Price = price; Kosher = kosher; DishType = dishType; }
public DishListPage(DISH_TYPE DishT) { InitializeComponent(); bl = FactoryBl.getBl(); dt = new DishType(); dt.DT = DishT; this.DataContext = dt; this.DishListBox.ItemsSource = bl.dishesForDishType(dt.DT); }
public IEnumerable <Dish> dishesForDishType(DISH_TYPE dishType) { var x = dishesPerDishType(); List <Dish> d = new List <Dish>(); foreach (var item in x) { if (item.Key == dishType) { foreach (var Item in item) { d.Add(Item); } } } return(d); }
public double revenueForDishType(DISH_TYPE dishType) { var x = from item in dal.getODList() group item by dal.getDish(item.DishID).DishType into g select g; double sum = 0; foreach (var item in x) { if (item.Key == dishType) { foreach (var a in item) { sum += dal.getDish(a.DishID).Price; } } } return(sum); }