Esempio n. 1
0
        private void ButtonEdit_Click(object sender, RoutedEventArgs e)
        {
            int selectedIndex = dataGridEmployeeSpravichnic.SelectedIndex;

            if (selectedIndex < 0)
            {
                MessageBox.Show("Не выбран сотрудник для редактирования");
                return;
            }

            var ap = new DBManager().getEmployeeList();

            Models.ModelEmployee modelEmployee = null;
            foreach (var it in ap)
            {
                if (it.ID_Authorization == Employees[selectedIndex].ID_Authorization)
                {
                    modelEmployee = it;
                    break;
                }
            }

            var ce = new EmployeeSpravochnikEdit(modelEmployee);

            ce.ShowDialog();
        }
Esempio n. 2
0
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            var ce = new EmployeeSpravochnikEdit(null);

            ce.ShowDialog();
        }