Beispiel #1
0
 private void OnEmployerSelected(object sender, SelectionChangedEventArgs e)
 {
     if (DataGridEmployers.SelectedItem != null)
     {
         EmployerUnit eu = (EmployerUnit)DataGridEmployers.SelectedItem;
         TextInfoLogin.Text       = eu.Login;
         TextInfoPassword.Text    = eu.Password;
         TextInfoClassNumber.Text = eu.ClassNumber;
     }
 }
Beispiel #2
0
        private void DeleteEmployer(object sender, RoutedEventArgs e)
        {
            if (DataGridEmployers.SelectedItem != null)
            {
                /*ListEmployer.Remove((EmployerUnit)DataGridEmployers.SelectedItem);*/
                EmployerUnit  eu         = (EmployerUnit)DataGridEmployers.SelectedItem;
                SqlConnection connection = new SqlConnection("Server=localhost\\SQLEXPRESS;Database=master;Trusted_Connection=True;");
                SqlCommand    command    = new SqlCommand("USE SchoolBase DELETE FROM dbo.SchoolEmployees WHERE [Идентификатор] = " + eu.Id + "", connection);
                connection.Open();
                command.ExecuteNonQuery();
                connection.Close();

                ListEmployer.Remove(eu);
            }
        }
 public UserEmployerEditor(EmployerUnit e)
 {
     InitializeComponent();
     employer = e;
     if (employer != null)
     {
         TextID.Text          = employer.Id + "";
         TextLogin.Text       = employer.Login;
         TextPassword.Text    = employer.Password;
         TextName.Text        = employer.Name;
         TextSurname.Text     = employer.Surname;
         TextPosition.Text    = employer.Position;
         TextClassNumber.Text = employer.ClassNumber;
     }
 }