コード例 #1
0
        //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;
        }
コード例 #2
0
 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);
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }