public void load() { mybl = FactorySingletonBl.getInstanceBl(); br = mybl.search_b(MainWindow.order.Get_branch_id); if ((odL.Count == 0) && (br.get_menu != null)) // only do it once, and no empty menu { //return all available meals foreach (var item in br.get_menu) { dL.Add(mybl.search_d(item)); // add them to a list (like a copy constructor :) */ } foreach (var dish in dL) { Dish_to_OD tmpod = new Dish_to_OD(); tmpod.Calories = dish.get_cal; tmpod.dish_id = dish.Get_Dish_id; tmpod.dish_name = dish.Get_name; tmpod.d_price = dish.get_price; tmpod.size = dish.get_size; tmpod.type = dish.get_typ; tmpod.supervision = dish.get_sup; odL.Add(tmpod); } } }
List <Dish_to_OD> myMenu = new List <Dish_to_OD>(); // selected branch menu public void Load() { List <Branch> data = new List <Branch>(mybl.get_branch_list()); foreach (var branch in data) { Dish_to_OD tmpod = new Dish_to_OD(); tmpod.dish_name = branch.Get_name; tmpod.dish_id = branch.Get_Branch_id; tmpod.location = branch.get_location; bL.Add(tmpod); } dataGrid.ItemsSource = bL; }
public void Load() { t_list = mybl.client_order_history(MainWindow.client.Get_Cus_id); foreach (var item in t_list) { foreach (var items in item) { Dish_to_OD temp = new Dish_to_OD { dish_name = items.name, time = items.time.ToString(), amount = items.number, size = items.size, supervision = items.supervision, type = items.type, Calories = items.calories, d_price = items.oo_number }; amount += items.number; calories += items.calories; price += items.oo_number; MDL.Add(temp); } } }
public void load() { dL = mybl.get_dish_list(); if ((odL.Count == 0)) // only do it once { //return all available meals foreach (var dish in dL) { if (dish.get_sup >= Add_Branch.sup) { Dish_to_OD tmpod = new Dish_to_OD(); tmpod.Calories = dish.get_cal; tmpod.dish_id = dish.Get_Dish_id; tmpod.dish_name = dish.Get_name; tmpod.d_price = dish.get_price; tmpod.size = dish.get_size; tmpod.type = dish.get_typ; tmpod.supervision = dish.get_sup; tmpod.Check = false; odL.Add(tmpod); } } } }