/* * 加载餐桌信息 * */ private void LoadAllTables() { int count = TableList.Items.Count; for (int i = 0; i < count; i++) { TableList.Items.RemoveAt(0); } tableInfoDatas = TableInfoConnector.GetTableInfoDatas(); foreach (TableInfoData table in tableInfoDatas) { InformationTable3 informationTable3 = new InformationTable3(); informationTable3.Left_TB.Text = table.TTitle; informationTable3.Mid_TB.Text = table.hall.HName; informationTable3.Right_TB.Text = table.TIsFree == 1 ? "是" : "否"; TableList.Items.Add(informationTable3); } }
/** * 模糊查询餐桌信息 * */ private void FindSimTable() { List <TableInfoData> tableInfoDatas = TableInfoConnector.GetTableInfoDatas(SearchTableName.Text, SearchHallCombo.SelectedIndex); int count = TableList.Items.Count; for (int i = 0; i < count; i++) { TableList.Items.RemoveAt(0); } foreach (TableInfoData table in tableInfoDatas) { InformationTable3 informationTable3 = new InformationTable3(); informationTable3.Left_TB.Text = table.TTitle; informationTable3.Mid_TB.Text = table.hall.HName; informationTable3.Right_TB.Text = table.TIsFree == 1 ? "是" : "否"; TableList.Items.Add(informationTable3); } }
/* * 选中餐桌显示在右侧 * */ private void TableList_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (TableList.SelectedIndex == -1) { return; } InformationTable3 informationTable3 = (InformationTable3)(TableList.SelectedItem); ModifyTableName.Text = informationTable3.Left_TB.Text; ModifyHallCombo.SelectedIndex = HallInfoConnector.GetHallInfoData(informationTable3.Mid_TB.Text).HId - 1; if (informationTable3.Right_TB.Text == "是") { FreeRadio.IsChecked = true; } else { NonFreeRadio.IsChecked = true; } }
/** * 加载所有菜品信息 * */ private void LoadAllDishes() { int count = DishList.Items.Count; for (int i = 0; i < count; i++) { DishList.Items.RemoveAt(0); } dishes = DishInfoConnector.GetDishes(); foreach (Dish dish in dishes) { InformationTable3 information = new InformationTable3(); information.Left_TB.Text = dish.DTitle; information.Mid_TB.Text = DishInfoConnector.GetTypeData(dish.DTypeId).DtTitle; information.Right_TB.Text = dish.DPrice.ToString(); DishList.Items.Add(information); } SearchDishTypeCombo.SelectedIndex = 0; }