Skip to content

Commit 95ca0c6

Browse files
committed
fixed reported bugs
1 parent 5116e4a commit 95ca0c6

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

login_activity.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,19 @@ FAILED: andy: 2020-12-09 22:38:14.242406 UTC
33
SUCCESS: test: 2020-12-09 22:38:15.851063 UTC
44
SUCCESS: admin: 2020-12-09 22:39:00.038085 UTC
55
SUCCESS: test: 2020-12-09 23:30:40.755351 UTC
6+
SUCCESS: test: 2020-12-11 02:24:19.28528 UTC
7+
SUCCESS: test: 2020-12-11 02:31:13.060535 UTC
8+
SUCCESS: test: 2020-12-11 02:35:35.291397 UTC
9+
SUCCESS: test: 2020-12-11 02:37:20.580016 UTC
10+
SUCCESS: test: 2020-12-11 02:38:38.742227 UTC
11+
SUCCESS: test: 2020-12-11 02:38:56.486514 UTC
12+
SUCCESS: test: 2020-12-11 02:40:25.990002 UTC
13+
SUCCESS: test: 2020-12-11 02:42:27.941055 UTC
14+
SUCCESS: test: 2020-12-11 02:43:55.0606 UTC
15+
SUCCESS: test: 2020-12-11 02:54:11.910866 UTC
16+
SUCCESS: test: 2020-12-11 02:57:03.052757 UTC
17+
SUCCESS: test: 2020-12-11 02:59:38.517233 UTC
18+
SUCCESS: test: 2020-12-11 03:02:03.230233 UTC
19+
SUCCESS: test: 2020-12-11 03:04:57.864894 UTC
20+
SUCCESS: test: 2020-12-11 03:10:22.106951 UTC
21+
SUCCESS: test: 2020-12-11 03:11:08.167803 UTC
65 Bytes
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
titleLabel=Application de bureau de planification
2+
usernameLabel=Nom d'utilisateur
3+
passwordLabel=Mot de passe
4+
loginButton=Se connecter
5+
resetButton=Réinitialiser
6+
messageText=Le pseudo ou mot de passe est incorect.

src/dao/AppointmentDao.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,21 +188,25 @@ public void setAppointmentList(ObservableList<Appointment> appointmentList) {
188188
*/
189189
private static Boolean hasAppointmentConflicts(Appointment appointment) {
190190
String selectStatement = "SELECT Local_Start, Local_End " +
191-
"FROM (SELECT Start + INTERVAL ? HOUR as Local_Start, End + INTERVAL ? HOUR as Local_End " +
191+
"FROM (SELECT Appointment_ID, Start + INTERVAL ? HOUR as Local_Start, End + INTERVAL ? HOUR as Local_End " +
192192
"FROM appointments " +
193-
"WHERE Customer_ID = ?) LocalTimeTable " +
194-
"WHERE Local_Start < ? " +
195-
"AND Local_End > ?";
193+
"WHERE Customer_ID = ? " +
194+
"AND Appointment_ID != ?) LocalTimeTable " +
195+
"WHERE ? BETWEEN Local_Start AND Local_End " +
196+
"OR ? BETWEEN Local_Start AND Local_End";
196197

197198
try {
198199
DBQuery.setPreparedStatement(connection, selectStatement);
199200
PreparedStatement preparedStatement = DBQuery.getPreparedStatement();
200201

201-
preparedStatement.setInt(1, TimezoneUtil.getOffsetToLocalTime());
202-
preparedStatement.setInt(2, TimezoneUtil.getOffsetToLocalTime());
202+
preparedStatement.setInt(1, 0);
203+
preparedStatement.setInt(2, 0);
204+
// preparedStatement.setInt(1, TimezoneUtil.getOffsetToLocalTime());
205+
// preparedStatement.setInt(2, TimezoneUtil.getOffsetToLocalTime());
203206
preparedStatement.setInt(3, appointment.getCustomerId());
204-
preparedStatement.setTimestamp(4, appointment.getEnd());
207+
preparedStatement.setInt(4, appointment.getId());
205208
preparedStatement.setTimestamp(5, appointment.getStart());
209+
preparedStatement.setTimestamp(6, appointment.getEnd());
206210

207211
preparedStatement.execute();
208212
ResultSet resultSet = preparedStatement.getResultSet();
@@ -245,7 +249,7 @@ public static void getUpcomingAppointment() {
245249
int id = resultSet.getInt("Appointment_ID");
246250
Timestamp start = resultSet.getTimestamp("Start");
247251

248-
String appointmentNotification = String.format("Appointment! ID: %s Starts: %s",id, start.toString());
252+
String appointmentNotification = String.format("Appointment! ID: %s Starts: %s", id, start.toString());
249253
Warning.generateMessage(appointmentNotification, Alert.AlertType.INFORMATION);
250254
} else {
251255
Warning.generateMessage("No Appointments Coming Up in 15 Minutes", Alert.AlertType.INFORMATION);

0 commit comments

Comments
 (0)