/// <summary> /// Carrega uma mesa para exibir os produtos e demais informações. /// </summary> /// <param name="tableIndex">Índice da mesa a ser carregada</param> private void LoadTable(int tableIndex) { this.currentTable = this.lstTables[tableIndex]; this.groupBoxProducts.Text = string.Format("Listagem de Produtos (Mesa {0:00})", tableIndex + 1); this.listBoxProducts.Items.Clear(); this.listBoxProducts.Items.Add(LIST_BOX_HEADER); this.listBoxProducts.Items.AddRange(this.lstTables[tableIndex].LstProducts.ToArray()); CountItemsAndCalculateSubtotal(tableIndex); }
/// <summary> /// Inicializa cada mesa com número e uma lista vazia de produtos. /// </summary> private void InitializeTables() { Table table; this.lstTables = new List<Table>(); for (int i = 0; i < 25; i++) { table = new Table(i + 1, new List<Product>()); this.lstTables.Add(table); } }