示例#1
0
        public BLDish ChargeDish(int code)
        {
            DAODish dv     = new DAODish();
            Dish    dish   = dv.ChargeDish(code);
            BLDish  bldish = new BLDish(dish.DishCode, dish.DishName, dish.DishDescription, dish.DishPrice, dish.DishAvailable, dish.DishPhoto);

            return(bldish);
        }
示例#2
0
        public void addDish(BLDish bldish)
        {
            DAODish dv     = new DAODish();
            Dish    todish = new Dish()
            {
                DishCode = bldish.Code, DishName = bldish.Name, DishDescription = bldish.Description, DishPrice = bldish.Price, DishAvailable = bldish.State, DishPhoto = bldish.Picture
            };

            dv.addDish(todish);
        }
示例#3
0
        public void ShoppingDishCar(BLDish bldish, int quantity)
        {
            OrderDetail TemporaryOrder = new OrderDetail();

            TemporaryOrder.DishCode     = bldish.Code;
            TemporaryOrder.DishPrice    = bldish.Price;
            TemporaryOrder.DishQuantity = quantity;
            TemporaryOrder.SubTotal     = CalculateSubtotalOrderDetail(quantity, bldish.Price);
            TemporaryOrder.Dish         = GetDish(bldish);
            TemporaryDishList.Add(TemporaryOrder);
        }
示例#4
0
        public ArrayList DishesList()
        {
            DAODish     dv   = new DAODish();
            List <Dish> list = dv.DishesList();

            foreach (Dish dish in list)
            {
                BLDish bldhs = new BLDish(dish.DishCode, dish.DishName, dish.DishDescription, dish.DishPrice, dish.DishAvailable, dish.DishPhoto);
                DishesLists.Add(bldhs);
            }
            return(DishesLists);
        }
示例#5
0
        public ArrayList chargeRelatedDishes(string word)
        {
            DAODish     dv     = new DAODish();
            List <Dish> dishes = dv.ChargeRelatedDish(word);
            ArrayList   array  = new ArrayList();

            foreach (var item in dishes)
            {
                BLDish blDish = new BLDish(item.DishCode, item.DishName, item.DishDescription, item.DishPrice, item.DishAvailable, item.DishPhoto);
                array.Add(blDish);
            }
            return(array);
        }
示例#6
0
        public List <BLDish> DishesList()
        {
            List <BLDish> ListD = new List <BLDish>();
            BLDish        bld   = new BLDish();

            foreach (BLDish dish in bld.DishesList())
            {
                if (dish.State == true)
                {
                    ListD.Add(dish);
                }
            }
            return(ListD);
        }
示例#7
0
        public Dish GetDish(BLDish bldish)
        {
            BLDish bldsh = new BLDish();

            bldsh = bldish.ChargeDish(bldish.Code);
            Dish dsh = new Dish();

            dsh.DishCode        = bldsh.Code;
            dsh.DishName        = bldsh.Name;
            dsh.DishDescription = bldsh.Description;
            dsh.DishPrice       = bldsh.Price;
            dsh.DishPhoto       = bldsh.Picture;
            dsh.DishAvailable   = bldsh.State;
            return(dsh);
        }
示例#8
0
        public List <BLDish> FilterDishes(int code)
        {
            List <BLDish> ListD        = DishesList();
            List <BLDish> dishToReturn = new List <BLDish>();
            BLDish        bld          = new BLDish();

            foreach (BLDish dish in bld.DishesList())
            {
                if (dish.Code == code)
                {
                    dishToReturn.Add(dish);
                }
            }
            return(dishToReturn);
        }
示例#9
0
        public void updateDishes(BLDish bldish)
        {
            DishesList();
            DAODish dv = new DAODish();

            foreach (BLDish dish in DishesLists)
            {
                if (dish.Code == bldish.Code)
                {
                    Dish todish = new Dish()
                    {
                        DishCode = bldish.Code, DishName = bldish.Name, DishDescription = bldish.Description, DishPrice = bldish.Price, DishAvailable = bldish.State, DishPhoto = bldish.Picture
                    };
                    dv.updateDish(todish);
                    return;
                }
            }
        }