1
0
Fork 0

edit projection

This commit is contained in:
Tergel TSAGAAN 2021-01-07 15:25:14 +01:00 committed by flifloo
parent 28d2b300f1
commit ebfc03efdf

View file

@ -119,18 +119,13 @@ public class ProjectionHandler extends JDialog {
slotComboBox.removeAllItems();
roomComboBox.removeAllItems();
if (dayComboBox.getSelectedItem() != null) {
ArrayList<Slot> slots = null;
ArrayList<Slot> slots;
Competition competition = (Competition) competitionComboBox.getSelectedItem();
Date date = Date.valueOf((LocalDate) dayComboBox.getSelectedItem());
switch (projectionType) {
case ADD:
if (projectionType == ProjectionType.ADD)
slots = Slot.getAvailable(competition, date);
break;
case EDIT:
break;
case REMOVE:
else
slots = Slot.getAll(competition, date);
}
if (slots != null)
for (Slot s : slots)
slotComboBox.addItem(s);
@ -146,9 +141,8 @@ public class ProjectionHandler extends JDialog {
Date date = Date.valueOf((LocalDate) dayComboBox.getSelectedItem());
switch (projectionType) {
case ADD:
rooms = Room.getAvailable(movie, slot, date);
break;
case EDIT:
rooms = Room.getAvailable(movie, slot, date);
break;
case REMOVE:
rooms = Room.getAll(movie, slot, date);
@ -173,6 +167,11 @@ public class ProjectionHandler extends JDialog {
new Projection(date, competition, room, movie, slot);
break;
case EDIT:
if (projection != null)
projection.delete();
else
(Projection.find(date, competition, room, movie, slot)).delete();
new Projection(date, competition, room, movie, slot);
break;
case REMOVE:
if (projection != null)