Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Dear all,

I have a hospital application where a patient can log on online and book a time slot to see a specific doctor. How can I make time slots of 15 minutes for each doctor and when a patient book a time slot it can't be booked by another patient?

Cheers,
Posted
Comments
Sergey Alexandrovich Kryukov 29-Apr-12 8:59am    
What is the problem? This is your application...
--SA
Sergey Alexandrovich Kryukov 29-Apr-12 9:01am    
Reason for my vote of 1
Pointless question, not explaining any particular concern. The answer would be: design and implement it. It also totally depends on the design of the application.
--SA
Mohamed Mitwalli 29-Apr-12 9:05am    
what you did so far ?
Mohamed Mitwalli 29-Apr-12 9:10am    
Reason for my vote of 1
Not Complete Question .
[no name] 29-Apr-12 10:17am    
Reason for my vote of 1
The answer to the question could only be answered by the OP. No one else knows anything about the architecture of the project to give any kind of an answer.

1 solution

Hello

Use Full DateTime

For example:
You have a List of Reservation.
C#
List<reservation> ReservationList;

This is the Reservation class:
C#
public class Reservation
{
   public Doctor Doctor {get; set;}
   public DateTime GettingTime {get; set;}
   public DateTime ExpiredTime {get; set;}
}


C#
public bool IsReserved(Doctor doctor, DateTime startDateTime, DateTime expiredDatetime, List<reservation> list)
{
   return (list.Where(r=>r.Doctor == doctor && startDateTime>=r.GettingTime && startDateTime<=r.ExpiredTime && expiredDatetime<r.GettingTime).Count()==0) true:false;
}
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900