Пример #1
0
        private void ButtonEditDepartment_Click(object sender, RoutedEventArgs e)
        {
            if (null == ListViewDepartaments.SelectedItem)
            {
                return;
            }
            Department editIt = (Department)ListViewDepartaments.SelectedItem;

            if (editIt.Id == 0)
            {
                SystemSounds.Hand.Play();
                MessageBox.Show("Это не отдел, его нельзя редактировать!", "Ошибочка вышла...", MessageBoxButton.OK,
                                MessageBoxImage.Warning);
                return;
            }
            EditDepartmentWindow editDepartment = new EditDepartmentWindow();

            editDepartment.Department = editIt;
            editDepartment.ShowDialog();
        }
Пример #2
0
        // окна редактирования
        private void OpenEditDepartmentWindowMethod(Department department)
        {
            EditDepartmentWindow newDepartmentWindow = new EditDepartmentWindow(department);

            SetCenterPositionOpen(newDepartmentWindow);
        }
Пример #3
0
        private void EditDepartmentWindow()
        {
            EditDepartmentWindow newEditDepartmentWindow = new EditDepartmentWindow();

            SetCurrentPositionAndOpenWindow(newEditDepartmentWindow);
        }