Пример #1
0
        private void DataGridCell_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            DataRowView row = (DataRowView)table.SelectedItems[0];
            int         id  = Convert.ToInt32(row.Row.ItemArray[0]);

            if (currentTable == "Countries")
            {
                EditCountryWindow editCountry = new EditCountryWindow(id, table);
                editCountry.ShowDialog();
            }
            else if (currentTable == "Manufacturers")
            {
                EditManufacturerWindow editManufacturer = new EditManufacturerWindow(id, table);
                editManufacturer.ShowDialog();
            }
            else if (currentTable == "Drugs")
            {
                EditDrugWindow editDrug = new EditDrugWindow(id, table);
                editDrug.ShowDialog();
            }
            else
            {
                EditSymptomWindow editSymptom = new EditSymptomWindow(id, table);
                editSymptom.ShowDialog();
            }
        }
Пример #2
0
 private void AddButton_Click(object sender, RoutedEventArgs e)
 {
     if (currentTable == "Countries")
     {
         EditCountryWindow editCountry = new EditCountryWindow(table);
         editCountry.ShowDialog();
     }
     else if (currentTable == "Manufacturers")
     {
         EditManufacturerWindow editManufacturer = new EditManufacturerWindow(table);
         editManufacturer.ShowDialog();
     }
     else if (currentTable == "Drugs")
     {
         EditDrugWindow editDrug = new EditDrugWindow(table);
         editDrug.ShowDialog();
     }
     else
     {
         EditSymptomWindow editSymptom = new EditSymptomWindow(table);
         editSymptom.ShowDialog();
     }
 }