public UpdateAccount(AdminDataGrid account) { UserName = account.StaffUserName; FirstName = account.StaffFirstName; LastName = account.StaffLastName; StaffTitle = account.StaffTitle; StaffID = account.StaffID; helperUserName = account.StaffUserName; InitializeComponent(); text_UserName.Focus(); }
private void EditAccount(object sender, MouseButtonEventArgs e) { try { DataGrid dg = sender as DataGrid; AdminDataGrid p = (AdminDataGrid)dg.SelectedItems[0]; // OR: Patient p = (Patient)dg.SelectedItem; UpdateAccount up = new UpdateAccount(p); up.UserRole.SelectedItem = p.StaffDBRole; up.ShowDialog(); } catch (Exception error) { } Refresh_AdminGrid(sender, e); }