private void editButton_Click(object sender, RoutedEventArgs e)
        {
            Client cl = new Client();

            int row = clientDataGrid.SelectedIndex;
            int id  = Convert.ToInt32((clientDataGrid.Columns[0].GetCellContent(clientDataGrid.Items[row]) as TextBlock).Text);

            try
            {
                using (var Db = new DatabaseContext())
                {
                    cl = Db.Client.FirstOrDefault(c => c.id == id);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Ошибка соединения с сервером!", "Ошибка соединения", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            addClientWindow addClientWindow = new addClientWindow(cl);

            addClientWindow.Show();
        }
Esempio n. 2
0
        private void menuAddClient_Click(object sender, RoutedEventArgs e)
        {
            addClientWindow addClientWindow = new addClientWindow();

            addClientWindow.Show();
        }
 private void menuAddClient_Click(object sender, RoutedEventArgs e)
 {
     addClientWindow addClientWindow = new addClientWindow();
     addClientWindow.Show();
 }