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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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; } } }