0% found this document useful (0 votes)
13 views2 pages

Test 4

The document outlines an AppointmentController class that manages appointment-related operations using an IAppointmentServices interface. It includes methods for retrieving, scheduling, updating, and canceling appointments based on various parameters such as doctor ID, patient ID, and date. The controller supports asynchronous operations for improved performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Test 4

The document outlines an AppointmentController class that manages appointment-related operations using an IAppointmentServices interface. It includes methods for retrieving, scheduling, updating, and canceling appointments based on various parameters such as doctor ID, patient ID, and date. The controller supports asynchronous operations for improved performance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

on]")]

[ApiController]
public class AppointmentController : ControllerBase
{
private IAppointmentServices _appointmentServices;
public AppointmentController(IAppointmentServices appointmentServices)
{
_appointmentServices = appointmentServices;
}

[HttpGet]
public async Task<object> GetAppointments()
{
return await _appointmentServices.GetAppointments();
}

[HttpGet]
public async Task<object> GetAppointmentsByDoctorId(int doctorId)
{
return await _appointmentServices.GetAppointmentsByDoctorId(doctorId);
}

[HttpGet]
public async Task<object> GetAppointmentsByDoctorName(string doctorname)
{
return await _appointmentServices.GetAppointments(doctorname);
}

[HttpGet]
public async Task<object> GetAppointmentsByDate(DateOnly date)
{
return await _appointmentServices.GetAppointments(date);
}

[HttpGet]
public async Task<object> GetAppointmentsByAppointmentId(int appointmentId)
{
return await _appointmentServices.GetAppointments(appointmentId);
}

[HttpPost]
public async Task<object> ScheduleAppointment(Appointment appointment)
{
return _appointmentServices.ScheduleAppointment(appointment);
}

[HttpGet]
public async Task<object> ViewAppointmentByPatientId(int patientId)
{
return await _appointmentServices.ViewAppointment(patientId);
}

[HttpGet]
public async Task<object> ViewAppointmentByPatientName(string patientName)
{
return await _appointmentServices.ViewAppointment(patientName);
}

[HttpPut]
public async Task<object> UpdateAppointment(int id, int doctorId, DateOnly
rescheduleDate)
{
return _appointmentServices.UpdateAppointment(id, doctorId,
rescheduleDate);
}

[HttpDelete]
public async Task<object> CancelAppointment(int id)
{
return _appointmentServices.CancelAppointment(id);
}

[HttpGet]
public async Task<object> ViewAppointmentByDate(int patientId, DateOnly
date)
{
return _appointmentServices.ViewAppointment(patientId, date);
}
}
}

You might also like