示例#1
0
        /// <summary>
        /// Author: Caitlin Abelson
        /// Created Date: 2/7/19
        ///
        /// This opens with window to add a new employee
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnAddEmployee_Click(object sender, RoutedEventArgs e)
        {
            var createEmployee = new EmployeeDetail();

            createEmployee.ShowDialog();
            refreshAllEmployees();
            populateEmployees();
        }
示例#2
0
        /// <summary>
        /// Author: Caitlin Abelson
        /// Created Date: 2/7/19
        ///
        /// Opens the window to read the information for the chosen employee.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DgEmployees_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            Employee chosenEmployee = new Employee();

            chosenEmployee = (Employee)dgEmployees.SelectedItem;
            try
            {
                var readUpdateEmployee = new EmployeeDetail(chosenEmployee);
                readUpdateEmployee.ShowDialog();

                refreshAllEmployees();
                populateEmployees();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to find Employee." + ex.Message);
            }
        }
示例#3
0
        /// <summary>
        /// James Heim
        /// Created 2019-04-26
        ///
        /// View the Employee Detail (if exists) for the selected ViewModel.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnViewEmployee_Click(object sender, RoutedEventArgs e)
        {
            if (_selectedItem != null && _selectedItem.EmployeeID != null)
            {
                Employee employee = null;

                try
                {
                    employee = _employeeManager.SelectEmployee((int)_selectedItem.EmployeeID);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                if (employee != null)
                {
                    EmployeeDetail window = new EmployeeDetail(employee);
                    window.ShowDialog();
                }
            }
        }