private void buttonAdd_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         EmployeeAddOrEditWindow dialog = new EmployeeAddOrEditWindow();
         if (dialog.ShowDialog() == true)
         {
             this.DoRefresh();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
 private void buttonEdit_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         CFG_Employee cfgEmployee = (CFG_Employee)this.dataGrid.SelectedItem;
         if (cfgEmployee != null)
         {
             EmployeeAddOrEditWindow dialog = new EmployeeAddOrEditWindow(cfgEmployee.Id);
             if (dialog.ShowDialog() == true)
             {
                 this.DoRefresh();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }