diff --git a/Dental_Clinic_System/Dental_Clinic_System/Areas/Dentist/Controllers/DentistDetailController.cs b/Dental_Clinic_System/Dental_Clinic_System/Areas/Dentist/Controllers/DentistDetailController.cs index 237689d5..99ac0f45 100644 --- a/Dental_Clinic_System/Dental_Clinic_System/Areas/Dentist/Controllers/DentistDetailController.cs +++ b/Dental_Clinic_System/Dental_Clinic_System/Areas/Dentist/Controllers/DentistDetailController.cs @@ -198,7 +198,7 @@ public async Task DentistSchedule() } // Những ngày còn lại đã dc lên lịch nếu không có appointment nào liên quan sẽ ko cho vô và đánh "Trống" - else if(!appointmentDict.ContainsKey(key) || !periodicAppointmentDict.ContainsKey(key)) + else if(!appointmentDict.ContainsKey(key)) { dailyTimeSlots.Add(new EventVM { diff --git a/Dental_Clinic_System/Dental_Clinic_System/Areas/Dentist/Services/AppointmentStatusUpdater.cs b/Dental_Clinic_System/Dental_Clinic_System/Areas/Dentist/Services/AppointmentStatusUpdater.cs index db590d8c..e2c0c812 100644 --- a/Dental_Clinic_System/Dental_Clinic_System/Areas/Dentist/Services/AppointmentStatusUpdater.cs +++ b/Dental_Clinic_System/Dental_Clinic_System/Areas/Dentist/Services/AppointmentStatusUpdater.cs @@ -88,6 +88,11 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) // Cập nhật trạng thái appointment.AppointmentStatus = "Đã Hủy"; + + //Cập nhật lại trạng thái của schedule + var schedules = context.Schedules.First(s => s.ID == appointment.ScheduleID); + schedules.ScheduleStatus = "Đã Hủy"; + // Gửi lại mail xác nhận đã hủy cho khách hàng var user = await context.Accounts.FirstOrDefaultAsync(a => a.ID == appointment.PatientRecords.AccountID); if (user != null)