private void Updatelists() { ListViewGuardians.SelectedItem = null; ListViewChildren.SelectedItem = null; ListViewConnections.SelectedItem = null; children = DbOperations.GetAllChildren(); ListViewChildren.ItemsSource = children; guardian = DbOperations.GetAllGuardians(); ListViewGuardians.ItemsSource = guardian; connections = DbOperations.GetChildGuardian(); ListViewConnections.ItemsSource = connections; ListViewConnections.DisplayMemberPath = "Fullinformation"; classes = DbOperations.GetAllClasses(); comboBoxClass.ItemsSource = classes; comboBoxClass.DisplayMemberPath = "ClassName"; }
private void AddNewGuardian_Click(object sender, RoutedEventArgs e) { if (txtboxFirstNameGuardian != null || txtboxLastNameGuardian != null) { try { DbOperations.AddNewGuardian(Convert.ToInt32(txtboxPhoneGuardian.Text), txtboxFirstNameGuardian.Text, txtboxLastNameGuardian.Text, txtboxEmailGuardian.Text); ClearTextbox(); ListViewGuardians.ItemsSource = DbOperations.GetAllGuardians(); UpdatedMessage(); } catch (PostgresException ex) { MessageBox.Show(ex.Message); } } }
private void UpdateListViewGuardian() { guardians = DbOperations.GetAllGuardians(); listViewGuardian.Items.Refresh(); listViewGuardian.ItemsSource = guardians; }