private void editRoom_MouseUp(object sender, MouseButtonEventArgs e) { DataRowView row = (DataRowView)roomsGrid.SelectedItem; if (row != null) { int id = (int)row["ID"]; string name = (string)row["Name"]; int size = (int)row["Size"]; string code = (string)row["Code"]; string building = (string)row["Building"]; string note = (string)row["Note"]; RoomAddEdit addEdit = new RoomAddEdit(); addEdit.Closed += (s, eventarg) => { rooms_Initialized(s, eventarg); }; addEdit.Owner = this; addEdit.txtId.Text = id.ToString(); addEdit.txtName.Text = name; addEdit.txtSize.Text = size.ToString(); addEdit.txtCode.Text = code; addEdit.txtNote.Text = note; addEdit.comboBox.Text = building; addEdit.ShowDialog(); } else { System.Windows.MessageBox.Show("Please select a row to edit!", "Information", MessageBoxButton.OK, MessageBoxImage.Exclamation); } }
private void addRoom_MouseUp(object sender, MouseButtonEventArgs e) { RoomAddEdit addEdit = new RoomAddEdit(); addEdit.Closed += (s, eventarg) => { rooms_Initialized(s, eventarg); }; addEdit.Owner = this; addEdit.ShowDialog(); }