public Schedule() { Available[0] = new Appointment("9:00 a.m."); Available[1] = new Appointment("10:00 a.m."); Available[2] = new Appointment("11:00 a.m."); Available[3] = new Appointment("1:00 p.m."); Available[4] = new Appointment("2:00 p.m."); Available[5] = new Appointment("3:00 p.m."); Available[6] = new Appointment("4:00 p.m."); }
public void MakeAppointment() { Monitor.Enter(Times); List<Appointment> timesLeft = Times.CheckForOpenAppointments(); if (timesLeft.Count > 0) { timesLeft[0].FilledWith = this; this.IsScheduledFor = timesLeft[0]; Console.Write("{0} is filled by...", this.IsScheduledFor.TimeSlot); Thread.Sleep(600); Console.WriteLine("{0}!", this.Name); } Monitor.Exit(Times); }
public Patient(string name) { Name = name; IsScheduledFor = null; }