private void EIECSave_Click(object sender, RoutedEventArgs e) { try { EIECClass eiec = EIECBdGrid.SelectedItem as EIECClass; bdClassUpdate.UpdateEIEC(eiec.Id, (DateTime)EIECDate.SelectedDate, EIdName.SelectedItem.ToString(), ECIdName.SelectedItem.ToString(), Int32.Parse(EIECPrice.Text), Int32.Parse(EIECFreeSpaces.Text), Int32.Parse(EIECReservedSpaces.Text)); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { refreshEIECBdGrid(); } }
private void EIECDelete_Click(object sender, RoutedEventArgs e) { try { if (EIECBdGrid.SelectedItem != null) { EIECClass eiec = EIECBdGrid.SelectedItem as EIECClass; bdClassDelete.DeleteRowTable(eiec.Id, "EIEC"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { refreshEIECBdGrid(); } }
private void EIECBdGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (EIECBdGrid.SelectedItem != null) { EIECClass eiec = EIECBdGrid.SelectedItem as EIECClass; EIECDate.SelectedDate = eiec.Date; int indexExhibitions = EIdName.Items.IndexOf(eiec.ExhibitionName); EIdName.SelectedItem = EIdName.Items.GetItemAt(indexExhibitions); int indexExhibitionCenters = ECIdName.Items.IndexOf(eiec.ExhibitionHallsName); ECIdName.SelectedItem = ECIdName.Items.GetItemAt(indexExhibitionCenters); EIECPrice.Text = eiec.Price.ToString(); EIECFreeSpaces.Text = eiec.FreeSpaces.ToString(); EIECReservedSpaces.Text = eiec.FreeSpaces.ToString(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }