Example #1
0
        private void AddDevice_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DeviceModel NewDevice = new DeviceModel
                {
                    Name              = NameDevice.Text,
                    Model             = ModelDevice.Text,
                    Manufacturer      = ManufacturerDevice.Text,
                    DescriptionDevice = DescriptionDevice.Text
                };
                DeviceLogic.RegistrationDevice(NewDevice);
                MessageBox.Show("Устройство успешно добавлено!");

                DeviceListWindow deviceList = new DeviceListWindow();
                deviceList.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }