예제 #1
0
        private void btnChange_Click(object sender, RoutedEventArgs e)
        {
            // Make sure the sure the user has selected an item in the listview
            if (lvEmployeeList.SelectedItem == null)
            {
                MessageBox.Show("Markera en anställd att ändra", "Ingen anställd vald");
                return;
            }

            // Initilize a new window for editing an employee
            EmployeeManager em = new EmployeeManager(SelectedEmployee);

            // Show the window
            em.ShowDialog();

            // If the users presses OK, update the item
            if (em.DialogResult.Equals(true))
            {
                // Update the database context
                EmployeeManagement.Instance.UpdateEmployee();
            }
        }
예제 #2
0
        private void btnAddEmployee_Click(object sender, RoutedEventArgs e)
        {
            EmployeeManager employeeManager = new EmployeeManager();

            employeeManager.ShowDialog();
        }