public void OnInfoPanelChooseButton_Click(int identNum) { InfoPanelDisplayInfoTextBox.Clear(); List <Locales> tiendasTotales = new List <Locales>(); List <Locales> cineTotales = new List <Locales>(); List <Locales> restTotales = new List <Locales>(); List <int> identTotales = new List <int>(); if (InfoPanelChooseButton_Clicked != null) { List <Locales> localesList = InfoPanelChooseButton_Clicked(this, new LocalesEventArgs()); if (localesList != null) { InfoPanelDisplayInfoTextBox.Visible = true; foreach (Locales local in localesList) { if (local.LocalType == "Tienda") { tiendasTotales.Add(local); foreach (Tienda tienda in tiendasTotales) { if (tienda.IdentifierNum == identNum) { InfoPanelDisplayInfoTextBox.Clear(); InfoPanelDisplayInfoTextBox.AppendText(tienda.ToString()); identTotales.Add(tienda.IdentifierNum); } } } else if (local.LocalType == "Cine") { cineTotales.Add(local); foreach (Cine cine in cineTotales) { if (cine.IdentifierNum == identNum) { InfoPanelDisplayInfoTextBox.Clear(); InfoPanelDisplayInfoTextBox.AppendText(cine.ToString()); identTotales.Add(cine.IdentifierNum); } } } else if (local.LocalType == "Rest") { restTotales.Add(local); foreach (Restaurant restaurant in restTotales) { if (restaurant.IdentifierNum == identNum) { InfoPanelDisplayInfoTextBox.Clear(); InfoPanelDisplayInfoTextBox.AppendText(restaurant.ToString()); identTotales.Add(restaurant.IdentifierNum); } } } if (identTotales.Contains(identNum) == false) { InfoPanelDisplayInfoTextBox.Clear(); InfoPanelDisplayInfoTextBox.AppendText("Este local no existe"); } } } } }
private void InfoPanelGoBackButton_Click(object sender, EventArgs e) { InitializePanel.BringToFront(); InfoPanelIdentNumTextbox.Clear(); InfoPanelDisplayInfoTextBox.Clear(); }