private void Btn_Edit_Room_Click(object sender, EventArgs e) { if (dgv_showRooms.SelectedRows.Count == 1) { DataGridViewRow selectedRow = dgv_showRooms.SelectedRows[0]; Room room = (Room)selectedRow.Tag; EditRoom editRoom = new EditRoom(rooms, room, roomsPath, bookings, bookingsPath); editRoom.SaveObjects += SaveObjects; editRoom.ShowDialog(); displayList(); } }
private void editeazaToolStripMenuItem_Click(object sender, EventArgs e) { DataGridViewCell selectedCol = dgv_showRooms.SelectedCells[0]; if (dgv_showRooms.SelectedCells.Count == 1) { DataGridViewRow selectedRow = selectedCol.OwningRow; Room room = (Room)selectedRow.Tag; EditRoom editRoom = new EditRoom(rooms, room, roomsPath, bookings, bookingsPath); editRoom.SaveObjects += SaveObjects; editRoom.ShowDialog(); displayList(); } }