2009-12-03 17:36:03 -05:00
|
|
|
|
namespace IndianHealthService.ClinicalScheduling
|
|
|
|
|
{
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
/// <summary>
|
2011-02-21 09:21:24 -05:00
|
|
|
|
/// Managers Appointment objects CGAppointment using an array list internally.
|
2009-12-03 17:36:03 -05:00
|
|
|
|
/// </summary>
|
2011-02-21 09:21:24 -05:00
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Really needs to be refactored to use generics
|
|
|
|
|
/// </remarks>
|
2009-12-03 17:36:03 -05:00
|
|
|
|
[Serializable]
|
2011-01-20 09:32:28 -05:00
|
|
|
|
public class CGAppointments : IEnumerable, ICloneable
|
2009-12-03 17:36:03 -05:00
|
|
|
|
{
|
|
|
|
|
private Hashtable apptList = new Hashtable();
|
|
|
|
|
|
|
|
|
|
public void AddAppointment(CGAppointment appt)
|
|
|
|
|
{
|
|
|
|
|
if (this.apptList.ContainsKey(appt.AppointmentKey))
|
|
|
|
|
{
|
|
|
|
|
this.apptList.Remove(appt.AppointmentKey);
|
|
|
|
|
}
|
|
|
|
|
this.apptList.Add(appt.AppointmentKey, appt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ClearAllAppointments()
|
|
|
|
|
{
|
|
|
|
|
this.apptList.Clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CGAppointment GetAppointment(int nKey)
|
|
|
|
|
{
|
|
|
|
|
return (CGAppointment) this.apptList[nKey];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerator GetEnumerator()
|
|
|
|
|
{
|
|
|
|
|
return this.apptList.GetEnumerator();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void RemoveAppointment(int nKey)
|
|
|
|
|
{
|
|
|
|
|
this.apptList.Remove(nKey);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int AppointmentCount
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return this.apptList.Count;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Hashtable AppointmentTable
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return this.apptList;
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-01-20 09:32:28 -05:00
|
|
|
|
|
2011-01-23 08:00:56 -05:00
|
|
|
|
|
2011-02-21 09:21:24 -05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns a deep copy of CGAppointments
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
2011-01-20 09:32:28 -05:00
|
|
|
|
public object Clone()
|
|
|
|
|
{
|
2011-01-23 08:00:56 -05:00
|
|
|
|
CGAppointments newappts = new CGAppointments();
|
|
|
|
|
foreach (DictionaryEntry d in this.apptList)
|
|
|
|
|
{
|
|
|
|
|
newappts.apptList.Add(d.Key, d.Value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return newappts;
|
2011-01-20 09:32:28 -05:00
|
|
|
|
}
|
2009-12-03 17:36:03 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|