private void btnAddTrainee_Click(object sender, RoutedEventArgs e)
        {
            string  content   = "Add";
            trainee mytrainee = new trainee(content);

            this.Close();
            mytrainee.Show();
        }
        private void dataGridTrainees_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (dataGridTrainee.SelectedItems == null)
            {
                return;
            }
            var     selectedTrainees = dataGridTrainee.SelectedItem as Trainee;
            trainee myTrainee        = new trainee("View", selectedTrainees.ID);

            this.Close();
            myTrainee.Show();
        }
        private void BtnOKID_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Convert.ToInt32(txtID.Text) < 100000000 || Convert.ToInt32(txtID.Text) > 999999999)
                {
                    throw new Exception("Non-valid Id. Please enter a valid Id.");
                }

                var found = bl.findById(Convert.ToInt32(txtID.Text));
                if (action == "remove")
                {
                    string  content   = "Remove";
                    trainee MyTrainee = new trainee(content, Convert.ToInt32(txtID.Text));
                    this.Close();
                    MyTrainee.Show();
                }
                else if (action == "update")
                {
                    string  content   = "Update";
                    trainee myTrainee = new trainee(content, Convert.ToInt32(txtID.Text));
                    this.Close();
                    myTrainee.Show();
                }
                else
                {
                    string  content   = "View";
                    trainee myTrainee = new trainee(content, Convert.ToInt32(txtID.Text));
                    this.Close();
                    myTrainee.Show();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                txtID.Text         = "";
                txtID.Visibility   = System.Windows.Visibility.Hidden;
                labelid.Visibility = System.Windows.Visibility.Hidden;
                btnOKID.Visibility = System.Windows.Visibility.Hidden;
            }
        }
        private void trainee(object sender, RoutedEventArgs e)
        {
            Window gotrainee = new trainee();

            gotrainee.Show();
        }