コード例 #1
0
        [HttpPut("cancelAppointment/{appointmentId}")]       // GET /api/appointment/cancelAppointment/{appointmentId}
        public IActionResult CancelPatientAppointment(int appointmentId)
        {
            Appointment appointmentForCancelation = appointmentService.GetEntity(appointmentId);

            if (appointmentForCancelation == null)
            {
                return(NotFound());
            }
            doctorWorkDayService.CancelPatientAppointment(appointmentForCancelation.DoctorWorkDayId, appointmentId, DateTime.Now);
            return(Ok(appointmentService.CancelPatientAppointment(appointmentId, DateTime.Now)));
        }