Ejemplo n.º 1
0
        //It deletes the existing Schedules for all the Instructors and the Date that don't have an Appointment with a Client
        public static void deleteExistingSchedulesForInstructorsAndDate(string myDate)
        {
            var deleteQuery = $"DELETE FROM Appointments WHERE slotDate='{ControlFunctions.formatToSQLDate(DateTime.Parse(myDate))}' AND usernameClient IS null";

            SQL.executeQuery(deleteQuery);
        }
Ejemplo n.º 2
0
        //It deletes the existing Schedules for a Instructor and between the Dates that don't have an Appointment with a Client nor have been confirmed by Admin
        public static void deleteExistingSchedulesForInstructorAndDates(string instructor, string myDate1, string myDate2)
        {
            var deleteQuery = $"DELETE FROM Appointments WHERE usernameInstructor='{instructor}' AND slotDate>='{ControlFunctions.formatToSQLDate(DateTime.Parse(myDate1))}' AND slotDate<='{ControlFunctions.formatToSQLDate(DateTime.Parse(myDate2))}' AND usernameClient IS null AND confirmed is null";

            SQL.executeQuery(deleteQuery);
        }