Index: Scheduling/branches/GUI1.2/AssemblyInfo.cs
===================================================================
--- Scheduling/branches/GUI1.2/AssemblyInfo.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/AssemblyInfo.cs	(revision 855)
@@ -0,0 +1,61 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+//
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("Clinical Scheduling")]
+[assembly: AssemblyDescription("Windows Scheduling Application for VistA")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("WorldVistA")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]		
+
+//
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.2.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the 
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing. 
+//
+// Notes: 
+//   (*) If no key is specified, the assembly is not signed.
+//   (*) KeyName refers to a key that has been installed in the Crypto Service
+//       Provider (CSP) on your machine. KeyFile refers to a file which contains
+//       a key.
+//   (*) If the KeyFile and the KeyName values are both specified, the 
+//       following processing occurs:
+//       (1) If the KeyName can be found in the CSP, that key is used.
+//       (2) If the KeyName does not exist and the KeyFile does exist, the key 
+//           in the KeyFile is installed into the CSP and used.
+//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+//       When specifying the KeyFile, the location of the KeyFile should be
+//       relative to the project output directory which is
+//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+//       located in the project directory, you would specify the AssemblyKeyFile 
+//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+//       documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
+[assembly: AssemblyFileVersionAttribute("1.2.0.0")]
+[assembly: ComVisibleAttribute(false)]
Index: Scheduling/branches/GUI1.2/CGAVDocument.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGAVDocument.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGAVDocument.cs	(revision 855)
@@ -0,0 +1,537 @@
+using System;
+using System.Collections;
+using System.Data;
+//using System.Data.OleDb;
+using System.Diagnostics;
+using System.Drawing;
+using System.Windows.Forms;
+using IndianHealthService.BMXNet;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Contains array of availability blocks for a scheduling resource
+	/// </summary>
+	public class CGAVDocument : System.Object
+	{
+		public CGAVDocument()
+		{
+			m_AVBlocks = new CGAppointments();
+			m_sResourcesArray = new ArrayList();
+		}
+
+		#region Member Variables
+
+		public int				m_nColumnCount; //todo: this should point to the view's member for column count
+		public int				m_nTimeUnits;
+		public string			m_sSecondary;
+		private string			m_sDocName;
+		public ArrayList		m_sResourcesArray;
+		public ScheduleType		m_ScheduleType;
+		private DateTime		m_dSelectedDate; //Holds the user's selection from the dtpicker
+		private DateTime		m_dStartDate; //Beginning date of document data
+		private DateTime		m_dEndDate; //Ending date of document data
+		public CGAppointments	m_AVBlocks;
+		private CGDocumentManager m_DocManager;
+		private int				m_nDocID;	//Resource IEN in ^BSDXRES
+
+		#endregion
+
+		#region Properties
+
+		/// <summary>
+		/// Resource IEN in ^BSDXRES
+		/// </summary>
+		public int ResourceID
+		{
+			get
+			{
+				return m_nDocID;
+			}
+			set
+			{
+				m_nDocID = value;
+			}
+		}
+
+		/// <summary>
+		/// The list of Resource names
+		/// </summary>
+		public ArrayList Resources
+		{
+			get
+			{
+				return this.m_sResourcesArray;
+			}
+			set
+			{
+				this.m_sResourcesArray = value;
+			}
+		}
+
+		public CGDocumentManager DocManager
+		{
+			get
+			{
+				return m_DocManager;
+			}
+			set
+			{
+				m_DocManager = value;
+			}
+		}
+
+		/// <summary>
+		/// Contains the hashtable of Availability Blocks
+		/// </summary>
+		public CGAppointments AVBlocks
+		{
+			get
+			{
+				return m_AVBlocks;
+			}
+			set
+			{
+				m_AVBlocks = value;
+			}
+		}
+
+		/// <summary>
+		/// Holds the date selected by the user in CGView.dateTimePicker1
+		/// </summary>
+		public DateTime SelectedDate
+		{
+			get
+			{
+				return this.m_dSelectedDate;
+			}
+			set
+			{
+				this.m_dSelectedDate = value;
+				bool bRet = false;
+				if (m_ScheduleType == ScheduleType.Resource)
+				{
+					bRet = this.WeekNeedsRefresh(1, m_dSelectedDate, out this.m_dStartDate, out this.m_dEndDate);
+				}
+				else
+				{
+					this.m_dStartDate = m_dSelectedDate;
+					this.m_dEndDate = m_dSelectedDate;
+					this.m_dEndDate = this.m_dEndDate.AddHours(23);
+					this.m_dEndDate = this.m_dEndDate.AddMinutes(59);
+					this.m_dEndDate = this.m_dEndDate.AddSeconds(59);
+				}
+
+				bRet = this.RefreshDaysSchedule();
+			}
+		}
+
+		/// <summary>
+		/// Contains the beginning date of the appointment document
+		/// </summary>
+		public DateTime StartDate
+		{
+			get
+			{
+				return this.m_dStartDate;
+			}
+		}
+		
+		public string DocName
+		{
+			get
+			{
+				return this.m_sDocName;
+			}
+			set
+			{
+				this.m_sDocName = value;
+			}
+		}
+
+		#endregion
+	
+		#region Methods
+
+		public void ChangeAppointmentTime(CGAppointment pAppt, DateTime dNewStart, DateTime dNewEnd, string sResource)
+		{
+			try 
+			{
+				DateTime dOldStart = pAppt.StartTime;
+				DateTime dOldEnd = pAppt.EndTime;
+				if ((dOldStart == dNewStart) && (dOldEnd == dNewEnd)) 
+				{ //no change in time
+					return;
+				}
+
+				foreach (CGAppointment a in m_AVBlocks.AppointmentTable.Values)
+				{
+					DateTime sStart2 = a.StartTime;
+					DateTime sEnd2 = a.EndTime;
+					if ((a.AppointmentKey != pAppt.AppointmentKey) && (CGSchedLib.TimesOverlap(dNewStart, dNewEnd, a.StartTime, a.EndTime)))
+					{
+						MessageBox.Show("Access blocks may not overlap.","Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+						return;
+					}
+				}
+
+				this.DeleteAvailability(pAppt.AppointmentKey);
+				pAppt.StartTime = dNewStart;
+				pAppt.EndTime = dNewEnd;
+				pAppt.Resource = sResource;
+				this.CreateAppointment(pAppt);
+				
+			}
+			catch(Exception e)
+			{
+				MessageBox.Show("CGDocument::ChangeAppointmentTime failed: " + e.Message);
+				return;
+			}
+		}
+
+		public void DeleteAvailability(int nApptID)
+		{
+			if (this.m_AVBlocks.AppointmentTable.ContainsKey(nApptID))
+			{
+				string sSql = "BSDX CANCEL AVAILABILITY^" + nApptID.ToString();
+				DataTable dtAppt =m_DocManager.RPMSDataTable(sSql, "DeleteAvailability");
+				int nErrorID;				
+				Debug.Assert(dtAppt.Rows.Count == 1);
+				DataRow r = dtAppt.Rows[0];
+				nErrorID = Convert.ToInt32(r["ERRORID"]);
+				this.m_AVBlocks.RemoveAppointment(nApptID);
+				UpdateAllViews();
+			}		
+		}
+
+		/// <summary>
+		/// Called by LoadTemplate to create Access Block
+		/// Returns the IEN of the availability block in the RPMS BSDX AVAILABILITY file.
+		/// </summary>
+		public int CreateAppointmentAuto(CGAppointment rApptInfo)
+		{
+			try
+			{
+				string sStart;
+				string sEnd;
+				string sResource;
+				string sNote;
+				string sTypeID;
+				string sSlots;
+
+				sStart = rApptInfo.StartTime.ToString("M-d-yyyy@HH:mm");
+				sEnd = rApptInfo.EndTime.ToString("M-d-yyyy@HH:mm");
+				sNote = rApptInfo.Note;
+				sResource = rApptInfo.Resource;
+				sTypeID = rApptInfo.AccessTypeID.ToString();
+				sSlots = rApptInfo.Slots.ToString();
+
+				CGAppointment aCopy = new CGAppointment();
+				aCopy.CreateAppointment(rApptInfo.StartTime, rApptInfo.EndTime, sNote, 0, sResource);
+				aCopy.AccessTypeID = rApptInfo.AccessTypeID;
+				aCopy.Slots = rApptInfo.Slots;
+				aCopy.IsAccessBlock = true;
+
+				string sSql = "BSDX ADD NEW AVAILABILITY^" + sStart + "^" + sEnd + "^" + sTypeID + "^" + sResource + "^" +  sSlots + "^" + sNote;
+				DataTable dtAppt =m_DocManager.RPMSDataTable(sSql, "NewAvailability");
+
+				int nApptID;
+				int nErrorID;
+
+				Debug.Assert(dtAppt.Rows.Count == 1);
+				DataRow r = dtAppt.Rows[0];
+				nApptID =Convert.ToInt32(r["AVAILABILITYID"]);
+				nErrorID = Convert.ToInt32(r["ERRORID"]);
+				if (nErrorID != -1)
+				{
+					throw new Exception("VistA Error");
+				}
+				Debug.Write("CreateAvailabilityAuto -- new AV block created\n");
+
+				UpdateAllViews();
+
+				aCopy.AppointmentKey = nApptID;
+				return nApptID;
+			}
+			catch (Exception ex)
+			{
+				Debug.Write("CGAVDocument.CreateAppointmentAuto Failed: " + ex.Message);
+				return -1;
+			}		
+		}
+
+
+		public int CreateAppointment(CGAppointment rApptInfo)
+		{
+			try
+			{
+				string sStart;
+				string sEnd;
+				string sResource;
+				string sNote;
+				string sTypeID;
+				string sSlots;
+
+				sStart = rApptInfo.StartTime.ToString("M-d-yyyy@HH:mm");
+				sEnd = rApptInfo.EndTime.ToString("M-d-yyyy@HH:mm");
+				sNote = rApptInfo.Note;
+				sResource = rApptInfo.Resource;
+				sTypeID = rApptInfo.AccessTypeID.ToString();
+				sSlots = rApptInfo.Slots.ToString();
+
+				CGAppointment aCopy = new CGAppointment();
+				aCopy.CreateAppointment(rApptInfo.StartTime, rApptInfo.EndTime, sNote, 0, sResource);
+				aCopy.AccessTypeID = rApptInfo.AccessTypeID;
+				aCopy.Slots = rApptInfo.Slots;
+				aCopy.IsAccessBlock = true;
+
+				aCopy.AccessTypeName = this.AccessNameFromID(aCopy.AccessTypeID);
+
+				foreach (CGAppointment a in this.m_AVBlocks.AppointmentTable.Values)
+				{
+					DateTime sStart2 = a.StartTime;
+					DateTime sEnd2 = a.EndTime;
+					if (CGSchedLib.TimesOverlap(aCopy.StartTime, aCopy.EndTime, a.StartTime, a.EndTime))
+					{
+						//						throw new Exception("Access blocks may not overlap.");
+						MessageBox.Show("Access blocks may not overlap.","Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+						return -1;
+					}
+						
+				}
+
+				string sSql = "BSDX ADD NEW AVAILABILITY^" + sStart + "^" + sEnd + "^" + sTypeID + "^" + sResource + "^" +  sSlots + "^" + sNote;
+				DataTable dtAppt =m_DocManager.RPMSDataTable(sSql, "NewAvailability");
+
+				int nApptID;
+				int nErrorID;
+
+				Debug.Assert(dtAppt.Rows.Count == 1);
+				DataRow r = dtAppt.Rows[0];
+				nApptID =Convert.ToInt32(r["AVAILABILITYID"]);
+				nErrorID = Convert.ToInt32(r["ERRORID"]);
+				if (nErrorID != -1)
+				{
+					throw new Exception("VistA Error");
+				}
+				Debug.Write("CreateAvailability -- new AV block created\n");
+
+				aCopy.AppointmentKey = nApptID;
+			
+				this.m_AVBlocks.AddAppointment(aCopy);
+
+				UpdateAllViews();
+
+				return nApptID;
+			}
+			catch (Exception ex)
+			{
+				Debug.Write("CGAVDocument.CreateAppointment Failed: " + ex.Message);
+				return -1;
+			}
+		}
+
+		private int GetTotalMinutes(DateTime dDate)
+		{
+			return ((dDate.Hour * 60) + dDate.Minute);
+		}
+
+		private string AccessNameFromID(int nAccessTypeID)
+		{
+			DataView dvTypes = new DataView(this.DocManager.GlobalDataSet.Tables["AccessTypes"]);
+			dvTypes.Sort = "BMXIEN ASC";
+			int nRow = dvTypes.Find(nAccessTypeID);
+			DataRowView drv = dvTypes[nRow];
+			string sAccessTypeName = drv["ACCESS_TYPE_NAME"].ToString();
+			return sAccessTypeName;		
+		}
+
+
+		/// <summary>
+		/// Update availability block schedule based on info in RPMS
+		/// </summary>
+		public bool RefreshDaysSchedule()
+		{
+			DateTime dStart;
+			DateTime dEnd;
+			int nKeyID;
+			string sNote;
+			string sResource;
+			string sAccessType;
+			string sSlots;
+			CGAppointment	pAppointment;
+			CGDocumentManager pApp = CGDocumentManager.Current;
+			DataTable rAppointmentSchedule;
+
+			this.m_AVBlocks.ClearAllAppointments();
+
+			ArrayList apptTypeIDs = new ArrayList();
+
+			rAppointmentSchedule = CGSchedLib.CreateAssignedSlotSchedule(m_DocManager, (string) m_sResourcesArray[0], this.m_dStartDate, this.m_dEndDate, apptTypeIDs,/* */ this.m_ScheduleType, "0");
+			CGSchedLib.OutputArray(rAppointmentSchedule, "rAppointmentSchedule");
+			foreach (DataRow r in rAppointmentSchedule.Rows) 
+			{
+				nKeyID = Convert.ToInt32(r["AVAILABILITYID"].ToString());
+				if (nKeyID > 0) 
+				{
+					dStart = (DateTime) r["START_TIME"];
+					dEnd = (DateTime) r["END_TIME"];
+					sNote = r["NOTE"].ToString();
+					sResource = r["RESOURCE"].ToString();
+					sAccessType = r["ACCESS_TYPE"].ToString();
+					sSlots = r["SLOTS"].ToString();
+
+					pAppointment = new CGAppointment();
+					pAppointment.CreateAppointment(dStart, dEnd, sNote, nKeyID, sResource);
+					pAppointment.AccessTypeID = Convert.ToInt16(sAccessType);
+					pAppointment.Slots = Convert.ToInt16(sSlots);
+					pAppointment.IsAccessBlock = true;
+					pAppointment.AccessTypeName = this.AccessNameFromID(pAppointment.AccessTypeID);
+
+					this.m_AVBlocks.AddAppointment(pAppointment);
+				}
+			}		
+			return true;
+		}
+
+		/// <summary>
+		/// Given a selected date,
+		/// Calculates StartDay and End Day and returns them in output params.  
+		/// nWeeks == number of Weeks to display
+		/// nColumnCount is number of days displayed per week.  If 5 columns, begin on
+		/// Monday, if 7 Columns, begin on Sunday
+		/// 
+		/// Returns TRUE if the document's data needs refreshing based on 
+		/// this newly selected date.
+		/// </summary>
+		public bool WeekNeedsRefresh(int nWeeks, DateTime SelectedDate, 
+			out DateTime WeekStartDay, out DateTime WeekEndDay)
+		{
+			DateTime OldStartDay = m_dStartDate;
+			DateTime OldEndDay = m_dEndDate;
+			int nWeekDay = (int) SelectedDate.DayOfWeek; //0 == Sunday
+
+			int nOff = 1;
+			TimeSpan ts = new TimeSpan(nWeekDay - nOff,0,0,0); //d,h,m,s
+
+			if (m_nColumnCount == 1) 
+			{
+				ts = new TimeSpan(0,23,59,59);
+				WeekStartDay = SelectedDate;
+			}
+			else 
+			{
+				WeekStartDay = SelectedDate - ts;
+				if (m_nColumnCount == 7)
+				{
+					ts = new TimeSpan(1,0,0,0);
+					WeekStartDay -= ts;
+				}
+				int nEnd = (m_nColumnCount == 7) ? 1 : 3;
+				ts = new TimeSpan((7* nWeeks) - nEnd, 23, 59,59);
+			}
+			WeekEndDay = WeekStartDay + ts;
+			bool bRet = (( WeekStartDay.Date != OldStartDay.Date) || (WeekEndDay.Date != OldEndDay.Date));
+			return bRet;
+		}
+
+		public void OnOpenDocument() 
+		{
+			//Create new Document
+			//			DateTime dStart;
+			//			DateTime dEnd;
+
+			Debug.Assert(m_sResourcesArray.Count > 0);
+
+			m_sSecondary = "";
+
+			m_ScheduleType = (m_sResourcesArray.Count == 1) ? ScheduleType.Resource: ScheduleType.Clinic;
+		
+			bool bRet = false;
+			//Set initial From and To dates based on current day
+			//			DateTime dDate = new DateTime(2001,12,05); //test line
+			DateTime dDate = DateTime.Today;
+			if (m_ScheduleType == ScheduleType.Resource)
+			{
+				bRet = this.WeekNeedsRefresh(1,dDate, out this.m_dStartDate, out this.m_dEndDate);
+			}
+			else
+			{
+				this.m_dStartDate = dDate;
+				this.m_dEndDate = dDate;
+				this.m_dEndDate = this.m_dEndDate.AddHours(23);
+				this.m_dEndDate = this.m_dEndDate.AddMinutes(59);
+				this.m_dEndDate = this.m_dEndDate.AddSeconds(59);
+			}
+
+			bRet = this.RefreshDaysSchedule();
+
+			CGAVView view = null;
+			//If this document already has a view, the use it
+			Hashtable h = CGDocumentManager.Current.AvailabilityViews;		
+			CGAVDocument d;
+			bool bReuseView = false;
+			foreach (CGAVView v in h.Keys)
+			{
+				d = (CGAVDocument) h[v];
+				if (d == this)
+				{
+					view = v;
+					bReuseView = true;
+					break;
+				}
+			}
+
+			//Otherwise, create new View
+			if (bReuseView == false)
+			{
+				view = new CGAVView();
+
+				view.DocManager = this.DocManager;
+				view.StartDate = m_dStartDate;
+			
+				//Assign the document to the view
+				view.Document = this;
+
+				//Link the calendargrid's appointments table to the document's table
+				view.AVBlocks = this.AVBlocks;
+			
+				view.Text = "Edit Availability - " + this.DocName;
+				view.Show();
+			}
+
+			this.UpdateAllViews();
+
+		}
+
+		public void AddResource(string sResource)
+		{
+			//TODO:  Test that resource is not currently in list, that it IS a resource, etc
+			this.m_sResourcesArray.Add(sResource);
+			this.UpdateAllViews();
+		}
+
+		/// <summary>
+		/// Calls each AVview associated with this AVdocument and tells it to update itself
+		/// </summary>
+		public void UpdateAllViews()
+		{
+			//iterate through all views and call update.
+			Hashtable h = CGDocumentManager.Current.AvailabilityViews;
+			
+			CGAVDocument d;
+			foreach (CGAVView v in h.Keys)
+			{
+				d = (CGAVDocument) h[v];
+				if (d == this)
+				{
+					v.UpdateArrays();
+				}
+			}
+
+		}
+
+		#endregion
+	
+	}//End class
+}
Index: Scheduling/branches/GUI1.2/CGAVView.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGAVView.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGAVView.cs	(revision 855)
@@ -0,0 +1,1403 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Diagnostics;
+using System.Data;
+using System.Data.OleDb;
+using System.IO;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Formatters.Binary;
+using IndianHealthService.BMXNet;
+
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for CGAVView.
+	/// </summary>
+	public class CGAVView : System.Windows.Forms.Form
+	{
+
+
+		public CGAVView()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+			this.panelRight.Visible = false;
+			this.tvSchedules.Visible = false;
+			m_ClipList = new CGAppointments();
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+            this.components = new System.ComponentModel.Container();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CGAVView));
+            this.panelRight = new System.Windows.Forms.Panel();
+            this.panelClip = new System.Windows.Forms.Panel();
+            this.lstClip = new System.Windows.Forms.ListBox();
+            this.ctxApptClipMenu = new System.Windows.Forms.ContextMenu();
+            this.mnuRemoveClipItem = new System.Windows.Forms.MenuItem();
+            this.mnuClearClipItems = new System.Windows.Forms.MenuItem();
+            this.label1 = new System.Windows.Forms.Label();
+            this.panelBottom = new System.Windows.Forms.Panel();
+            this.statusBar1 = new System.Windows.Forms.StatusBar();
+            this.panelTop = new System.Windows.Forms.Panel();
+            this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
+            this.lblResource = new System.Windows.Forms.Label();
+            this.panelCenter = new System.Windows.Forms.Panel();
+            this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
+            this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu();
+            this.ctxCalGridAdd = new System.Windows.Forms.MenuItem();
+            this.ctxCalGridEdit = new System.Windows.Forms.MenuItem();
+            this.ctxCalGridDelete = new System.Windows.Forms.MenuItem();
+            this.tvSchedules = new System.Windows.Forms.TreeView();
+            this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components);
+            this.menuItem1 = new System.Windows.Forms.MenuItem();
+            this.mnuLoadTemplate = new System.Windows.Forms.MenuItem();
+            this.mnuSaveTemplate = new System.Windows.Forms.MenuItem();
+            this.menuItem6 = new System.Windows.Forms.MenuItem();
+            this.mnuSchedulingManagment = new System.Windows.Forms.MenuItem();
+            this.menuItem5 = new System.Windows.Forms.MenuItem();
+            this.mnuClose = new System.Windows.Forms.MenuItem();
+            this.mnuAvailability = new System.Windows.Forms.MenuItem();
+            this.mnuAddNewAV = new System.Windows.Forms.MenuItem();
+            this.mnuRemoveAV = new System.Windows.Forms.MenuItem();
+            this.mnuEditAV = new System.Windows.Forms.MenuItem();
+            this.mnuCalendar = new System.Windows.Forms.MenuItem();
+            this.mnu1Day = new System.Windows.Forms.MenuItem();
+            this.mnu5Day = new System.Windows.Forms.MenuItem();
+            this.mnu7Day = new System.Windows.Forms.MenuItem();
+            this.menuItem7 = new System.Windows.Forms.MenuItem();
+            this.mnuTimeScale = new System.Windows.Forms.MenuItem();
+            this.mnu10Minute = new System.Windows.Forms.MenuItem();
+            this.mnu15Minute = new System.Windows.Forms.MenuItem();
+            this.mnu20Minute = new System.Windows.Forms.MenuItem();
+            this.mnu30Minute = new System.Windows.Forms.MenuItem();
+            this.mnuViewRightPanel = new System.Windows.Forms.MenuItem();
+            this.mnuHelp = new System.Windows.Forms.MenuItem();
+            this.mnuHelpAbout = new System.Windows.Forms.MenuItem();
+            this.splitter1 = new System.Windows.Forms.Splitter();
+            this.panelRight.SuspendLayout();
+            this.panelClip.SuspendLayout();
+            this.panelBottom.SuspendLayout();
+            this.panelTop.SuspendLayout();
+            this.panelCenter.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // panelRight
+            // 
+            this.panelRight.Controls.Add(this.panelClip);
+            this.panelRight.Dock = System.Windows.Forms.DockStyle.Right;
+            this.panelRight.Location = new System.Drawing.Point(728, 0);
+            this.panelRight.Name = "panelRight";
+            this.panelRight.Size = new System.Drawing.Size(120, 450);
+            this.panelRight.TabIndex = 1;
+            // 
+            // panelClip
+            // 
+            this.panelClip.Controls.Add(this.lstClip);
+            this.panelClip.Controls.Add(this.label1);
+            this.panelClip.Dock = System.Windows.Forms.DockStyle.Top;
+            this.panelClip.Location = new System.Drawing.Point(0, 0);
+            this.panelClip.Name = "panelClip";
+            this.panelClip.Size = new System.Drawing.Size(120, 448);
+            this.panelClip.TabIndex = 1;
+            // 
+            // lstClip
+            // 
+            this.lstClip.AllowDrop = true;
+            this.lstClip.ContextMenu = this.ctxApptClipMenu;
+            this.lstClip.DisplayMember = "ToString()";
+            this.lstClip.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lstClip.Location = new System.Drawing.Point(0, 32);
+            this.lstClip.Name = "lstClip";
+            this.lstClip.Size = new System.Drawing.Size(120, 407);
+            this.lstClip.TabIndex = 0;
+            this.lstClip.DragDrop += new System.Windows.Forms.DragEventHandler(this.lstClip_DragDrop);
+            this.lstClip.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseMove);
+            this.lstClip.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseDown);
+            this.lstClip.DragEnter += new System.Windows.Forms.DragEventHandler(this.lstClip_DragEnter);
+            // 
+            // ctxApptClipMenu
+            // 
+            this.ctxApptClipMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuRemoveClipItem,
+            this.mnuClearClipItems});
+            this.ctxApptClipMenu.Popup += new System.EventHandler(this.ctxApptClipMenu_Popup);
+            // 
+            // mnuRemoveClipItem
+            // 
+            this.mnuRemoveClipItem.Index = 0;
+            this.mnuRemoveClipItem.Text = "Remove Item";
+            this.mnuRemoveClipItem.Click += new System.EventHandler(this.mnuRemoveClipItem_Click);
+            // 
+            // mnuClearClipItems
+            // 
+            this.mnuClearClipItems.Index = 1;
+            this.mnuClearClipItems.Text = "Clear All";
+            this.mnuClearClipItems.Click += new System.EventHandler(this.mnuClearClipItems_Click);
+            // 
+            // label1
+            // 
+            this.label1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.label1.Location = new System.Drawing.Point(0, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(120, 32);
+            this.label1.TabIndex = 1;
+            this.label1.Text = "Access Block Clipboard";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+            // 
+            // panelBottom
+            // 
+            this.panelBottom.Controls.Add(this.statusBar1);
+            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.panelBottom.Location = new System.Drawing.Point(8, 426);
+            this.panelBottom.Name = "panelBottom";
+            this.panelBottom.Size = new System.Drawing.Size(720, 24);
+            this.panelBottom.TabIndex = 2;
+            // 
+            // statusBar1
+            // 
+            this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.statusBar1.Location = new System.Drawing.Point(0, 0);
+            this.statusBar1.Name = "statusBar1";
+            this.statusBar1.Size = new System.Drawing.Size(720, 24);
+            this.statusBar1.SizingGrip = false;
+            this.statusBar1.TabIndex = 1;
+            // 
+            // panelTop
+            // 
+            this.panelTop.Controls.Add(this.dateTimePicker1);
+            this.panelTop.Controls.Add(this.lblResource);
+            this.panelTop.Dock = System.Windows.Forms.DockStyle.Top;
+            this.panelTop.Location = new System.Drawing.Point(8, 0);
+            this.panelTop.Name = "panelTop";
+            this.panelTop.Size = new System.Drawing.Size(720, 24);
+            this.panelTop.TabIndex = 3;
+            // 
+            // dateTimePicker1
+            // 
+            this.dateTimePicker1.Dock = System.Windows.Forms.DockStyle.Right;
+            this.dateTimePicker1.DropDownAlign = System.Windows.Forms.LeftRightAlignment.Right;
+            this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short;
+            this.dateTimePicker1.Location = new System.Drawing.Point(592, 0);
+            this.dateTimePicker1.Name = "dateTimePicker1";
+            this.dateTimePicker1.Size = new System.Drawing.Size(128, 20);
+            this.dateTimePicker1.TabIndex = 4;
+            this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged);
+            // 
+            // lblResource
+            // 
+            this.lblResource.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lblResource.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblResource.ForeColor = System.Drawing.SystemColors.Highlight;
+            this.lblResource.Location = new System.Drawing.Point(0, 0);
+            this.lblResource.Name = "lblResource";
+            this.lblResource.Size = new System.Drawing.Size(720, 24);
+            this.lblResource.TabIndex = 3;
+            this.lblResource.Text = "lblResource";
+            // 
+            // panelCenter
+            // 
+            this.panelCenter.Controls.Add(this.calendarGrid1);
+            this.panelCenter.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.panelCenter.Location = new System.Drawing.Point(8, 24);
+            this.panelCenter.Name = "panelCenter";
+            this.panelCenter.Size = new System.Drawing.Size(712, 402);
+            this.panelCenter.TabIndex = 4;
+            // 
+            // calendarGrid1
+            // 
+            this.calendarGrid1.AllowDrop = true;
+            this.calendarGrid1.Appointments = null;
+            this.calendarGrid1.ApptDragSource = null;
+            this.calendarGrid1.AutoScroll = true;
+            this.calendarGrid1.AutoScrollMinSize = new System.Drawing.Size(600, 1898);
+            this.calendarGrid1.AvailabilityArray = null;
+            this.calendarGrid1.BackColor = System.Drawing.SystemColors.Window;
+            this.calendarGrid1.Columns = 5;
+            this.calendarGrid1.ContextMenu = this.ctxCalendarGrid;
+            this.calendarGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.calendarGrid1.DrawWalkIns = true;
+            this.calendarGrid1.GridBackColor = "blue";
+            this.calendarGrid1.GridEnter = false;
+            this.calendarGrid1.Location = new System.Drawing.Point(0, 0);
+            this.calendarGrid1.Name = "calendarGrid1";
+            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
+            this.calendarGrid1.SelectedAppointment = 0;
+            this.calendarGrid1.Size = new System.Drawing.Size(712, 402);
+            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
+            this.calendarGrid1.TabIndex = 2;
+            this.calendarGrid1.TimeScale = 20;
+            this.calendarGrid1.DoubleClick += new System.EventHandler(this.calendarGrid1_DoubleClick);
+            this.calendarGrid1.CGSelectionChanged += new IndianHealthService.ClinicalScheduling.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
+            this.calendarGrid1.CGAppointmentChanged += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
+            this.calendarGrid1.CGAppointmentAdded += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded);
+            // 
+            // ctxCalendarGrid
+            // 
+            this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.ctxCalGridAdd,
+            this.ctxCalGridEdit,
+            this.ctxCalGridDelete});
+            this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);
+            // 
+            // ctxCalGridAdd
+            // 
+            this.ctxCalGridAdd.Index = 0;
+            this.ctxCalGridAdd.Text = "Add New Access Block";
+            this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);
+            // 
+            // ctxCalGridEdit
+            // 
+            this.ctxCalGridEdit.Index = 1;
+            this.ctxCalGridEdit.Text = "Edit Access Block";
+            this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);
+            // 
+            // ctxCalGridDelete
+            // 
+            this.ctxCalGridDelete.Index = 2;
+            this.ctxCalGridDelete.Text = "Delete Access Block";
+            this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);
+            // 
+            // tvSchedules
+            // 
+            this.tvSchedules.BackColor = System.Drawing.SystemColors.ControlLight;
+            this.tvSchedules.Dock = System.Windows.Forms.DockStyle.Left;
+            this.tvSchedules.HotTracking = true;
+            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
+            this.tvSchedules.Name = "tvSchedules";
+            this.tvSchedules.Size = new System.Drawing.Size(8, 450);
+            this.tvSchedules.Sorted = true;
+            this.tvSchedules.TabIndex = 5;
+            // 
+            // mainMenu1
+            // 
+            this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.menuItem1,
+            this.mnuAvailability,
+            this.mnuCalendar,
+            this.mnuHelp});
+            // 
+            // menuItem1
+            // 
+            this.menuItem1.Index = 0;
+            this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuLoadTemplate,
+            this.mnuSaveTemplate,
+            this.menuItem6,
+            this.mnuSchedulingManagment,
+            this.menuItem5,
+            this.mnuClose});
+            this.menuItem1.Text = "&File";
+            // 
+            // mnuLoadTemplate
+            // 
+            this.mnuLoadTemplate.Index = 0;
+            this.mnuLoadTemplate.Text = "&Apply Template";
+            this.mnuLoadTemplate.Click += new System.EventHandler(this.mnuLoadTemplate_Click);
+            // 
+            // mnuSaveTemplate
+            // 
+            this.mnuSaveTemplate.Index = 1;
+            this.mnuSaveTemplate.Text = "&Save Template";
+            this.mnuSaveTemplate.Click += new System.EventHandler(this.mnuSaveTemplate_Click);
+            // 
+            // menuItem6
+            // 
+            this.menuItem6.Index = 2;
+            this.menuItem6.Text = "-";
+            // 
+            // mnuSchedulingManagment
+            // 
+            this.mnuSchedulingManagment.Index = 3;
+            this.mnuSchedulingManagment.Text = "Scheduling &Management";
+            this.mnuSchedulingManagment.Click += new System.EventHandler(this.mnuSchedulingManagment_Click);
+            // 
+            // menuItem5
+            // 
+            this.menuItem5.Index = 4;
+            this.menuItem5.Text = "-";
+            // 
+            // mnuClose
+            // 
+            this.mnuClose.Index = 5;
+            this.mnuClose.Text = "&Close";
+            this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
+            // 
+            // mnuAvailability
+            // 
+            this.mnuAvailability.Index = 1;
+            this.mnuAvailability.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuAddNewAV,
+            this.mnuRemoveAV,
+            this.mnuEditAV});
+            this.mnuAvailability.Text = "&Access Blocks";
+            this.mnuAvailability.Popup += new System.EventHandler(this.mnuAvailability_Popup);
+            // 
+            // mnuAddNewAV
+            // 
+            this.mnuAddNewAV.Index = 0;
+            this.mnuAddNewAV.Text = "&Add New Block";
+            this.mnuAddNewAV.Click += new System.EventHandler(this.mnuAddNewAV_Click);
+            // 
+            // mnuRemoveAV
+            // 
+            this.mnuRemoveAV.Index = 1;
+            this.mnuRemoveAV.Text = "&Remove Block";
+            this.mnuRemoveAV.Click += new System.EventHandler(this.mnuRemoveAV_Click);
+            // 
+            // mnuEditAV
+            // 
+            this.mnuEditAV.Index = 2;
+            this.mnuEditAV.Text = "&Edit Block";
+            this.mnuEditAV.Click += new System.EventHandler(this.mnuEditAV_Click);
+            // 
+            // mnuCalendar
+            // 
+            this.mnuCalendar.Index = 2;
+            this.mnuCalendar.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnu1Day,
+            this.mnu5Day,
+            this.mnu7Day,
+            this.menuItem7,
+            this.mnuTimeScale,
+            this.mnuViewRightPanel});
+            this.mnuCalendar.Text = "&View";
+            // 
+            // mnu1Day
+            // 
+            this.mnu1Day.Index = 0;
+            this.mnu1Day.Text = "&1-Day View";
+            this.mnu1Day.Click += new System.EventHandler(this.mnu1Day_Click);
+            // 
+            // mnu5Day
+            // 
+            this.mnu5Day.Index = 1;
+            this.mnu5Day.Text = "&5-Day View";
+            this.mnu5Day.Click += new System.EventHandler(this.mnu5Day_Click);
+            // 
+            // mnu7Day
+            // 
+            this.mnu7Day.Index = 2;
+            this.mnu7Day.Text = "&7-Day View";
+            this.mnu7Day.Click += new System.EventHandler(this.mnu7Day_Click);
+            // 
+            // menuItem7
+            // 
+            this.menuItem7.Index = 3;
+            this.menuItem7.Text = "-";
+            // 
+            // mnuTimeScale
+            // 
+            this.mnuTimeScale.Index = 4;
+            this.mnuTimeScale.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnu10Minute,
+            this.mnu15Minute,
+            this.mnu20Minute,
+            this.mnu30Minute});
+            this.mnuTimeScale.Text = "&Time Scale";
+            // 
+            // mnu10Minute
+            // 
+            this.mnu10Minute.Index = 0;
+            this.mnu10Minute.Text = "&10-Minute";
+            this.mnu10Minute.Click += new System.EventHandler(this.mnu10Minute_Click);
+            // 
+            // mnu15Minute
+            // 
+            this.mnu15Minute.Index = 1;
+            this.mnu15Minute.Text = "&15-Minute";
+            this.mnu15Minute.Click += new System.EventHandler(this.mnu15Minute_Click);
+            // 
+            // mnu20Minute
+            // 
+            this.mnu20Minute.Index = 2;
+            this.mnu20Minute.Text = "&20-Minute";
+            this.mnu20Minute.Click += new System.EventHandler(this.mnu20Minute_Click);
+            // 
+            // mnu30Minute
+            // 
+            this.mnu30Minute.Index = 3;
+            this.mnu30Minute.Text = "&30-Minute";
+            this.mnu30Minute.Click += new System.EventHandler(this.mnu30Minute_Click);
+            // 
+            // mnuViewRightPanel
+            // 
+            this.mnuViewRightPanel.Index = 5;
+            this.mnuViewRightPanel.Text = "&Access Block Clipboard";
+            this.mnuViewRightPanel.Click += new System.EventHandler(this.mnuViewRightPanel_Click);
+            // 
+            // mnuHelp
+            // 
+            this.mnuHelp.Index = 3;
+            this.mnuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuHelpAbout});
+            this.mnuHelp.Text = "&Help";
+            // 
+            // mnuHelpAbout
+            // 
+            this.mnuHelpAbout.Index = 0;
+            this.mnuHelpAbout.Text = "&About";
+            this.mnuHelpAbout.Click += new System.EventHandler(this.mnuHelpAbout_Click);
+            // 
+            // splitter1
+            // 
+            this.splitter1.Dock = System.Windows.Forms.DockStyle.Right;
+            this.splitter1.Location = new System.Drawing.Point(720, 24);
+            this.splitter1.Name = "splitter1";
+            this.splitter1.Size = new System.Drawing.Size(8, 402);
+            this.splitter1.TabIndex = 6;
+            this.splitter1.TabStop = false;
+            // 
+            // CGAVView
+            // 
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(848, 450);
+            this.Controls.Add(this.panelCenter);
+            this.Controls.Add(this.splitter1);
+            this.Controls.Add(this.panelTop);
+            this.Controls.Add(this.panelBottom);
+            this.Controls.Add(this.panelRight);
+            this.Controls.Add(this.tvSchedules);
+            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.Menu = this.mainMenu1;
+            this.Name = "CGAVView";
+            this.Text = "CGAVView";
+            this.Load += new System.EventHandler(this.CGAVView_Load);
+            this.Closing += new System.ComponentModel.CancelEventHandler(this.CGAVView_Closing);
+            this.panelRight.ResumeLayout(false);
+            this.panelClip.ResumeLayout(false);
+            this.panelBottom.ResumeLayout(false);
+            this.panelTop.ResumeLayout(false);
+            this.panelCenter.ResumeLayout(false);
+            this.ResumeLayout(false);
+
+		}
+		#endregion
+
+        private IContainer components;
+
+		#region Member Variables
+
+        private	CGAVDocument			m_Document;
+		private System.Windows.Forms.Panel panelRight;
+		private System.Windows.Forms.Panel panelBottom;
+		private System.Windows.Forms.Panel panelTop;
+		private System.Windows.Forms.Panel panelCenter;
+		private System.Windows.Forms.Label lblResource;
+		private System.Windows.Forms.TreeView tvSchedules;
+		private System.Windows.Forms.DateTimePicker dateTimePicker1;
+		private IndianHealthService.ClinicalScheduling.CalendarGrid calendarGrid1;
+		private System.Windows.Forms.StatusBar statusBar1;
+		private System.Windows.Forms.MainMenu mainMenu1;
+		private System.Windows.Forms.MenuItem mnuAvailability;
+		private System.Windows.Forms.MenuItem mnuAddNewAV;
+		private System.Windows.Forms.MenuItem mnuRemoveAV;
+		private System.Windows.Forms.MenuItem mnuEditAV;
+		private System.Windows.Forms.MenuItem menuItem1;
+		private System.Windows.Forms.MenuItem mnuSchedulingManagment;
+		private System.Windows.Forms.MenuItem menuItem5;
+		private System.Windows.Forms.MenuItem menuItem6;
+		private System.Windows.Forms.MenuItem mnuClose;
+		private System.Windows.Forms.MenuItem mnuHelp;
+		private System.Windows.Forms.MenuItem mnuHelpAbout;
+		private System.Windows.Forms.MenuItem mnuLoadTemplate;
+		private System.Windows.Forms.MenuItem mnuSaveTemplate;
+		private System.Windows.Forms.Panel panelClip;
+		private System.Windows.Forms.ListBox lstClip;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.MenuItem mnuCalendar;
+		private System.Windows.Forms.MenuItem mnuViewRightPanel;
+		private System.Windows.Forms.MenuItem mnuTimeScale;
+		private System.Windows.Forms.MenuItem mnu10Minute;
+		private System.Windows.Forms.MenuItem mnu15Minute;
+		private System.Windows.Forms.MenuItem mnu20Minute;
+		private System.Windows.Forms.MenuItem mnu30Minute;
+		private System.Windows.Forms.MenuItem menuItem7;
+		private System.Windows.Forms.MenuItem mnu1Day;
+		private System.Windows.Forms.MenuItem mnu5Day;
+		private System.Windows.Forms.MenuItem mnu7Day;
+		private System.Windows.Forms.Splitter splitter1;
+		private CGDocumentManager		m_DocManager;
+		private CGAppointments		m_ClipList;
+		private System.Windows.Forms.ContextMenu ctxApptClipMenu;
+		private System.Windows.Forms.MenuItem mnuRemoveClipItem;
+		private System.Windows.Forms.MenuItem mnuClearClipItems;
+		private System.Windows.Forms.ContextMenu ctxCalendarGrid;
+		private System.Windows.Forms.MenuItem ctxCalGridAdd;
+		private System.Windows.Forms.MenuItem ctxCalGridEdit;
+		private System.Windows.Forms.MenuItem ctxCalGridDelete;
+		private bool				m_bDragDropStart = false;
+
+		#endregion
+
+		#region Properties
+
+		/// <summary>
+		/// Access the CalendarGrid associated with this view
+		/// </summary>
+		public CalendarGrid CGrid
+		{
+			get
+			{
+				return this.calendarGrid1;
+			}
+		}
+		/// <summary>
+		/// Accesses the document associated with this view
+		/// </summary>
+		public CGAVDocument Document
+		{
+			get
+			{
+				return this.m_Document;
+			}
+			set
+			{
+				this.m_Document = value;
+			}
+		}
+
+		public CGDocumentManager DocManager
+		{
+			get
+			{
+				return m_DocManager;
+			}
+			set
+			{
+				m_DocManager = value;
+			}
+
+		}
+
+		public CGAppointments AVBlocks
+		{
+			get
+			{
+				return this.calendarGrid1.Appointments;
+			}
+			set
+			{
+				this.calendarGrid1.Appointments = value;
+			}
+		}
+
+		public DateTime StartDate
+		{
+			get
+			{
+				return this.calendarGrid1.StartDate;
+			}
+			set
+			{
+				this.calendarGrid1.StartDate = value;
+			}
+		}	
+		
+		#endregion //Properties
+
+		#region Methods
+
+		private void RaiseRPMSEvent(string sEvent, string sParams)
+		{
+			try
+			{
+				//Signal RPMS to raise an event
+//				string sSql;
+//				sSql = "BSDX RAISE EVENT^" + sEvent + "^" + sParams + "^^";
+//				DataTable dtAppt =m_DocManager.RPMSDataTable(sSql, "RaiseEvent");
+				this.m_DocManager.ConnectInfo.RaiseEvent(sEvent, sParams, true);
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}
+
+		void UpdateStatusBar(DateTime dStart, DateTime dEnd)
+		{
+			string sMsg =  dStart.ToShortTimeString() + " to " + dEnd.ToShortTimeString();
+			this.statusBar1.Text = sMsg;
+		}
+
+		private void AvailabilityEdit()
+		{
+			try
+			{
+				int nApptID = this.calendarGrid1.SelectedAppointment;
+				if (nApptID != 0)
+				{
+
+					CGAppointment pAppt = this.Document.AVBlocks.GetAppointment(nApptID);
+					DAccessBlock dA = new DAccessBlock();
+					dA.InitializePage(pAppt, m_DocManager.GlobalDataSet);
+					calendarGrid1.CGToolTip.Active = false;
+					if (dA.ShowDialog(this) == DialogResult.Cancel)
+					{
+						calendarGrid1.CGToolTip.Active = true;
+						return;
+					}
+					calendarGrid1.CGToolTip.Active = true;
+					this.Document.DeleteAvailability(nApptID);
+					this.Document.CreateAppointment(dA.Appointment);
+					this.calendarGrid1.Invalidate();
+					this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
+				}
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to add new access block  " +  ex.Message, "Clinical Scheduling");
+				return;
+			}
+			try
+			{
+				RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
+				this.calendarGrid1.Invalidate();
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}
+
+		private void AvailabilityAddNew()
+		{
+			try
+			{
+				CGAppointment appt = new CGAppointment();
+			
+				//Get Time and Resource from Selected Cell
+				DateTime dStart = DateTime.Today;
+				DateTime dEnd = DateTime.Today;
+				string sResource = "";
+				bool bRet = this.calendarGrid1.GetSelectedTime(out dStart, out dEnd, out sResource);
+				if (bRet == false)
+					return;
+
+				foreach (CGAppointment a in this.Document.m_AVBlocks.AppointmentTable.Values)
+				{
+					DateTime sStart2 = a.StartTime;
+					DateTime sEnd2 = a.EndTime;
+					if (CGSchedLib.TimesOverlap(dStart, dEnd, a.StartTime, a.EndTime))
+					{
+						MessageBox.Show("Access blocks may not overlap.","Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+						return;
+					}
+				}
+			
+				string sNote = "";
+				DAccessBlock dA = new DAccessBlock();
+				dA.InitializePage(dStart, dEnd, sResource, sNote, this.m_DocManager.GlobalDataSet);
+				if (dA.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+				appt.StartTime = dStart;
+				appt.EndTime = dEnd;
+				appt.Resource = sResource;
+				appt.Note = " " + dA.Note; // + ": " + dA.Slots.ToString()+ " Slots";
+				appt.AccessTypeID = dA.AccessTypeID;
+				appt.Slots = dA.Slots;
+
+				//Call Document to add a new appointment
+				this.Document.CreateAppointment(appt);
+				this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to add new access block  " +  ex.Message, "Clinical Scheduling");
+				return;
+			}
+			try
+			{
+				RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
+				this.calendarGrid1.Invalidate();
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}//End AvailabilityAddNew
+
+		private void AppointmentDelete() 
+		{
+			calendarGrid1.CGToolTip.Active = false;
+			string sMsg = " this access block?";
+			if (calendarGrid1.SelectedAppointments.AppointmentTable.Count > 1)
+				sMsg = " these access blocks?";
+
+			if (MessageBox.Show("Are you sure you want to delete" + sMsg, "Clinical Scheduling",  MessageBoxButtons.YesNo) != DialogResult.Yes)
+			{
+				calendarGrid1.CGToolTip.Active = true;
+				return;
+			}
+			calendarGrid1.CGToolTip.Active = true;
+
+			bool bDeleted = false;
+			foreach (CGAppointment a in this.calendarGrid1.SelectedAppointments.AppointmentTable.Values)
+			{
+				int nApptID = a.AppointmentKey;
+				Debug.Assert(nApptID != 0);
+				try
+				{
+					Document.DeleteAvailability(nApptID);
+					bDeleted = true;
+				}
+				catch (Exception ex)
+				{
+					MessageBox.Show("Unable to delete access block" +  ex.Message, "Clinical Scheduling");
+				}
+			}
+			if (bDeleted == true)
+			{
+				try
+				{
+					this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
+					RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
+				}
+				catch (Exception ex)
+				{
+					Debug.Write(ex.Message);
+				}
+				this.calendarGrid1.Invalidate();
+			}		
+		}
+
+		private void AccessTypeManage()
+		{
+//			DAccessType dAT = new DAccessType();
+//			dAT.InitializePage(0, this.m_DocManager.GlobalDataSet, this.m_DocManager.ADOConnection);
+//			if (dAT.ShowDialog(this) == DialogResult.Cancel)
+//			{
+//				return;
+//			}
+		}
+
+		private void SchedulingManagement()
+		{
+			try
+			{
+				bool bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "+");
+				if (bLock == false)
+				{
+					throw new Exception("Another user is currently in Scheduling Management.  Try later.");
+				}
+
+				DManagement dMgm = new DManagement();
+				dMgm.InitializeDialog(this.m_DocManager);
+			
+				if (dMgm.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+				bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "-");
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Scheduling Management Error:  " +  ex.Message, "Clinical Scheduling");
+			}
+		}
+
+		public void UpdateArrays()
+		{
+			//TODO:  Create these components
+			this.calendarGrid1.Resources = this.m_Document.Resources;
+			this.calendarGrid1.OnUpdateArrays();
+			this.lblResource.Text = this.m_Document.DocName;
+			
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+		#endregion //Methods
+
+		#region Events
+
+		private void dateTimePicker1_ValueChanged(object sender, System.EventArgs e)
+		{
+			DateTime dDate = dateTimePicker1.Value;
+			dDate = dDate.Date;
+			this.Document.SelectedDate = dDate;
+			if (this.calendarGrid1.Columns > 1)
+			{
+				this.StartDate = this.Document.StartDate;
+			}
+			else
+			{
+				this.StartDate = this.Document.SelectedDate;
+			}
+			this.Document.UpdateAllViews();
+			this.calendarGrid1.Invalidate();
+		}
+
+		private void CGAVView_Load(object sender, System.EventArgs e)
+		{
+			Debug.Assert (this.Document != null);
+
+			//Register the view
+			CGDocumentManager.Current.RegisterAVDocumentView(this.Document, this);
+            this.mnu5Day.Click += new System.EventHandler(this.dateTimePicker1_ValueChanged); // MJL 1/17/2007
+            this.mnu7Day.Click += new System.EventHandler(this.dateTimePicker1_ValueChanged);
+
+		}
+
+		private void CGAVView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+		{
+			this.calendarGrid1.CloseGrid();
+			DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXRES(" + Document.ResourceID.ToString() + ")", "-");
+		}
+
+		private void calendarGrid1_CGSelectionChanged(object sender, IndianHealthService.ClinicalScheduling.CGSelectionChangedArgs e)
+		{
+			UpdateStatusBar(e.StartTime, e.EndTime);
+		}
+
+		private void calendarGrid1_CGAppointmentChanged(object sender, IndianHealthService.ClinicalScheduling.CGAppointmentChangedArgs e)
+		{
+			try
+			{
+//				this.DocManager.EnableAutoRefresh(false);
+
+				if (MessageBox.Show("Are you sure you want to move this access block?", "Clinical Scheduling",  MessageBoxButtons.YesNo) != DialogResult.Yes)
+					return;
+
+				m_Document.ChangeAppointmentTime(e.Appointment, e.StartTime, e.EndTime, e.Resource);
+				this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to change access block  " +  ex.Message, "Clinical Scheduling");
+				this.m_DocManager.UpdateViews();
+				return;
+			}
+			finally
+			{
+//				this.DocManager.EnableAutoRefresh(true);
+			}
+			try
+			{
+				RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
+				this.calendarGrid1.Invalidate();
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}
+
+		private void mnuAddNewAV_Click(object sender, System.EventArgs e)
+		{
+			AvailabilityAddNew();
+		}
+
+		private void mnuRemoveAV_Click(object sender, System.EventArgs e)
+		{
+			this.AppointmentDelete();
+		}
+
+		private void mnuManageAT_Click(object sender, System.EventArgs e)
+		{
+			AccessTypeManage();
+		}
+
+		private void mnuEditAV_Click(object sender, System.EventArgs e)
+		{
+			AvailabilityEdit();
+		}
+
+		private void mnuAvailability_Popup(object sender, System.EventArgs e)
+		{
+			this.mnuAddNewAV.Enabled = (this.calendarGrid1.SelectedRange.Cells.CellCount > 0);	
+			this.mnuEditAV.Enabled = (this.calendarGrid1.SelectedAppointment > 0);
+			this.mnuRemoveAV.Enabled = (this.calendarGrid1.SelectedAppointment > 0);
+		}
+
+		private void mnuSchedulingManagment_Click(object sender, System.EventArgs e)
+		{
+			SchedulingManagement();
+		}
+
+		#endregion //Events
+
+		private void mnuClose_Click(object sender, System.EventArgs e)
+		{
+			DialogResult dr = MessageBox.Show("Are you sure you want to close this schedule?", Application.ProductName, MessageBoxButtons.OKCancel);
+			if (dr != DialogResult.OK)
+				return;
+
+			this.Close();
+		}
+
+		private void mnuHelpAbout_Click(object sender, System.EventArgs e)
+		{
+			MessageBox.Show("Clinical Scheduling Version " + Application.ProductVersion, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Information);	
+		}
+
+		private void ImplementMsg()
+		{
+			MessageBox.Show("Clinical Scheduling", "TODO: Implement this function");
+		}
+
+		private void mnuLoadTemplate_Click(object sender, System.EventArgs e)
+		{
+			/*
+			 * Display dialog to collect:
+			 * - Number of weeks to apply template
+			 * - Starting week Monday
+			 * - Template path & filename
+			 * 
+			 * for each week,
+			 *	Delete all availability during that week
+			 *  apply the template
+			 * 
+			 */
+			DAccessTemplate dlg = new DAccessTemplate();
+			dlg.InitializePage();
+			if (dlg.ShowDialog(this) == DialogResult.Cancel)
+			{
+				return;
+			}
+
+			try
+			{
+				OpenFileDialog openFileDialog1 = dlg.FileDialog;
+				Stream streamFile;
+				if((streamFile = openFileDialog1.OpenFile())== null)
+				{
+					MessageBox.Show("Unable to open template file.");
+					return;
+				}
+
+				BinaryFormatter formatter = new BinaryFormatter();
+				CGAppointments cgaTemp = (CGAppointments) formatter.Deserialize(streamFile);
+				streamFile.Close();
+
+				DateTime dtStart = dlg.StartDate;
+				int nWeeksToApply = dlg.WeeksToApply;
+				DateTime dtEnd = dtStart.AddDays(6); // or 7?
+				string sResourceID = this.m_Document.ResourceID.ToString();
+				DataTable dt;
+
+				for (int j=1; j < nWeeksToApply + 1; j++)
+				{
+					//Convert start and end to string
+					string sStart = dtStart.ToString("M/d/yyyy");
+					string sEnd = dtEnd.ToString("M/d/yyyy");
+
+					//Cancel all existing access blocks in the date range
+					string sSql = "BSDX CANCEL AV BY DATE^" + sResourceID + "^" + sStart + "^" + sEnd;
+					dt = this.m_DocManager.RPMSDataTable(sSql, "Cancelled");
+
+					//for each CGAppointment in AVBlocks, call AddNew
+					string sResource = "";
+					sResource = (string) this.Document.Resources[0];
+					foreach (CGAppointment a in cgaTemp.AppointmentTable.Values)
+					{
+						//Change the resource to the current one
+						a.Resource = sResource;
+
+						//Change the date to correspond to the GridColumn member
+						int col = a.GridColumn;
+						col--;
+						DateTime dBuildDate = dtStart.Date;
+						dBuildDate = dBuildDate.AddDays(col);
+						dBuildDate = dBuildDate.AddHours(a.StartTime.Hour);
+						dBuildDate = dBuildDate.AddMinutes(a.StartTime.Minute);
+						a.StartTime = dBuildDate;
+						dBuildDate = dtStart.Date;
+						dBuildDate = dBuildDate.AddDays(col);
+						dBuildDate = dBuildDate.AddHours(a.EndTime.Hour);
+						dBuildDate = dBuildDate.AddMinutes(a.EndTime.Minute);
+						a.EndTime = dBuildDate;
+
+						//Call Document to add a new appointment
+						this.Document.CreateAppointmentAuto(a);
+					}
+
+					//Increment start and end
+					dtStart = dtStart.AddDays(7);
+					dtEnd = dtStart.AddDays(6);
+
+				}//end for
+				try
+				{
+					RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
+				}
+				catch (Exception ex)
+				{
+					Debug.Write(ex.Message);
+				}
+				this.calendarGrid1.Invalidate();
+				this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(this, "Error loading template:  " + ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+			}
+		}
+
+				//Check that there are no blocks in document
+//				if (this.Document.AVBlocks.AppointmentTable.Count > 0)
+//				{
+//					Exception bmxex = new Exception("You may not load a template if there are already access blocks defined for the week.");
+//					throw bmxex;
+//				}
+//				OpenFileDialog openFileDialog1 = new OpenFileDialog();
+//				string sPath = "";
+//				sPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+//
+//				openFileDialog1.InitialDirectory = "c:\\" ;
+//				openFileDialog1.InitialDirectory = sPath ;
+//				openFileDialog1.Filter = "Schedule Template Files (*.bsdxa)|*.bsdxa|All files (*.*)|*.*" ;
+//				openFileDialog1.FilterIndex = 0 ;
+//				openFileDialog1.RestoreDirectory = true ;
+
+//				Stream streamFile;
+//				if(openFileDialog1.ShowDialog() == DialogResult.OK)
+//				{
+//					if((streamFile = openFileDialog1.OpenFile())!= null)
+//					{
+//						BinaryFormatter formatter = new BinaryFormatter();
+//						CGAppointments cgaTemp = (CGAppointments) formatter.Deserialize(streamFile);
+//						streamFile.Close();
+//
+//						//for each CGAppointment in AVBlocks, call AddNew
+//						string sResource = "";
+//						sResource = (string) this.Document.Resources[0];
+//						foreach (CGAppointment a in cgaTemp.AppointmentTable.Values)
+//						{
+//							//Change the resource to the current one
+//							a.Resource = sResource;
+//
+//							//Change the date to correspond to the GridColumn member
+//							int col = a.GridColumn;
+//							Rectangle r = new Rectangle(0,0,0,0);
+//							int row = 5;
+//							CGCell c = new CGCell(r, row, col);
+//							DateTime dTemp = this.calendarGrid1.GetTimeFromCell(c);
+//							DateTime dBuildDate = dTemp.Date;
+//							dBuildDate = dBuildDate.AddHours(a.StartTime.Hour);
+//							dBuildDate = dBuildDate.AddMinutes(a.StartTime.Minute);
+//							a.StartTime = dBuildDate;
+//							dBuildDate = dTemp.Date;
+//							dBuildDate = dBuildDate.AddHours(a.EndTime.Hour);
+//							dBuildDate = dBuildDate.AddMinutes(a.EndTime.Minute);
+//							a.EndTime = dBuildDate;
+//
+//							//Call Document to add a new appointment
+//							this.Document.CreateAppointment(a);
+//						}
+//						try
+//						{
+//							RaiseRPMSEvent("SCHEDULE-" + m_Document.DocName, "");
+//						}
+//						catch (Exception ex)
+//						{
+//							Debug.Write(ex.Message);
+//						}
+//						this.calendarGrid1.Invalidate();
+//						this.m_DocManager.UpdateViews((string) this.m_Document.Resources[0], "");
+//					}
+//				}
+//			}//end try
+//			catch (Exception ex)
+//			{
+//				MessageBox.Show(this, "Error loading template:  " + ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+//			}
+//		}
+
+		private void mnuSaveTemplate_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				//Check that there is at least one block in document
+//				if (this.Document.AVBlocks.AppointmentTable.Count == 0)
+//				{
+//					Exception bmxex = new Exception("You may not save a template if there are no access blocks defined for the week.");
+//					throw bmxex;
+//				}
+
+				Stream streamFile ;
+				SaveFileDialog saveFileDialog1 = new SaveFileDialog();
+ 
+				saveFileDialog1.Filter = "Schedule Template Files (*.bsdxa)|*.bsdxa|All files (*.*)|*.*" ;
+				saveFileDialog1.FilterIndex = 0 ;
+				saveFileDialog1.RestoreDirectory = true ;
+				saveFileDialog1.AddExtension = true;
+				saveFileDialog1.DefaultExt = "bsdxa";
+ 
+				//Iterate through AVBlocks and set the GridColumn member based on the date
+				foreach (CGAppointment a in this.Document.AVBlocks.AppointmentTable.Values)
+				{
+					//Get the column by subtracting the grid's Start day from dStart.		
+					int col =(int) a.StartTime.DayOfWeek - (int) this.calendarGrid1.StartDate.DayOfWeek + 1;
+					a.GridColumn = col;
+				}
+
+				if(saveFileDialog1.ShowDialog() == DialogResult.OK)
+				{
+					if((streamFile = saveFileDialog1.OpenFile()) != null)
+					{
+						BinaryFormatter formatter = new BinaryFormatter();
+
+						formatter.Serialize(streamFile, this.Document.AVBlocks);
+
+						streamFile.Close();
+					}
+				}
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(this, "Error saving template:  " + ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+			}
+		}
+
+		private void mnuViewRightPanel_Click(object sender, System.EventArgs e)
+		{
+			this.mnuViewRightPanel.Checked = this.panelRight.Visible;
+			this.panelRight.Visible = !(this.panelRight.Visible);
+			this.mnuViewRightPanel.Checked = !(this.mnuViewRightPanel.Checked);
+		}
+
+		private void lstClip_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
+		{
+			try
+			{
+				CGAppointment a = (CGAppointment) e.Data.GetData(typeof(CGAppointment));
+				if (m_ClipList.AppointmentTable.Contains((int) a.AppointmentKey))
+				{
+					return;
+				}
+				m_ClipList.AddAppointment(a);
+				lstClip.Items.Add(a);
+			}
+			catch(Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}		
+		}
+
+		private void lstClip_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
+		{
+			bool b = e.Data.GetDataPresent(typeof(CGAppointment));
+			if (b == true)
+			{
+				e.Effect = DragDropEffects.Move;
+			}
+			else
+			{
+				e.Effect = DragDropEffects.None;
+			}
+		}
+
+		private void lstClip_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
+		{
+			m_bDragDropStart = false;
+		}
+
+		private void lstClip_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
+		{
+			try
+			{
+				if ((m_bDragDropStart == false)&&(lstClip.SelectedIndex > -1))
+				{
+					CGAppointment a = (CGAppointment) lstClip.Items[lstClip.SelectedIndex];
+					this.calendarGrid1.ApptDragSource = "list";
+					DragDropEffects effect = DoDragDrop(a, DragDropEffects.Move);
+					m_bDragDropStart = true;
+				}
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}
+
+		private void calendarGrid1_CGAppointmentAdded(object sender, IndianHealthService.ClinicalScheduling.CGAppointmentChangedArgs e)
+		{
+			//CalendarGrid Event raised when appointment is dragdropped onto the grid
+
+			try
+			{
+				CGAppointment aCopy = new CGAppointment();
+				aCopy.CreateAppointment(e.StartTime, e.EndTime, e.Appointment.Note, 0, e.Resource);
+				aCopy.AccessTypeID = e.AccessTypeID;
+				aCopy.Slots = e.Slots;
+
+				m_Document.CreateAppointment(aCopy);
+				//			RaiseRPMSEvent("SCHEDULE-" + e.Resource , "");
+				this.m_DocManager.UpdateViews(e.Resource, e.OldResource);
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to add new access block  " +  ex.Message, "Clinical Scheduling");
+				return;
+			}
+			try
+			{
+				RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
+				if (e.Resource != e.OldResource)
+					RaiseRPMSEvent("BSDX SCHEDULE", m_Document.DocName);
+				this.calendarGrid1.Invalidate();
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}
+
+		#region ctxApptClipMenu Handlers
+
+		private void ctxApptClipMenu_Popup(object sender, System.EventArgs e)
+		{
+			mnuClearClipItems.Enabled = (m_ClipList.AppointmentTable.Count > 0);
+			mnuRemoveClipItem.Enabled = (lstClip.SelectedIndex > -1);
+		}
+
+		private void mnuRemoveClipItem_Click(object sender, System.EventArgs e)
+		{
+			int i = lstClip.SelectedIndex;
+			CGAppointment a = (CGAppointment) lstClip.SelectedItem;
+			int nKey = a.AppointmentKey;
+			if (i > -1)
+			{
+				m_ClipList.RemoveAppointment(nKey);
+				lstClip.Items.RemoveAt(i);
+			}
+		}
+
+		private void mnuClearClipItems_Click(object sender, System.EventArgs e)
+		{
+			this.m_ClipList.ClearAllAppointments();
+			lstClip.Items.Clear();
+		}
+
+		#endregion ctxApptClipMenu Handlers
+
+		#region ctxCalGridMenu Handlers
+
+		private void ctxCalGridAdd_Click(object sender, System.EventArgs e)
+		{
+			AvailabilityAddNew();
+		}
+
+		private void ctxCalGridEdit_Click(object sender, System.EventArgs e)
+		{
+			AvailabilityEdit();
+		}
+
+		private void ctxCalGridDelete_Click(object sender, System.EventArgs e)
+		{
+			AppointmentDelete();
+		}
+
+		private void ctxCalendarGrid_Popup(object sender, System.EventArgs e)
+		{
+			//Toggle availability of make, edit and delete appointments
+			//based on whether appropriate element is selected.
+			ctxCalGridAdd.Enabled = ((calendarGrid1.SelectedRange.Cells.CellCount > 0) );	
+			ctxCalGridDelete.Enabled = (calendarGrid1.SelectedAppointment > 0);
+			ctxCalGridEdit.Enabled = (calendarGrid1.SelectedAppointment > 0);
+		}
+
+		private void calendarGrid1_DoubleClick(object sender, System.EventArgs e)
+		{
+			if (calendarGrid1.SelectedAppointment > 0)
+				AvailabilityEdit();
+		}
+
+		#endregion ctxCalGridMenu Handlers
+
+		private void mnu10Minute_Click(object sender, System.EventArgs e)
+		{
+			CalendarGrid cg = this.calendarGrid1;
+			cg.TimeScale = 10;
+			PositionGrid(cg, 7);		
+		}
+
+		private void mnu15Minute_Click(object sender, System.EventArgs e)
+		{
+			CalendarGrid cg = this.calendarGrid1;
+			cg.TimeScale = 15;
+			PositionGrid(cg, 7);		
+		}
+
+		private void mnu20Minute_Click(object sender, System.EventArgs e)
+		{
+			CalendarGrid cg = this.calendarGrid1;
+			cg.TimeScale = 20;
+			PositionGrid(cg, 7);		
+		}
+
+		private void mnu30Minute_Click(object sender, System.EventArgs e)
+		{
+			CalendarGrid cg = this.calendarGrid1;
+			cg.TimeScale = 30;
+			PositionGrid(cg, 7);		
+		}
+
+		private void mnu1Day_Click(object sender, System.EventArgs e)
+		{
+			DateTime dtPicker = dateTimePicker1.Value;
+			DateTime DayOnly = new DateTime(dtPicker.Year, dtPicker.Month, dtPicker.Day);
+			this.calendarGrid1.StartDate = DayOnly;
+			this.calendarGrid1.Columns = 1;
+		}
+
+		private void mnu5Day_Click(object sender, System.EventArgs e)
+		{
+			if (this.calendarGrid1.Columns == 1)
+			{
+				this.StartDate = this.Document.StartDate;
+			}
+
+			this.calendarGrid1.Columns = 5;
+			this.Document.UpdateAllViews();
+		}
+
+		private void mnu7Day_Click(object sender, System.EventArgs e)
+		{
+			this.calendarGrid1.Columns = 7;
+		}
+
+		private void PositionGrid(CalendarGrid cg, int nHour)
+		{
+			//Position grid to nHour
+			int nRow = 0, nCol = 0;
+			DateTime dStart = DateTime.Today;
+			dStart = dStart.AddHours(nHour);
+			cg.GetCellFromTime(dStart, ref nRow, ref nCol, false, "");
+			int nHeight = cg.CellHeight;
+			nHeight *= nRow;
+			cg.AutoScrollPosition = new Point(50, nHeight);
+			cg.Invalidate();
+		}
+	}
+}
Index: Scheduling/branches/GUI1.2/CGAVView.resx
===================================================================
--- Scheduling/branches/GUI1.2/CGAVView.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/CGAVView.resx	(revision 855)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="ctxApptClipMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="ctxCalendarGrid.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>151, 17</value>
+  </metadata>
+  <data name="calendarGrid1.Resources" mimetype="application/x-microsoft.net.object.binary.base64">
+    <value>
+        AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRl
+        bXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAAAAAAAAAAAQAgAAAAAAAAAL
+</value>
+  </data>
+  <metadata name="mainMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>281, 17</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAABAAIAICAQAAAAAADoAgAAJgAAABAQEAAAAAAAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAIAC
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAAAAD/AAD/
+        AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIh3iI
+        iId4iAAAAAAAAAAACId4iIiHeIAiIiIggAAAAAAAAAAAAAgCqqqqoggAAAAAAAAAAACAKqqqqiAIAAiH
+        eId4iIiIAqqqqqIAAIAIh3iHeIiIgCqqqqogAACAAAAAAAAACAKqqqqiAAAAgAAAAAAAAIAqqqqqIAAA
+        AIAAAAAAAAgCqqqqogAAAAgAAAAAAAAAIiIiIiAAAACAAAAA////8AAAAAAAAAAIAAAAAP////8Aqqqq
+        IAAAgAAAAAD/iIj/gCqqqqIACAAAAAAA/4iI/4gCqqqqIIAAAAAAAP//////8AAAAAgAAAAAAAD/////
+        //+IiIiPAAAAAAAA/4iI/4iI/4iI/wAAAAAAAP+IiP+IiP+IiP8AAAAAAAD/////////////AAAAAAAA
+        /////////////wAAAAAAAP+IiP+IiP+IiP8AAAAAAAD/iIj/iIj/iIj/AAAAAAAA/////////////wAA
+        AAAAAP////////////8AAAAAAERERERERERERERERAAAAABEREREREREREREREQAAAAARERERERERERE
+        REREAAAAAERERERERERERERERAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////
+        ///4AAAP+AAAB///gAP//wADgAAAAYAAAAH/+AAB//AAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8AA
+        AD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/////////
+        //8oAAAAEAAAACAAAAABAAQAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAA
+        AACAAIAAgIAAAMDAwACAgIAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAHh4iHgA
+        CAAAAAAAACIiAAh4eIgCqqIIAAAAACqqIAAAAAACqqIAAAAP/wAAAAAAAA+IgKqiAAAAD//4AADwAAAP
+        iPiPiPAAAA//////8AAAD4j4j4jwAAAP//////AAAERERERERAAAREREREREAAAAAAAAAAAA//8AAMAD
+        AAD/gQAAgAAAAP4AAADAAQAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAA//8AAA==
+</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/CGAppointment.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGAppointment.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGAppointment.cs	(revision 855)
@@ -0,0 +1,305 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    using System.Drawing;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    [Serializable]
+    public class CGAppointment
+    {
+        private bool m_bAccessBlock;
+        private bool m_bNoShow;
+        private bool m_bSelected = false;
+        private bool m_bWalkIn;
+        public DateTime m_dAuxTime;
+        public DateTime m_dCheckIn;
+        private DateTime m_EndTime;
+        public int m_nAccessTypeID = -1;
+        private int m_nColumn;
+        public int m_nKey;
+        private string m_Note;
+        public int m_nPatientID;
+        public int m_nSlots;
+        private Rectangle m_rectangle;
+        public string m_sAccessTypeName;
+        private string m_sHRN = "";
+        private string m_sPatientName;
+        public string m_sResource;
+        private DateTime m_StartTime;
+        private string m_Text;
+
+        public void CreateAppointment(DateTime StartTime, DateTime EndTime, string Note, int Key, string sResource)
+        {
+            this.m_StartTime = StartTime;
+            this.m_EndTime = EndTime;
+            this.m_Note = Note;
+            this.m_nKey = Key;
+            this.m_sResource = sResource;
+        }
+
+        public override string ToString()
+        {
+            string patientName = "";
+            if (this.m_bAccessBlock)
+            {
+                string str2 = (this.Slots == 1) ? " Slot, " : " Slots, ";
+                return ((((this.AccessTypeName + ": ") + this.Slots.ToString() + str2) + this.Duration.ToString() + " Minutes. ") + this.Note);
+            }
+            patientName = this.PatientName;
+            if (this.HealthRecordNumber != "")
+            {
+                patientName = patientName + " #" + this.HealthRecordNumber;
+            }
+            return (patientName + " " + this.Note);
+        }
+
+        public int AccessTypeID
+        {
+            get
+            {
+                return this.m_nAccessTypeID;
+            }
+            set
+            {
+                this.m_nAccessTypeID = value;
+            }
+        }
+
+        public string AccessTypeName
+        {
+            get
+            {
+                return this.m_sAccessTypeName;
+            }
+            set
+            {
+                this.m_sAccessTypeName = value;
+            }
+        }
+
+        public int AppointmentKey
+        {
+            get
+            {
+                return this.m_nKey;
+            }
+            set
+            {
+                this.m_nKey = value;
+            }
+        }
+
+        public DateTime AuxTime
+        {
+            get
+            {
+                return this.m_dAuxTime;
+            }
+            set
+            {
+                this.m_dAuxTime = value;
+            }
+        }
+
+        public DateTime CheckInTime
+        {
+            get
+            {
+                return this.m_dCheckIn;
+            }
+            set
+            {
+                this.m_dCheckIn = value;
+            }
+        }
+
+        public int Duration
+        {
+            get
+            {
+                TimeSpan span = (TimeSpan) (this.EndTime - this.StartTime);
+                return (int) span.TotalMinutes;
+            }
+        }
+
+        public DateTime EndTime
+        {
+            get
+            {
+                return this.m_EndTime;
+            }
+            set
+            {
+                this.m_EndTime = value;
+            }
+        }
+
+        public int GridColumn
+        {
+            get
+            {
+                return this.m_nColumn;
+            }
+            set
+            {
+                this.m_nColumn = value;
+            }
+        }
+
+        public Rectangle GridRectangle
+        {
+            get
+            {
+                return this.m_rectangle;
+            }
+            set
+            {
+                this.m_rectangle = value;
+            }
+        }
+
+        public string HealthRecordNumber
+        {
+            get
+            {
+                return this.m_sHRN;
+            }
+            set
+            {
+                this.m_sHRN = value;
+            }
+        }
+
+        public bool IsAccessBlock
+        {
+            get
+            {
+                return this.m_bAccessBlock;
+            }
+            set
+            {
+                this.m_bAccessBlock = value;
+            }
+        }
+
+        public bool NoShow
+        {
+            get
+            {
+                return this.m_bNoShow;
+            }
+            set
+            {
+                this.m_bNoShow = value;
+            }
+        }
+
+        public string Note
+        {
+            get
+            {
+                return this.m_Note;
+            }
+            set
+            {
+                this.m_Note = value;
+            }
+        }
+
+        public int PatientID
+        {
+            get
+            {
+                return this.m_nPatientID;
+            }
+            set
+            {
+                this.m_nPatientID = value;
+            }
+        }
+
+        public string PatientName
+        {
+            get
+            {
+                return this.m_sPatientName;
+            }
+            set
+            {
+                this.m_sPatientName = value;
+            }
+        }
+
+        public string Resource
+        {
+            get
+            {
+                return this.m_sResource;
+            }
+            set
+            {
+                this.m_sResource = value;
+            }
+        }
+
+        public bool Selected
+        {
+            get
+            {
+                return this.m_bSelected;
+            }
+            set
+            {
+                this.m_bSelected = value;
+            }
+        }
+
+        public int Slots
+        {
+            get
+            {
+                return this.m_nSlots;
+            }
+            set
+            {
+                this.m_nSlots = value;
+            }
+        }
+
+        public DateTime StartTime
+        {
+            get
+            {
+                return this.m_StartTime;
+            }
+            set
+            {
+                this.m_StartTime = value;
+            }
+        }
+
+        public string Text
+        {
+            get
+            {
+                this.m_Text = this.m_sPatientName;
+                return this.m_Text;
+            }
+        }
+
+        public bool WalkIn
+        {
+            get
+            {
+                return this.m_bWalkIn;
+            }
+            set
+            {
+                this.m_bWalkIn = value;
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/CGAppointmentChangedArgs.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGAppointmentChangedArgs.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGAppointmentChangedArgs.cs	(revision 855)
@@ -0,0 +1,104 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    [Serializable]
+    public class CGAppointmentChangedArgs : EventArgs
+    {
+        private DateTime m_dEnd;
+        private DateTime m_dStart;
+        private int m_nAccessTypeID;
+        private int m_nSlots;
+        private CGAppointment m_pAppt;
+        private string m_sOldResource;
+        private string m_sResource;
+
+        public int AccessTypeID
+        {
+            get
+            {
+                return this.m_nAccessTypeID;
+            }
+            set
+            {
+                this.m_nAccessTypeID = value;
+            }
+        }
+
+        public CGAppointment Appointment
+        {
+            get
+            {
+                return this.m_pAppt;
+            }
+            set
+            {
+                this.m_pAppt = value;
+            }
+        }
+
+        public DateTime EndTime
+        {
+            get
+            {
+                return this.m_dEnd;
+            }
+            set
+            {
+                this.m_dEnd = value;
+            }
+        }
+
+        public string OldResource
+        {
+            get
+            {
+                return this.m_sOldResource;
+            }
+            set
+            {
+                this.m_sOldResource = value;
+            }
+        }
+
+        public string Resource
+        {
+            get
+            {
+                return this.m_sResource;
+            }
+            set
+            {
+                this.m_sResource = value;
+            }
+        }
+
+        public int Slots
+        {
+            get
+            {
+                return this.m_nSlots;
+            }
+            set
+            {
+                this.m_nSlots = value;
+            }
+        }
+
+        public DateTime StartTime
+        {
+            get
+            {
+                return this.m_dStart;
+            }
+            set
+            {
+                this.m_dStart = value;
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/CGAppointmentChangedHandler.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGAppointmentChangedHandler.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGAppointmentChangedHandler.cs	(revision 855)
@@ -0,0 +1,11 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    using System.Runtime.CompilerServices;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    public delegate void CGAppointmentChangedHandler(object sender, CGAppointmentChangedArgs e);
+}
+
Index: Scheduling/branches/GUI1.2/CGAppointments.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGAppointments.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGAppointments.cs	(revision 855)
@@ -0,0 +1,60 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    using System.Collections;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    [Serializable]
+    public class CGAppointments : IEnumerable
+    {
+        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;
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/CGAvailability.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGAvailability.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGAvailability.cs	(revision 855)
@@ -0,0 +1,218 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    using System.Drawing;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    public class CGAvailability
+    {
+        private DateTime m_EndTime;
+        private int m_nAvailabilityType;
+        private int m_nBlue;
+        private int m_nGreen;
+        private int m_nRed;
+        private int m_nSlots;
+        private string m_sAccessRuleList;
+        private string m_sAccessTypeName;
+        private string m_sDisplayColor = "Cornsilk";
+        private string m_sNote;
+        private string m_sResourceList;
+        private DateTime m_StartTime;
+
+        public CGAvailability()
+        {
+            Color color = Color.FromName("Khaki");
+            this.m_nRed = color.R;
+            this.m_nGreen = color.G;
+            this.m_nBlue = color.B;
+            this.m_sNote = "";
+        }
+
+        public void Create(DateTime StartTime, DateTime EndTime, int nSlots)
+        {
+            this.m_StartTime = StartTime;
+            this.m_EndTime = EndTime;
+            this.m_nAvailabilityType = 0;
+            this.m_nSlots = nSlots;
+            this.m_sResourceList = "";
+            this.m_sAccessRuleList = "";
+        }
+
+        public void Create(DateTime StartTime, DateTime EndTime, int nAvailabilityType, int nSlots)
+        {
+            this.m_StartTime = StartTime;
+            this.m_EndTime = EndTime;
+            this.m_nAvailabilityType = nAvailabilityType;
+            this.m_nSlots = nSlots;
+            this.m_sResourceList = "";
+            this.m_sAccessRuleList = "";
+        }
+
+        public void Create(DateTime StartTime, DateTime EndTime, int nAvailabilityType, int nSlots, string sResourceList)
+        {
+            this.m_StartTime = StartTime;
+            this.m_EndTime = EndTime;
+            this.m_nAvailabilityType = nAvailabilityType;
+            this.m_nSlots = nSlots;
+            this.m_sResourceList = sResourceList;
+            this.m_sAccessRuleList = "";
+        }
+
+        public void Create(DateTime StartTime, DateTime EndTime, int nAvailabilityType, int nSlots, string sResourceList, string sAccessRuleList)
+        {
+            this.m_StartTime = StartTime;
+            this.m_EndTime = EndTime;
+            this.m_nAvailabilityType = nAvailabilityType;
+            this.m_nSlots = nSlots;
+            this.m_sResourceList = sResourceList;
+            this.m_sAccessRuleList = sAccessRuleList;
+        }
+
+        public string AccessRuleList
+        {
+            get
+            {
+                return this.m_sAccessRuleList;
+            }
+            set
+            {
+                this.m_sAccessRuleList = value;
+            }
+        }
+
+        public string AccessTypeName
+        {
+            get
+            {
+                return this.m_sAccessTypeName;
+            }
+            set
+            {
+                this.m_sAccessTypeName = value;
+            }
+        }
+
+        public int AvailabilityType
+        {
+            get
+            {
+                return this.m_nAvailabilityType;
+            }
+            set
+            {
+                this.m_nAvailabilityType = value;
+            }
+        }
+
+        public int Blue
+        {
+            get
+            {
+                return this.m_nBlue;
+            }
+            set
+            {
+                this.m_nBlue = value;
+            }
+        }
+
+        public string DisplayColor
+        {
+            get
+            {
+                return this.m_sDisplayColor;
+            }
+            set
+            {
+                this.m_sDisplayColor = value;
+            }
+        }
+
+        public DateTime EndTime
+        {
+            get
+            {
+                return this.m_EndTime;
+            }
+            set
+            {
+                this.m_EndTime = value;
+            }
+        }
+
+        public int Green
+        {
+            get
+            {
+                return this.m_nGreen;
+            }
+            set
+            {
+                this.m_nGreen = value;
+            }
+        }
+
+        public string Note
+        {
+            get
+            {
+                return this.m_sNote;
+            }
+            set
+            {
+                this.m_sNote = value;
+            }
+        }
+
+        public int Red
+        {
+            get
+            {
+                return this.m_nRed;
+            }
+            set
+            {
+                this.m_nRed = value;
+            }
+        }
+
+        public string ResourceList
+        {
+            get
+            {
+                return this.m_sResourceList;
+            }
+            set
+            {
+                this.m_sResourceList = value;
+            }
+        }
+
+        public int Slots
+        {
+            get
+            {
+                return this.m_nSlots;
+            }
+            set
+            {
+                this.m_nSlots = value;
+            }
+        }
+
+        public DateTime StartTime
+        {
+            get
+            {
+                return this.m_StartTime;
+            }
+            set
+            {
+                this.m_StartTime = value;
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/CGCell.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGCell.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGCell.cs	(revision 855)
@@ -0,0 +1,113 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    using System.Drawing;
+    using System.Text;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    public class CGCell
+    {
+        private Brush m_ApptTypeColor;
+        public bool m_bIsSelected;
+        private int m_Col;
+        private Rectangle m_Rectangle;
+        private int m_Row;
+        private string m_sKey;
+
+        public CGCell()
+        {
+            this.m_ApptTypeColor = Brushes.Cornsilk;
+        }
+
+        public CGCell(Rectangle r, int row, int col)
+        {
+            this.m_Rectangle = r;
+            this.m_Row = row;
+            this.m_Col = col;
+            this.m_sKey = BuildKey(this.m_Row, this.m_Col);
+            this.m_ApptTypeColor = Brushes.Cornsilk;
+        }
+
+        public static string BuildKey(int nRow, int nCol)
+        {
+            StringBuilder builder = new StringBuilder("r");
+            builder.Append(nRow.ToString());
+            builder.Append("c");
+            builder.Append(nCol.ToString());
+            return builder.ToString();
+        }
+
+        public Brush AppointmentTypeColor
+        {
+            get
+            {
+                return this.m_ApptTypeColor;
+            }
+            set
+            {
+                this.m_ApptTypeColor = value;
+            }
+        }
+
+        public int CellColumn
+        {
+            get
+            {
+                return this.m_Col;
+            }
+            set
+            {
+                this.m_Col = value;
+                this.m_sKey = BuildKey(this.m_Row, this.m_Col);
+            }
+        }
+
+        public Rectangle CellRectangle
+        {
+            get
+            {
+                return this.m_Rectangle;
+            }
+            set
+            {
+                this.m_Rectangle = value;
+            }
+        }
+
+        public int CellRow
+        {
+            get
+            {
+                return this.m_Row;
+            }
+            set
+            {
+                this.m_Row = value;
+                this.m_sKey = BuildKey(this.m_Row, this.m_Col);
+            }
+        }
+
+        public bool IsSelected
+        {
+            get
+            {
+                return this.m_bIsSelected;
+            }
+            set
+            {
+                this.m_bIsSelected = value;
+            }
+        }
+
+        public string Key
+        {
+            get
+            {
+                return this.m_sKey;
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/CGCells.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGCells.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGCells.cs	(revision 855)
@@ -0,0 +1,60 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    using System.Collections;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    public class CGCells : IEnumerable
+    {
+        private Hashtable cellList = new Hashtable();
+
+        internal CGCells()
+        {
+        }
+
+        public void AddCell(CGCell r)
+        {
+            this.cellList.Add(r.Key, r);
+        }
+
+        public void ClearAllCells()
+        {
+            this.cellList.Clear();
+        }
+
+        public CGCell GetCellFromRowCol(int nRow, int nCol)
+        {
+            string str = CGCell.BuildKey(nRow, nCol);
+            return (CGCell) this.cellList[str];
+        }
+
+        public IEnumerator GetEnumerator()
+        {
+            return this.cellList.GetEnumerator();
+        }
+
+        public void RemoveCell(string sKey)
+        {
+            this.cellList.Remove(sKey);
+        }
+
+        public int CellCount
+        {
+            get
+            {
+                return this.cellList.Count;
+            }
+        }
+
+        public Hashtable CellHashTable
+        {
+            get
+            {
+                return this.cellList;
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/CGDocument.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGDocument.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGDocument.cs	(revision 855)
@@ -0,0 +1,1027 @@
+using System;
+using System.Collections;
+using System.Data;
+using System.Data.OleDb;
+using System.Diagnostics;
+using System.Drawing;
+using System.Windows.Forms;
+using IndianHealthService.BMXNet;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Contains the array of appointments and availabily that make up the document class
+	/// </summary>
+	public class CGDocument : System.Object
+	{
+		
+		public CGDocument()
+		{
+			m_appointments = new CGAppointments();
+			m_pAvArray = new ArrayList();
+			m_sResourcesArray = new ArrayList();
+		}
+
+		#region Member Variables
+		public int				m_nColumnCount; //todo: this should point to the view's member for column count
+		public int				m_nTimeUnits;
+		private string			m_sDocName;
+		public ArrayList		m_sResourcesArray;
+		public ScheduleType		m_ScheduleType;
+		private DateTime		m_dSelectedDate; //Holds the user's selection from the dtpicker
+		private DateTime		m_dStartDate; //Beginning date of document data
+		private DateTime		m_dEndDate; //Ending date of document data
+		public CGAppointments	m_appointments;
+		private ArrayList		m_pAvArray;
+		private CGDocumentManager m_DocManager;
+		private DateTime		m_dLastRefresh = DateTime.Now;
+
+		#endregion
+
+		#region Properties
+
+		/// <summary>
+		/// Returns the latest refresh time for this document
+		/// </summary>
+		public DateTime LastRefreshed
+		{
+			get
+			{
+				return m_dLastRefresh;
+			}			
+		}
+
+		/// <summary>
+		/// The list of Resource names
+		/// </summary>
+		public ArrayList Resources
+		{
+			get
+			{
+				return this.m_sResourcesArray;
+			}
+			set
+			{
+				this.m_sResourcesArray = value;
+			}
+		}
+
+		/// <summary>
+		/// The array of CGAvailabilities that contains appt type and slots
+		/// </summary>
+		public ArrayList AvailabilityArray
+		{
+			get
+			{
+				return this.m_pAvArray;
+			}
+		}
+
+		public CGDocumentManager DocManager
+		{
+			get
+			{
+				return m_DocManager;
+			}
+			set
+			{
+				m_DocManager = value;
+			}
+		}
+
+		/// <summary>
+		/// Contains the hashtable of appointments
+		/// </summary>
+		public CGAppointments Appointments
+		{
+			get
+			{
+				return m_appointments;
+			}
+		}
+
+		/// <summary>
+		/// Holds the date selected by the user in CGView.dateTimePicker1
+		/// </summary>
+		public DateTime SelectedDate
+		{
+			get
+			{
+				return this.m_dSelectedDate;
+			}
+			set
+			{
+				this.m_dSelectedDate = value;
+				bool bRet = false;
+				if (m_sResourcesArray.Count == 1)
+				{
+					bRet = this.WeekNeedsRefresh(1, m_dSelectedDate, out this.m_dStartDate, out this.m_dEndDate);
+				}
+				else
+				{
+					this.m_dStartDate = m_dSelectedDate;
+					this.m_dEndDate = m_dSelectedDate;
+					this.m_dEndDate = this.m_dEndDate.AddHours(23);
+					this.m_dEndDate = this.m_dEndDate.AddMinutes(59);
+					this.m_dEndDate = this.m_dEndDate.AddSeconds(59);
+				}
+
+				bRet = RefreshSchedule();
+			}
+		}
+
+			/// <summary>
+			/// Contains the beginning date of the appointment document
+			/// </summary>
+			public DateTime StartDate
+		{
+			get
+			{
+				return this.m_dStartDate;
+			}
+		}
+		
+		public string DocName
+		{
+			get
+			{
+				return this.m_sDocName;
+			}
+			set
+			{
+				this.m_sDocName = value;
+			}
+		}
+
+		#endregion
+
+		#region Methods
+
+		public void UpdateAllViews()
+		{
+			//iterate through all views and call update.
+			Hashtable h = CGDocumentManager.Current.Views;
+			
+			CGDocument d;
+			foreach (CGView v in h.Keys)
+			{
+				d = (CGDocument) h[v];
+				if (d == this)
+				{
+					v.UpdateArrays();
+				}
+			}
+
+		}
+
+		/// <summary>
+		/// Update schedule based on info in RPMS
+		/// </summary>
+		private bool RefreshDaysSchedule()
+		{
+			try
+			{
+				string				sPatientName;
+				string				sPatientID;
+				DateTime			dStart;
+				DateTime			dEnd;
+				DateTime			dCheckIn;
+				DateTime			dAuxTime;
+				int					nKeyID;
+				string				sNote;
+				string				sResource;
+				bool				bNoShow = false;
+				string				sNoShow = "0";
+				string				sHRN = "";
+				int					nAccessTypeID; //used in autorebook
+				string				sWalkIn = "0";
+				bool				bWalkIn;
+				CGAppointment		pAppointment;
+				CGDocumentManager	pApp = CGDocumentManager.Current;
+				DataTable			rAppointmentSchedule;
+
+				m_dLastRefresh = DateTime.Now;
+
+				this.m_appointments.ClearAllAppointments();
+
+				rAppointmentSchedule = CGSchedLib.CreateAppointmentSchedule(m_DocManager, m_sResourcesArray, this.m_dStartDate, this.m_dEndDate);
+				CGSchedLib.OutputArray(rAppointmentSchedule, "rAppointmentSchedule");
+				foreach (DataRow r in rAppointmentSchedule.Rows) 
+				{
+				
+					if (r["APPOINTMENTID"].ToString() == "0")
+					{
+						string sMsg = r["NOTE"].ToString();
+						throw new BMXNetException(sMsg);
+					}
+					nKeyID = Convert.ToInt32(r["APPOINTMENTID"].ToString());
+					sResource =  r["RESOURCENAME"].ToString();
+					sPatientName =r["PATIENTNAME"].ToString();
+					sPatientID =r["PATIENTID"].ToString();
+					dStart = (DateTime) r["START_TIME"];
+					dEnd = (DateTime) r["END_TIME"];
+					dCheckIn = new DateTime();
+					dAuxTime = new DateTime();
+
+					if (r["CHECKIN"].GetType() != typeof(System.DBNull))
+						dCheckIn = (DateTime) r["CHECKIN"];
+					if (r["AUXTIME"].GetType() != typeof(System.DBNull))
+						dCheckIn = (DateTime) r["AUXTIME"];
+					sNote = r["NOTE"].ToString();
+					sNoShow = r["NOSHOW"].ToString();
+					bNoShow = (sNoShow == "1")?true: false;
+					sHRN = r["HRN"].ToString();
+					nAccessTypeID = (int) r["ACCESSTYPEID"];
+					sWalkIn = r["WALKIN"].ToString();
+					bWalkIn = (sWalkIn == "1")?true: false;
+
+					pAppointment = new CGAppointment();
+					pAppointment.CreateAppointment(dStart, dEnd, sNote, nKeyID, sResource);
+					pAppointment.PatientName = sPatientName;
+					pAppointment.PatientID = Convert.ToInt32(sPatientID);
+					if (dCheckIn.Ticks > 0)
+						pAppointment.CheckInTime = dCheckIn;
+					if (dAuxTime.Ticks > 0)
+						pAppointment.AuxTime = dAuxTime;
+					pAppointment.NoShow = bNoShow;
+					pAppointment.HealthRecordNumber = sHRN;
+					pAppointment.AccessTypeID = nAccessTypeID;
+					pAppointment.WalkIn = bWalkIn;
+					this.m_appointments.AddAppointment(pAppointment);
+
+				}
+			
+				return true;
+			}
+			catch(Exception Ex)
+			{
+				Debug.Write("CGDocument.RefreshDaysSchedule error: " + Ex.Message + "\n");
+				return false;
+			}
+		}
+
+
+		public void OnNewDocument()
+		{
+			/*
+			 * TEST EXCEPTION -- REMOVE AFTER TESTING
+			 */
+			//throw new Exception("Simulated Uncaught Exception");
+			/*
+			 * TEST EXCEPTION -- REMOVE AFTER TESTING
+			 */
+
+			//Open an empty document
+			m_sResourcesArray.Clear();
+			m_ScheduleType = ScheduleType.Resource;
+
+			//Set initial From and To dates based on current day
+			//			DateTime dDate = new DateTime(2001,12,05);  //Testing line
+			DateTime dDate = DateTime.Today;
+			bool bRet = this.WeekNeedsRefresh(2,dDate, out this.m_dStartDate, out this.m_dEndDate);
+
+			//Create new View
+			CGView view = new CGView();
+			view.InitializeDocView(this, 
+				this.DocManager,
+				m_dStartDate, 
+				this.Appointments, 
+				DocManager.WindowText);
+
+			view.Show();
+			view.SyncTree();
+			view.Activate();
+			this.UpdateAllViews();
+		}
+
+		private void SetDate(DateTime dDate)
+		{
+			bool bRet = false;
+			if (m_ScheduleType == ScheduleType.Resource)
+			{
+				bRet = this.WeekNeedsRefresh(2,dDate, out this.m_dStartDate, out this.m_dEndDate);
+			}
+			else
+			{
+				this.m_dStartDate = dDate;
+				this.m_dEndDate = dDate;
+				this.m_dEndDate = this.m_dEndDate.AddHours(23);
+				this.m_dEndDate = this.m_dEndDate.AddMinutes(59);
+				this.m_dEndDate = this.m_dEndDate.AddSeconds(59);
+			}
+
+			bRet = RefreshSchedule();
+			this.UpdateAllViews();
+		}
+
+		public void RefreshDocument()
+		{
+			bool bRet = RefreshSchedule();
+			this.UpdateAllViews();
+		}
+
+		public void OnOpenDocument() 
+		{
+			try
+			{
+				//Create new Document
+				m_ScheduleType = (m_sResourcesArray.Count == 1) ? ScheduleType.Resource: ScheduleType.Clinic;
+				bool bRet = false;
+
+				//Set initial From and To dates based on current day
+				DateTime dDate = DateTime.Today;
+				if (m_ScheduleType == ScheduleType.Resource)
+				{
+					bRet = this.WeekNeedsRefresh(1,dDate, out this.m_dStartDate, out this.m_dEndDate);
+				}
+				else
+				{
+					this.m_dStartDate = dDate;
+					this.m_dEndDate = dDate;
+					this.m_dEndDate = this.m_dEndDate.AddHours(23);
+					this.m_dEndDate = this.m_dEndDate.AddMinutes(59);
+					this.m_dEndDate = this.m_dEndDate.AddSeconds(59);
+				}
+
+				bRet = RefreshSchedule();
+
+				CGView view = null;
+				//If this document already has a view, the use it
+				Hashtable h = CGDocumentManager.Current.Views;		
+				CGDocument d;
+				bool bReuseView = false;
+				foreach (CGView v in h.Keys)
+				{
+					d = (CGDocument) h[v];
+					if (d == this)
+					{
+						view = v;
+						bReuseView = true;
+						v.InitializeDocView(this.DocName);
+						break;
+					}
+				}
+
+				//Otherwise, create new View
+				if (bReuseView == false)
+				{
+					view = new CGView();
+
+					view.InitializeDocView(this, 
+						this.DocManager,
+						m_dStartDate, 
+						this.Appointments, 
+						this.DocName);
+
+					view.Show();
+					view.SyncTree();
+
+				}
+				this.UpdateAllViews();
+			}
+			catch (BMXNetException bmxEx)
+			{
+				throw bmxEx;
+			}
+			catch (Exception ex)
+			{
+				throw new BMXNet.BMXNetException("ClinicalScheduling.OnOpenDocument error:  " + ex.Message);
+			}
+		}
+
+		private bool RefreshSchedule()
+		{
+			try
+			{
+				bool bRet = this.RefreshAvailabilitySchedule();
+				if (bRet == false)
+				{
+					return bRet;
+				}
+				bRet = this.RefreshDaysSchedule();
+				return bRet;
+			}
+			catch (ApplicationException aex)
+			{
+				Debug.Write("CGDocument.RefreshSchedule Application Error:  " + aex.Message + "\n");
+				return false;
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("CGDocument.RefreshSchedule error:  " + ex.Message + "\n");
+				return false;
+			}
+		}
+
+		private bool RefreshAvailabilitySchedule()
+		{
+			try
+			{
+				if (this.m_DocManager.ConnectInfo.Connected == false)
+				{
+					m_DocManager.ConnectInfo.LoadConnectInfo();
+				}
+				System.IntPtr pHandle = m_DocManager.Handle;
+
+				m_pAvArray.Clear();
+
+				ArrayList saryApptTypes = new ArrayList();
+				int nApptTypeID = 0;
+
+				//Refresh Availability schedules
+				DataTable rAvailabilitySchedule;
+				rAvailabilitySchedule = CGSchedLib.CreateAvailabilitySchedule(m_DocManager, m_sResourcesArray, this.m_dStartDate, this.m_dEndDate, saryApptTypes,/**/ m_ScheduleType, "0");
+				CGSchedLib.OutputArray(rAvailabilitySchedule, "rAvailabilitySchedule");
+
+				//Refresh Type Schedule
+				string sResourceName = "";
+				DataTable rTypeSchedule = new DataTable();;
+				for (int j = 0; j < m_sResourcesArray.Count; j++)
+				{
+					sResourceName = m_sResourcesArray[j].ToString();
+					DataTable dtTemp = CGSchedLib.CreateAssignedTypeSchedule(m_DocManager, sResourceName, this.m_dStartDate, this.m_dEndDate, m_ScheduleType);
+					CGSchedLib.OutputArray(dtTemp, "dtTemp");
+					if (j == 0)
+					{
+						rTypeSchedule = dtTemp;
+					}
+					else
+					{
+						rTypeSchedule = CGSchedLib.UnionBlocks(rTypeSchedule, dtTemp);
+					}
+				}
+				CGSchedLib.OutputArray(rTypeSchedule, "rTypeSchedule");
+
+				DateTime dStart;
+				DateTime dEnd;
+				DateTime dTypeStart;
+				DateTime dTypeEnd;
+				int nSlots;
+				Rectangle	crRectA = new Rectangle(0,0,1,0);
+				Rectangle	crRectB= new Rectangle(0,0,1,0);
+				bool	bIsect;
+				string sResourceList;
+				string sAccessRuleList;
+
+
+				foreach (DataRow rTemp in rAvailabilitySchedule.Rows)
+				{
+					//get StartTime, EndTime and Slots 
+					dStart = (DateTime) rTemp["START_TIME"];
+					dEnd = (DateTime) rTemp["END_TIME"];
+
+					//TODO: Fix this slots datatype problem
+					string sSlots = rTemp["SLOTS"].ToString();
+					nSlots = Convert.ToInt16(sSlots);
+
+					sResourceList = rTemp["RESOURCE"].ToString();
+					sAccessRuleList = rTemp["ACCESS_TYPE"].ToString();
+
+					string sNote = rTemp["NOTE"].ToString();
+
+					if ((nSlots < -1000)||(sAccessRuleList == ""))
+					{
+						nApptTypeID = 0;
+					}
+					else 
+					{
+						foreach (DataRow rType in rTypeSchedule.Rows)
+						{
+						
+							dTypeStart = (DateTime) rType["StartTime"];
+							dTypeEnd = (DateTime) rType["EndTime"];
+							//if start & end times overlap, then
+							string sTypeResource = rType["ResourceName"].ToString();
+							if ((dTypeStart.DayOfYear == dStart.DayOfYear)  && (sResourceList == sTypeResource))
+							{
+								crRectA.Y = GetTotalMinutes(dStart);
+								crRectA.Height = GetTotalMinutes(dEnd) - crRectA.Top;
+								crRectB.Y = GetTotalMinutes(dTypeStart);
+								crRectB.Height = GetTotalMinutes(dTypeEnd) - crRectB.Top;
+								bIsect = crRectA.IntersectsWith(crRectB);
+								if (bIsect == true) 
+								{
+									//TODO: This code:
+									//	nApptTypeID = (int) rType["AppointmentTypeID"];
+									//Causes this exception:
+									//Unhandled Exception: System.InvalidCastException: Specified cast is not valid.
+									string sTemp = rType["AppointmentTypeID"].ToString();
+									nApptTypeID = Convert.ToInt16(sTemp);
+									break;
+								}
+							}
+						}//end foreach datarow rType
+					}
+
+					AddAvailability(dStart, dEnd, nApptTypeID, nSlots, false, sResourceList, sAccessRuleList, sNote);
+				}//end foreach datarow rTemp
+
+				return true;
+			}
+			catch (Exception ex)
+			{
+				Debug.Write("CGDocument.RefreshAvailabilitySchedule error: " + ex.Message + "\n");
+				return false;
+			}
+		}
+
+		private int GetTotalMinutes(DateTime dDate)
+		{
+			return ((dDate.Hour * 60) + dDate.Minute);
+		}
+
+		public int AddAvailability(DateTime StartTime, DateTime EndTime, int nType, int nSlots, bool UpdateView, string sResourceList, string sAccessRuleList, string sNote)
+		{
+			//adds it to the object array
+			//Returns the index in the array
+
+			CGAvailability pNewAv = new CGAvailability();
+			pNewAv.Create(StartTime, EndTime, nType, nSlots, sResourceList, sAccessRuleList);
+
+			pNewAv.Note = sNote;
+
+			//Look up the color and type name using the AppointmentTypes datatable
+			DataTable dtType = this.m_DocManager.GlobalDataSet.Tables["AccessTypes"];
+			DataRow dRow = dtType.Rows.Find(nType.ToString());
+			if (dRow != null)
+			{
+				string sColor = dRow["DISPLAY_COLOR"].ToString();
+				pNewAv.DisplayColor = sColor;
+				string sTemp = dRow["RED"].ToString();
+				sTemp = (sTemp == "")?"0":sTemp;
+				int nRed = Convert.ToInt16(sTemp);
+				pNewAv.Red = nRed;
+				sTemp = dRow["GREEN"].ToString();
+				sTemp = (sTemp == "")?"0":sTemp;
+				int nGreen = Convert.ToInt16(sTemp);
+				pNewAv.Green = nGreen;
+				sTemp = dRow["BLUE"].ToString();
+				sTemp = (sTemp == "")?"0":sTemp;
+				int nBlue = Convert.ToInt16(sTemp);
+				pNewAv.Blue = nBlue;
+
+				string sName = dRow["ACCESS_TYPE_NAME"].ToString();
+				pNewAv.AccessTypeName = sName;
+			}
+
+			int nIndex = 0;
+			nIndex = m_pAvArray.Add(pNewAv);
+			if (UpdateView == true) 
+			{
+				this.UpdateAllViews();
+			}
+			return nIndex;			
+		}
+
+
+		public void AddResource(string sResource)
+		{
+			//TODO:  Test that resource is not currently in list, that it IS a resource, etc
+			this.m_sResourcesArray.Add(sResource);
+			this.UpdateAllViews();
+		}
+
+		public void ClearResources()
+		{
+			this.m_sResourcesArray.Clear();
+		}
+
+		public int SlotsAvailable(DateTime dSelStart, DateTime dSelEnd, string sResource, out string sAccessType, out string sAvailabilityMessage)
+		{
+			sAccessType = "";
+			sAvailabilityMessage = "";
+			DateTime dStart;
+			DateTime dEnd;
+			int nAvailableSlots = 999;
+			int nSlots = 0;
+			int i = 0;
+			CGAvailability pAv;
+			Rectangle crRectA = new Rectangle(0,0,1,0);
+			Rectangle crRectB = new Rectangle(0,0,1,0);
+			bool bIsect;
+			crRectB.Y = GetTotalMinutes(dSelStart);
+			crRectB.Height = GetTotalMinutes(dSelEnd)- crRectB.Y;
+
+			//			//loop thru m_pAvArray
+			//			//Compare the start time and end time of eachblock
+			while (i < m_pAvArray.Count) 
+			{
+				pAv =  (CGAvailability) m_pAvArray[i];
+				dStart = pAv.StartTime;
+				dEnd = pAv.EndTime;
+				if ((sResource == pAv.ResourceList) && 
+					((dSelStart.Date == dStart.Date) || (dSelStart.Date == dEnd.Date)))
+				{
+					crRectA.Y = (dStart.Date < dSelStart.Date) ? 0 : GetTotalMinutes(dStart);
+					crRectA.Height = (dEnd.Date > dSelEnd.Date) ? 1440 : GetTotalMinutes(dEnd);
+					crRectA.Height = crRectA.Height - crRectA.Y;
+					bIsect = crRectA.IntersectsWith(crRectB);
+					if (bIsect != false) 
+					{
+						nSlots = pAv.Slots;
+						if (nSlots < 1) 
+						{
+							nAvailableSlots = 0;
+							break;
+						}
+						if (nSlots < nAvailableSlots) 
+						{
+							nAvailableSlots = nSlots;
+							sAccessType = pAv.AccessTypeName;
+							sAvailabilityMessage = pAv.Note;
+							
+						}
+					}
+				}
+				i++;
+			}
+			if (nAvailableSlots == 999) 
+			{
+				nAvailableSlots = 0;
+			}
+			return nAvailableSlots;
+		}		
+
+		/// <summary>
+		/// Given a selected date,
+		/// Calculates StartDay and End Day and returns them in output params.  
+		/// nWeeks == number of Weeks to display
+		/// nColumnCount is number of days displayed per week.  If 5 columns, begin on
+		/// Monday, if 7 Columns, begin on Sunday
+		/// 
+		/// Returns TRUE if the document's data needs refreshing based on 
+		/// this newly selected date.
+		/// </summary>
+		public bool WeekNeedsRefresh(int nWeeks, DateTime SelectedDate, 
+			out DateTime WeekStartDay, out DateTime WeekEndDay)
+		{
+			DateTime OldStartDay = m_dStartDate;
+			DateTime OldEndDay = m_dEndDate;
+			int nWeekDay = (int) SelectedDate.DayOfWeek; //0 == Sunday
+
+			int nOff = 1;
+			TimeSpan ts = new TimeSpan(nWeekDay - nOff,0,0,0); //d,h,m,s
+
+			if (m_nColumnCount == 1) 
+			{
+				ts = new TimeSpan(0,23,59,59);
+				WeekStartDay = SelectedDate;
+			}
+			else 
+			{
+				WeekStartDay = SelectedDate - ts;
+				if (m_nColumnCount == 7)
+				{
+					ts = new TimeSpan(1,0,0,0);
+					WeekStartDay -= ts;
+				}
+				int nEnd = (m_nColumnCount == 7) ? 1 : 3;
+				ts = new TimeSpan((7* nWeeks) - nEnd, 23, 59,59);
+			}
+			WeekEndDay = WeekStartDay + ts;
+			bool bRet = (( WeekStartDay.Date != OldStartDay.Date) || (WeekEndDay.Date != OldEndDay.Date));
+			return bRet;
+		}
+
+		/// <summary>
+		/// Calls RPMS to create appointment then 
+		/// adds appointment to the m_appointments collection
+		/// Returns the IEN of the appointment in the RPMS BSDX APPOINTMENT file.
+		/// </summary>
+		/// <param name="rApptInfo"></param>
+		/// <returns></returns>
+		public int CreateAppointment(CGAppointment rApptInfo)
+		{
+			return CreateAppointment(rApptInfo, false);
+		}
+		
+		/// <summary>
+		/// Use this overload to create a walkin appointment
+		/// </summary>
+		/// <param name="rApptInfo"></param>
+		/// <param name="bWalkin"></param>
+		/// <returns></returns>
+		public int CreateAppointment(CGAppointment rApptInfo, bool bWalkin)
+		{
+			string sStart;
+			string sEnd;
+			string sPatID;
+			string sResource;
+			string sNote;
+			string sLen;
+			string sApptID;
+
+			sStart = rApptInfo.StartTime.ToString("M-d-yyyy@HH:mm");
+			sEnd = rApptInfo.EndTime.ToString("M-d-yyyy@HH:mm");
+			TimeSpan sp = rApptInfo.EndTime - rApptInfo.StartTime;
+			sLen = sp.TotalMinutes.ToString();
+			sPatID = rApptInfo.PatientID.ToString();
+			sNote = rApptInfo.Note;
+			sResource = rApptInfo.Resource;
+			if (bWalkin == true)
+			{
+				sApptID = "WALKIN";
+			}
+			else
+			{
+				sApptID = rApptInfo.AccessTypeID.ToString();
+			}
+
+			CGAppointment aCopy = new CGAppointment();
+			aCopy.CreateAppointment(rApptInfo.StartTime, rApptInfo.EndTime, sNote, 0, sResource);
+			aCopy.PatientID = rApptInfo.PatientID;
+			aCopy.PatientName = rApptInfo.PatientName;
+			aCopy.HealthRecordNumber = rApptInfo.HealthRecordNumber;
+			aCopy.AccessTypeID = rApptInfo.AccessTypeID;
+
+			string sSql = "BSDX ADD NEW APPOINTMENT^" + sStart + "^" + sEnd + "^" + sPatID + "^" + sResource + "^" + sLen + "^" + sNote + "^" + sApptID ;
+			System.Data.DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "NewAppointment");
+			int nApptID;
+
+			Debug.Assert(dtAppt.Rows.Count == 1);
+			DataRow r = dtAppt.Rows[0];
+			nApptID =Convert.ToInt32(r["APPOINTMENTID"]);
+			string sErrorID;
+			sErrorID = r["ERRORID"].ToString();
+			if ((sErrorID != "")||(nApptID < 1))
+				throw new Exception(sErrorID);
+			aCopy.AppointmentKey = nApptID;
+			this.m_appointments.AddAppointment(aCopy);
+
+			bool bRet = RefreshAvailabilitySchedule();
+
+			UpdateAllViews();
+
+			return nApptID;
+		}
+
+		public void EditAppointment(CGAppointment pAppt, string sNote)
+		{
+			try
+			{
+				int nApptID = pAppt.AppointmentKey;
+				string sSql = "BSDX EDIT APPOINTMENT^" + nApptID.ToString() + "^" + sNote;
+
+				System.Data.DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "EditAppointment");
+
+				Debug.Assert(dtAppt.Rows.Count == 1);
+				DataRow r = dtAppt.Rows[0];
+				string sErrorID = r["ERRORID"].ToString();
+				if (sErrorID == "-1")
+					pAppt.Note = sNote;
+				
+				if (this.m_appointments.AppointmentTable.ContainsKey(nApptID))
+				{
+					bool bRet = RefreshAvailabilitySchedule();
+					UpdateAllViews();
+				}
+			}
+			catch (Exception ex)
+			{
+				Debug.Write("CGDocument.EditAppointment Failed:  " + ex.Message);
+			}
+		}
+
+		public void CheckInAppointment(int nApptID, DateTime dCheckIn,
+			string ClinicStopIEN,
+			string ProviderIEN,
+			string PrintRouteSlip,
+			string PCCClinicIEN,
+			string PCCFormIEN,
+			string PCCOutGuide
+			)
+		{
+			string sCheckIn = dCheckIn.ToString("M-d-yyyy@HH:mm");
+
+			string sSql = "BSDX CHECKIN APPOINTMENT^" + nApptID.ToString() + "^" + sCheckIn + "^";
+			sSql += ClinicStopIEN + "^" + ProviderIEN + "^" + PrintRouteSlip + "^";
+			sSql += PCCClinicIEN + "^" + PCCFormIEN + "^" + PCCOutGuide;
+
+			System.Data.DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "CheckInAppointment");
+
+			Debug.Assert(dtAppt.Rows.Count == 1);
+			DataRow r = dtAppt.Rows[0];
+			string sErrorID = r["ERRORID"].ToString();
+				
+			if (this.m_appointments.AppointmentTable.ContainsKey(nApptID))
+			{
+				bool bRet = RefreshSchedule();
+				UpdateAllViews();
+			}
+		}
+
+		public string DeleteAppointment(int nApptID)
+		{
+			return DeleteAppointment(nApptID, true, 0, "");
+		}
+
+		public string DeleteAppointment(int nApptID, bool bClinicCancelled, int nReason, string sRemarks)
+		{
+			//Returns "" if deletion successful
+			//Otherwise, returns reason for failure
+
+			string sClinicCancelled = (bClinicCancelled == true)?"C":"PC";
+			string sReasonID = nReason.ToString();
+			string sSql = "BSDX CANCEL APPOINTMENT^" + nApptID.ToString();
+			sSql += "^" + sClinicCancelled;
+			sSql += "^" + sReasonID;
+			sSql += "^" + sRemarks;
+			DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "DeleteAppointment");
+
+			Debug.Assert(dtAppt.Rows.Count == 1);
+			DataRow r = dtAppt.Rows[0];
+			string sErrorID = r["ERRORID"].ToString();
+			if (sErrorID != "")
+				return sErrorID;
+				
+			if (this.m_appointments.AppointmentTable.ContainsKey(nApptID))
+			{
+				this.m_appointments.RemoveAppointment(nApptID);
+				bool bRet = RefreshAvailabilitySchedule();
+				UpdateAllViews();
+			}
+			return "";
+		}
+
+		public string AutoRebook(CGAppointment a, int nSearchType, int nMinimumDays, int nMaximumDays, out CGAppointment aRebook)
+		{
+			//If successful Returns "1" and new start date and time returned in aRebook
+			//Otherwise, returns error message
+			
+			CGAppointment aCopy = new CGAppointment();
+			aCopy.CreateAppointment(a.StartTime, a.EndTime, a.Note, 0, a.Resource);
+			aCopy.PatientID = a.PatientID;
+			aCopy.PatientName = a.PatientName;
+			aCopy.HealthRecordNumber = a.HealthRecordNumber;
+			aCopy.AccessTypeID = a.AccessTypeID;
+			aRebook = aCopy;
+
+			//Determine Rebook access type
+			//nSearchType = -1: use current, -2: use any non-zero type, >0 use this access type id
+			int nAVType = 0;
+
+			switch (nSearchType)
+			{
+				case -1:
+					nAVType = a.AccessTypeID;
+					break;
+				case -2:
+					nAVType = 0;
+					break;
+				default:
+					nAVType = nSearchType;
+					break;
+			}
+
+			int nSlots = 0;
+			string sSlots = "";
+			int nAccessTypeID;  //To compare with nAVType
+
+			DateTime dResult = new DateTime(); //StartTime of access block to autorebook into
+
+			//Next two are empty, but needed to pass to CreateAvailabilitySchedule
+			ArrayList alAccessTypes = new ArrayList();
+			string sSearchInfo = "";
+
+			//Find the StartTime of first availability block of this type for this clinic
+			//between nMinimumDays and nMaximumDays
+
+			string sAVStart = a.StartTime.AddDays(nMinimumDays).ToString("M/d/yyyy@H:mm");
+
+			//dtAVEnd is the last day to search
+			DateTime dtAVEnd = a.StartTime.AddDays(nMinimumDays + nMaximumDays);
+			string sAVEnd = dtAVEnd.ToString("M/d/yyyy@H:mm");
+
+			//Increment start day to search a week (or so) at a time
+			//30 is a test increment.  Need to test different values for performance
+			int nIncrement = (nMaximumDays < 30)?nMaximumDays:30;
+
+			//nCount and nCountEnd are the 'moving' counters 
+			//that I add to start and end to get the bracket
+			//At the beginning of the DO loop, nCount and nCountEnd are already set
+			bool bFinished = false;
+			bool bFound = false;
+
+			DateTime dStart = a.StartTime.AddDays(nMinimumDays);
+			DateTime dEnd = dStart.AddDays(nIncrement);
+			do
+			{	
+				string sSql = "BSDX REBOOK NEXT BLOCK^" + dStart.ToString("M/d/yyyy@H:mm")+ "^" + a.Resource + "^" + nAVType.ToString();
+				DataTable dtNextBlock = this.DocManager.RPMSDataTable(sSql, "NextBlock");
+				Debug.Assert(dtNextBlock.Rows.Count == 1);
+				DataRow drNextBlockRow = dtNextBlock.Rows[0];
+				
+				object oNextBlock;
+				oNextBlock = drNextBlockRow["NEXTBLOCK"];
+				if (oNextBlock.GetType() == typeof(System.DBNull))
+					break;
+				DateTime dNextBlock = (DateTime) drNextBlockRow["NEXTBLOCK"];
+				if (dNextBlock > dtAVEnd)
+				{
+					break;
+				}
+
+				dStart = dNextBlock;
+				dEnd = dStart.AddDays(nIncrement);
+				if (dEnd > dtAVEnd)
+					dEnd = dtAVEnd;
+
+				DataTable dtResult = CGSchedLib.CreateAvailabilitySchedule(m_DocManager, this.Resources, dStart, dEnd, alAccessTypes, ScheduleType.Resource, sSearchInfo);
+				//Loop thru dtResult looking for a slot having the required availability type.
+				//If found, set bFinished = true;	
+				foreach (DataRow dr in dtResult.Rows)
+				{
+
+					sSlots = dr["SLOTS"].ToString();
+					if (sSlots == "")
+						sSlots = "0";
+					nSlots = Convert.ToInt16(sSlots);
+					if (nSlots > 0)
+					{
+						nAccessTypeID = 0;  //holds the access type id of the availability block
+						if (dr["ACCESS_TYPE"].ToString() != "") 
+							nAccessTypeID =Convert.ToInt16(dr["ACCESS_TYPE"].ToString());
+						if ((nSearchType == -2) && (nAccessTypeID > 0)) //Match on any non-zero type
+						{
+							bFinished = true;
+							bFound = true;
+							dResult = (DateTime) dr["START_TIME"];
+							break;
+						}
+						if (nAccessTypeID == nAVType)
+						{
+							bFinished = true;
+							bFound = true;
+							dResult = (DateTime) dr["START_TIME"];
+							break;
+						}
+					}
+				}
+				dStart = dEnd.AddDays(1);
+				dEnd = dStart.AddDays(nIncrement);
+				if (dEnd > dtAVEnd)
+					dEnd = dtAVEnd;
+			} while (bFinished == false);
+
+			if (bFound == true)
+			{
+				aCopy.StartTime = dResult;
+				aCopy.EndTime = dResult.AddMinutes(a.Duration);
+				//Create the appointment
+				//Set the AUTOREBOOKED flag 
+				//and store the "AutoRebooked To DateTime" 
+				//in each autorebooked appointment
+				this.CreateAppointment(aCopy);
+				SetAutoRebook(a, dResult);
+				return "1";
+			}
+			else
+			{
+				return "0";
+			}
+		}
+
+		private void SetAutoRebook(CGAppointment a, DateTime dtRebookedTo)
+		{
+			string sApptKey = a.AppointmentKey.ToString();
+			string sRebookedTo = dtRebookedTo.ToString("M/d/yyyy@HH:mm");
+			string sSql = "BSDX REBOOK SET^" + sApptKey + "^" + sRebookedTo;
+			System.Data.DataTable dtRebook = m_DocManager.RPMSDataTable(sSql, "AutoRebook");
+
+		}
+
+		public string AppointmentNoShow(int nApptID, bool bNoShow)
+		{
+			/*
+			 * BSDX NOSHOW RPC Returns 1  in ERRORID if  successfully sets NOSHOW flag in BSDX APPOINTMENT and, if applicable, File 2
+			 *Otherwise, returns 0 for failure and errormessage in ERRORTXT
+			 *THIS routine returns "" if success or the message in ERRORTEXT if failed
+			 *Exceptions should be caught by caller
+			 *
+			 */
+			
+			string sTest = bNoShow.ToString();
+			string sNoShow = (bNoShow == true)?"1":"0";
+			string sSql = "BSDX NOSHOW^" + nApptID.ToString();
+			sSql += "^";
+			sSql += sNoShow;
+
+			DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AppointmentNoShow");
+
+			Debug.Assert(dtAppt.Rows.Count == 1);
+			DataRow r = dtAppt.Rows[0];
+			string sErrorID = r["ERRORID"].ToString();
+			if (sErrorID != "1")
+			{
+				return r["ERRORTEXT"].ToString();
+			}
+
+			bool bRet = RefreshSchedule();
+			
+			return sErrorID;
+		}
+
+		#endregion Methods
+
+	}//End class
+}//End namespace
Index: Scheduling/branches/GUI1.2/CGDocumentManager.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGDocumentManager.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGDocumentManager.cs	(revision 855)
@@ -0,0 +1,1078 @@
+using System;
+using System.Windows.Forms;
+using System.Collections;
+using System.Data;
+using System.Diagnostics;
+using IndianHealthService.BMXNet;
+using Mono.Options;
+using System.Runtime.InteropServices;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DocumentManager.
+	/// </summary>
+	public class CGDocumentManager : System.Windows.Forms.Form
+	{
+		#region Member Variables
+
+		private static CGDocumentManager	_current;
+		private Hashtable					_views = new Hashtable();
+		private Hashtable					m_AVViews = new Hashtable();
+		private string						m_sWindowText = "Clinical Scheduling"; //Default Window Text
+		private bool						m_bSchedManager;
+		private bool						m_bExitOK = true;
+        public string                       m_sHandle = "0";
+        private string                      m_AccessCode="";
+        private string                      m_VerifyCode="";
+        private string                      m_Server="";
+        private int                         m_Port=0;
+
+		//M Connection member variables
+		private DataSet									m_dsGlobal = null;
+		private System.ComponentModel.IContainer		components = null;
+		private BMXNetConnectInfo						m_ConnectInfo = null;
+		private BMXNetConnectInfo.BMXNetEventDelegate	CDocMgrEventDelegate;
+
+		#endregion
+
+		public CGDocumentManager()
+		{
+			InitializeComponent();
+			m_ConnectInfo = new BMXNetConnectInfo();
+            //m_ConnectInfo.bmxNetLib.StartLog();    //This line turns on logging of messages
+            m_bSchedManager = false;
+			CDocMgrEventDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(CDocMgrEventHandler);
+			m_ConnectInfo.BMXNetEvent += CDocMgrEventDelegate;
+			m_ConnectInfo.EventPollingEnabled = false;
+        }
+
+        #region BMXNet Event Handler
+        private void CDocMgrEventHandler(Object obj, BMXNet.BMXNetEventArgs e)
+		{
+			if (e.BMXEvent == "BSDX CALL WORKSTATIONS")
+			{
+				string sParam = "";
+				string sDelim="~";
+				sParam += this.m_ConnectInfo.UserName + sDelim;
+				sParam += this.m_sHandle + sDelim;
+				sParam += Application.ProductVersion + sDelim;
+				sParam += this._views.Count.ToString();
+				_current.m_ConnectInfo.RaiseEvent("BSDX WORKSTATION REPORT", sParam, true);
+			}
+			if (e.BMXEvent == "BSDX ADMIN MESSAGE")
+			{
+				string sMsg = e.BMXParam;
+				ShowAdminMsgDelegate samd = new ShowAdminMsgDelegate(ShowAdminMsg);
+				this.Invoke(samd, new object [] {sMsg});
+			}
+			if (e.BMXEvent == "BSDX ADMIN SHUTDOWN")
+			{
+				string sMsg = e.BMXParam;
+				CloseAllDelegate cad = new CloseAllDelegate(CloseAll);
+				this.Invoke(cad, new object [] {sMsg});
+			}
+		}
+		
+		delegate void ShowAdminMsgDelegate(string sMsg);
+
+		private void ShowAdminMsg(string sMsg)
+		{
+			MessageBox.Show(sMsg, "Message from Scheduling Administrator", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+        }
+
+        #endregion  BMXNet Event Handler
+
+        #region Properties
+
+        /// <summary>
+		/// Returns the document manager's BMXNetConnectInfo member
+		/// </summary>
+		public BMXNetConnectInfo ConnectInfo
+		{
+			get
+			{
+				return m_ConnectInfo;
+			}
+		}
+
+		/// <summary>
+		/// True if the current user holds the BSDXZMGR or XUPROGMODE keys in RPMS
+		/// </summary>
+		public bool ScheduleManager
+		{
+			get
+			{
+				return m_bSchedManager;
+			}
+		}
+
+		/// <summary>
+		/// Holds the user and division
+		/// </summary>
+		public string WindowText
+		{
+			get
+			{
+				return m_sWindowText;
+			}
+		}
+
+		/// <summary>
+		/// This dataset contains tables used by the entire application
+		/// </summary>		
+		public DataSet GlobalDataSet
+		{
+			get
+			{
+				return m_dsGlobal;
+			}
+			set
+			{
+				m_dsGlobal = value;
+			}
+		}
+        //public BMXNetConnection ADOConnection 
+        //{
+        //    get
+        //    {
+        //        return m_ADOConnection;
+        //    }
+        //}
+
+		/// <summary>
+		/// Returns the single CGDocumentManager object
+		/// </summary>
+		public static CGDocumentManager Current
+		{
+			get
+			{
+				return _current;
+			}
+		}
+
+		/// <summary>
+		/// Returns the list of currently opened documents
+		/// </summary>
+		public Hashtable Views
+		{
+			get
+			{
+				return _views;
+			}
+		}
+
+		/// <summary>
+		/// Returns the list of currently opened CGAVViews
+		/// </summary>
+		public Hashtable AvailabilityViews
+		{
+			get
+			{
+				return this.m_AVViews;
+			}
+		}
+
+
+		#endregion
+
+		#region Methods & Events
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if (m_ConnectInfo != null)
+				{
+					m_ConnectInfo.EventPollingEnabled = false;
+					m_ConnectInfo.UnSubscribeEvent("BSDX SCHEDULE");
+					m_ConnectInfo.UnSubscribeEvent("BSDX CALL WORKSTATIONS");
+					m_ConnectInfo.CloseConnection();
+				}
+				if (components != null) 
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+
+		private void InitializeComponent()
+		{
+			// 
+			// CGDocumentManager
+			// 
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.ClientSize = new System.Drawing.Size(292, 266);
+			this.Name = "CGDocumentManager";
+
+		}
+
+
+		private DSplash m_ds;
+		public void StartSplash()
+		{
+			m_ds = new DSplash();
+			m_ds.ShowDialog();
+		}
+
+		private void InitializeApp()
+		{
+			InitializeApp(false);
+		}
+
+		private void InitializeApp(bool bReLogin)
+		{
+			try
+			{
+				//Set M connection info
+				//Show a splash screen while initializing
+				m_ds = new DSplash();
+                m_ds.Show(this);
+				m_ds.SetStatus("Loading Configuration Settings...");
+                m_ds.Refresh();
+				this.Activate();
+                System.Configuration.ConfigurationManager.GetSection("appSettings");
+                m_ds.SetStatus("Connecting to VistA Server...");
+                m_ds.Refresh();
+				bool bRetry = true;
+
+                //Try to connect using supplied values for Server and Port
+                //Why am I doing this? The library BMX net uses prompts for access and verify code
+                //whether you can connect or not. Not good. So I test first whether
+                //we can connect at all by doing a simple connection and disconnect.
+                //TODO: Make this more robust by sending a TCPConnect message and seeing if you get a response.
+
+                if (m_Server != "" && m_Port != 0)
+                {
+                    System.Net.Sockets.TcpClient tcpClient = new System.Net.Sockets.TcpClient();
+                    try
+                    {
+                        tcpClient.Connect(m_Server, m_Port); // open it
+                        tcpClient.Close();                  // then close it
+                    }
+                    catch (System.Net.Sockets.SocketException ex)
+                    {
+                        throw ex;
+                    }
+                }
+				do
+				{
+                    try
+                    {
+                        if (bReLogin == true)
+                        {
+                            //Prompt for Access and Verify codes
+                            _current.m_ConnectInfo.LoadConnectInfo("", "");
+                        }
+                        else
+                        {
+                            if (m_Server != String.Empty && m_Port != 0 && m_AccessCode != String.Empty
+                                && m_VerifyCode != String.Empty)
+                            {
+                                m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, m_AccessCode, m_VerifyCode);
+                            }
+                            else if (m_Server != String.Empty && m_Port != 0)
+                                m_ConnectInfo.LoadConnectInfo(m_Server, m_Port, "", "");
+                            else
+                                m_ConnectInfo.LoadConnectInfo();
+                        }
+                        bRetry = false;
+                    }
+                    catch (System.Net.Sockets.SocketException)
+                    {
+                        MessageBox.Show("Cannot connect to VistA. ");
+                    }
+                    catch (Exception ex)
+                    {
+                        m_ds.Close();
+                        if (MessageBox.Show("Unable to connect to VistA.  " + ex.Message, "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry)
+                        {
+                            bRetry = true;
+                            _current.m_ConnectInfo.ChangeServerInfo();
+                        }
+                        else
+                        {
+                            bRetry = false;
+                            throw ex;
+                        }
+                    }
+				}while (bRetry == true);
+
+				//Create global dataset
+				_current.m_dsGlobal = new DataSet("GlobalDataSet");
+
+				//Version info
+				m_ds.SetStatus("Getting Version Info...");
+                m_ds.Refresh();
+                String sCmd = "BMX VERSION INFO^BSDX^";
+                this.m_ConnectInfo.RPMSDataTable(sCmd, "VersionInfo", m_dsGlobal);
+
+				//Keep the following commented code for future use:
+				//How to extract the version numbers:
+                //DataTable dtVersion = m_dsGlobal.Tables["VersionInfo"];
+                //Debug.Assert(dtVersion.Rows.Count == 1);
+                //DataRow rVersion = dtVersion.Rows[0];
+                //string sMajor = rVersion["MAJOR_VERSION"].ToString();
+                //string sMinor = rVersion["MINOR_VERSION"].ToString();
+                //string sBuild = rVersion["BUILD"].ToString();
+                //decimal fBuild = Convert.ToDecimal(sBuild);
+
+				//Set application context
+				m_ds.SetStatus("Setting Application Context to BSDXRPC...");
+                m_ds.Refresh();
+				m_ConnectInfo.AppContext = "BSDXRPC";
+	
+				//Load global recordsets
+				m_ds.SetStatus("Loading VistA data tables...");
+                m_ds.Refresh();
+				if (_current.LoadGlobalRecordsets() == false)
+				{
+					MessageBox.Show("Unable to create VistA recordsets"); //TODO Improve this message
+					m_ds.Close();
+					return;
+				}
+				
+				System.IntPtr pHandle = this.Handle;
+				System.IntPtr pConnHandle = this.ConnectInfo.Handle;
+                this.m_sHandle = pHandle.ToString();
+
+                _current.m_ConnectInfo.ReceiveTimeout = 30000; //30-second timeout
+
+#if DEBUG
+                _current.m_ConnectInfo.ReceiveTimeout = 600000; //longer timeout for debugging
+#endif 
+				_current.m_ConnectInfo.SubscribeEvent("BSDX SCHEDULE");
+				_current.m_ConnectInfo.SubscribeEvent("BSDX CALL WORKSTATIONS");
+				_current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN MESSAGE");
+				_current.m_ConnectInfo.SubscribeEvent("BSDX ADMIN SHUTDOWN");
+
+				_current.m_ConnectInfo.EventPollingInterval = 5000; //in milliseconds
+				_current.m_ConnectInfo.EventPollingEnabled = true;
+				_current.m_ConnectInfo.AutoFire = 12; //AutoFire every 12*5 seconds
+
+				m_ds.Close();
+			}
+			catch (Exception ex)
+			{
+				m_ds.Close();
+				Debug.Write(ex.Message);
+				MessageBox.Show(ex.Message + ex.StackTrace, "Clinical Scheduling Error -- Closing Application");
+				throw ex;
+			}
+		}
+
+        //To write to the console
+        [DllImport("kernel32.dll")]
+        static extern bool AttachConsole(int dwProcessId);
+        private const int ATTACH_PARENT_PROCESS = -1;
+
+		[STAThread()] 
+        static void Main(string[] args)
+		{
+#if DEBUG
+            // Print console messages to console if launched from console
+            AttachConsole(ATTACH_PARENT_PROCESS);
+#endif
+            try
+            {
+                 //Store the current manager
+                _current = new CGDocumentManager();
+                
+                //Get command line options; store in private variables
+                var opset = new OptionSet () {
+                    { "s=", s => _current.m_Server = s },
+                    { "p=", p => _current.m_Port = int.Parse(p) },
+                    { "a=", a => _current.m_AccessCode = a },
+                    { "v=", v => _current.m_VerifyCode = v }
+                };
+
+                opset.Parse(args);
+                
+                try
+                {
+                    _current.InitializeApp();
+                }
+                catch (Exception ex)
+                {
+                    Debug.Write(ex.Message);
+                    return;
+                }
+
+                //Create the first empty document
+                CGDocument doc = new CGDocument();
+                doc.DocManager = _current;
+                doc.OnNewDocument();
+                Application.DoEvents();
+
+                //Run the application
+                Application.Run();
+            }
+            catch (Exception ex)
+            {
+                Debug.Write(ex.Message);
+                MessageBox.Show(ex.Message + ex.StackTrace, "CGDocumentManager.Main(): Clinical Scheduling Error -- Closing Application");
+                return;
+            }
+		}
+
+		public void LoadAccessTypesTable()
+		{
+			string sCommandText = "SELECT * FROM BSDX_ACCESS_TYPE";
+			ConnectInfo.RPMSDataTable(sCommandText, "AccessTypes", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- AccessTypes loaded\n");
+		}
+
+		public void LoadAccessGroupsTable()
+		{
+			string sCommandText = "SELECT * FROM BSDX_ACCESS_GROUP";
+			ConnectInfo.RPMSDataTable(sCommandText, "AccessGroup", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- AccessGroups loaded\n");
+		}
+
+		public void LoadAccessGroupTypesTable()
+		{
+			string sCommandText = "BSDX GET ACCESS GROUP TYPES";
+			ConnectInfo.RPMSDataTable(sCommandText, "AccessGroupType", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- AccessGroupTypes loaded\n");
+		}
+
+        //TODO:REMOVE THIS
+		/*public void LoadClinicSetupTable()
+		{
+			string sCommandText = "BSDX CLINIC SETUP";
+			ConnectInfo.RPMSDataTable(sCommandText, "ClinicSetupParameters", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- ClinicSetupParameters loaded\n");
+		}*/
+
+		public void LoadBSDXResourcesTable()
+		{
+			string sCommandText = "BSDX RESOURCES^" + m_ConnectInfo.DUZ;
+			ConnectInfo.RPMSDataTable(sCommandText, "Resources", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- Resources loaded\n");
+		}
+		
+		public void LoadResourceGroupTable()
+		{
+			//ResourceGroup Table (Resource Groups by User)
+			//Table "ResourceGroup" contains all resource group names
+			//to which user has access
+			//Fields are: RESOURCE_GROUPID, RESOURCE_GROUP
+			string sCommandText = "BSDX RESOURCE GROUPS BY USER^" + m_ConnectInfo.DUZ;
+			ConnectInfo.RPMSDataTable(sCommandText, "ResourceGroup", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- ResourceGroup loaded\n");
+		}
+
+		public void LoadGroupResourcesTable()
+		{
+			//Table "GroupResources" contains all active GROUP/RESOURCE combinations
+			//to which user has access based on entries in BSDX RESOURCE USER file
+			//If user has BSDXZMGR or XUPROGMODE keys, then ALL Group/Resource combinstions
+			//are returned.
+			//Fields are: RESOURCE_GROUPID, RESOURCE_GROUP, RESOURCE_GROUP_ITEMID, RESOURCE_NAME, RESOURCE_ID
+			string sCommandText = "BSDX GROUP RESOURCE^" + m_ConnectInfo.DUZ;
+			ConnectInfo.RPMSDataTable(sCommandText, "GroupResources", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- GroupResources loaded\n");
+		}
+
+		public void LoadScheduleUserTable()
+		{
+			//Table "ScheduleUser" contains an entry for each user in File 200 (NEW PERSON)
+			//who possesses the BSDXZMENU security key.
+			string sCommandText = "BSDX SCHEDULE USER";
+			ConnectInfo.RPMSDataTable(sCommandText, "ScheduleUser", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- ScheduleUser loaded\n");
+		}
+
+		public void LoadResourceUserTable()
+		{
+			//Table "ResourceUser" duplicates the BSDX RESOURCE USER File.
+			//NOTE: Column names are RESOURCEUSER_ID, RESOURCEID, 
+			//						 OVERBOOK, MODIFY_SCHEDULE, USERID, USERID1
+			//string sCommandText = "SELECT BMXIEN RESOURCEUSER_ID, INTERNAL[RESOURCENAME] RESOURCEID, OVERBOOK, MODIFY_SCHEDULE, USERNAME USERID, INTERNAL[USERNAME] FROM BSDX_RESOURCE_USER";
+			LoadResourceUserTable(false);
+		}
+
+		public void LoadResourceUserTable(bool bAllUsers)
+		{
+			string sCommandText = "SELECT BMXIEN RESOURCEUSER_ID, RESOURCENAME, INTERNAL[RESOURCENAME] RESOURCEID, OVERBOOK, MODIFY_SCHEDULE, MODIFY_APPOINTMENTS, USERNAME, INTERNAL[USERNAME] USERID FROM BSDX_RESOURCE_USER";
+			ConnectInfo.RPMSDataTable(sCommandText, "ResourceUser", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- ResourceUser loaded\n");
+		}
+
+		private bool LoadGlobalRecordsets() 
+		{
+			//Schedule User Info
+			string sCommandText = "BSDX SCHEDULING USER INFO^" + m_ConnectInfo.DUZ;
+			DataTable dtUser = ConnectInfo.RPMSDataTable(sCommandText, "SchedulingUser", m_dsGlobal);
+
+			Debug.Assert(dtUser.Rows.Count == 1);
+			DataRow rUser = dtUser.Rows[0];
+			Object oUser = rUser["MANAGER"];
+			string sUser = oUser.ToString();
+			m_bSchedManager = (sUser == "YES")?true:false;
+
+			//AccessTypes
+			LoadAccessTypesTable();
+
+			//Build Primary Key for AccessTypes table
+			DataTable dtTypes = m_dsGlobal.Tables["AccessTypes"];
+			DataColumn dcKey = dtTypes.Columns["BMXIEN"];
+			DataColumn[] dcKeys = new DataColumn[1];
+			dcKeys[0] = dcKey;
+			dtTypes.PrimaryKey = dcKeys;
+
+			//AccessGroups
+			LoadAccessGroupsTable();
+
+			//Build Primary Key for AccessGroup table
+			DataTable dtGroups = m_dsGlobal.Tables["AccessGroup"];
+			dcKey = dtGroups.Columns["ACCESS_GROUP"];
+			dcKeys = new DataColumn[1];
+			dcKeys[0] = dcKey;
+			dtGroups.PrimaryKey = dcKeys;
+
+			//AccessGroupType
+			LoadAccessGroupTypesTable();
+
+			//Build Primary Key for AccessGroupType table
+			DataTable dtAGTypes = m_dsGlobal.Tables["AccessGroupType"];
+			DataColumn dcGTKey = dtAGTypes.Columns["ACCESS_GROUP_TYPEID"];
+			DataColumn[] dcGTKeys = new DataColumn[1];
+			dcGTKeys[0] = dcGTKey;
+			dtAGTypes.PrimaryKey = dcGTKeys;
+
+			//Build Data Relationship between AccessGroupType and AccessTypes tables
+			DataRelation dr = new DataRelation("AccessGroupType",	//Relation Name
+				m_dsGlobal.Tables["AccessGroup"].Columns["BMXIEN"],	//Parent
+				m_dsGlobal.Tables["AccessGroupType"].Columns["ACCESS_GROUP_ID"]);	//Child
+			m_dsGlobal.Relations.Add(dr);
+
+			//ResourceGroup Table (Resource Groups by User)
+			LoadResourceGroupTable();
+			
+			//Resources by user
+			LoadBSDXResourcesTable();
+
+			//Build Primary Key for Resources table
+			DataColumn[] dc = new DataColumn[1];
+			dc[0] = m_dsGlobal.Tables["Resources"].Columns["RESOURCEID"];
+			m_dsGlobal.Tables["Resources"].PrimaryKey = dc;
+
+			//GroupResources table
+			LoadGroupResourcesTable();
+
+			//Build Primary Key for ResourceGroup table
+			dc = new DataColumn[1];
+			dc[0] = m_dsGlobal.Tables["ResourceGroup"].Columns["RESOURCE_GROUP"];
+			m_dsGlobal.Tables["ResourceGroup"].PrimaryKey = dc;
+			
+			//Build Data Relationships between ResourceGroup and GroupResources tables
+			dr = new DataRelation("GroupResource",	//Relation Name
+				m_dsGlobal.Tables["ResourceGroup"].Columns["RESOURCE_GROUP"],	//Parent
+				m_dsGlobal.Tables["GroupResources"].Columns["RESOURCE_GROUP"]);	//Child
+			CGSchedLib.OutputArray(m_dsGlobal.Tables["GroupResources"], "GroupResources");
+			m_dsGlobal.Relations.Add(dr);
+
+			//HospitalLocation table
+			//cmd.CommandText = "SELECT BMXIEN 'HOSPITAL_LOCATION_ID', NAME 'HOSPITAL_LOCATION', DEFAULT_PROVIDER, STOP_CODE_NUMBER, INACTIVATE_DATE, REACTIVATE_DATE FROM HOSPITAL_LOCATION";
+			sCommandText = "BSDX HOSPITAL LOCATION";
+			ConnectInfo.RPMSDataTable(sCommandText, "HospitalLocation", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- HospitalLocation loaded\n");
+
+			//Build Primary Key for HospitalLocation table
+			dc = new DataColumn[1];
+			DataTable dtTemp = m_dsGlobal.Tables["HospitalLocation"];
+			dc[0] = dtTemp.Columns["HOSPITAL_LOCATION_ID"];
+			m_dsGlobal.Tables["HospitalLocation"].PrimaryKey = dc;
+
+            //smh
+			//LoadClinicSetupTable();
+
+            //smh
+			//Build Primary Key for ClinicSetupParameters table
+			/*dc = new DataColumn[1];
+			dtTemp = m_dsGlobal.Tables["ClinicSetupParameters"];
+			dc[0] = dtTemp.Columns["HOSPITAL_LOCATION_ID"];
+			m_dsGlobal.Tables["ClinicSetupParameters"].PrimaryKey = dc;
+
+			//Build Data Relationships between ClinicSetupParameters and HospitalLocation tables
+			dr = new DataRelation("HospitalLocationClinic",	//Relation Name
+				m_dsGlobal.Tables["HospitalLocation"].Columns["HOSPITAL_LOCATION_ID"],	//Parent
+				m_dsGlobal.Tables["ClinicSetupParameters"].Columns["HOSPITAL_LOCATION_ID"], false);	//Child
+			m_dsGlobal.Relations.Add(dr);*/
+            /*SMH
+			dtTemp.Columns.Add("PROVIDER", System.Type.GetType("System.String"), "Parent.DEFAULT_PROVIDER");
+			dtTemp.Columns.Add("CLINIC_STOP", System.Type.GetType("System.String"), "Parent.STOP_CODE_NUMBER");
+			dtTemp.Columns.Add("INACTIVATE_DATE", System.Type.GetType("System.String"), "Parent.INACTIVATE_DATE");
+			dtTemp.Columns.Add("REACTIVATE_DATE", System.Type.GetType("System.String"), "Parent.REACTIVATE_DATE");
+            */
+
+			//Build Data Relationships between Resources and HospitalLocation tables
+			dr = new DataRelation("HospitalLocationResource",	//Relation Name
+				m_dsGlobal.Tables["HospitalLocation"].Columns["HOSPITAL_LOCATION_ID"],	//Parent
+				m_dsGlobal.Tables["Resources"].Columns["HOSPITAL_LOCATION_ID"], false);	//Child
+			m_dsGlobal.Relations.Add(dr);
+
+			//Build ScheduleUser table
+			this.LoadScheduleUserTable();
+
+			//Build Primary Key for ScheduleUser table
+			dc = new DataColumn[1];
+			dtTemp = m_dsGlobal.Tables["ScheduleUser"];
+			dc[0] = dtTemp.Columns["USERID"];
+			m_dsGlobal.Tables["ScheduleUser"].PrimaryKey = dc;
+
+			//Build ResourceUser table
+			this.LoadResourceUserTable();
+
+			//Build Primary Key for ResourceUser table
+			dc = new DataColumn[1];
+			dtTemp = m_dsGlobal.Tables["ResourceUser"];
+			dc[0] = dtTemp.Columns["RESOURCEUSER_ID"];
+			m_dsGlobal.Tables["ResourceUser"].PrimaryKey = dc;
+
+			//Create relation between BSDX Resource and BSDX Resource User tables
+			dr = new DataRelation("ResourceUser",	//Relation Name
+				m_dsGlobal.Tables["Resources"].Columns["RESOURCEID"],	//Parent
+				m_dsGlobal.Tables["ResourceUser"].Columns["RESOURCEID"]);	//Child
+			m_dsGlobal.Relations.Add(dr);
+
+			//Build active provider table
+			sCommandText = "SELECT BMXIEN, NAME FROM NEW_PERSON WHERE INACTIVE_DATE = ''";
+			ConnectInfo.RPMSDataTable(sCommandText, "Provider", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- Provider loaded\n");
+
+			//Build the CLINIC_STOP table
+			// sCommandText = "SELECT BMXIEN, CODE, NAME FROM CLINIC_STOP"; //SMH
+            sCommandText = "SELECT BMXIEN, AMIS_REPORTING_STOP_CODE, NAME FROM CLINIC_STOP";
+			ConnectInfo.RPMSDataTable(sCommandText, "ClinicStop", m_dsGlobal);
+			Debug.Write("LoadGlobalRecordsets -- ClinicStop loaded\n");
+
+			//Build the HOLIDAY table
+			sCommandText = "SELECT NAME, DATE FROM HOLIDAY WHERE DATE > '" + DateTime.Today.ToShortDateString() + "'";
+			ConnectInfo.RPMSDataTable(sCommandText, "HOLIDAY", m_dsGlobal);
+            Debug.Write("LoadingGlobalRecordsets -- Holidays loaded\n");
+
+
+			//Save the xml schema
+			//m_dsGlobal.WriteXmlSchema(@"..\..\csSchema20060526.xsd");
+
+			return true;
+		}
+
+		public void RegisterDocumentView(CGDocument doc, CGView view)
+		{			
+			//Store the view in the list of views
+			this.Views.Add(view, doc);
+
+			//Hook into the view's 'closed' event
+			view.Closed += new EventHandler(ViewClosed);
+
+			//Hook into the view's mnuRPMSServer.Click event
+			view.mnuRPMSServer.Click += new EventHandler(mnuRPMSServer_Click);
+
+			//Hook into the view's mnuRPMSLogin.Click event
+			view.mnuRPMSLogin.Click += new EventHandler(mnuRPMSLogin_Click);
+
+		}
+
+		public void RegisterAVDocumentView(CGAVDocument doc, CGAVView view)
+		{
+			//Store the view in the list of views
+			this.AvailabilityViews.Add(view, doc);
+
+			//Hook into the view's 'closed' event
+			view.Closed += new EventHandler(AVViewClosed);
+		}
+
+		public CGAVView GetAVViewByResource(ArrayList sResourceArray)
+		{
+			if (sResourceArray == null)
+				return null;
+
+			bool bEqual = true;
+			foreach (CGAVView v in m_AVViews.Keys)
+			{
+				CGAVDocument d = v.Document;
+
+				bEqual = false;
+				if (d.Resources.Count == sResourceArray.Count)
+				{
+					bEqual = true;
+					for (int j = 0; j < sResourceArray.Count; j++)
+					{
+						if (sResourceArray.Contains(d.Resources[j]) == false)
+						{
+							bEqual = false;
+							break;
+						}
+						if (d.Resources.Contains(sResourceArray[j]) == false)
+						{
+							bEqual = false;
+							break;
+						}
+					}					
+					if (bEqual == true)
+						return v;
+				}
+			}
+			return null;
+		}
+		/// <summary>
+		/// Return the first view having a resource array matching sResourceArray
+		/// </summary>
+		/// <param name="sResourceArray"></param>
+		/// <returns></returns>
+		public CGView GetViewByResource(ArrayList sResourceArray)
+		{
+			if (sResourceArray == null)
+				return null;
+
+			bool bEqual = true;
+			foreach (CGView v in _views.Keys)
+			{
+				CGDocument d = v.Document;
+
+				bEqual = false;
+				if (d.Resources.Count == sResourceArray.Count)
+				{
+					bEqual = true;
+					for (int j = 0; j < sResourceArray.Count; j++)
+					{
+						if (sResourceArray.Contains(d.Resources[j]) == false)
+						{
+							bEqual = false;
+							break;
+						}
+						if (d.Resources.Contains(sResourceArray[j]) == false)
+						{
+							bEqual = false;
+							break;
+						}
+					}					
+					if (bEqual == true)
+						return v;
+				}
+			}
+			return null;
+		}
+
+		private void ViewClosed(object sender, EventArgs e)
+		{
+			//Remove the sender from our document list
+			Views.Remove(sender);
+
+			//If no documents left, then close RPMS connection & exit the application
+			if ((Views.Count == 0)&&(this.AvailabilityViews.Count == 0)&&(m_bExitOK == true))
+			{
+				m_ConnectInfo.EventPollingEnabled = false;
+				m_ConnectInfo.UnSubscribeEvent("BSDX SCHEDULE");
+				m_ConnectInfo.CloseConnection();
+				Application.Exit();
+			}
+		}
+
+		private void AVViewClosed(object sender, EventArgs e)
+		{
+			//Remove the sender from our document list
+			this.AvailabilityViews.Remove(sender);
+
+			//If no documents left, then close RPMS connection & exit the application
+			if ((Views.Count == 0)&&(this.AvailabilityViews.Count == 0)&&(m_bExitOK == true))
+			{
+				m_ConnectInfo.bmxNetLib.CloseConnection();
+				Application.Exit();
+			}
+		}
+
+		private void KeepAlive()
+		{
+			foreach (CGView v in _views.Keys)
+			{
+				CGDocument d = v.Document;
+				DateTime dNow = DateTime.Now;
+				DateTime dLast = d.LastRefreshed;
+				TimeSpan tsDiff = dNow - dLast;
+				if (tsDiff.Seconds > 180)
+				{				
+					for (int j = 0; j < d.Resources.Count; j++)
+					{
+						v.RaiseRPMSEvent("SCHEDULE-" + d.Resources[j].ToString(), "");
+					}
+
+					break;
+				}
+			}		
+		}
+
+		/// <summary>
+		/// Propogate availability updates to all sRresource's doc/views 
+		/// </summary>
+		public void UpdateViews(string sResource, string sOldResource)
+		{
+			if (sResource == null)
+				return;
+			foreach (CGView v in _views.Keys)
+			{
+				CGDocument d = v.Document;
+				for (int j = 0; j < d.Resources.Count; j++)
+				{
+					if ((sResource == "") || (sResource == ((string) d.Resources[j])) || (sOldResource == ((string) d.Resources[j])))
+					{
+						d.RefreshDocument();
+						break;
+					}
+				}
+				v.UpdateTree();
+			}
+		}
+		
+		/// <summary>
+		/// Propogate availability updates to all doc/views 
+		/// </summary>
+		public void UpdateViews()
+		{
+			UpdateViews("","");
+			foreach (CGView v in _views.Keys)
+			{
+				v.UpdateTree();
+			}
+		}
+
+		/// <summary>
+		/// Calls each view associated with document Doc and closes it.
+		/// </summary>		
+		public void CloseAllViews(CGDocument doc)
+		{
+			//iterate through all views and call update.
+			Hashtable h = CGDocumentManager.Current.Views;
+			
+			CGDocument d;
+			int nTempCount = h.Count;
+			do
+			{
+				nTempCount = h.Count;
+				foreach (CGView v in h.Keys)
+				{
+					d = (CGDocument) h[v];
+					if (d == doc)
+					{
+						v.Close();
+						break;
+					}
+				}
+			} while ((h.Count > 0) && (nTempCount != h.Count));
+		}
+
+		/// <summary>
+		/// Calls each view associated with Availability Doc and closes it.
+		/// </summary>		
+		public void CloseAllViews(CGAVDocument doc)
+		{
+			//iterate through all views and call update.
+			Hashtable h = CGDocumentManager.Current.AvailabilityViews;
+			
+			CGAVDocument d;
+			int nTempCount = h.Count;
+			do
+			{
+				nTempCount = h.Count;
+				foreach (CGAVView v in h.Keys)
+				{
+					d = (CGAVDocument) h[v];
+					if (d == doc)
+					{
+						v.Close();
+						break;
+					}
+				}
+			} while ((h.Count > 0) && (nTempCount != h.Count));
+
+
+		}
+
+		private void mnuRPMSServer_Click(object sender, EventArgs e)
+		{
+			//Warn that changing servers will close all schedules
+			if (MessageBox.Show("Are you sure you want to close all schedules and connect to a different VistA server?", "Clinical Scheduling", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
+				return;
+
+			//Reconnect to RPMS and recreate all global recordsets
+			try
+			{
+				m_bExitOK = false;
+				bool bRetry = true;
+				BMXNetConnectInfo tmpInfo;
+				do
+				{
+					tmpInfo = m_ConnectInfo;
+					try
+					{
+						tmpInfo.ChangeServerInfo();
+						bRetry = false;
+					}
+					catch (Exception ex)
+					{
+						if (ex.Message == "User cancelled.")
+						{
+							bRetry = false;
+							return;
+						}
+						if (MessageBox.Show("Unable to connect to VistA.  " + ex.Message , "Clinical Scheduling", MessageBoxButtons.RetryCancel) == DialogResult.Retry)
+						{
+							bRetry = true;
+						}
+						else
+						{
+							bRetry = false;
+							return;
+						}
+					}
+				} while (bRetry == true);
+
+				CloseAll();
+				m_bExitOK = true;
+				m_ConnectInfo = tmpInfo;
+
+				this.InitializeApp();
+
+				//Create a new document
+				CGDocument doc = new CGDocument();
+				doc.DocManager = _current;
+				doc.OnNewDocument();
+
+			}
+			catch (Exception ex)
+			{
+				throw ex;
+			}
+	
+		}
+
+		private void mnuRPMSLogin_Click(object sender, EventArgs e)
+		{
+			//Warn that changing login will close all schedules
+			if (MessageBox.Show("Are you sure you want to close all schedules and login to VistA?", "Clinical Scheduling", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
+				return;
+
+			//Reconnect to RPMS and recreate all global recordsets
+			try
+			{
+				m_bExitOK = false;
+				CloseAll();
+				m_bExitOK = true;
+				_current.m_ConnectInfo = new BMXNet.BMXNetConnectInfo();
+				this.InitializeApp(true);
+				//Create a new document
+				CGDocument doc = new CGDocument();
+				doc.DocManager = _current;
+				doc.OnNewDocument();
+			}
+			catch (Exception ex)
+			{
+				throw ex;
+			}
+	
+		}
+
+		delegate void CloseAllDelegate(string sMsg);
+		
+		private void CloseAll(string sMsg)
+		{
+			if (sMsg == "")
+			{
+				sMsg = "Scheduling System Shutting Down Immediately for Maintenance.";
+			}
+
+			MessageBox.Show(sMsg, "Clinical Scheduling Administrator -- System Shutdown Notification", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+
+			CloseAll();
+		}
+
+		private void CloseAll()
+		{
+			//Close all documents, views and connections
+			Hashtable h = CGDocumentManager.Current.Views;
+			int nTempCount = h.Count;
+			do
+			{
+				nTempCount = h.Count;
+				foreach (CGView v in h.Keys)
+				{
+					v.Close();
+					break;
+				}
+			} while ((h.Count > 0) && (nTempCount != h.Count));
+
+			h = CGDocumentManager.Current.AvailabilityViews;
+			nTempCount = h.Count;
+			do
+			{
+				nTempCount = h.Count;
+				foreach (CGAVView v in h.Keys)
+				{
+					v.Close();
+					break;
+				}
+			} while ((h.Count > 0) && (nTempCount != h.Count));
+
+		}
+
+		delegate DataTable RPMSDataTableDelegate(string CommandString, string TableName);
+
+		public DataTable RPMSDataTable(string sSQL, string sTableName)
+		{
+			//Retrieves a recordset from RPMS
+			string			sErrorMessage = "";
+			try
+			{
+				System.IntPtr pHandle = this.Handle;
+				DataTable dtOut;
+				RPMSDataTableDelegate rdtd = new RPMSDataTableDelegate(ConnectInfo.RPMSDataTable);
+				dtOut = (DataTable) this.Invoke(rdtd, new object[] {sSQL, sTableName});
+				return dtOut;
+			}
+			catch (Exception ex)
+			{
+				sErrorMessage = "CGDocumentManager.RPMSDataTable error: " + ex.Message;
+				throw ex;
+			}
+		}
+
+		public void ChangeDivision(System.Windows.Forms.Form frmCaller)
+		{
+			this.ConnectInfo.ChangeDivision(frmCaller);
+			foreach (CGView v in _views.Keys)
+			{
+				v.InitializeDocView(v.Document.DocName);
+				v.Document.RefreshDocument();
+			}
+		}
+
+		public void ViewRefresh()
+		{
+			foreach (CGView v in _views.Keys)
+			{
+				try
+				{
+					v.Document.RefreshDocument();
+				}
+				catch (Exception ex)
+				{
+					Debug.Write("CGDocumentManager.ViewRefresh Exception: " + ex.Message + "\n");
+				}
+				finally
+				{
+				}
+			}
+			Debug.Write("DocManager refreshed all views.\n");
+		}
+
+		#endregion Methods & Events
+
+	}
+}
Index: Scheduling/branches/GUI1.2/CGDocumentManager.resx
===================================================================
--- Scheduling/branches/GUI1.2/CGDocumentManager.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/CGDocumentManager.resx	(revision 855)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.Name">
+    <value>CGDocumentManager</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/CGRange.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGRange.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGRange.cs	(revision 855)
@@ -0,0 +1,109 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    public class CGRange
+    {
+        private CGCells m_Cells;
+        private CGCell m_gcEnd;
+        private CGCell m_gcStart;
+
+        public CGRange()
+        {
+            this.m_Cells = new CGCells();
+        }
+
+        public CGRange(CGCells gridCells, CGCell gcStart, CGCell gcEnd)
+        {
+            this.CreateRange(gridCells, gcStart, gcEnd);
+        }
+
+        public void AppendCell(CGCells gridCells, CGCell aCell)
+        {
+            if ((aCell != this.StartCell) && (aCell.CellColumn == this.StartCell.CellColumn))
+            {
+                CGCell startCell = this.StartCell;
+                this.m_Cells.ClearAllCells();
+                this.CreateRange(gridCells, startCell, aCell);
+            }
+        }
+
+        public bool CellIsInRange(CGCell cgCell)
+        {
+            return this.m_Cells.CellHashTable.ContainsKey(cgCell.Key);
+        }
+
+        public void CreateRange(CGCells gridCells, CGCell sCell, CGCell eCell)
+        {
+            this.m_Cells.ClearAllCells();
+            this.m_Cells.AddCell(sCell);
+            this.m_gcStart = sCell;
+            this.m_gcEnd = eCell;
+            if (sCell != eCell)
+            {
+                int num;
+                CGCell r = null;
+                if (sCell.CellRow < eCell.CellRow)
+                {
+                    for (num = sCell.CellRow + 1; num <= eCell.CellRow; num++)
+                    {
+                        r = gridCells.GetCellFromRowCol(num, eCell.CellColumn);
+                        this.m_Cells.AddCell(r);
+                    }
+                }
+                else
+                {
+                    for (num = sCell.CellRow - 1; num >= eCell.CellRow; num--)
+                    {
+                        r = gridCells.GetCellFromRowCol(num, eCell.CellColumn);
+                        this.m_Cells.AddCell(r);
+                    }
+                }
+            }
+        }
+
+        public void SubtractCell(CGCells gridCells, CGCell aCell, bool bUp)
+        {
+            int nRow = bUp ? (this.m_gcEnd.CellRow - 1) : (this.m_gcEnd.CellRow + 1);
+            int cellColumn = this.m_gcEnd.CellColumn;
+            this.Cells.RemoveCell(this.m_gcEnd.Key);
+            this.m_gcEnd = gridCells.GetCellFromRowCol(nRow, cellColumn);
+        }
+
+        public CGCells Cells
+        {
+            get
+            {
+                return this.m_Cells;
+            }
+        }
+
+        public CGCell EndCell
+        {
+            get
+            {
+                return this.m_gcEnd;
+            }
+            set
+            {
+                this.m_gcEnd = value;
+            }
+        }
+
+        public CGCell StartCell
+        {
+            get
+            {
+                return this.m_gcStart;
+            }
+            set
+            {
+                this.m_gcStart = value;
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/CGResource.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGResource.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGResource.cs	(revision 855)
@@ -0,0 +1,129 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    public class CGResource
+    {
+        private bool m_bInactive = false;
+        private int m_nHospitalLocationID = 0;
+        private int m_nResourceID = 0;
+        private int m_nTimeScale = 15;
+        private string m_sCancellationLetterText;
+        private string m_sHospitalLocation = "";
+        private string m_sLetterText;
+        private string m_sNoShowLetterText;
+        private string m_sResourceName = "";
+
+        public string CancellationLetterText
+        {
+            get
+            {
+                return this.m_sCancellationLetterText;
+            }
+            set
+            {
+                this.m_sCancellationLetterText = value;
+            }
+        }
+
+        public string HospitalLocation
+        {
+            get
+            {
+                return this.m_sHospitalLocation;
+            }
+            set
+            {
+                this.m_sHospitalLocation = value;
+            }
+        }
+
+        public int HospitalLocationID
+        {
+            get
+            {
+                return this.m_nHospitalLocationID;
+            }
+            set
+            {
+                this.m_nHospitalLocationID = value;
+            }
+        }
+
+        public bool Inactive
+        {
+            get
+            {
+                return this.m_bInactive;
+            }
+            set
+            {
+                this.m_bInactive = value;
+            }
+        }
+
+        public string LetterText
+        {
+            get
+            {
+                return this.m_sLetterText;
+            }
+            set
+            {
+                this.m_sLetterText = value;
+            }
+        }
+
+        public string NoShowLetterText
+        {
+            get
+            {
+                return this.m_sNoShowLetterText;
+            }
+            set
+            {
+                this.m_sNoShowLetterText = value;
+            }
+        }
+
+        public int ResourceID
+        {
+            get
+            {
+                return this.m_nResourceID;
+            }
+            set
+            {
+                this.m_nResourceID = value;
+            }
+        }
+
+        public string ResourceName
+        {
+            get
+            {
+                return this.m_sResourceName;
+            }
+            set
+            {
+                this.m_sResourceName = value;
+            }
+        }
+
+        public int TimeScale
+        {
+            get
+            {
+                return this.m_nTimeScale;
+            }
+            set
+            {
+                this.m_nTimeScale = value;
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/CGSchedLib.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGSchedLib.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGSchedLib.cs	(revision 855)
@@ -0,0 +1,992 @@
+using System;
+using System.Data;
+//using System.Data.OleDb;
+using System.Collections;
+using System.Diagnostics;
+using System.Drawing;
+using IndianHealthService.BMXNet;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	public enum ScheduleType 
+	{
+		Resource,
+		Clinic
+	}
+
+	/// <summary>
+	/// CGSchedLib contains static functions that are called from throughout the 
+	/// scheduling application.
+	/// </summary>
+	public class CGSchedLib
+	{
+		public CGSchedLib()
+		{
+
+		}
+
+		public static DataTable CreateAppointmentSchedule(CGDocumentManager docManager, ArrayList saryResNames, DateTime StartTime, DateTime EndTime)
+		{
+			string sResName = "";
+			for  (int i = 0; i < saryResNames.Count; i++)
+			{
+				sResName += saryResNames[i];
+				if ((i+1) < saryResNames.Count)
+					sResName += "|";
+			}
+			string sStart;
+			string sEnd;
+			sStart = StartTime.ToString("M-d-yyyy");
+			sEnd = EndTime.ToString("M-d-yyyy@HH:m");
+			string sSql = "BSDX CREATE APPT SCHEDULE^" + sResName + "^" + sStart + "^" + sEnd ;
+			DataTable dtRet = docManager.RPMSDataTable(sSql, "AppointmentSchedule");
+			return dtRet;
+			
+		}
+
+		public static void OutputArray(DataTable dt, string sName)
+		{
+#if (DEBUG && OUTPUTARRAY)
+			Debug.Write("\n " + sName + " OutputArray:\n");
+			if (dt == null)
+				return;
+
+			foreach (DataColumn c in dt.Columns)
+			{
+				Debug.Write(c.ToString());
+			}
+			Debug.Write("\n");
+			foreach (DataRow r in dt.Rows) 
+			{
+				foreach (DataColumn c in dt.Columns)
+				{
+					Debug.Write(r[c].ToString());
+				}
+				Debug.Write("\n");
+			}			
+			Debug.Write("\n");
+#endif
+		}
+
+		public static DataTable CreateAvailabilitySchedule(CGDocumentManager docManager, 
+			ArrayList saryResourceNames, DateTime StartTime, DateTime EndTime, 
+			ArrayList saryApptTypes,/**/ ScheduleType stType, string sSearchInfo) 
+		{
+			DataTable rsOut;
+			rsOut = new DataTable("AvailabilitySchedule");
+
+			DataTable rsSlotSchedule;
+			DataTable rsApptSchedule;
+			DataTable rsTemp1;
+
+			int nSize = saryResourceNames.Count;
+			if (nSize == 0) 
+			{
+				return rsOut;
+			}
+			
+			string sResName;
+			for (int i = 0; i < nSize; i++) 
+			{
+				sResName = saryResourceNames[i].ToString();
+
+				rsSlotSchedule = CGSchedLib.CreateAssignedSlotSchedule(docManager, sResName, StartTime, EndTime, saryApptTypes,/**/ stType, sSearchInfo);
+				OutputArray(rsSlotSchedule, "rsSlotSchedule");
+
+				if (rsSlotSchedule.Rows.Count > 0 ) 
+				{
+					rsApptSchedule = CGSchedLib.CreateAppointmentSlotSchedule(docManager, sResName, StartTime, EndTime, stType);
+					OutputArray(rsApptSchedule, "rsApptSchedule");
+					rsTemp1 = CGSchedLib.SubtractSlotsRS2(rsSlotSchedule, rsApptSchedule, sResName);
+					OutputArray(rsTemp1, "rsTemp1");
+				}
+				else 
+				{
+					rsTemp1 = rsSlotSchedule;
+					OutputArray(rsTemp1, "rsTemp1");
+				}
+				if (i == 0) 
+				{
+					rsOut = rsTemp1;
+					OutputArray(rsOut, "rsOut");
+				}
+				else 
+				{
+					rsOut = CGSchedLib.UnionBlocks(rsTemp1, rsOut);
+					OutputArray(rsOut, "United rsOut");
+				}
+			}
+			return rsOut;
+		}		
+
+		public static DataTable CreateAssignedTypeSchedule(CGDocumentManager docManager, string sResourceName, DateTime StartTime, DateTime EndTime, ScheduleType stType)
+		{
+
+			string sStart;
+			string sEnd;
+			sStart = StartTime.ToString("M-d-yyyy");
+			sEnd = EndTime.ToString("M-d-yyyy");
+//			string sSource = (stType == ScheduleType.Resource ? "ST_RESOURCE" : "ST_CLINIC");
+			string sSql = "BSDX TYPE BLOCKS OVERLAP^" + sStart + "^" + sEnd + "^" + sResourceName ;//+ "^" + sSource;
+
+			DataTable rs = docManager.RPMSDataTable(sSql, "AssignedTypeSchedule");
+
+			if (rs.Rows.Count == 0)
+				return rs;
+
+			DataTable rsCopy = new DataTable("rsCopy");			
+			DataColumn dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.DateTime");
+			dCol.ColumnName = "StartTime";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			rsCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.DateTime");
+			dCol.ColumnName = "EndTime";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			rsCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.Int16");
+			dCol.ColumnName = "AppointmentTypeID";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			rsCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			//dCol.DataType = Type.GetType("System.Int16");
+            dCol.DataType = Type.GetType("System.Int32"); //MJL 11/17/2006
+            dCol.ColumnName = "AvailabilityID";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			rsCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.String");
+			dCol.ColumnName = "ResourceName";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			rsCopy.Columns.Add(dCol);
+
+
+			DateTime dLastEnd;
+			DateTime dStart;
+			DateTime dEnd;
+//			DataRow r;
+			DataRow rNew;
+
+			rNew = rs.Rows[rs.Rows.Count - 1];
+			dLastEnd = (DateTime) rNew["EndTime"];
+			rNew = rs.Rows[0];
+			dStart = (DateTime) rNew["StartTime"];
+
+			long UNSPECIFIED_TYPE = 10;
+			long UNSPECIFIED_ID = 0;
+
+			//if first block in vgetrows starts later than StartTime,
+			// then pad with a new block
+
+			if (dStart > StartTime) 
+			{
+				dEnd = dStart;
+				rNew = rsCopy.NewRow();
+				rNew["StartTime"] = StartTime;
+				rNew["EndTime"] = dEnd;
+				rNew["AppointmentTypeID"] = UNSPECIFIED_TYPE;
+				rNew["AvailabilityID"] = UNSPECIFIED_ID;
+				rNew["ResourceName"] = sResourceName;
+				rsCopy.Rows.Add(rNew);
+			}	
+			
+			//if first block start time is < StartTime then trim
+			if (dStart < StartTime) 
+			{
+				rNew = rs.Rows[0];
+				rNew["StartTime"] = StartTime;
+				dStart = StartTime;
+			}	
+
+			int nAppointmentTypeID;
+			int nAvailabilityID;
+
+			dEnd = dStart;
+			foreach (DataRow rEach in rs.Rows)
+			{
+				dStart = (DateTime) rEach["StartTime"];
+				if (dStart > dEnd) 
+				{
+					rNew = rsCopy.NewRow();
+					rNew["StartTime"] = dEnd;
+					rNew["EndTime"] = dStart;
+					rNew["AppointmentTypeID"] = 0;
+					rNew["AvailabilityID"] = UNSPECIFIED_ID;
+					rNew["ResourceName"] = sResourceName;
+					rsCopy.Rows.Add(rNew);
+				}
+
+				dEnd = (DateTime) rEach["EndTime"];
+
+				if (dEnd > EndTime) 
+					dEnd = EndTime;
+				nAppointmentTypeID = (int) rEach["AppointmentTypeID"];
+				nAvailabilityID = (int) rEach["AvailabilityID"];
+				
+				rNew = rsCopy.NewRow();
+				rNew["StartTime"] = dStart;
+				rNew["EndTime"] = dEnd;
+				rNew["AppointmentTypeID"] = nAppointmentTypeID;
+				rNew["AvailabilityID"] = nAvailabilityID;
+				rNew["ResourceName"] = sResourceName;
+				rsCopy.Rows.Add(rNew);
+			}
+
+			//Pad the end if necessary
+			if (dLastEnd < EndTime) 
+			{
+				rNew = rsCopy.NewRow();
+				rNew["StartTime"] = dLastEnd;
+				rNew["EndTime"] = EndTime;
+				rNew["AppointmentTypeID"] = UNSPECIFIED_TYPE;
+				rNew["AvailabilityID"] = UNSPECIFIED_ID;
+				rNew["ResourceName"] = sResourceName;
+				rsCopy.Rows.Add(rNew);		
+			}
+			OutputArray(rsCopy, "CreateAssignedTypeSchedule");
+			return rsCopy;
+		}
+
+		public static DataTable CreateAssignedSlotSchedule(CGDocumentManager docManager, string sResourceName, DateTime StartTime, DateTime EndTime, ArrayList rsaryApptTypeIDs, /**/ ScheduleType stType, string sSearchInfo) 
+		{
+
+			//Appointment type ids is now always "" so that all appointment types are returned.
+			string sApptTypeIDs = "";
+			
+			//The following code block is not used now, but keep for possible later use:
+			//Unpack the Appointment Type IDs
+			/*
+			*/
+			int nSize = rsaryApptTypeIDs.Count;
+			for (int i=0; i < nSize; i++) 
+			{
+				sApptTypeIDs += rsaryApptTypeIDs[i];
+				if (i < (nSize-1))
+					sApptTypeIDs += "|";
+			}	
+	
+			string sStart;
+			string sEnd;
+			sStart = StartTime.ToString("M-d-yyyy");
+			sEnd = EndTime.ToString("M-d-yyyy@H:mm");
+			string sSql = "BSDX CREATE ASGND SLOT SCHED^" + sResourceName + "^" + sStart + "^" + sEnd + "^" + sApptTypeIDs + "^" + sSearchInfo; //+ "^" + sSTType ;
+
+			DataTable dtRet = docManager.RPMSDataTable(sSql, "AssignedSlotSchedule");
+
+			if (sResourceName == "")
+			{
+				return dtRet; 
+			}
+
+			return dtRet;
+		}
+
+		public static DataTable CreateCopyTable()
+		{
+			DataTable dtCopy = new DataTable("dtCopy");			
+			DataColumn dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.DateTime");
+			dCol.ColumnName = "START_TIME";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			dtCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.DateTime");
+			dCol.ColumnName = "END_TIME";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			dtCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.Int16");
+			dCol.ColumnName = "SLOTS";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			dtCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.String");
+			dCol.ColumnName = "RESOURCE";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = true;
+			dCol.Unique = false;
+			dtCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.String");
+			dCol.ColumnName = "ACCESS_TYPE";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = true;
+			dCol.Unique = false;
+			dtCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.String");
+			dCol.ColumnName = "NOTE";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = true;
+			dCol.Unique = false;
+			dtCopy.Columns.Add(dCol);
+
+
+			return dtCopy;
+		}
+
+		public static DataTable CreateAppointmentSlotSchedule(CGDocumentManager docManager, string sResourceName, DateTime StartTime, DateTime EndTime, ScheduleType stType)
+		{
+
+
+			string sStart;
+			string sEnd;
+			sStart = StartTime.ToString("M-d-yyyy");
+			sEnd = EndTime.ToString("M-d-yyyy");
+
+			string sSTType = (stType == ScheduleType.Resource ? "ST_RESOURCE" : "ST_CLINIC");
+			string sSql = "BSDX APPT BLOCKS OVERLAP^" + sStart + "^" + sEnd + "^" + sResourceName ;//+ "^"  + sSTType;
+
+			DataTable dtRet = docManager.RPMSDataTable(sSql, "AppointmentSlotSchedule");
+			
+			if (dtRet.Rows.Count < 1)
+				return dtRet;
+			
+			//Create CDateTimeArray & load records from rsOut
+			int nRC;
+			nRC = dtRet.Rows.Count;
+			ArrayList cdtArray = new ArrayList();
+			cdtArray.Capacity = (nRC * 2);
+			DateTime v;
+			int i = 0;
+
+			foreach (DataRow r in dtRet.Rows) 
+			{
+				v = (DateTime) r[dtRet.Columns["START_TIME"]];
+				cdtArray.Add(v);
+				v = (DateTime) r[dtRet.Columns["END_TIME"]];
+				cdtArray.Add(v);
+			}
+			cdtArray.Sort();
+
+			//Create a CTimeBlockArray and load it from rsOut
+		
+			ArrayList ctbAppointments = new ArrayList(nRC);
+			CGAvailability cTB;
+			i = 0;
+			foreach (DataRow r in dtRet.Rows) 
+			{
+				cTB = new CGAvailability();
+				cTB.StartTime = (DateTime) r[dtRet.Columns["START_TIME"]];
+				cTB.EndTime = (DateTime) r[dtRet.Columns["END_TIME"]];
+				ctbAppointments.Add(cTB);
+			}			
+			
+			//Create a TimeBlock Array from the data in the DateTime array
+			ArrayList ctbApptSchedule = new ArrayList();
+			ScheduleFromArray(cdtArray, StartTime, EndTime, ref ctbApptSchedule);
+			
+			//Find number of TimeBlocks in ctbApptSchedule that
+			//overlap the TimeBlocks in ctbAppointments
+			ArrayList ctbApptSchedule2 = new ArrayList();
+			CGAvailability cTB2;
+			int nSlots = 0;
+			for (i=0; i< ctbApptSchedule.Count; i++) 
+			{
+				cTB = (CGAvailability) ctbApptSchedule[i];
+				nSlots = BlocksOverlap(cTB, ctbAppointments);
+				cTB2 = new CGAvailability();
+				cTB2.Create(cTB.StartTime, cTB.EndTime, nSlots);
+				ctbApptSchedule2.Add(cTB2);
+			}
+			
+			ConsolidateBlocks(ctbApptSchedule2);
+			
+			DataTable dtCopy = new DataTable("dtCopy");			
+			DataColumn dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.DateTime");
+			dCol.ColumnName = "START_TIME";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			dtCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.DateTime");
+			dCol.ColumnName = "END_TIME";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			dtCopy.Columns.Add(dCol);
+
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.Int16");
+			dCol.ColumnName = "SLOTS";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			dtCopy.Columns.Add(dCol);
+			
+			dCol = new DataColumn();
+			dCol.DataType = Type.GetType("System.String");
+			dCol.ColumnName = "RESOURCE";
+			dCol.ReadOnly = true;
+			dCol.AllowDBNull = false;
+			dCol.Unique = false;
+			dtCopy.Columns.Add(dCol);
+
+			for (int k=0; k < ctbApptSchedule2.Count; k++) 
+			{
+				cTB = (CGAvailability) ctbApptSchedule2[k];
+				DataRow newRow;
+				newRow = dtCopy.NewRow();
+				newRow["START_TIME"] = cTB.StartTime;
+				newRow["END_TIME"] = cTB.EndTime;
+				newRow["SLOTS"] = cTB.Slots;
+				newRow["RESOURCE"] = sResourceName;
+				dtCopy.Rows.Add(newRow);
+			}
+
+			return dtCopy;
+
+		}
+
+		public static int BlocksOverlap(CGAvailability rBlock, ArrayList rTBArray)
+		{
+			//this overload implements default false for bCountSlots
+			return CGSchedLib.BlocksOverlap(rBlock, rTBArray, false);
+		}
+		public static int BlocksOverlap(CGAvailability rBlock, ArrayList rTBArray, bool bCountSlots)
+		{
+			//If bCountSlots == true, then returns
+			//sum of Slots in overlapping blocks 
+			//instead of the count of overlapping blocks
+
+			DateTime dStart1;
+			DateTime dStart2;
+			DateTime dEnd1;
+			DateTime dEnd2;
+			int nSlots;
+			int nCount = 0;
+			CGAvailability cBlock;
+
+			dStart1 = rBlock.StartTime;
+			dEnd1 = rBlock.EndTime;
+
+			for (int j=0; j< rTBArray.Count; j++) 
+			{
+				cBlock = (CGAvailability) rTBArray[j];
+				dStart2 = cBlock.StartTime;
+				dEnd2 = cBlock.EndTime;
+				nSlots = cBlock.Slots;
+				if (TimesOverlap(dStart1, dEnd1, dStart2, dEnd2)) 
+				{
+					if (bCountSlots == true) 
+					{
+						nCount += nSlots;
+					}
+					else 
+					{
+						nCount++;
+					}
+				}
+			}
+
+			return nCount;
+		}
+
+		//BOOL CResourceLink::TimesOverlap(COleDateTime dStart1, COleDateTime dEnd1, COleDateTime dStart2, COleDateTime dEnd2)
+		public static bool TimesOverlap(DateTime dStart1, DateTime dEnd1, DateTime dStart2, DateTime dEnd2)
+		{
+			Rectangle rect1 = new Rectangle();
+			Rectangle rect2 = new Rectangle();
+			rect1.X = 0;
+			rect2.X = 0;
+			rect1.Width = 1;
+			rect2.Width = 1;
+
+			rect1.Y = CGSchedLib.MinSince80(dStart1);
+			rect1.Height = CGSchedLib.MinSince80(dEnd1) - rect1.Y;
+			rect2.Y = CGSchedLib.MinSince80(dStart2);
+			rect2.Height = CGSchedLib.MinSince80(dEnd2) - rect2.Y;
+			bool bRet = rect2.IntersectsWith(rect1);
+			return bRet;
+		}
+
+		public static void ConsolidateBlocks(ArrayList rTBArray)
+		{
+			//TODO: Test this function
+
+			int j = 0;
+			bool bDirty = false;
+			CGAvailability cBlockA;
+			CGAvailability cBlockB;
+			CGAvailability cTemp1;
+			if (rTBArray.Count < 2)
+				return;
+			do 
+			{
+				bDirty = false;
+				for (j = 0; j < (rTBArray.Count - 1); j++) //TODO: why minus 1?
+				{
+					cBlockA = (CGAvailability) rTBArray[j];
+					cBlockB = (CGAvailability) rTBArray[j+1];
+					if ((cBlockA.EndTime == cBlockB.StartTime) 
+						&& (cBlockA.Slots == cBlockB.Slots)
+						&& (cBlockA.ResourceList == cBlockB.ResourceList)
+						&& (cBlockA.AccessRuleList == cBlockB.AccessRuleList)
+						) 
+					{
+						cTemp1 = new CGAvailability();
+						cTemp1.StartTime = cBlockA.StartTime;
+						cTemp1.EndTime = cBlockB.EndTime;
+						cTemp1.Slots = cBlockA.Slots;
+						cTemp1.AccessRuleList = cBlockA.AccessRuleList;
+						cTemp1.ResourceList = cBlockA.ResourceList;
+						rTBArray.Insert(j, cTemp1);
+						rTBArray.RemoveRange(j+1, 2);
+						bDirty = true;
+						break;
+					}
+				}
+			}
+			while (!((bDirty == false) || (rTBArray.Count == 1)));
+		}
+
+		public static DataTable SubtractSlotsRS2(DataTable rsBlocks1, DataTable rsBlocks2, string sResource)
+		{
+			//Subtract slots in rsBlocks2 from rsBlocks1
+			//7-16-01 SUBCLINIC data field in rsBlocks1 persists thru routine.
+			//7-18-01 RESOURCE and ACCESS_TYPE fields presisted
+
+			if ((rsBlocks2.Rows.Count == 0) || (rsBlocks1.Rows.Count == 0))
+				return rsBlocks1;
+
+
+			//Create an array of the start and end times of blocks2
+			ArrayList cdtArray = new ArrayList(2*(rsBlocks1.Rows.Count + rsBlocks2.Rows.Count));
+
+			foreach (DataRow r in rsBlocks1.Rows) 
+			{
+				cdtArray.Add(r[rsBlocks1.Columns["START_TIME"]]);
+				cdtArray.Add(r[rsBlocks1.Columns["END_TIME"]]);
+			}
+
+			foreach (DataRow r in rsBlocks2.Rows) 
+			{
+				cdtArray.Add(r[rsBlocks2.Columns["START_TIME"]]);
+				cdtArray.Add(r[rsBlocks2.Columns["END_TIME"]]);
+			}
+
+			cdtArray.Sort();
+
+			ArrayList ctbReturn = new ArrayList();
+			DateTime cDate = new DateTime();
+			ScheduleFromArray(cdtArray, cDate, cDate, ref ctbReturn);
+
+			//Set up return table
+			DataTable rsCopy = CGSchedLib.CreateCopyTable();	//TODO: There's a datatable method that does this.	
+			long nSlots = 0;
+			CGAvailability cTB;
+
+			for (int j=0; j < (ctbReturn.Count -1); j++) //TODO: why minus 1?
+			{
+				cTB = (CGAvailability) ctbReturn[j];
+				nSlots = SlotsInBlock(cTB, rsBlocks1) - SlotsInBlock(cTB, rsBlocks2);
+				string sResourceList = "";
+				string sAccessRuleList = "";
+				string sNote = "";
+
+				if (nSlots > 0) 
+				{
+					bool bRet = ResourceRulesInBlock(cTB, rsBlocks1, ref sResourceList, ref sAccessRuleList, ref sNote);
+				}
+				DataRow newRow;
+				newRow = rsCopy.NewRow();
+				newRow["START_TIME"] = cTB.StartTime;
+				newRow["END_TIME"] = cTB.EndTime;
+				newRow["SLOTS"] = nSlots;
+				//Subclinic, Access Rule and Resource are null in subtractedSlot sets
+				newRow["RESOURCE"] = sResource;
+				newRow["ACCESS_TYPE"] = sAccessRuleList;
+
+				newRow["NOTE"] = sNote;
+
+				rsCopy.Rows.Add(newRow);
+			}
+			return rsCopy;
+
+		}
+
+		public static DataTable UnionBlocks(DataTable rs1, DataTable rs2)
+		{
+			//Test input tables
+			Debug.Assert(rs1 != null);
+			Debug.Assert(rs2 != null);
+			CGSchedLib.OutputArray(rs1, "UnionBlocks rs1");
+			CGSchedLib.OutputArray(rs2, "UnionBlocks rs2");
+			
+			DataTable rsCopy;
+			DataRow dr;
+			if (rs1.Columns.Count >= rs2.Columns.Count)
+			{
+				rsCopy = rs1.Copy();
+				foreach (DataRow dr2 in rs2.Rows)
+				{
+					dr = rsCopy.NewRow();
+					dr.ItemArray = dr2.ItemArray;
+					//dr["START_TIME"] = dr2["START_TIME"];
+					//dr["END_TIME"] = dr2["END_TIME"];
+					//dr["SLOTS"] = dr2["SLOTS"];
+					rsCopy.Rows.Add(dr);
+				}			
+			}
+			else
+			{
+				rsCopy = rs2.Copy();
+				foreach (DataRow dr2 in rs1.Rows)
+				{
+					dr = rsCopy.NewRow();
+					dr.ItemArray = dr2.ItemArray;
+					rsCopy.Rows.Add(dr);
+				}			
+			}
+			return rsCopy;
+		}
+
+		public static DataTable IntersectBlocks(DataTable rs1, DataTable rs2)
+		{
+			DataTable rsCopy = CGSchedLib.CreateCopyTable();
+
+			//Test input tables
+
+			if ((rs1 == null) || (rs2 == null))
+				return rsCopy;
+
+			if ((rs1.Rows.Count == 0) || (rs2.Rows.Count == 0))
+				return rsCopy;
+
+			int nSlots1 = 0;
+			int nSlots2 = 0;
+			int nSlots3 = 0;
+			DateTime dStart1;
+			DateTime dStart2;
+			DateTime dStart3;
+			DateTime dEnd1;
+			DateTime dEnd2;
+			DateTime dEnd3;
+			string sClinic;
+			string sClinic2;
+//			Rectangle rect1 = new Rectangle();
+//			Rectangle rect2 = new Rectangle();
+//			rect1.X = 0;
+//			rect2.X = 0;
+//			rect1.Width = 1;
+//			rect2.Width = 1;
+
+			//			DataColumn cSlots = rs1.Columns["SLOTS"];
+			foreach (System.Data.DataRow r1 in rs1.Rows)
+			{
+				nSlots1 = (int) r1[rs1.Columns["SLOTS"]];
+				if (nSlots1 > 0) 
+				{
+					dStart1 = (DateTime) r1[rs1.Columns["START_TIME"]];
+					dEnd1 = (DateTime) r1[rs1.Columns["END_TIME"]];
+					sClinic = r1[rs1.Columns["SUBCLINIC"]].ToString();
+					if (sClinic == "NULL")
+						sClinic = "";
+//					rect1.Y = CGSchedLib.MinSince80(dStart1);
+//					rect1.Height = CGSchedLib.MinSince80(dEnd1) - rect1.Y;
+					foreach (System.Data.DataRow r2 in rs2.Rows) 
+					{
+						nSlots2 = (int) r2[rs2.Columns["SLOTS"]];
+
+						if (nSlots2 > 0) 
+						{
+							dStart2 = (DateTime) r2[rs2.Columns["START_TIME"]];
+							dEnd2 = (DateTime) r2[rs2.Columns["END_TIME"]];
+							sClinic2 = r2[rs2.Columns["SUBCLINIC"]].ToString();
+//							rect2.Y = CGSchedLib.MinSince80(dStart2);
+//							rect2.Height = CGSchedLib.MinSince80(dEnd2) - rect2.Y;
+							if (
+								/*(rect2.IntersectsWith(rect1) == true)*/
+								(CGSchedLib.TimesOverlap(dStart1, dEnd1, dStart2, dEnd2) == true)
+								&& 
+								((sClinic == sClinic2) || (sClinic == "NONE") || (sClinic2 == "NONE"))
+								)
+							{
+								dStart3 = (dStart1 >= dStart2) ? dStart1 : dStart2 ;
+								dEnd3 = (dEnd1 >= dEnd2) ? dEnd2 : dEnd1;
+								nSlots3 = (nSlots1 >= nSlots2) ? nSlots2 : nSlots1 ;
+
+								DataRow newRow;
+								newRow = rsCopy.NewRow();
+								newRow["START_TIME"] = dStart3;
+								newRow["END_TIME"] = dEnd3;
+								newRow["SLOTS"] = nSlots3;
+								newRow["SUBCLINIC"] = (sClinic == "NONE") ? sClinic2 : sClinic;
+								//Access Rule and Resource are null in interesected sets
+								newRow["ACCESS_TYPE"] = "";
+								newRow["RESOURCE"] = "";
+								rsCopy.Rows.Add(newRow);
+							}
+						}//nSlots2 > 0
+					}//foreach r2 in rs2.rows					
+				}//nSlots1 > 0
+			}//foreach r1 in rs1.rows
+			return rsCopy;
+		}//end IntersectBlocks
+
+
+		public static int MinSince80(DateTime d)
+		{
+			//Returns the total minutes between d and 1 Jan 1980
+			DateTime y = new DateTime(1980,1,1,0,0,0);
+			Debug.Assert(d > y);
+			TimeSpan ts = d - y;
+			//Assure ts.TotalMinutes within int range so that cast on next line works
+			Debug.Assert(ts.TotalMinutes < 2147483646); 
+			int nMinutes = (int) ts.TotalMinutes;
+			return nMinutes;
+		}
+
+		public static void ScheduleFromArray(ArrayList cdtArray, DateTime dStartTime, DateTime dEndTime, ref ArrayList rTBArray)
+		{
+			int j = 0;
+			CGAvailability cTB;
+
+			if (cdtArray.Count == 0)
+				return;
+
+			Debug.Assert(cdtArray.Count > 0);
+			Debug.Assert(cdtArray[0].GetType() == typeof(DateTime));
+
+			//If StartTime passed in, then adjust for it
+			if (dStartTime.Ticks > 0) 
+			{
+				if ((DateTime) cdtArray[0] > dStartTime) 
+				{
+					cTB = new CGAvailability();
+					cTB.Create(dStartTime, (DateTime) cdtArray[0], 0);
+					rTBArray.Add(cTB);
+				}
+				if ((DateTime) cdtArray[0] < dStartTime) 
+				{
+					for (j = 0; j < cdtArray.Count; j++) 
+					{
+						if ((DateTime) cdtArray[j] < dStartTime)
+							cdtArray[j] = dStartTime;
+					}
+				}
+			}
+
+			//Trim the end if necessary
+			if (dEndTime.Ticks > 0) 
+			{
+				for (j = 0; j < cdtArray.Count; j++) 
+				{
+					if ((DateTime) cdtArray[j] > dEndTime)
+						cdtArray[j] = dEndTime;
+				}
+			}
+
+			//build the schedule in rTBArray
+			DateTime dTemp = new DateTime();
+			DateTime dStart;
+			DateTime dEnd;
+			int k = 0;
+			for (j = 0; j < (cdtArray.Count -1); j++) //TODO: why minus 1?
+			{
+				if ((DateTime) cdtArray[j] != dTemp) 
+				{
+					dStart =(DateTime) cdtArray[j];
+					dTemp = dStart;
+					for (k = j+1; k < cdtArray.Count; k++) 
+					{
+						dEnd = new DateTime();
+						if ((DateTime) cdtArray[k] != dStart) 
+						{
+							dEnd = (DateTime) cdtArray[k];
+						}
+						if (dEnd.Ticks > 0) 
+						{
+							cTB = new CGAvailability();
+							cTB.Create(dStart, dEnd, 0);
+							rTBArray.Add(cTB);
+							break;
+						}
+					}
+				}
+			}
+
+		}//end ScheduleFromArray
+
+		//long CResourceLink::SlotsInBlock(CTimeBlock &rTimeBlock, _RecordsetPtr rsBlock)
+		public static int SlotsInBlock(CGAvailability rTimeBlock, DataTable rsBlock)
+		{
+			DateTime dStart1;
+			DateTime dStart2;
+			DateTime dEnd1;
+			DateTime dEnd2;
+			int nSlots = 0;
+
+			if (rsBlock.Rows.Count == 0)
+				return nSlots;
+
+			Rectangle rect1 = new Rectangle();
+			Rectangle rect2 = new Rectangle();
+			rect1.X = 0;
+			rect2.X = 0;
+			rect1.Width = 1;
+			rect2.Width = 1;
+
+			dStart1 = rTimeBlock.StartTime;
+			dEnd1 = rTimeBlock.EndTime;
+			rect1.Y = CGSchedLib.MinSince80(dStart1);
+			rect1.Height = CGSchedLib.MinSince80(dEnd1) - rect1.Y;
+
+			foreach (DataRow r in rsBlock.Rows) 
+			{
+				dStart2 = (DateTime) r[rsBlock.Columns["START_TIME"]];
+				dEnd2 = (DateTime) r[rsBlock.Columns["END_TIME"]];
+
+				rect2.Y = CGSchedLib.MinSince80(dStart2);
+				rect2.Height = CGSchedLib.MinSince80(dEnd2) - rect2.Y;
+				if (rect2.IntersectsWith(rect1) == true)
+				{
+					string sSlots =  r[rsBlock.Columns["SLOTS"]].ToString();
+					nSlots = System.Convert.ToInt16(sSlots);
+//					nSlots = (int) r[rsBlock.Columns["SLOTS"]];
+					break;
+				}
+			}
+			return nSlots;
+		}//end SlotsInBlock
+
+		public static string ClinicInBlock(CGAvailability rTimeBlock, DataTable rsBlock)
+		{
+			DateTime dStart1;
+			DateTime dStart2;
+			DateTime dEnd1;
+			DateTime dEnd2;
+			string sClinic = "";
+
+			if (rsBlock.Rows.Count == 0)
+				return sClinic;
+
+			Rectangle rect1 = new Rectangle();
+			Rectangle rect2 = new Rectangle();
+			rect1.X = 0;
+			rect2.X = 0;
+			rect1.Width = 1;
+			rect2.Width = 1;
+
+			dStart1 = rTimeBlock.StartTime;
+			dEnd1 = rTimeBlock.EndTime;
+			rect1.Y = CGSchedLib.MinSince80(dStart1);
+			rect1.Height = CGSchedLib.MinSince80(dEnd1) - rect1.Y;
+
+			foreach (DataRow r in rsBlock.Rows) 
+			{
+				dStart2 = (DateTime) r[rsBlock.Columns["START_TIME"]];
+				dEnd2 = (DateTime) r[rsBlock.Columns["END_TIME"]];
+
+				rect2.Y = CGSchedLib.MinSince80(dStart2);
+				rect2.Height = CGSchedLib.MinSince80(dEnd2) - rect2.Y;
+				if (rect2.IntersectsWith(rect1) == true)
+				{
+					sClinic =  r[rsBlock.Columns["SUBCLINIC"]].ToString();
+					break;
+				}
+			}
+			return sClinic;
+		}//end ClinicInBlock
+
+		public static bool ResourceRulesInBlock(CGAvailability rTimeBlock, DataTable rsBlock, ref string sResourceList, ref string sAccessRuleList, ref string sNote)
+		{
+			DateTime dStart1;
+			DateTime dStart2;
+			DateTime dEnd1;
+			DateTime dEnd2;
+			string sResource;
+			string sAccessRule;
+
+			if (rsBlock.Rows.Count == 0)
+				return true;
+
+			Rectangle rect1 = new Rectangle();
+			Rectangle rect2 = new Rectangle();
+			rect1.X = 0;
+			rect2.X = 0;
+			rect1.Width = 1;
+			rect2.Width = 1;
+
+			dStart1 = rTimeBlock.StartTime;
+			dEnd1 = rTimeBlock.EndTime;
+			rect1.Y = CGSchedLib.MinSince80(dStart1);
+			rect1.Height = CGSchedLib.MinSince80(dEnd1) - rect1.Y;
+
+			foreach (DataRow r in rsBlock.Rows) 
+			{
+				dStart2 = (DateTime) r[rsBlock.Columns["START_TIME"]];
+				dEnd2 = (DateTime) r[rsBlock.Columns["END_TIME"]];
+
+				rect2.Y = CGSchedLib.MinSince80(dStart2);
+				rect2.Height = CGSchedLib.MinSince80(dEnd2) - rect2.Y;
+				if (rect2.IntersectsWith(rect1) == true)
+				{
+					sResource = r[rsBlock.Columns["RESOURCE"]].ToString();
+					if (sResource == "NULL")
+						sResource = "";
+					if (sResource != "") 
+					{
+						if (sResourceList == "") 
+						{
+							sResourceList += sResource;
+						}
+						else 
+						{
+							sResourceList += "^" + sResource;
+						}
+					}
+					sAccessRule = r[rsBlock.Columns["ACCESS_TYPE"]].ToString();
+					if (sAccessRule == "0")
+						sAccessRule = "";
+					if (sAccessRule != "") 
+					{
+						if (sAccessRuleList == "") 
+						{
+							sAccessRuleList += sAccessRule;
+						}
+						else 
+						{
+							sAccessRuleList += "^" + sAccessRule;
+						}
+					}
+					sNote = r[rsBlock.Columns["NOTE"]].ToString();
+
+				}
+			}
+			return true;
+		}//End ResourceRulesInBlock
+
+	
+	}
+}
Index: Scheduling/branches/GUI1.2/CGSelectionChangedArgs.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGSelectionChangedArgs.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGSelectionChangedArgs.cs	(revision 855)
@@ -0,0 +1,52 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    [Serializable]
+    public class CGSelectionChangedArgs : EventArgs
+    {
+        private DateTime m_dEnd;
+        private DateTime m_dStart;
+        private string m_sResource;
+
+        public DateTime EndTime
+        {
+            get
+            {
+                return this.m_dEnd;
+            }
+            set
+            {
+                this.m_dEnd = value;
+            }
+        }
+
+        public string Resource
+        {
+            get
+            {
+                return this.m_sResource;
+            }
+            set
+            {
+                this.m_sResource = value;
+            }
+        }
+
+        public DateTime StartTime
+        {
+            get
+            {
+                return this.m_dStart;
+            }
+            set
+            {
+                this.m_dStart = value;
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/CGSelectionChangedHandler.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGSelectionChangedHandler.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGSelectionChangedHandler.cs	(revision 855)
@@ -0,0 +1,11 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    using System.Runtime.CompilerServices;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    public delegate void CGSelectionChangedHandler(object sender, CGSelectionChangedArgs e);
+}
+
Index: Scheduling/branches/GUI1.2/CGView.cd
===================================================================
--- Scheduling/branches/GUI1.2/CGView.cd	(revision 855)
+++ Scheduling/branches/GUI1.2/CGView.cd	(revision 855)
@@ -0,0 +1,24 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<ClassDiagram MajorVersion="1" MinorVersion="1">
+  <Font Name="Tahoma" Size="8.25" />
+  <Class Name="IndianHealthService.ClinicalScheduling.CGView">
+    <Position X="0.5" Y="0.5" Width="1.5" />
+    <TypeIdentifier>
+      <FileName>CGView.cs</FileName>
+      <HashCode>DBuO+A/ufrC8J96Wgi264uOaaLj8+O62UEo12OCfGSw=</HashCode>
+    </TypeIdentifier>
+    <Compartments>
+      <Compartment Name="Fields" Collapsed="true" />
+      <Compartment Name="Properties" Collapsed="true" />
+      <Compartment Name="Methods" Collapsed="true" />
+      <Compartment Name="Nested Types" Collapsed="false" />
+    </Compartments>
+    <NestedTypes>
+      <Delegate Name="IndianHealthService.ClinicalScheduling.CGView.OnUpdateScheduleDelegate" Collapsed="true">
+        <TypeIdentifier>
+          <NewMemberFileName>CGView.cs</NewMemberFileName>
+        </TypeIdentifier>
+      </Delegate>
+    </NestedTypes>
+  </Class>
+</ClassDiagram>
Index: Scheduling/branches/GUI1.2/CGView.cs
===================================================================
--- Scheduling/branches/GUI1.2/CGView.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CGView.cs	(revision 855)
@@ -0,0 +1,3114 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Diagnostics;
+using System.Data;
+using System.Net;
+using System.Net.Sockets;
+using System.Threading;
+using System.IO;
+using IndianHealthService.BMXNet;
+using System.Reflection;
+
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for CGView.
+	/// </summary>
+	public class CGView : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.MainMenu mainMenu1;
+		private System.Windows.Forms.MenuItem mnuFile;
+		private System.Windows.Forms.MenuItem mnuTest;
+		private System.Windows.Forms.MenuItem mnuAppointment;
+		private System.Windows.Forms.MenuItem mnuNewAppointment;
+		private System.Windows.Forms.MenuItem mnu1Day;
+		private System.Windows.Forms.MenuItem mnu7Day;
+		private System.Windows.Forms.MenuItem menuItem4;
+		private System.Windows.Forms.MenuItem mnu5Day;
+		private System.Windows.Forms.MenuItem mnu10Minute;
+		private System.Windows.Forms.MenuItem mnu20Minute;
+		private System.Windows.Forms.MenuItem mnu30Minute;
+		private System.Windows.Forms.MenuItem mnuTimeScale;
+		private System.Windows.Forms.MenuItem mnu15Minute;
+		private System.Windows.Forms.MenuItem mnuOpenSchedule;
+		private System.Windows.Forms.MenuItem menuItem1;
+		private System.Windows.Forms.TreeView tvSchedules;
+		private System.Windows.Forms.MenuItem mnuViewScheduleTree;
+		private System.Windows.Forms.MenuItem mnuDeleteAppointment;
+		private System.Windows.Forms.MenuItem mnuTest1;
+		private System.Windows.Forms.Splitter splitter1;
+		private System.Windows.Forms.Splitter splitter2;
+		private System.Windows.Forms.StatusBar statusBar1;
+		private System.Windows.Forms.DateTimePicker dateTimePicker1;
+		private System.Windows.Forms.MenuItem mnuViewRightPanel;
+		private System.Windows.Forms.Panel panelRight;
+		private System.Windows.Forms.Panel panelTop;
+		private System.Windows.Forms.Panel panelCenter;
+		private System.Windows.Forms.Panel panelBottom;
+		private System.Windows.Forms.Label lblResource;
+		private System.Windows.Forms.ContextMenu contextMenu1;
+		private System.Windows.Forms.MenuItem ctxOpenSchedule;
+		private System.Windows.Forms.MenuItem ctxEditAvailability;
+		private System.Windows.Forms.MenuItem ctxProperties;
+		private System.Windows.Forms.MenuItem mnuSchedulingManagment;
+		private System.Windows.Forms.MenuItem ctxFindAppt;
+		private System.Windows.Forms.MenuItem mnuFindAppt;
+		internal System.Windows.Forms.MenuItem mnuRPMSServer;
+		internal System.Windows.Forms.MenuItem mnuRPMSLogin;
+		private System.Windows.Forms.MenuItem mnuCheckIn;
+		private System.Windows.Forms.MenuItem menuItem3;
+		private System.Windows.Forms.MenuItem mnuHelpAbout;
+		private System.Windows.Forms.MenuItem mnuCalendar;
+		private System.Windows.Forms.MenuItem mnuHelp;
+		private System.Windows.Forms.MenuItem mnuClose;
+		private System.Windows.Forms.MenuItem mnuViewPatientAppts;
+		private IndianHealthService.ClinicalScheduling.CalendarGrid calendarGrid1;
+		private System.Windows.Forms.MenuItem mnuCopyAppointment;
+		private System.Windows.Forms.Panel panelClip;
+		private System.Windows.Forms.ListBox lstClip;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.ContextMenu ctxApptClipMenu;
+		private System.Windows.Forms.MenuItem mnuRemoveClipItem;
+		private System.Windows.Forms.MenuItem mnuClearClipItems;
+		private System.Windows.Forms.MenuItem mnuEditAppointment;
+		private System.Windows.Forms.ContextMenu ctxCalendarGrid;
+		private System.Windows.Forms.MenuItem ctxCalGridAdd;
+		private System.Windows.Forms.MenuItem ctxCalGridEdit;
+		private System.Windows.Forms.MenuItem ctxCalGridDelete;
+		private System.Windows.Forms.MenuItem ctxCalGridCheckIn;
+		private System.Windows.Forms.MenuItem menuItem6;
+		private System.Windows.Forms.MenuItem menuItem7;
+		private System.Windows.Forms.MenuItem mnuPrintReminderLetters;
+		private System.Windows.Forms.MenuItem mnuPrintPatientLetter;
+		private System.Windows.Forms.MenuItem mnuPrintClinicSchedules;
+		private System.Windows.Forms.MenuItem ctxCalGridNoShow;
+		private System.Windows.Forms.MenuItem ctxCalGridNoShowUndo;
+		private System.Windows.Forms.MenuItem mnuNoShow;
+		private System.Windows.Forms.MenuItem mnuNoShowUndo;
+		private System.Windows.Forms.MenuItem mnuPrintRebookLetters;
+		private System.Windows.Forms.MenuItem mnuPrintCancellationLetters;
+		private System.Windows.Forms.MenuItem mnuWalkIn;
+		private System.Windows.Forms.MenuItem menuItem5;
+		private System.Windows.Forms.MenuItem menuItem8;
+		private System.Windows.Forms.MenuItem ctxCalGridWalkin;
+		private System.Windows.Forms.MenuItem menuItem2;
+		private System.Windows.Forms.MenuItem menuItem9;
+		private System.Windows.Forms.MenuItem mnuOpenMultipleSchedules;
+		private System.Windows.Forms.MenuItem mnuDisplayWalkIns;
+        private System.Windows.Forms.MenuItem mnuRPMSDivision;
+        private System.Drawing.Printing.PrintDocument printRoutingSlip;
+        private MenuItem menuItem10;
+        private MenuItem ctxCalGridReprintRoutingSlip;
+        private IContainer components;
+
+        #region Initialization
+        public CGView()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			m_nSlots = 0;
+			m_alSelectedTreeResourceArray = new ArrayList();
+			m_ClipList = new CGAppointments();
+
+		}
+
+		public void InitializeDocView(string sText)
+		{
+			this.Text = this.DocManager.ConnectInfo.UserName;
+			if (sText != null)
+				this.Text += " - " + sText;
+			if (DocManager.ConnectInfo.DivisionName != null)
+				this.Text += " - " + DocManager.ConnectInfo.DivisionName;
+		}
+
+		public void InitializeDocView(CGDocument doc, 
+			CGDocumentManager docMgr,
+			DateTime dStartDate,
+			CGAppointments cgAppts,
+			string sText)
+		{
+			System.IntPtr pHandle = this.Handle;
+			this.DocManager = docMgr;
+			this.StartDate = dStartDate;
+			this.Document = doc;
+			this.Appointments = cgAppts;
+			this.Text = this.DocManager.ConnectInfo.UserName;
+			if (sText != null)
+				this.Text += " - " + sText;
+			if (DocManager.ConnectInfo.DivisionName != null)
+				this.Text += " - " + DocManager.ConnectInfo.DivisionName;
+
+			this.m_ConnectInfo = m_DocManager.ConnectInfo;
+			m_bmxDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(BMXNetEventHandler);
+			m_ConnectInfo.BMXNetEvent += m_bmxDelegate;
+		}
+
+		private BMXNetConnectInfo.BMXNetEventDelegate m_bmxDelegate;
+		delegate void OnUpdateScheduleDelegate();
+
+		private void BMXNetEventHandler(Object obj, BMXNet.BMXNetEventArgs e)
+		{
+			try
+			{
+				if (e.BMXEvent == "BMXNet AutoFire")
+				{
+					Debug.Write("CGView caught AutoFire event.\n");
+					if (this == null)
+						return;
+					OnUpdateScheduleDelegate ousd = new OnUpdateScheduleDelegate(OnUpdateSchedule);
+					this.BeginInvoke(ousd);
+					return;
+				}
+
+				if (e.BMXEvent != "BSDX SCHEDULE")
+				{
+					return;
+				}
+				string sResourceName;
+				for (int j=0; j < m_Document.m_sResourcesArray.Count; j++)
+				{
+					sResourceName = m_Document.m_sResourcesArray[j].ToString();
+					if (e.BMXParam == sResourceName)
+					{
+						OnUpdateScheduleDelegate ousd = new OnUpdateScheduleDelegate(OnUpdateSchedule);
+						if (this == null)
+							return;
+						this.BeginInvoke(ousd);
+						Debug.Write("CGView caught BSDX SCHEDULE event.\n");
+						break;
+					}
+				}
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+        }
+
+        #endregion initialization
+
+        #region Windows Form Designer generated code
+        /// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+            this.components = new System.ComponentModel.Container();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CGView));
+            this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components);
+            this.mnuFile = new System.Windows.Forms.MenuItem();
+            this.mnuOpenSchedule = new System.Windows.Forms.MenuItem();
+            this.mnuOpenMultipleSchedules = new System.Windows.Forms.MenuItem();
+            this.menuItem1 = new System.Windows.Forms.MenuItem();
+            this.mnuRPMSServer = new System.Windows.Forms.MenuItem();
+            this.mnuRPMSLogin = new System.Windows.Forms.MenuItem();
+            this.mnuRPMSDivision = new System.Windows.Forms.MenuItem();
+            this.menuItem3 = new System.Windows.Forms.MenuItem();
+            this.mnuSchedulingManagment = new System.Windows.Forms.MenuItem();
+            this.menuItem6 = new System.Windows.Forms.MenuItem();
+            this.mnuPrintClinicSchedules = new System.Windows.Forms.MenuItem();
+            this.mnuPrintReminderLetters = new System.Windows.Forms.MenuItem();
+            this.mnuPrintRebookLetters = new System.Windows.Forms.MenuItem();
+            this.mnuPrintCancellationLetters = new System.Windows.Forms.MenuItem();
+            this.mnuPrintPatientLetter = new System.Windows.Forms.MenuItem();
+            this.menuItem7 = new System.Windows.Forms.MenuItem();
+            this.mnuClose = new System.Windows.Forms.MenuItem();
+            this.mnuAppointment = new System.Windows.Forms.MenuItem();
+            this.mnuNewAppointment = new System.Windows.Forms.MenuItem();
+            this.mnuEditAppointment = new System.Windows.Forms.MenuItem();
+            this.mnuDeleteAppointment = new System.Windows.Forms.MenuItem();
+            this.menuItem5 = new System.Windows.Forms.MenuItem();
+            this.mnuNoShow = new System.Windows.Forms.MenuItem();
+            this.mnuNoShowUndo = new System.Windows.Forms.MenuItem();
+            this.menuItem8 = new System.Windows.Forms.MenuItem();
+            this.mnuCopyAppointment = new System.Windows.Forms.MenuItem();
+            this.mnuWalkIn = new System.Windows.Forms.MenuItem();
+            this.mnuFindAppt = new System.Windows.Forms.MenuItem();
+            this.mnuCheckIn = new System.Windows.Forms.MenuItem();
+            this.mnuViewPatientAppts = new System.Windows.Forms.MenuItem();
+            this.mnuCalendar = new System.Windows.Forms.MenuItem();
+            this.mnuDisplayWalkIns = new System.Windows.Forms.MenuItem();
+            this.mnu1Day = new System.Windows.Forms.MenuItem();
+            this.mnu5Day = new System.Windows.Forms.MenuItem();
+            this.mnu7Day = new System.Windows.Forms.MenuItem();
+            this.menuItem4 = new System.Windows.Forms.MenuItem();
+            this.mnuTimeScale = new System.Windows.Forms.MenuItem();
+            this.mnu10Minute = new System.Windows.Forms.MenuItem();
+            this.mnu15Minute = new System.Windows.Forms.MenuItem();
+            this.mnu20Minute = new System.Windows.Forms.MenuItem();
+            this.mnu30Minute = new System.Windows.Forms.MenuItem();
+            this.mnuViewScheduleTree = new System.Windows.Forms.MenuItem();
+            this.mnuViewRightPanel = new System.Windows.Forms.MenuItem();
+            this.mnuHelp = new System.Windows.Forms.MenuItem();
+            this.mnuHelpAbout = new System.Windows.Forms.MenuItem();
+            this.mnuTest = new System.Windows.Forms.MenuItem();
+            this.mnuTest1 = new System.Windows.Forms.MenuItem();
+            this.tvSchedules = new System.Windows.Forms.TreeView();
+            this.contextMenu1 = new System.Windows.Forms.ContextMenu();
+            this.ctxOpenSchedule = new System.Windows.Forms.MenuItem();
+            this.ctxEditAvailability = new System.Windows.Forms.MenuItem();
+            this.ctxProperties = new System.Windows.Forms.MenuItem();
+            this.ctxFindAppt = new System.Windows.Forms.MenuItem();
+            this.panelRight = new System.Windows.Forms.Panel();
+            this.panelClip = new System.Windows.Forms.Panel();
+            this.lstClip = new System.Windows.Forms.ListBox();
+            this.ctxApptClipMenu = new System.Windows.Forms.ContextMenu();
+            this.mnuRemoveClipItem = new System.Windows.Forms.MenuItem();
+            this.mnuClearClipItems = new System.Windows.Forms.MenuItem();
+            this.label1 = new System.Windows.Forms.Label();
+            this.panelTop = new System.Windows.Forms.Panel();
+            this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
+            this.lblResource = new System.Windows.Forms.Label();
+            this.panelCenter = new System.Windows.Forms.Panel();
+            this.ctxCalendarGrid = new System.Windows.Forms.ContextMenu();
+            this.ctxCalGridAdd = new System.Windows.Forms.MenuItem();
+            this.ctxCalGridEdit = new System.Windows.Forms.MenuItem();
+            this.ctxCalGridDelete = new System.Windows.Forms.MenuItem();
+            this.ctxCalGridCheckIn = new System.Windows.Forms.MenuItem();
+            this.menuItem2 = new System.Windows.Forms.MenuItem();
+            this.ctxCalGridNoShow = new System.Windows.Forms.MenuItem();
+            this.ctxCalGridNoShowUndo = new System.Windows.Forms.MenuItem();
+            this.menuItem9 = new System.Windows.Forms.MenuItem();
+            this.ctxCalGridWalkin = new System.Windows.Forms.MenuItem();
+            this.menuItem10 = new System.Windows.Forms.MenuItem();
+            this.panelBottom = new System.Windows.Forms.Panel();
+            this.statusBar1 = new System.Windows.Forms.StatusBar();
+            this.splitter1 = new System.Windows.Forms.Splitter();
+            this.splitter2 = new System.Windows.Forms.Splitter();
+            this.printRoutingSlip = new System.Drawing.Printing.PrintDocument();
+            this.calendarGrid1 = new IndianHealthService.ClinicalScheduling.CalendarGrid();
+            this.ctxCalGridReprintRoutingSlip = new System.Windows.Forms.MenuItem();
+            this.panelRight.SuspendLayout();
+            this.panelClip.SuspendLayout();
+            this.panelTop.SuspendLayout();
+            this.panelCenter.SuspendLayout();
+            this.panelBottom.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // mainMenu1
+            // 
+            this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuFile,
+            this.mnuAppointment,
+            this.mnuCalendar,
+            this.mnuHelp,
+            this.mnuTest});
+            // 
+            // mnuFile
+            // 
+            this.mnuFile.Index = 0;
+            this.mnuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuOpenSchedule,
+            this.mnuOpenMultipleSchedules,
+            this.menuItem1,
+            this.mnuRPMSServer,
+            this.mnuRPMSLogin,
+            this.mnuRPMSDivision,
+            this.menuItem3,
+            this.mnuSchedulingManagment,
+            this.menuItem6,
+            this.mnuPrintClinicSchedules,
+            this.mnuPrintReminderLetters,
+            this.mnuPrintRebookLetters,
+            this.mnuPrintCancellationLetters,
+            this.mnuPrintPatientLetter,
+            this.menuItem7,
+            this.mnuClose});
+            this.mnuFile.Text = "&File";
+            this.mnuFile.Popup += new System.EventHandler(this.mnuFile_Popup);
+            // 
+            // mnuOpenSchedule
+            // 
+            this.mnuOpenSchedule.Enabled = false;
+            this.mnuOpenSchedule.Index = 0;
+            this.mnuOpenSchedule.Text = "&Open Schedule";
+            this.mnuOpenSchedule.Visible = false;
+            this.mnuOpenSchedule.Click += new System.EventHandler(this.mnuOpenSchedule_Click);
+            // 
+            // mnuOpenMultipleSchedules
+            // 
+            this.mnuOpenMultipleSchedules.Index = 1;
+            this.mnuOpenMultipleSchedules.Shortcut = System.Windows.Forms.Shortcut.CtrlM;
+            this.mnuOpenMultipleSchedules.Text = "Open M&ultiple Schedules";
+            this.mnuOpenMultipleSchedules.Click += new System.EventHandler(this.mnuOpenMultipleSchedules_Click);
+            // 
+            // menuItem1
+            // 
+            this.menuItem1.Index = 2;
+            this.menuItem1.Text = "-";
+            // 
+            // mnuRPMSServer
+            // 
+            this.mnuRPMSServer.Index = 3;
+            this.mnuRPMSServer.Text = "Change VistA &Server";
+            this.mnuRPMSServer.Click += new System.EventHandler(this.mnuRPMSServer_Click);
+            // 
+            // mnuRPMSLogin
+            // 
+            this.mnuRPMSLogin.Index = 4;
+            this.mnuRPMSLogin.Text = "Change VistA &Login";
+            this.mnuRPMSLogin.Click += new System.EventHandler(this.mnuRPMSLogin_Click);
+            // 
+            // mnuRPMSDivision
+            // 
+            this.mnuRPMSDivision.Index = 5;
+            this.mnuRPMSDivision.Text = "Change VistA &Division";
+            this.mnuRPMSDivision.Click += new System.EventHandler(this.mnuRPMSDivision_Click);
+            // 
+            // menuItem3
+            // 
+            this.menuItem3.Index = 6;
+            this.menuItem3.Text = "-";
+            // 
+            // mnuSchedulingManagment
+            // 
+            this.mnuSchedulingManagment.Index = 7;
+            this.mnuSchedulingManagment.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftM;
+            this.mnuSchedulingManagment.Text = "Scheduling &Management";
+            this.mnuSchedulingManagment.Click += new System.EventHandler(this.mnuSchedulingManagment_Click);
+            // 
+            // menuItem6
+            // 
+            this.menuItem6.Index = 8;
+            this.menuItem6.Text = "-";
+            // 
+            // mnuPrintClinicSchedules
+            // 
+            this.mnuPrintClinicSchedules.Index = 9;
+            this.mnuPrintClinicSchedules.Shortcut = System.Windows.Forms.Shortcut.CtrlP;
+            this.mnuPrintClinicSchedules.Text = "&Print Clinic Schedules";
+            this.mnuPrintClinicSchedules.Click += new System.EventHandler(this.mnuPrintClinicSchedules_Click);
+            // 
+            // mnuPrintReminderLetters
+            // 
+            this.mnuPrintReminderLetters.Index = 10;
+            this.mnuPrintReminderLetters.Shortcut = System.Windows.Forms.Shortcut.CtrlR;
+            this.mnuPrintReminderLetters.Text = "Print Rem&inder Letters";
+            this.mnuPrintReminderLetters.Click += new System.EventHandler(this.mnuPrintReminderLetters_Click);
+            // 
+            // mnuPrintRebookLetters
+            // 
+            this.mnuPrintRebookLetters.Index = 11;
+            this.mnuPrintRebookLetters.Text = "Print &Rebook Letters";
+            this.mnuPrintRebookLetters.Click += new System.EventHandler(this.mnuPrintRebookLetters_Click);
+            // 
+            // mnuPrintCancellationLetters
+            // 
+            this.mnuPrintCancellationLetters.Index = 12;
+            this.mnuPrintCancellationLetters.Shortcut = System.Windows.Forms.Shortcut.CtrlShiftC;
+            this.mnuPrintCancellationLetters.Text = "Print C&ancellation Letters";
+            this.mnuPrintCancellationLetters.Click += new System.EventHandler(this.mnuPrintCancellationLetters_Click);
+            // 
+            // mnuPrintPatientLetter
+            // 
+            this.mnuPrintPatientLetter.Index = 13;
+            this.mnuPrintPatientLetter.Shortcut = System.Windows.Forms.Shortcut.CtrlL;
+            this.mnuPrintPatientLetter.Text = "Print Patient Le&tter";
+            this.mnuPrintPatientLetter.Click += new System.EventHandler(this.mnuPrintPatientLetter_Click);
+            // 
+            // menuItem7
+            // 
+            this.menuItem7.Index = 14;
+            this.menuItem7.Text = "-";
+            // 
+            // mnuClose
+            // 
+            this.mnuClose.Index = 15;
+            this.mnuClose.Shortcut = System.Windows.Forms.Shortcut.CtrlW;
+            this.mnuClose.Text = "&Close Schedule";
+            this.mnuClose.Click += new System.EventHandler(this.mnuClose_Click);
+            // 
+            // mnuAppointment
+            // 
+            this.mnuAppointment.Index = 1;
+            this.mnuAppointment.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuNewAppointment,
+            this.mnuEditAppointment,
+            this.mnuDeleteAppointment,
+            this.menuItem5,
+            this.mnuNoShow,
+            this.mnuNoShowUndo,
+            this.menuItem8,
+            this.mnuCopyAppointment,
+            this.mnuWalkIn,
+            this.mnuFindAppt,
+            this.mnuCheckIn,
+            this.mnuViewPatientAppts});
+            this.mnuAppointment.Text = "&Appointment";
+            this.mnuAppointment.Popup += new System.EventHandler(this.mnuAppointment_Popup);
+            // 
+            // mnuNewAppointment
+            // 
+            this.mnuNewAppointment.Index = 0;
+            this.mnuNewAppointment.Text = "&New Appointment";
+            this.mnuNewAppointment.Click += new System.EventHandler(this.mnuNewAppointment_Click);
+            // 
+            // mnuEditAppointment
+            // 
+            this.mnuEditAppointment.Index = 1;
+            this.mnuEditAppointment.Text = "&Edit Appointment";
+            this.mnuEditAppointment.Click += new System.EventHandler(this.mnuEditAppointment_Click);
+            // 
+            // mnuDeleteAppointment
+            // 
+            this.mnuDeleteAppointment.Index = 2;
+            this.mnuDeleteAppointment.Text = "Cance&l Appointment";
+            this.mnuDeleteAppointment.Click += new System.EventHandler(this.mnuDeleteAppointment_Click);
+            // 
+            // menuItem5
+            // 
+            this.menuItem5.Index = 3;
+            this.menuItem5.Text = "-";
+            // 
+            // mnuNoShow
+            // 
+            this.mnuNoShow.Index = 4;
+            this.mnuNoShow.Text = "Mark as No Sho&w";
+            this.mnuNoShow.Click += new System.EventHandler(this.mnuNoShow_Click);
+            // 
+            // mnuNoShowUndo
+            // 
+            this.mnuNoShowUndo.Index = 5;
+            this.mnuNoShowUndo.Text = "&Undo No Show";
+            this.mnuNoShowUndo.Click += new System.EventHandler(this.mnuNoShowUndo_Click);
+            // 
+            // menuItem8
+            // 
+            this.menuItem8.Index = 6;
+            this.menuItem8.Text = "-";
+            // 
+            // mnuCopyAppointment
+            // 
+            this.mnuCopyAppointment.Index = 7;
+            this.mnuCopyAppointment.Text = "&Copy  Appointment to Clipboard";
+            this.mnuCopyAppointment.Click += new System.EventHandler(this.mnuCopyAppointment_Click);
+            // 
+            // mnuWalkIn
+            // 
+            this.mnuWalkIn.Index = 8;
+            this.mnuWalkIn.Text = "Create Wal&k-In Appointment";
+            this.mnuWalkIn.Click += new System.EventHandler(this.mnuWalkIn_Click);
+            // 
+            // mnuFindAppt
+            // 
+            this.mnuFindAppt.Index = 9;
+            this.mnuFindAppt.Text = "&Find Available Appointment";
+            this.mnuFindAppt.Click += new System.EventHandler(this.mnuFindAppt_Click);
+            // 
+            // mnuCheckIn
+            // 
+            this.mnuCheckIn.Index = 10;
+            this.mnuCheckIn.Text = "Check &In Patient";
+            this.mnuCheckIn.Click += new System.EventHandler(this.mnuCheckIn_Click);
+            // 
+            // mnuViewPatientAppts
+            // 
+            this.mnuViewPatientAppts.Index = 11;
+            this.mnuViewPatientAppts.Text = "&View Patient Appointments";
+            this.mnuViewPatientAppts.Click += new System.EventHandler(this.mnuViewPatientAppts_Click);
+            // 
+            // mnuCalendar
+            // 
+            this.mnuCalendar.Index = 2;
+            this.mnuCalendar.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuDisplayWalkIns,
+            this.mnu1Day,
+            this.mnu5Day,
+            this.mnu7Day,
+            this.menuItem4,
+            this.mnuTimeScale,
+            this.mnuViewScheduleTree,
+            this.mnuViewRightPanel});
+            this.mnuCalendar.Text = "&View";
+            // 
+            // mnuDisplayWalkIns
+            // 
+            this.mnuDisplayWalkIns.Checked = true;
+            this.mnuDisplayWalkIns.Index = 0;
+            this.mnuDisplayWalkIns.Text = "&Display Walk-Ins";
+            this.mnuDisplayWalkIns.Click += new System.EventHandler(this.mnuDisplayWalkIns_Click);
+            // 
+            // mnu1Day
+            // 
+            this.mnu1Day.Index = 1;
+            this.mnu1Day.Shortcut = System.Windows.Forms.Shortcut.Ctrl1;
+            this.mnu1Day.Text = "&1-Day View";
+            this.mnu1Day.Click += new System.EventHandler(this.mnu1Day_Click);
+            // 
+            // mnu5Day
+            // 
+            this.mnu5Day.Index = 2;
+            this.mnu5Day.Shortcut = System.Windows.Forms.Shortcut.Ctrl5;
+            this.mnu5Day.Text = "&5-Day View";
+            this.mnu5Day.Click += new System.EventHandler(this.mnu5Day_Click);
+            // 
+            // mnu7Day
+            // 
+            this.mnu7Day.Index = 3;
+            this.mnu7Day.Shortcut = System.Windows.Forms.Shortcut.Ctrl7;
+            this.mnu7Day.Text = "&7-Day View";
+            this.mnu7Day.Click += new System.EventHandler(this.mnu7Day_Click);
+            // 
+            // menuItem4
+            // 
+            this.menuItem4.Index = 4;
+            this.menuItem4.Text = "-";
+            // 
+            // mnuTimeScale
+            // 
+            this.mnuTimeScale.Index = 5;
+            this.mnuTimeScale.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnu10Minute,
+            this.mnu15Minute,
+            this.mnu20Minute,
+            this.mnu30Minute});
+            this.mnuTimeScale.Text = "&Time Scale";
+            // 
+            // mnu10Minute
+            // 
+            this.mnu10Minute.Index = 0;
+            this.mnu10Minute.Shortcut = System.Windows.Forms.Shortcut.Ctrl0;
+            this.mnu10Minute.Text = "&10-Minute";
+            this.mnu10Minute.Click += new System.EventHandler(this.mnu10Minute_Click);
+            // 
+            // mnu15Minute
+            // 
+            this.mnu15Minute.Index = 1;
+            this.mnu15Minute.Shortcut = System.Windows.Forms.Shortcut.Ctrl4;
+            this.mnu15Minute.Text = "1&5-Minute";
+            this.mnu15Minute.Click += new System.EventHandler(this.mnu15Minute_Click);
+            // 
+            // mnu20Minute
+            // 
+            this.mnu20Minute.Index = 2;
+            this.mnu20Minute.Shortcut = System.Windows.Forms.Shortcut.Ctrl3;
+            this.mnu20Minute.Text = "&20-Minute";
+            this.mnu20Minute.Click += new System.EventHandler(this.mnu20Minute_Click);
+            // 
+            // mnu30Minute
+            // 
+            this.mnu30Minute.Index = 3;
+            this.mnu30Minute.Shortcut = System.Windows.Forms.Shortcut.Ctrl2;
+            this.mnu30Minute.Text = "&30-Minute";
+            this.mnu30Minute.Click += new System.EventHandler(this.mnu30Minute_Click);
+            // 
+            // mnuViewScheduleTree
+            // 
+            this.mnuViewScheduleTree.Index = 6;
+            this.mnuViewScheduleTree.Text = "&Schedule Tree";
+            this.mnuViewScheduleTree.Click += new System.EventHandler(this.mnuViewScheduleTree_Click);
+            // 
+            // mnuViewRightPanel
+            // 
+            this.mnuViewRightPanel.Index = 7;
+            this.mnuViewRightPanel.Text = "&Appointment Clipboard";
+            this.mnuViewRightPanel.Click += new System.EventHandler(this.mnuViewRightPanel_Click);
+            // 
+            // mnuHelp
+            // 
+            this.mnuHelp.Index = 3;
+            this.mnuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuHelpAbout});
+            this.mnuHelp.Text = "&Help";
+            // 
+            // mnuHelpAbout
+            // 
+            this.mnuHelpAbout.Index = 0;
+            this.mnuHelpAbout.Text = "&About";
+            this.mnuHelpAbout.Click += new System.EventHandler(this.mnuHelpAbout_Click);
+            // 
+            // mnuTest
+            // 
+            this.mnuTest.Enabled = false;
+            this.mnuTest.Index = 4;
+            this.mnuTest.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuTest1});
+            this.mnuTest.Text = "&Test";
+            this.mnuTest.Visible = false;
+            // 
+            // mnuTest1
+            // 
+            this.mnuTest1.Index = 0;
+            this.mnuTest1.Text = "Test1";
+            this.mnuTest1.Click += new System.EventHandler(this.mnuTest1_Click);
+            // 
+            // tvSchedules
+            // 
+            this.tvSchedules.BackColor = System.Drawing.SystemColors.ControlLight;
+            this.tvSchedules.ContextMenu = this.contextMenu1;
+            this.tvSchedules.Dock = System.Windows.Forms.DockStyle.Left;
+            this.tvSchedules.HotTracking = true;
+            this.tvSchedules.Location = new System.Drawing.Point(0, 0);
+            this.tvSchedules.Name = "tvSchedules";
+            this.tvSchedules.Size = new System.Drawing.Size(128, 369);
+            this.tvSchedules.Sorted = true;
+            this.tvSchedules.TabIndex = 1;
+            this.tvSchedules.DoubleClick += new System.EventHandler(this.tvSchedules_DoubleClick);
+            this.tvSchedules.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvSchedules_AfterSelect);
+            this.tvSchedules.BeforeSelect += new System.Windows.Forms.TreeViewCancelEventHandler(this.tvSchedules_BeforeSelect);
+            this.tvSchedules.Click += new System.EventHandler(this.tvSchedules_Click);
+            // 
+            // contextMenu1
+            // 
+            this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.ctxOpenSchedule,
+            this.ctxEditAvailability,
+            this.ctxProperties,
+            this.ctxFindAppt});
+            this.contextMenu1.Popup += new System.EventHandler(this.contextMenu1_Popup);
+            // 
+            // ctxOpenSchedule
+            // 
+            this.ctxOpenSchedule.DefaultItem = true;
+            this.ctxOpenSchedule.Index = 0;
+            this.ctxOpenSchedule.Text = "&Open Schedule";
+            this.ctxOpenSchedule.Click += new System.EventHandler(this.ctxOpenSchedule_Click);
+            // 
+            // ctxEditAvailability
+            // 
+            this.ctxEditAvailability.Index = 1;
+            this.ctxEditAvailability.Text = "&Edit Resource Availability";
+            this.ctxEditAvailability.Click += new System.EventHandler(this.ctxEditAvailability_Click);
+            // 
+            // ctxProperties
+            // 
+            this.ctxProperties.Index = 2;
+            this.ctxProperties.Text = "&Properties";
+            this.ctxProperties.Click += new System.EventHandler(this.ctxProperties_Click);
+            // 
+            // ctxFindAppt
+            // 
+            this.ctxFindAppt.Index = 3;
+            this.ctxFindAppt.Text = "Find Available Appointment";
+            this.ctxFindAppt.Click += new System.EventHandler(this.ctxFindAppt_Click);
+            // 
+            // panelRight
+            // 
+            this.panelRight.Controls.Add(this.panelClip);
+            this.panelRight.Dock = System.Windows.Forms.DockStyle.Right;
+            this.panelRight.Location = new System.Drawing.Point(807, 0);
+            this.panelRight.Name = "panelRight";
+            this.panelRight.Size = new System.Drawing.Size(128, 369);
+            this.panelRight.TabIndex = 3;
+            this.panelRight.Visible = false;
+            // 
+            // panelClip
+            // 
+            this.panelClip.Controls.Add(this.lstClip);
+            this.panelClip.Controls.Add(this.label1);
+            this.panelClip.Dock = System.Windows.Forms.DockStyle.Top;
+            this.panelClip.Location = new System.Drawing.Point(0, 0);
+            this.panelClip.Name = "panelClip";
+            this.panelClip.Size = new System.Drawing.Size(128, 448);
+            this.panelClip.TabIndex = 0;
+            // 
+            // lstClip
+            // 
+            this.lstClip.AllowDrop = true;
+            this.lstClip.ContextMenu = this.ctxApptClipMenu;
+            this.lstClip.DisplayMember = "PatientName";
+            this.lstClip.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lstClip.Location = new System.Drawing.Point(0, 32);
+            this.lstClip.Name = "lstClip";
+            this.lstClip.Size = new System.Drawing.Size(128, 407);
+            this.lstClip.TabIndex = 0;
+            this.lstClip.SelectedIndexChanged += new System.EventHandler(this.lstClip_SelectedIndexChanged);
+            this.lstClip.DragDrop += new System.Windows.Forms.DragEventHandler(this.lstClip_DragDrop);
+            this.lstClip.MouseMove += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseMove);
+            this.lstClip.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstClip_MouseDown);
+            this.lstClip.DragEnter += new System.Windows.Forms.DragEventHandler(this.lstClip_DragEnter);
+            // 
+            // ctxApptClipMenu
+            // 
+            this.ctxApptClipMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.mnuRemoveClipItem,
+            this.mnuClearClipItems});
+            this.ctxApptClipMenu.Popup += new System.EventHandler(this.ctxApptClipMenu_Popup);
+            // 
+            // mnuRemoveClipItem
+            // 
+            this.mnuRemoveClipItem.Index = 0;
+            this.mnuRemoveClipItem.Text = "Remove Item";
+            this.mnuRemoveClipItem.Click += new System.EventHandler(this.mnuRemoveClipItem_Click);
+            // 
+            // mnuClearClipItems
+            // 
+            this.mnuClearClipItems.Index = 1;
+            this.mnuClearClipItems.Text = "Clear All";
+            this.mnuClearClipItems.Click += new System.EventHandler(this.mnuClearClipItems_Click);
+            // 
+            // label1
+            // 
+            this.label1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.label1.Location = new System.Drawing.Point(0, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(128, 32);
+            this.label1.TabIndex = 1;
+            this.label1.Text = "Appointment Clipboard";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+            // 
+            // panelTop
+            // 
+            this.panelTop.Controls.Add(this.dateTimePicker1);
+            this.panelTop.Controls.Add(this.lblResource);
+            this.panelTop.Dock = System.Windows.Forms.DockStyle.Top;
+            this.panelTop.Location = new System.Drawing.Point(128, 0);
+            this.panelTop.Name = "panelTop";
+            this.panelTop.Size = new System.Drawing.Size(679, 24);
+            this.panelTop.TabIndex = 6;
+            // 
+            // dateTimePicker1
+            // 
+            this.dateTimePicker1.Dock = System.Windows.Forms.DockStyle.Right;
+            this.dateTimePicker1.DropDownAlign = System.Windows.Forms.LeftRightAlignment.Right;
+            this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short;
+            this.dateTimePicker1.Location = new System.Drawing.Point(551, 0);
+            this.dateTimePicker1.Name = "dateTimePicker1";
+            this.dateTimePicker1.Size = new System.Drawing.Size(128, 20);
+            this.dateTimePicker1.TabIndex = 1;
+            this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged);
+            // 
+            // lblResource
+            // 
+            this.lblResource.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblResource.ForeColor = System.Drawing.SystemColors.Highlight;
+            this.lblResource.Location = new System.Drawing.Point(8, 5);
+            this.lblResource.Name = "lblResource";
+            this.lblResource.Size = new System.Drawing.Size(456, 19);
+            this.lblResource.TabIndex = 2;
+            this.lblResource.Text = "lblResource";
+            // 
+            // panelCenter
+            // 
+            this.panelCenter.Controls.Add(this.calendarGrid1);
+            this.panelCenter.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.panelCenter.Location = new System.Drawing.Point(136, 24);
+            this.panelCenter.Name = "panelCenter";
+            this.panelCenter.Size = new System.Drawing.Size(668, 321);
+            this.panelCenter.TabIndex = 7;
+            // 
+            // ctxCalendarGrid
+            // 
+            this.ctxCalendarGrid.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
+            this.ctxCalGridAdd,
+            this.ctxCalGridEdit,
+            this.ctxCalGridDelete,
+            this.ctxCalGridCheckIn,
+            this.menuItem2,
+            this.ctxCalGridNoShow,
+            this.ctxCalGridNoShowUndo,
+            this.menuItem9,
+            this.ctxCalGridWalkin,
+            this.menuItem10,
+            this.ctxCalGridReprintRoutingSlip});
+            this.ctxCalendarGrid.Popup += new System.EventHandler(this.ctxCalendarGrid_Popup);
+            // 
+            // ctxCalGridAdd
+            // 
+            this.ctxCalGridAdd.Index = 0;
+            this.ctxCalGridAdd.Text = "Add Appointment";
+            this.ctxCalGridAdd.Click += new System.EventHandler(this.ctxCalGridAdd_Click);
+            // 
+            // ctxCalGridEdit
+            // 
+            this.ctxCalGridEdit.Index = 1;
+            this.ctxCalGridEdit.Text = "Edit Appointment";
+            this.ctxCalGridEdit.Click += new System.EventHandler(this.ctxCalGridEdit_Click);
+            // 
+            // ctxCalGridDelete
+            // 
+            this.ctxCalGridDelete.Index = 2;
+            this.ctxCalGridDelete.Text = "Cancel Appointment";
+            this.ctxCalGridDelete.Click += new System.EventHandler(this.ctxCalGridDelete_Click);
+            // 
+            // ctxCalGridCheckIn
+            // 
+            this.ctxCalGridCheckIn.Index = 3;
+            this.ctxCalGridCheckIn.Text = "Check In Patient";
+            this.ctxCalGridCheckIn.Click += new System.EventHandler(this.ctxCalGridCheckIn_Click);
+            // 
+            // menuItem2
+            // 
+            this.menuItem2.Index = 4;
+            this.menuItem2.Text = "-";
+            // 
+            // ctxCalGridNoShow
+            // 
+            this.ctxCalGridNoShow.Index = 5;
+            this.ctxCalGridNoShow.Text = "Mark as No Show";
+            this.ctxCalGridNoShow.Click += new System.EventHandler(this.ctxCalGridNoShow_Click);
+            // 
+            // ctxCalGridNoShowUndo
+            // 
+            this.ctxCalGridNoShowUndo.Index = 6;
+            this.ctxCalGridNoShowUndo.Text = "Undo NoShow";
+            this.ctxCalGridNoShowUndo.Click += new System.EventHandler(this.ctxCalGridNoShowUndo_Click);
+            // 
+            // menuItem9
+            // 
+            this.menuItem9.Index = 7;
+            this.menuItem9.Text = "-";
+            // 
+            // ctxCalGridWalkin
+            // 
+            this.ctxCalGridWalkin.Index = 8;
+            this.ctxCalGridWalkin.Text = "Create Wal&k-In Appointment";
+            this.ctxCalGridWalkin.Click += new System.EventHandler(this.ctxCalGridWalkin_Click);
+            // 
+            // menuItem10
+            // 
+            this.menuItem10.Index = 9;
+            this.menuItem10.Text = "-";
+            // 
+            // panelBottom
+            // 
+            this.panelBottom.Controls.Add(this.statusBar1);
+            this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.panelBottom.Location = new System.Drawing.Point(136, 345);
+            this.panelBottom.Name = "panelBottom";
+            this.panelBottom.Size = new System.Drawing.Size(668, 24);
+            this.panelBottom.TabIndex = 8;
+            // 
+            // statusBar1
+            // 
+            this.statusBar1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.statusBar1.Location = new System.Drawing.Point(0, 0);
+            this.statusBar1.Name = "statusBar1";
+            this.statusBar1.Size = new System.Drawing.Size(668, 24);
+            this.statusBar1.SizingGrip = false;
+            this.statusBar1.TabIndex = 0;
+            // 
+            // splitter1
+            // 
+            this.splitter1.Location = new System.Drawing.Point(128, 24);
+            this.splitter1.Name = "splitter1";
+            this.splitter1.Size = new System.Drawing.Size(8, 345);
+            this.splitter1.TabIndex = 9;
+            this.splitter1.TabStop = false;
+            // 
+            // splitter2
+            // 
+            this.splitter2.Dock = System.Windows.Forms.DockStyle.Right;
+            this.splitter2.Location = new System.Drawing.Point(804, 24);
+            this.splitter2.Name = "splitter2";
+            this.splitter2.Size = new System.Drawing.Size(3, 345);
+            this.splitter2.TabIndex = 10;
+            this.splitter2.TabStop = false;
+            // 
+            // printRoutingSlip
+            // 
+            this.printRoutingSlip.DocumentName = "Routing Slip";
+            this.printRoutingSlip.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printRoutingSlip_PrintPage);
+            // 
+            // calendarGrid1
+            // 
+            this.calendarGrid1.AllowDrop = true;
+            this.calendarGrid1.Appointments = null;
+            this.calendarGrid1.ApptDragSource = null;
+            this.calendarGrid1.AutoScroll = true;
+            this.calendarGrid1.AutoScrollMinSize = new System.Drawing.Size(600, 1898);
+            this.calendarGrid1.AvailabilityArray = null;
+            this.calendarGrid1.BackColor = System.Drawing.SystemColors.Window;
+            this.calendarGrid1.Columns = 5;
+            this.calendarGrid1.ContextMenu = this.ctxCalendarGrid;
+            this.calendarGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.calendarGrid1.DrawWalkIns = true;
+            this.calendarGrid1.GridBackColor = null;
+            this.calendarGrid1.GridEnter = false;
+            this.calendarGrid1.Location = new System.Drawing.Point(0, 0);
+            this.calendarGrid1.Name = "calendarGrid1";
+            this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
+            this.calendarGrid1.SelectedAppointment = 0;
+            this.calendarGrid1.Size = new System.Drawing.Size(668, 321);
+            this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
+            this.calendarGrid1.TabIndex = 0;
+            this.calendarGrid1.TimeScale = 20;
+            this.calendarGrid1.DoubleClick += new System.EventHandler(this.calendarGrid1_DoubleClick);
+            this.calendarGrid1.CGSelectionChanged += new IndianHealthService.ClinicalScheduling.CGSelectionChangedHandler(this.calendarGrid1_CGSelectionChanged);
+            this.calendarGrid1.CGAppointmentChanged += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentChanged);
+            this.calendarGrid1.CGAppointmentAdded += new IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler(this.calendarGrid1_CGAppointmentAdded);
+            // 
+            // ctxCalGridReprintRoutingSlip
+            // 
+            this.ctxCalGridReprintRoutingSlip.Index = 10;
+            this.ctxCalGridReprintRoutingSlip.Text = "&Reprint Routing Slip";
+            this.ctxCalGridReprintRoutingSlip.Click += new System.EventHandler(this.ctxCalGridReprintRoutingSlip_Click);
+            // 
+            // CGView
+            // 
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(935, 369);
+            this.Controls.Add(this.panelCenter);
+            this.Controls.Add(this.panelBottom);
+            this.Controls.Add(this.splitter2);
+            this.Controls.Add(this.splitter1);
+            this.Controls.Add(this.panelTop);
+            this.Controls.Add(this.panelRight);
+            this.Controls.Add(this.tvSchedules);
+            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
+            this.Menu = this.mainMenu1;
+            this.Name = "CGView";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "CGView";
+            this.CursorChanged += new System.EventHandler(this.CGView_CursorChanged);
+            this.Load += new System.EventHandler(this.CGView_Load);
+            this.Activated += new System.EventHandler(this.CGView_Activated);
+            this.Closing += new System.ComponentModel.CancelEventHandler(this.CGView_Closing);
+            this.panelRight.ResumeLayout(false);
+            this.panelClip.ResumeLayout(false);
+            this.panelTop.ResumeLayout(false);
+            this.panelCenter.ResumeLayout(false);
+            this.panelBottom.ResumeLayout(false);
+            this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		#region Fields
+
+		private	CGDocument			m_Document;
+		private CGDocumentManager	m_DocManager;
+		private int					m_nSlots;
+		bool						bSchedulesClicked = false;
+		private ArrayList			m_alSelectedTreeResourceArray = new ArrayList();
+		private string				m_sDocName;
+		private CGAppointments		m_ClipList;
+		private bool				m_bDragDropStart = false;
+		private Hashtable			m_htOverbook;
+		private Hashtable			m_htModifySchedule;
+		private Hashtable			m_htChangeAppts;
+		private BMXNetConnectInfo	m_ConnectInfo = null;
+		public BMXNetConnectInfo.BMXNetEventDelegate	BMXNetEvent;
+
+		#endregion Fields
+
+		#region Properties
+
+		/// <summary>
+		/// Access the CalendarGrid associated with this view
+		/// </summary>
+		public CalendarGrid CGrid
+		{
+			get
+			{
+				return this.calendarGrid1;
+			}
+		}
+
+		/// <summary>
+		/// Accesses the document associated with this view
+		/// </summary>
+		public CGDocument Document
+		{
+			get
+			{
+				return this.m_Document;
+			}
+			set
+			{
+				this.m_Document = value;
+			}
+		}
+
+		public CGDocumentManager DocManager
+		{
+			get
+			{
+				return m_DocManager;
+			}
+			set
+			{
+				m_DocManager = value;
+			}
+		}
+
+		public DateTime StartDate
+		{
+			get
+			{
+				return this.calendarGrid1.StartDate;
+			}
+			set
+			{
+				this.calendarGrid1.StartDate = value;
+			}
+		}
+
+		public CGAppointments Appointments
+		{
+			get
+			{
+				return this.calendarGrid1.Appointments;
+			}
+			set
+			{
+				this.calendarGrid1.Appointments = value;
+			}
+		}
+
+
+		#endregion
+
+		#region AppointmentMenu Handlers
+
+		private void mnuAppointment_Popup(object sender, System.EventArgs e)
+		{
+			bool bEnabled = (this.Document.Resources.Count > 0)? true : false ;
+			this.mnuFindAppt.Enabled = bEnabled;
+
+			//Toggle availability of make, edit, checkin and delete appointments
+			//based on whether a range is selected.
+
+			mnuNewAppointment.Enabled = AddAppointmentEnabled();
+			this.mnuWalkIn.Enabled = mnuNewAppointment.Enabled;
+			bool bEditAppointments = this.EditAppointmentEnabled();
+
+			mnuDeleteAppointment.Enabled = bEditAppointments;
+			mnuCheckIn.Enabled = bEditAppointments;
+			mnuEditAppointment.Enabled = bEditAppointments;
+			mnuNoShow.Enabled = bEditAppointments;
+			mnuNoShowUndo.Enabled = bEditAppointments;
+		}
+
+		private void mnuCheckIn_Click(object sender, System.EventArgs e)
+		{
+			AppointmentCheckIn();
+		}
+
+		private void mnuCopyAppointment_Click(object sender, System.EventArgs e)
+		{
+			//For each appointment in the grid's selected list,
+			//add to the clip list
+			//and add to m_ClipList
+			try
+			{
+				foreach (CGAppointment a in this.calendarGrid1.SelectedAppointments.AppointmentTable.Values)
+				{
+					if (m_ClipList.AppointmentTable.Contains((int) a.AppointmentKey))
+					{
+						return;
+					}
+					m_ClipList.AddAppointment(a);
+					lstClip.Items.Add(a.PatientName);
+				}
+			}
+			catch (Exception ex)
+			{
+				string s = ex.Message;
+				Debug.Write(s);
+				return;
+			}
+		}
+
+		private void mnuDeleteAppointment_Click(object sender, System.EventArgs e)
+		{
+			AppointmentDelete();
+		}
+
+		private void mnuEditAppointment_Click(object sender, System.EventArgs e)
+		{
+			AppointmentEdit();
+		}
+
+		private void mnuNewAppointment_Click(object sender, System.EventArgs e)
+		{
+			AppointmentAddNew();
+		}
+
+		private void mnuNoShow_Click(object sender, System.EventArgs e)
+		{
+			AppointmentNoShow(true);
+		}
+
+		private void mnuNoShowUndo_Click(object sender, System.EventArgs e)
+		{
+			AppointmentNoShow(false);
+		}
+
+		#endregion AppointmentMenu Handlers
+
+		#region ContextMenu1 Handlers
+
+		private void contextMenu1_Popup(object sender, System.EventArgs e)
+		{
+			//Enable/disable OpenSchedule and Find Appointment options
+			bool bEnabled = (m_alSelectedTreeResourceArray.Count > 0)? true : false ;
+			this.ctxOpenSchedule.Enabled = bEnabled;
+			this.ctxFindAppt.Enabled = bEnabled;
+
+			//properties not supported now
+			this.ctxProperties.Enabled = false;
+			this.ctxProperties.Visible = false;
+
+			//Enable/disable Availability menu option
+			if (m_alSelectedTreeResourceArray.Count != 1)
+			{
+				this.ctxEditAvailability.Enabled = false;
+				return;
+			}
+			
+			if (this.DocManager.ScheduleManager == true)
+			{
+				ctxEditAvailability.Enabled = true;
+				return;
+			}
+
+			string sResource = (string) m_alSelectedTreeResourceArray[0];
+			DataTable dt = this.DocManager.GlobalDataSet.Tables["ResourceUser"];
+			DataView dv = new DataView(dt, "", "RESOURCENAME ASC", DataViewRowState.OriginalRows);
+			string sDuz = this.DocManager.ConnectInfo.DUZ;
+			bool bModSchedule = false;
+			DataRowView[] drvA = dv.FindRows(sResource);
+			if (drvA.Length == 0)
+			{
+				this.ctxEditAvailability.Enabled = false;
+			}
+			else
+			{
+				string sModSchedule = "NO";
+				foreach (DataRowView drv in drvA)
+				{
+					if (drv["USERID"].ToString() == sDuz)
+					{
+						sModSchedule = drv["MODIFY_SCHEDULE"].ToString();
+						break;
+					}
+				}
+
+				bModSchedule = (sModSchedule == "YES")?true:false;
+				this.ctxEditAvailability.Enabled = bModSchedule;
+			}
+		}
+
+		private void ctxEditAvailability_Click(object sender, System.EventArgs e)
+		{
+			this.EditScheduleAvailability();
+		}
+
+		private void ctxOpenSchedule_Click(object sender, System.EventArgs e)
+		{
+			OpenSelectedSchedule(m_alSelectedTreeResourceArray, DateTime.Today);
+		}
+
+		private void ctxProperties_Click(object sender, System.EventArgs e)
+		{
+			//TODO: Implement Properties dialog
+			MessageBox.Show("TODO: Implement Properties dialog");
+		}
+
+		private void ctxFindAppt_Click(object sender, System.EventArgs e)
+		{
+			FindAvailableAppointment(m_alSelectedTreeResourceArray);
+		}
+
+		#endregion ContextMenu1 Handlers
+
+		#region ctxApptClipMenu Handlers
+
+		private void mnuClearClipItems_Click(object sender, System.EventArgs e)
+		{
+			this.m_ClipList.ClearAllAppointments();
+			lstClip.Items.Clear();
+		}
+
+		private void mnuRemoveClipItem_Click(object sender, System.EventArgs e)
+		{
+			int i = lstClip.SelectedIndex;
+			CGAppointment a = (CGAppointment) lstClip.SelectedItem;
+			int nKey = a.AppointmentKey;
+			if (i > -1)
+			{
+				m_ClipList.RemoveAppointment(nKey);
+				lstClip.Items.RemoveAt(i);
+			}
+		}
+
+		private void ctxApptClipMenu_Popup(object sender, System.EventArgs e)
+		{
+			mnuClearClipItems.Enabled = (m_ClipList.AppointmentTable.Count > 0);
+			mnuRemoveClipItem.Enabled = (lstClip.SelectedIndex > -1);
+		}
+
+		#endregion ctxApptClipMenu Handlers
+
+		#region ctxCalGridMenu Handlers
+
+		private void ctxCalendarGrid_Popup(object sender, System.EventArgs e)
+		{
+			//Toggle availability of make, edit, checkin and delete appointments
+			//based on whether appropriate element is selected.
+			ctxCalGridAdd.Enabled = AddAppointmentEnabled();
+			bool bEditAppointments = (EditAppointmentEnabled() && (calendarGrid1.SelectedAppointment > 0)) ;
+			ctxCalGridDelete.Enabled = bEditAppointments;
+			ctxCalGridEdit.Enabled = bEditAppointments;
+			ctxCalGridCheckIn.Enabled = bEditAppointments;
+			ctxCalGridNoShow.Enabled = bEditAppointments;
+			ctxCalGridNoShowUndo.Enabled = bEditAppointments;
+			ctxCalGridWalkin.Enabled = ctxCalGridAdd.Enabled;
+            //smh new code
+            ctxCalGridReprintRoutingSlip.Enabled = ctxCalGridEdit.Enabled;
+		    //end new code
+        }
+
+		private void ctxCalGridAdd_Click(object sender, System.EventArgs e)
+		{
+			AppointmentAddNew();
+		}
+
+		private void calendarGrid1_DoubleClick(object sender, System.EventArgs e)
+		{
+			if (calendarGrid1.SelectedAppointment > 0)
+				AppointmentEdit();
+		}
+
+		private void ctxCalGridEdit_Click(object sender, System.EventArgs e)
+		{
+			AppointmentEdit();
+		}
+
+		private void ctxCalGridDelete_Click(object sender, System.EventArgs e)
+		{
+			AppointmentDelete();
+		}
+
+		private void ctxCalGridCheckIn_Click(object sender, System.EventArgs e)
+		{
+			AppointmentCheckIn();
+		}
+
+		private void ctxCalGridNoShow_Click(object sender, System.EventArgs e)
+		{
+			AppointmentNoShow(true);
+		}
+
+		private void ctxCalGridNoShowUndo_Click(object sender, System.EventArgs e)
+		{
+			AppointmentNoShow(false);
+		}
+
+        //new code smh
+        private void ctxCalGridReprintRoutingSlip_Click(object sender, EventArgs e)
+        {
+            printRoutingSlip.Print();
+        }
+        //end new code
+
+		#endregion ctxCalGridMenu Handlers
+
+		#region Methods
+
+        private bool EditAppointmentEnabled()
+        {
+            try
+            {
+                //Call here if there is a selected appointment in the grid
+                if (calendarGrid1.SelectedAppointment < 1)
+                    return false;
+                CGAppointment appt = (CGAppointment)this.Appointments.AppointmentTable[calendarGrid1.SelectedAppointment];
+                string sResource = appt.Resource;
+                return EditAppointmentEnabled(sResource);
+
+            }
+            catch (Exception ex)
+            {
+                string sMsg = ex.Message;
+                return false;
+            }
+        }
+
+        private bool EditAppointmentEnabled(string sResource)
+        {
+
+            bool bManager = this.DocManager.ScheduleManager;
+            if (bManager == true)
+            {
+                return (true);
+            }
+            else
+            {
+                bool bModAppts;
+                bModAppts = (bool)this.m_htChangeAppts[sResource];
+                return bModAppts;
+            }
+        }
+
+        private bool AddAppointmentEnabled()
+        {
+            if (this.calendarGrid1.SelectedRange.Cells.CellCount < 1)
+                return false;
+
+            bool bManager = this.DocManager.ScheduleManager;
+            if (bManager == true)
+            {
+                return (true);
+            }
+            else
+            {
+                DateTime dStart = DateTime.Today;
+                DateTime dEnd = DateTime.Today;
+                string sResource = "";
+                bool bRet = this.calendarGrid1.GetSelectedTime(out dStart, out dEnd, out sResource);
+                if (bRet == false)
+                {
+                    return false;
+                }
+                bool bSlotsAvailable;
+                bool bOverbook;
+                bool bModSchedule;
+                bool bModAppts;
+                bOverbook = (bool)this.m_htOverbook[sResource];
+                bModSchedule = (bool)this.m_htModifySchedule[sResource];
+                bModAppts = (bool)this.m_htChangeAppts[sResource];
+                if (bModAppts == false)
+                    return false;
+
+                bSlotsAvailable = (this.m_nSlots > 0);
+                return ((bSlotsAvailable) || (bModSchedule) || (bOverbook));
+            }
+        }
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		void UpdateStatusBar(DateTime dStart, DateTime dEnd, string sAccessType, string sAvailabilityMessage)
+		{
+			string sMsg =  dStart.ToShortTimeString() + " to " + dEnd.ToShortTimeString();
+			if (m_nSlots > 0)
+			{
+				sMsg = sMsg + ": " + m_nSlots.ToString() + " slot";
+				sMsg = sMsg + ((m_nSlots > 1)?"s " : " ");
+				sMsg = sMsg + "available";
+				if (sAccessType != "")
+				{
+					sMsg = sMsg + " for " + sAccessType;
+				}
+				sMsg = sMsg + ".";
+				if (sAvailabilityMessage != "")
+				{
+					sMsg = sMsg + "  Note: " + sAvailabilityMessage;
+				}
+			}
+			else
+			{
+				sMsg += ": No appointment slots available.";
+			}
+
+			this.statusBar1.Text = sMsg;
+		}
+
+		private void EditScheduleAvailability()
+		{
+			CGAVDocument doc = new CGAVDocument();
+			try 
+			{
+				//If resource already open, then navigate to its window
+				CGAVView v =this.DocManager.GetAVViewByResource(m_alSelectedTreeResourceArray);
+			
+				if (v != null) 
+				{
+					v.Activate();
+				}
+				else 
+				{
+					//If not already open, get a lock and open it
+					doc.DocManager = this.DocManager;
+					for (int j=0; j < m_alSelectedTreeResourceArray.Count; j++)
+					{
+						doc.AddResource((string) m_alSelectedTreeResourceArray[j]);
+					}
+					doc.DocName = this.m_sDocName;
+
+					//Get preferred time scale from resource info
+
+					DataTable dt = this.DocManager.GlobalDataSet.Tables["Resources"];
+					DataView dv = new DataView(dt, "", "RESOURCE_NAME ASC", DataViewRowState.OriginalRows);
+					int nScale = 60;
+					int nTest=0;
+					string sResource;
+					int nDataRow;
+					DataRowView drv;
+					string sResourceID="";
+					for (int j=0; j < m_alSelectedTreeResourceArray.Count; j++)
+					{
+						sResource = (string) m_alSelectedTreeResourceArray[j];
+						nDataRow = dv.Find(sResource);
+						Debug.Assert(nDataRow != -1);
+						drv = dv[nDataRow];
+						if (drv["TIMESCALE"].ToString() == "")
+						{
+							nTest = 15; //15 minute default
+						}
+						else
+						{
+							nTest = (int) drv["TIMESCALE"];
+						}
+						nScale = (nTest < nScale)?nTest : nScale ;
+						sResourceID = drv["RESOURCEID"].ToString();
+					}
+					
+					doc.ResourceID = Convert.ToInt32(sResourceID);
+
+					bool bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXRES(" + sResourceID + ")", "+");
+					if (bLock == false)
+					{
+						throw new BMXNetException("Another user is currently editing availability for this resource.  Try later.");
+					}					
+					
+					doc.OnOpenDocument();
+					v =this.DocManager.GetAVViewByResource(m_alSelectedTreeResourceArray);
+					CalendarGrid cg = v.CGrid;
+
+					cg.TimeScale = nScale;
+
+					//Position grid to 0700
+					PositionGrid(cg, 7);
+				}
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to edit availability for " + m_sDocName + " schedule.  " +  ex.Message, "Clinical Scheduling");
+				this.m_DocManager.CloseAllViews(doc);
+				return;
+			}
+		}
+
+		private void OpenSelectedSchedule(ArrayList sSelectedTreeResourceArray, DateTime dDate)
+		{
+			//If resource already open, then navigate to its window
+			CGDocument doc;
+			CGView v =this.DocManager.GetViewByResource(sSelectedTreeResourceArray);
+			if (v != null) 
+			{
+				v.Activate();
+				v.dateTimePicker1.Value = dDate;
+			}
+			else 
+			{
+				//If not already open, open it
+				//If current document has a resource, then open a new window 
+				//with the selected resource.
+				//Otherwise just use the current document.
+				if (this.Document.m_sResourcesArray.Count > 0)
+				{
+					doc = new CGDocument();
+					doc.DocManager = this.DocManager;
+				}
+				else 
+				{
+					doc = this.Document;
+				}
+				for (int j=0; j < sSelectedTreeResourceArray.Count; j++)
+				{
+					doc.AddResource((string) sSelectedTreeResourceArray[j]);
+				}
+				doc.DocName = this.m_sDocName;
+				try
+				{
+					doc.OnOpenDocument();
+				}
+				catch (Exception ex)
+				{
+					MessageBox.Show("Unable to open " + m_sDocName + " schedule.  " +  ex.Message, "Clinical Scheduling");
+					this.m_DocManager.CloseAllViews(doc);
+					return;
+				}
+				v =this.DocManager.GetViewByResource(sSelectedTreeResourceArray);
+				v.dateTimePicker1.Value = dDate;
+
+				//Get preferred time scale from resource info
+				//If more than one resource, get smallest time scale
+				CalendarGrid cg = v.CGrid;
+				DataTable dt = this.DocManager.GlobalDataSet.Tables["Resources"];
+				DataView dv = new DataView(dt, "", "RESOURCE_NAME ASC", DataViewRowState.OriginalRows);
+				int nScale = 60;
+				int nTest=0;
+				string sResource;
+				int nDataRow;
+				DataRowView drv;
+				for (int j=0; j < sSelectedTreeResourceArray.Count; j++)
+				{
+					sResource = (string) sSelectedTreeResourceArray[j];
+					nDataRow = dv.Find(sResource);
+					Debug.Assert(nDataRow != -1);
+					drv = dv[nDataRow];
+					if (drv["TIMESCALE"].ToString() == "")
+					{
+						nTest = 15; //15 minute default
+					}
+					else
+					{
+						nTest = (int) drv["TIMESCALE"];
+					}
+					nScale = (nTest < nScale)?nTest : nScale ;
+				}
+
+				cg.TimeScale = nScale;
+
+				PositionGrid(cg, 7);
+
+				//Get the OverBook and ModifySchedule permissions from ResourceUser table
+				//and populate the hashtables
+				string	sOverbook;
+				string	sModSchedule;
+				string	sModAppts;
+				bool	bOverbook;
+				bool	bModSchedule;
+				bool	bModAppts;
+				v.m_htOverbook = new Hashtable(sSelectedTreeResourceArray.Count);
+				v.m_htModifySchedule = new Hashtable(sSelectedTreeResourceArray.Count);
+				v.m_htChangeAppts = new Hashtable(sSelectedTreeResourceArray.Count);
+				dt = this.DocManager.GlobalDataSet.Tables["ResourceUser"];
+				dv = new DataView(dt, "", "RESOURCENAME ASC", DataViewRowState.OriginalRows);
+				dv.RowFilter = "USERNAME = '" + this.DocManager.ConnectInfo.UserName + "'";
+				for (int j=0; j < dv.Count; j++)
+				{
+					drv = dv[j];
+					sResource = drv["RESOURCENAME"].ToString();
+					sOverbook = drv["OVERBOOK"].ToString();
+					bOverbook = (sOverbook == "YES")?true:false;
+					sModSchedule = drv["MODIFY_SCHEDULE"].ToString();
+					bModSchedule = (sModSchedule == "YES")?true:false;
+					sModAppts = drv["MODIFY_APPOINTMENTS"].ToString();
+					bModAppts = (sModAppts == "YES")?true:false;
+					v.m_htOverbook[sResource] = bOverbook;
+					v.m_htModifySchedule[sResource] = bModSchedule;
+					v.m_htChangeAppts[sResource] = bModAppts;
+				}
+
+				//For programmers and scheduling managers, set all permissions for all resources
+				if (this.DocManager.ScheduleManager == true)
+				{
+					dt = this.DocManager.GlobalDataSet.Tables["Resources"];
+					foreach (DataRow dr in dt.Rows)
+					{
+						sResource = dr["RESOURCE_NAME"].ToString();
+						v.m_htOverbook[sResource] = true;
+						v.m_htModifySchedule[sResource] = true;
+						v.m_htChangeAppts[sResource] = true;
+					}
+				}
+
+				v.calendarGrid1.SetOverlapTable();
+				v.calendarGrid1.Refresh();
+			}
+		}
+
+		private void PositionGrid(CalendarGrid cg, int nHour)
+		{
+				//Position grid to nHour
+				int nRow = 0, nCol = 0;
+				DateTime dStart = DateTime.Today;
+				dStart = dStart.AddHours(nHour);
+				cg.GetCellFromTime(dStart, ref nRow, ref nCol, false, "");
+				int nHeight = cg.CellHeight + 10;
+				nHeight *= nRow;
+				cg.AutoScrollPosition = new Point(50, nHeight);
+				cg.Invalidate();
+		}
+
+		private void LoadTree()
+		{
+			//Navigate from ResourceGroup table to Resources table
+			DataRow[] arrRows;
+			DataRelation dr = DocManager.GlobalDataSet.Relations["GroupResource"];
+			string sGroup;
+			string sResource;
+			int nIndex = 0;
+			foreach (DataRow r in DocManager.GlobalDataSet.Tables["ResourceGroup"].Rows)
+			{
+				sGroup = r["RESOURCE_GROUP"].ToString();
+				TreeNode deptNode = new TreeNode(sGroup);
+				nIndex = this.tvSchedules.Nodes.Add(deptNode);
+				tvSchedules.Nodes[nIndex].Tag = "Dept";
+				arrRows = r.GetChildRows(dr);
+				for (int i=0; i< arrRows.Length; i++) 
+				{
+					sResource = arrRows[i]["RESOURCE_NAME"].ToString();
+					TreeNode resNode = new TreeNode(sResource);
+					int nResIndex = deptNode.Nodes.Add(resNode);
+					deptNode.Nodes[nResIndex].Tag = "Resource";
+				}
+			}
+		}
+
+		public void CreateNewSchedule()
+		{				
+			//Create a new document and open it
+			CGDocument doc = new CGDocument();
+			doc.DocManager = this.DocManager;
+			try
+			{
+				doc.OnOpenDocument();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to open " + m_sDocName + " schedule.  " +  ex.Message, "Clinical Scheduling");
+				this.m_DocManager.CloseAllViews(doc);
+				return;
+			}
+		}
+
+		private void AppointmentEdit()
+		{
+			try
+			{
+				int nApptID = this.calendarGrid1.SelectedAppointment;
+				Debug.Assert(nApptID != 0);
+			
+				CGAppointment a = (CGAppointment) this.Appointments.AppointmentTable[nApptID];
+
+				DAppointPage dAppt = new DAppointPage();			
+				dAppt.DocManager = this.m_DocManager;
+				dAppt.InitializePage(a);
+
+				calendarGrid1.CGToolTip.Active = false;
+
+				if (dAppt.ShowDialog(this) == DialogResult.Cancel)
+				{
+					calendarGrid1.CGToolTip.Active = true;
+					return;
+				}
+				calendarGrid1.CGToolTip.Active = true;
+
+				string sNote = dAppt.Note;
+
+				//Call Document to edit appointment
+				this.Document.EditAppointment(a, sNote);
+
+			}
+			catch (Exception ex)
+			{
+				Debug.Write("CGView.AppointmentEdit Failed:  " + ex.Message);
+			}
+		}
+
+		/// <summary>
+		/// Marks all selected appointments as No Show
+		/// </summary>
+		/// <param name="nApptID"></param>
+		/// <returns></returns>		
+		private void AppointmentNoShow(bool bNoShow)
+		{
+
+			//bNoShow indicates whether to mark or un-mark as noshow
+			bool			bMarked = false;	//Indicates at least one attempt to mark as noshow succeeded
+			bool			bRebook = false;	//Stores user's response to auto-rebook dialog question
+			CGAppointments	alRebookList = new CGAppointments();
+			DNoShow dlg = new DNoShow();;
+			if (bNoShow == true)
+			{
+				if (dlg.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+			}
+
+			bRebook = dlg.AutoRebook;
+
+			foreach (CGAppointment a in this.calendarGrid1.SelectedAppointments.AppointmentTable.Values)
+			{
+				int nApptID = a.AppointmentKey;
+				Debug.Assert(nApptID != 0);
+				try
+				{
+					if ((bNoShow == true)
+						&&
+						(a.StartTime.Date > DateTime.Today.Date)
+						&&
+						(MessageBox.Show(this, "The appointment for " + a.PatientName + " is in the future.  Are you sure you want to No-Show?", "Windows Scheduling", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK))
+					{
+					}
+					else
+					{
+						string sError = Document.AppointmentNoShow(nApptID, bNoShow);
+						if (sError != "1")
+							throw new Exception(sError);
+
+						bMarked = true;
+					}
+				}
+				catch (Exception ex)
+				{
+					MessageBox.Show("Unable to mark appointment No Show: " +  ex.Message, "Clinical Scheduling");
+				}
+				if (bRebook == true)
+				{
+					try
+					{
+						CGAppointment aRebook;
+						int nMinimumdays = dlg.RebookStartDays;
+						int nMaximumdays = dlg.RebookMaxDays;
+						int nAccessType = dlg.RebookAccessType;
+						//-1 means use current type
+
+						if (nAccessType == -1)
+						{
+							//Get access type from grid
+							int nRow = 0;
+							int nCol = 0;
+							CGCell cgCell = new CGCell();
+							this.calendarGrid1.GetCellFromTime(a.StartTime, ref nRow, ref nCol, true , a.Resource);
+							cgCell.CellColumn = nCol;
+							cgCell.CellRow = nRow;
+							this.calendarGrid1.GetTypeFromCell(cgCell, out nAccessType);
+							a.AccessTypeID = nAccessType;
+						}
+						string sResult = Document.AutoRebook(a, nAccessType, nMinimumdays, nMaximumdays, out aRebook);
+						if (sResult == "1")
+						{
+							//Add appointment to list of rebooked appointments
+							alRebookList.AddAppointment(a);
+						}
+						else
+						{
+							MessageBox.Show("Unable to rebook this patient: " + a.PatientName);
+						}
+
+					}
+					catch (Exception ex)
+					{
+						MessageBox.Show("Unable to rebook: " + ex.Message);
+					}
+				}
+			}
+			
+			if (bMarked == true)
+			{
+				//Notify other scheduling users that this schedule has changed
+				try
+				{
+					this.Document.RefreshDocument();
+					RaiseRPMSEvent("BSDX SCHEDULE" , m_Document.DocName);
+				}
+				catch (Exception ex)
+				{
+					Debug.Write(ex.Message);
+				}
+				this.calendarGrid1.Invalidate();
+				
+				AutoRebookFromList(alRebookList);
+			}			
+		}
+		
+		private void AutoRebookFromList(CGAppointments alRebookList)
+		{
+			//Print AutoRebook letters.
+			if (alRebookList.AppointmentCount > 0)
+			{
+				//build |-delimited list of ApptIDs to pass to BSDX REBOOK LIST
+				string sApptIDList = "";
+
+				System.Collections.ArrayList a = new ArrayList();
+
+				foreach (CGAppointment appt in alRebookList.AppointmentTable.Values)
+				{
+					string sApptID = appt.AppointmentKey.ToString() + "|";
+					sApptIDList += sApptID;
+					if (a.Contains(appt.Resource) == false)
+						a.Add(appt.Resource);
+				}
+
+                // Print rebooks
+				string sClinicList = "";
+				foreach (string sRes in a)
+				{
+					sClinicList = sClinicList + sRes + "|";	
+				}
+				DPatientLetter dpl = new DPatientLetter();					
+				dpl.InitializeFormRebookLetters(this.DocManager, sClinicList, sApptIDList);
+				dpl.ShowDialog(this);
+			}		
+		}
+
+		/// <summary>
+		/// Delete appointment ApptID
+		/// </summary>
+		/// <param name="nApptID"></param>
+		/// <returns></returns>
+		private string AppointmentDeleteOne(int nApptID)
+		{
+			return Document.DeleteAppointment(nApptID);
+		}
+
+		/// <summary>
+		/// Delete all selected appointments
+		/// </summary>
+		private void AppointmentDelete() 
+		{
+			calendarGrid1.CGToolTip.Active = false;
+			CGAppointments	alRebookList = new CGAppointments();
+
+			DCancelAppt dCancel = new DCancelAppt();
+			dCancel.InitializePage(this.m_DocManager);
+			if (dCancel.ShowDialog(this) != DialogResult.OK)
+			{
+				calendarGrid1.CGToolTip.Active = true;
+				return;
+			}
+
+			bool bClinic = dCancel.ClinicCancelled;
+			int nReason = dCancel.CancelReason;
+			string sRemarks = dCancel.CancelRemarks;
+			bool bRebook = dCancel.AutoRebook;
+			int nRebookStart = dCancel.RebookStartDays;
+			int nRebookMax = dCancel.RebookMaxDays;
+			int nRebookAccessType = dCancel.RebookAccessType;
+
+			calendarGrid1.CGToolTip.Active = true;
+
+			bool bDeleted = false;
+			foreach (CGAppointment a in this.calendarGrid1.SelectedAppointments.AppointmentTable.Values)
+			{
+				int nApptID = a.AppointmentKey;
+				Debug.Assert(nApptID != 0);
+				try
+				{
+					string sError = Document.DeleteAppointment(nApptID,bClinic, nReason, sRemarks);
+					if (sError != "")
+						throw new Exception(sError);
+
+					bDeleted = true;
+					if (bRebook == true)
+					{
+						try
+						{
+							//TODO: Parameterize  or dialogize the minum and maximum rebook days
+							CGAppointment aRebook;
+							int nMinimumdays = nRebookStart;
+							int nMaximumdays = nRebookMax;
+							string sResult = Document.AutoRebook(a, nRebookAccessType, nMinimumdays, nMaximumdays, out aRebook);
+							if (sResult == "1")
+							{
+								//Add appointment to list of rebooked appointments
+								alRebookList.AddAppointment(a);
+							}
+
+						}
+						catch (Exception ex)
+						{
+							MessageBox.Show("Unable to rebook: " + ex.Message);
+						}
+					}
+				}
+				catch (Exception ex)
+				{
+					MessageBox.Show("Unable to delete appointment.  " +  ex.Message, "Clinical Scheduling");
+				}
+
+			}
+			if (bDeleted == true)
+			{
+				try
+				{
+					RaiseRPMSEvent("BSDX SCHEDULE" , m_Document.DocName);
+				}
+				catch (Exception ex)
+				{
+					Debug.Write(ex.Message);
+				}
+				this.calendarGrid1.Invalidate();
+				if (bRebook == true)
+				{
+					AutoRebookFromList(alRebookList);
+				}
+			}
+
+		}
+
+		private void AppointmentCheckIn()
+		{
+			bool bDeleted = false;
+			int nApptID = this.calendarGrid1.SelectedAppointment;
+			Debug.Assert(nApptID != 0);
+
+			CGAppointment a = (CGAppointment) this.Appointments.AppointmentTable[nApptID];
+
+			try
+			{
+
+				bool bAlreadyCheckedIn = false;
+				if (a.CheckInTime.Ticks > 0)
+					bAlreadyCheckedIn = true;
+
+				if ((bAlreadyCheckedIn == false)
+					&&
+					(a.StartTime.Date > DateTime.Today.Date))
+				{
+					MessageBox.Show(this, "It is too early to check in " + a.PatientName, "Windows Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+					return;
+				}
+				//Find the default provider for the resource & load into combo box
+				DataView rv = new DataView(this.m_DocManager.GlobalDataSet.Tables["Resources"]);
+				rv.Sort="RESOURCE_NAME ASC";
+				int nFind = rv.Find((string) a.Resource);
+				DataRowView drv = rv[nFind];
+				
+				string sHospLoc = drv["HOSPITAL_LOCATION_ID"].ToString();
+				sHospLoc = (sHospLoc == "")?"0":sHospLoc;
+				int nHospLoc = 0;
+				try
+				{
+					nHospLoc = Convert.ToInt32(sHospLoc);
+				}
+				catch(Exception ex)
+				{
+					Debug.Write("CGView.AppointmentCheckIn Error: " + ex.Message);
+				}
+
+				
+				string sProv = "";
+				string sProvReqd = "NO";
+				string sPCC = "NO";
+				string sMultCodes = "NO";
+				string sStopCode = "";
+				bool bProvReqd = false;
+				bool bPCC = false;
+				bool bMultCodes = false;
+				if (nHospLoc > 0)
+				{
+					DataRow dr = drv.Row;
+					DataRow drHL = dr.GetParentRow(m_DocManager.GlobalDataSet.Relations["HospitalLocationResource"]);
+					sProv = drHL["DEFAULT_PROVIDER"].ToString();
+					sStopCode = drHL["STOP_CODE_NUMBER"].ToString();
+
+					
+                    //TODO: Remove this. This doesn't exist in VISTA.
+                    /*
+                    DataRow[] draCS = drHL.GetChildRows(m_DocManager.GlobalDataSet.Relations["HospitalLocationClinic"]);
+					if (draCS.GetLength(0) > 0)
+					{
+						DataRow drCS = draCS[0];
+						sProvReqd = drCS["VISIT_PROVIDER_REQUIRED"].ToString();
+						sPCC = drCS["GENERATE_PCCPLUS_FORMS?"].ToString();
+						sMultCodes = drCS["MULTIPLE_CLINIC_CODES_USED?"].ToString();
+					}
+					bProvReqd = (sProvReqd == "YES")?true:false;
+					bPCC = (sPCC == "YES")?true:false;
+					bMultCodes = (sMultCodes == "YES")?true:false;
+                     */
+				}
+
+				DCheckIn dlgCheckin = new DCheckIn();
+				dlgCheckin.InitializePage(a, this.m_DocManager, sProv, bProvReqd, bPCC, bMultCodes, sStopCode, nHospLoc);
+				calendarGrid1.CGToolTip.Active = false;
+				if (dlgCheckin.ShowDialog(this) != DialogResult.OK)
+				{
+					calendarGrid1.CGToolTip.Active = true;
+					return;
+				}
+				calendarGrid1.CGToolTip.Active = true;
+
+				if (bAlreadyCheckedIn == true)
+					return;
+
+				DateTime dtCheckIn = dlgCheckin.CheckInTime;
+
+				/*
+				 * Need to pass Provider, ClinicStop, PrintRouteSlip, 
+				 * PCC Clinic, PCC Form, Print OutGuide
+				 */
+
+				this.Document.CheckInAppointment(nApptID, dtCheckIn,
+			 dlgCheckin.ClinicStopIEN,
+			 dlgCheckin.ProviderIEN,
+			 dlgCheckin.PrintRouteSlip,
+			 dlgCheckin.PCCClinicIEN,
+			 dlgCheckin.PCCFormIEN,
+			 dlgCheckin.PCCOutGuide
+					);
+                //smh new code
+                if (dlgCheckin.PrintRouteSlip == "true") //TODO: strange that we use a string for a boolean value??
+                    this.printRoutingSlip.Print();
+                // end new code
+
+				this.calendarGrid1.Invalidate();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Error checking in patient:  " +  ex.Message, "Clinical Scheduling");
+			}
+
+			if (bDeleted == true)
+			{
+				try
+				{
+					RaiseRPMSEvent("BSDX SCHEDULE" , m_Document.DocName);
+				}
+				catch (Exception ex)
+				{
+					Debug.Write(ex.Message);
+				}
+				this.calendarGrid1.Invalidate();
+			}		
+		}
+
+		private void AppointmentAddWalkin()
+		{
+			try
+			{
+				CGAppointment appt = new CGAppointment();
+			
+				//Get Time and Resource from Selected Cell
+				DateTime dStart = DateTime.Today;
+				DateTime dEnd = DateTime.Today;
+				string sResource = "";
+				bool bRet = this.calendarGrid1.GetSelectedTime(out dStart, out dEnd, out sResource);
+				if (bRet == false)
+					return;
+
+				TimeSpan tsDuration = dEnd - dStart;
+				int nDuration = (int) tsDuration.TotalMinutes;
+				Debug.Assert(nDuration > 0);
+
+				/*
+				 * 8-10-05 Added check to prevent walkin from being created
+				 * on a date later than today.
+				 */
+
+				if (dStart.Date > DateTime.Today.Date)
+				{
+					MessageBox.Show(this, "You cannot create a walk-in appointment for a date in the future.\n Select today's date and try again.", "Windows Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+					return;
+				}
+
+				/*
+				 * 8-10-05 Added overbook prompt for walkin
+				*/
+				this.Document.RefreshDocument();
+				string sAccessType = "";
+				string sAvailabilityMessage = "";
+				m_nSlots = m_Document.SlotsAvailable(dStart, dEnd, sResource, out sAccessType, out sAvailabilityMessage);
+
+				if (m_nSlots < 1)
+				{
+					DialogResult dr = MessageBox.Show(this, "There are no slots available at the selected time.  Do you want to overbook this appointment?", "Clinical Scheduling",MessageBoxButtons.YesNo);
+					if (dr != DialogResult.Yes)
+					{
+						return;
+					}
+				}
+
+				//Display a dialog to collect Patient Name
+				DPatientLookup dPat = new DPatientLookup();
+				dPat.DocManager = m_DocManager;
+				
+				int nAccessTypeID = 0;
+				bRet = calendarGrid1.GetSelectedType(out nAccessTypeID);
+
+				if (dPat.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				appt.PatientID = Convert.ToInt32(dPat.PatientIEN);
+				appt.PatientName = dPat.PatientName;
+				appt.StartTime = dStart;
+				appt.EndTime = dEnd;
+				appt.Resource = sResource;
+				appt.HealthRecordNumber = dPat.HealthRecordNumber;
+
+				/*
+				 * 8-10-05 Copied overbook prompt for walkin
+				 * to this position in order to check just prior
+				 * to calling CreateAppointment
+				*/
+				this.Document.RefreshDocument();
+				m_nSlots = m_Document.SlotsAvailable(dStart, dEnd, sResource, out sAccessType, out sAvailabilityMessage);
+
+				if (m_nSlots < 1)
+				{
+					DialogResult dr = MessageBox.Show(this, "There are no slots available at the selected time.  Do you want to overbook this appointment?", "Clinical Scheduling",MessageBoxButtons.YesNo);
+					if (dr != DialogResult.Yes)
+					{
+						return;
+					}
+				}
+
+				//Call Document to add a walkin appointment
+				int nApptID = this.Document.CreateAppointment(appt, true);
+
+				//Now check them in.
+				calendarGrid1.SelectedAppointment = nApptID;
+
+				AppointmentCheckIn();
+
+				try
+				{
+					RaiseRPMSEvent("BSDX SCHEDULE" , m_Document.DocName);
+				}
+				catch (Exception ex)
+				{
+					Debug.Write(ex.Message);
+				}
+			
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to add walk-in appointment  " +  ex.Message, "Clinical Scheduling");
+				return;
+
+			}
+		}
+
+		private void AppointmentAddNew() 
+		{
+			try
+			{
+				CGAppointment appt = new CGAppointment();
+			
+				//Get Time and Resource from Selected Cell
+				DateTime dStart = DateTime.Today;
+				DateTime dEnd = DateTime.Today;
+				string sResource = "";
+				bool bRet = this.calendarGrid1.GetSelectedTime(out dStart, out dEnd, out sResource);
+				if (bRet == false)
+					return;
+				
+				//Test dStart for Holiday
+				DataView dvHoliday = new DataView(this.DocManager.GlobalDataSet.Tables["HOLIDAY"]);
+				dvHoliday.Sort="DATE ASC";
+				int nFind = dvHoliday.Find(dStart.Date);
+				if (nFind > -1)
+				{
+					string sHoliday = "";
+					DataRowView drv = dvHoliday[nFind];
+					sHoliday = drv["NAME"].ToString();
+					if (MessageBox.Show(this, dStart.ToShortDateString() + " is a holiday (" + sHoliday + ").  Are you sure you want to make this appointment?","Clinical Scheduling", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
+						return;
+				}
+				
+				TimeSpan tsDuration = dEnd - dStart;
+				int nDuration = (int) tsDuration.TotalMinutes;
+				Debug.Assert(nDuration > 0);
+
+				this.Document.RefreshDocument();
+				string sAccessType = "";
+				string sAvailabilityMessage = "";
+				m_nSlots = m_Document.SlotsAvailable(dStart, dEnd, sResource, out sAccessType, out sAvailabilityMessage);
+
+				if (m_nSlots < 1)
+				{
+					DialogResult dr = MessageBox.Show(this, "There are no slots available at the selected time.  Do you want to overbook this appointment?", "Clinical Scheduling",MessageBoxButtons.YesNo);
+					if (dr != DialogResult.Yes)
+					{
+						return;
+					}
+				}
+
+				//Display a dialog to collect Patient Name
+				DPatientLookup dPat = new DPatientLookup();
+				dPat.DocManager = m_DocManager;
+				
+				int nAccessTypeID = 0;
+				bRet = calendarGrid1.GetSelectedType(out nAccessTypeID);
+
+				if (dPat.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				//Call the appointment dialog to collect the appointment info
+				Debug.Assert(dPat.PatientIEN != "");
+				DAppointPage dAppt = new DAppointPage();			
+				dAppt.DocManager = this.m_DocManager;
+				string sNote = "";
+				dAppt.InitializePage(dPat.PatientIEN, dStart, nDuration, sResource, sNote);
+
+				if (dAppt.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				appt.PatientID = Convert.ToInt32(dPat.PatientIEN);
+				appt.PatientName = dPat.PatientName;
+				appt.StartTime = dStart;
+				appt.EndTime = dEnd;
+				appt.Resource = sResource;
+				appt.Note = dAppt.Note;
+				appt.HealthRecordNumber = dPat.HealthRecordNumber;
+				appt.AccessTypeID = nAccessTypeID;
+
+				//Call Document to add a new appointment
+				this.Document.CreateAppointment(appt);
+                this.Document.RefreshDocument();
+
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to add new appointment  " +  ex.Message, "Clinical Scheduling");
+				return;
+
+			}
+			try
+			{
+				RaiseRPMSEvent("BSDX SCHEDULE" , m_Document.DocName);
+				this.calendarGrid1.Invalidate();
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}
+
+		public void OnUpdateSchedule()
+		{
+			try
+			{
+				this.Cursor = Cursors.WaitCursor;
+				m_Document.RefreshDocument();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to refresh document " +  ex.Message, "Clinical Scheduling");
+			}
+			finally
+			{
+				this.Cursor = Cursors.Default;
+			}
+		}
+
+		public void UpdateArrays()
+		{
+			Debug.Assert(this.InvokeRequired == false,"CGView.UpdateArrays InvokeRequired");
+			try 
+			{
+				this.calendarGrid1.AvailabilityArray = this.m_Document.AvailabilityArray;
+				this.calendarGrid1.Resources = this.m_Document.Resources;
+				this.calendarGrid1.OnUpdateArrays();
+				this.lblResource.Text = this.m_Document.DocName;
+				this.calendarGrid1.Invalidate();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to update arrays " +  ex.Message, "Clinical Scheduling");
+			}
+		}
+
+		public void RaiseRPMSEvent(string sEvent, string sParams)
+		{
+			try
+			{
+				//Signal RPMS to raise an event
+				m_ConnectInfo.RaiseEvent(sEvent, sParams, true);
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}
+
+        private void SchedulingManagement()
+        {
+            try
+            {
+                bool bLock = DocManager.ConnectInfo.Lock("^BSDXMGR", "+", "");
+                if (bLock == false)
+                {
+                    throw new Exception("Another user is currently in Scheduling Management.  Try later.");
+                }
+
+                DManagement dMgm = new DManagement();
+                dMgm.InitializeDialog(this.m_DocManager);
+
+                if (dMgm.ShowDialog(this) == DialogResult.Cancel)
+                {
+                }
+
+                m_DocManager.GlobalDataSet.Tables["ResourceUser"].Clear();
+                m_DocManager.LoadResourceUserTable(false);
+                bLock = DocManager.ConnectInfo.bmxNetLib.Lock("^BSDXMGR", "-");
+            }
+            catch (ApplicationException aex)
+            {
+                string sMsg = aex.Message;
+                MessageBox.Show("Unable to acquire transmit lock.  Try later.");
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show("Scheduling Management Error:  " + ex.Message, "Clinical Scheduling");
+            }
+        }
+
+        public void UpdateTree()
+        {
+            this.tvSchedules.Nodes.Clear();
+            this.LoadTree();
+        }
+
+        public void ViewPatientAppointments()
+        {
+            try
+            {
+                //Display a dialog to collect Patient Name
+                DPatientLookup dPat = new DPatientLookup();
+                dPat.DocManager = m_DocManager;
+                if (dPat.ShowDialog(this) == DialogResult.Cancel)
+                {
+                    return;
+                }
+
+                Debug.Assert(dPat.PatientIEN != "");
+                int nPatientID = Convert.ToInt32(dPat.PatientIEN);
+                ViewPatientAppointments(nPatientID);
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(this, ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+            }
+        }
+
+        public void ViewPatientAppointments(int PatientID)
+        {
+            DPatientApptDisplay dPa = new DPatientApptDisplay();
+
+            dPa.InitializeForm(this.DocManager, PatientID);
+
+
+            if (dPa.ShowDialog(this) != DialogResult.Cancel)
+            {
+
+            }
+
+        }
+
+        private void FindAvailableAppointment(ArrayList alResourceArray)
+        {
+            DApptSearch dSearch = new DApptSearch();
+            dSearch.InitializePage(alResourceArray, this.m_DocManager);
+            if (dSearch.ShowDialog(this) == DialogResult.Cancel)
+                return;
+
+            string sResource = dSearch.SelectedResource;
+            ArrayList alResource = new ArrayList();
+            alResource.Add(sResource);
+            DateTime sDate = dSearch.SelectedDate;
+            m_sDocName = sResource;
+            OpenSelectedSchedule(alResource, sDate);
+
+        }
+
+        #endregion Methods
+
+		#region Events
+
+		private void CGView_Load(object sender, System.EventArgs e)
+		{
+			Debug.Assert (this.Document != null);
+
+			//Register the view
+			CGDocumentManager.Current.RegisterDocumentView(this.Document, this);
+            this.mnu5Day.Click += new System.EventHandler(this.dateTimePicker1_ValueChanged); // MJL 1/17/2007
+            this.mnu7Day.Click += new System.EventHandler(this.dateTimePicker1_ValueChanged);
+
+			//Load the Group-Resource treeview
+			LoadTree();
+
+			this.SetDesktopLocation(this.DesktopLocation.X + 10, this.DesktopLocation.Y + 10);
+		}
+
+		private void mnuOpenSchedule_Click(object sender, System.EventArgs e)
+		{
+			CreateNewSchedule();
+		}
+
+		private void mnu1Day_Click(object sender, System.EventArgs e)
+		{
+			DateTime dtPicker = dateTimePicker1.Value;
+			DateTime DayOnly = new DateTime(dtPicker.Year, dtPicker.Month, dtPicker.Day);
+			this.calendarGrid1.StartDate = DayOnly;
+			this.calendarGrid1.Columns = 1;
+		}
+
+		private void mnu5Day_Click(object sender, System.EventArgs e)
+		{
+			if (this.calendarGrid1.Columns == 1)
+			{
+				this.StartDate = this.Document.StartDate;
+			}
+
+			this.calendarGrid1.Columns = 5;
+            this.Document.m_nColumnCount = 5; // MJL 1/17/2007
+            //this.Document.UpdateAllViews();
+		}
+
+		private void mnu7Day_Click(object sender, System.EventArgs e)
+		{
+			this.calendarGrid1.Columns = 7;
+            this.Document.m_nColumnCount = 7; // MJL 1/17/2007
+        }
+
+		private void mnu10Minute_Click(object sender, System.EventArgs e)
+		{
+			CalendarGrid cg = this.calendarGrid1;
+			cg.TimeScale = 10;
+			PositionGrid(cg, 7);
+		}
+
+		private void mnu15Minute_Click(object sender, System.EventArgs e)
+		{
+			CalendarGrid cg = this.calendarGrid1;
+			cg.TimeScale = 15;
+			PositionGrid(cg, 7);
+		}
+
+		private void mnu20Minute_Click(object sender, System.EventArgs e)
+		{
+			CalendarGrid cg = this.calendarGrid1;
+			cg.TimeScale = 20;
+			PositionGrid(cg, 7);
+		}
+
+		private void mnu30Minute_Click(object sender, System.EventArgs e)
+		{
+			CalendarGrid cg = this.calendarGrid1;
+			cg.TimeScale = 30;
+			PositionGrid(cg, 7);
+		}
+
+		private void mnuViewScheduleTree_Click(object sender, System.EventArgs e)
+		{
+			this.mnuViewScheduleTree.Checked = this.tvSchedules.Visible;
+			this.tvSchedules.Visible = !(this.tvSchedules.Visible);
+			this.mnuViewScheduleTree.Checked = !(this.mnuViewScheduleTree.Checked);
+		}
+
+		private void tvSchedules_Click(object sender, System.EventArgs e)
+		{
+			bSchedulesClicked = true;
+		}
+
+		private void tvSchedules_DoubleClick(object sender, System.EventArgs e)
+		{
+			if (m_alSelectedTreeResourceArray == null)
+				return;
+			if (m_alSelectedTreeResourceArray.Count < 1)
+			{
+				if (this.tvSchedules.SelectedNode.Text != "")
+				{
+					SetResourceArrayFromGroup(tvSchedules.SelectedNode.Text);
+				}
+				else
+				{
+					return;
+				}
+			}
+			OpenSelectedSchedule(m_alSelectedTreeResourceArray, DateTime.Today);
+		}
+
+		//20041109 Added
+		private void SetResourceArrayFromGroup(string sGroup)
+		{
+			//Navigate from ResourceGroup table to Resources table
+			DataRow[] arrRows;
+			DataRelation dr = DocManager.GlobalDataSet.Relations["GroupResource"];
+			DataRow r = DocManager.GlobalDataSet.Tables["ResourceGroup"].Rows.Find(sGroup);
+			arrRows = r.GetChildRows(dr);
+			for (int i=0; i< arrRows.Length; i++) 
+			{
+				string sResource = arrRows[i]["RESOURCE_NAME"].ToString();
+				m_alSelectedTreeResourceArray.Add(sResource);
+			}
+			m_sDocName = sGroup;
+		}
+
+		public void SyncTree()
+		{
+
+        }
+
+		private void tvSchedules_BeforeSelect(object sender, System.Windows.Forms.TreeViewCancelEventArgs e)
+		{
+
+		}
+
+		private void tvSchedules_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
+		{
+			if (bSchedulesClicked == false)
+				return;
+			bSchedulesClicked = false;
+			
+			m_alSelectedTreeResourceArray = new ArrayList();
+			string sResource = e.Node.FullPath;
+			string[] ss = sResource.Split((char) 92);
+			int l = ss.GetUpperBound(0);
+
+			if (l == 0) //a resource group was checked, so get all underying resources 
+			{
+				SetResourceArrayFromGroup(ss[0]);
+			}
+			else 
+			{
+				sResource = ss[l];
+				m_alSelectedTreeResourceArray.Add(ss[1]);
+			}
+
+			m_sDocName = ss[l];
+			return;
+
+		}
+
+		private void mnuTest1_Click(object sender, System.EventArgs e)
+		{
+			ReaderWriterLock m_rwl = this.DocManager.ConnectInfo.bmxNetLib.BMXRWL;
+			try
+			{
+				m_rwl.AcquireWriterLock(50);
+				Debug.Write("\nTest Button 1 Acquired first lock\n");
+				m_rwl.AcquireWriterLock(50);
+				Debug.Write("Test Button 1 Acquired second lock\n");
+				this.DocManager.ViewRefresh();
+				Thread.Sleep(5000);
+				try
+				{
+				}
+				catch
+				{
+				}
+				finally
+				{
+					m_rwl.ReleaseWriterLock();
+					Debug.Write ("Test Button 1 released first lock.\n");
+					m_rwl.ReleaseWriterLock();
+					Debug.Write ("Test Button 1 released second lock.\n");
+				}
+
+				return;
+			}
+			catch (Exception ex)
+			{
+				Debug.Write("Test Button 1 exception: " + ex.Message + "\n");
+			}
+		}
+
+		private void CGView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+		{
+			try
+			{
+				m_ConnectInfo.BMXNetEvent -= m_bmxDelegate;
+				this.calendarGrid1.CloseGrid();
+			}
+			catch (Exception ex)
+			{
+				Debug.Write("CGView_Closing exception: " + ex.Message + "\n");
+			}
+		}
+
+		private void mnuViewRightPanel_Click(object sender, System.EventArgs e)
+		{
+			this.mnuViewRightPanel.Checked = this.panelRight.Visible;
+			this.panelRight.Visible = !(this.panelRight.Visible);
+			this.mnuViewRightPanel.Checked = !(this.mnuViewRightPanel.Checked);
+		}
+
+		private void dateTimePicker1_ValueChanged(object sender, System.EventArgs e)
+		{
+			DateTime dDate = dateTimePicker1.Value;
+			dDate = dDate.Date;
+			this.Document.SelectedDate = dDate;
+			if (this.Document.Resources.Count == 1) 
+			{
+				if (this.calendarGrid1.Columns > 1)
+				{
+					this.StartDate = this.Document.StartDate;
+				}
+				else
+				{
+					this.StartDate = this.Document.SelectedDate;
+				}
+			}
+			else
+			{
+					this.StartDate = this.Document.SelectedDate;
+			}
+			this.Document.UpdateAllViews();
+			this.calendarGrid1.Invalidate();
+		}
+
+		private void calendarGrid1_CGSelectionChanged(object sender, IndianHealthService.ClinicalScheduling.CGSelectionChangedArgs e)
+		{
+			string sAccessType = "";
+			string sAvailabilityMessage = "";
+			m_nSlots = m_Document.SlotsAvailable(e.StartTime, e.EndTime, e.Resource, out sAccessType, out sAvailabilityMessage);
+			UpdateStatusBar(e.StartTime, e.EndTime, sAccessType, sAvailabilityMessage);
+		}
+
+		private void calendarGrid1_CGAppointmentChanged(object sender, IndianHealthService.ClinicalScheduling.CGAppointmentChangedArgs e)
+		{
+			try
+			{
+				if (e.Appointment.CheckInTime.Ticks > 0)
+				{
+					MessageBox.Show("You cannot change the appointment time because the patient has already checked in.", "Clinical Scheduling",  MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
+					return;
+				}
+
+				if (EditAppointmentEnabled(e.Resource) == false)
+					return;
+				if (EditAppointmentEnabled(e.Appointment.Resource) == false)
+					return;
+
+				if (MessageBox.Show("Are you sure you want to move this appointment?", "Clinical Scheduling",  MessageBoxButtons.YesNo) != DialogResult.Yes)
+					return;
+
+				//20040909 Cherokee Replaced this block with following
+				string sAccessType = "";
+				string sAvailabilityMessage = "";
+				//				if (m_Document.SlotsAvailable(e.StartTime, e.EndTime, e.Resource, out sAccessType, out sAvailabilityMessage) < 1)
+				//				{
+				//					MessageBox.Show("There are no appointment slots available for the selected time.");
+				//					return;
+				//				}
+				bool bOverbook =false;
+				if (m_htOverbook.Count > 0)
+				{
+					bOverbook = (bool) this.m_htOverbook[e.Resource.ToString()];
+				}
+				bool bModSchedule =false;
+				if (m_htModifySchedule.Count > 0)
+				{
+					bModSchedule =  (bool) this.m_htModifySchedule[e.Resource.ToString()];
+				}
+				bool bSlotsAvailable = (m_Document.SlotsAvailable(e.StartTime, e.EndTime, e.Resource, out sAccessType, out sAvailabilityMessage) > 0);
+				if (!((bSlotsAvailable) || (bModSchedule) || (bOverbook) ))
+				{
+					MessageBox.Show("There are no appointment slots available for the selected time.");
+					return;
+				}
+
+				/*
+				 * 7-19-05 Added overbook prompt
+				*/
+				if (bSlotsAvailable == false)
+				{
+					DialogResult dr = MessageBox.Show(this, "There are no slots available at the selected time.  Do you want to overbook this appointment?", "Clinical Scheduling",MessageBoxButtons.YesNo);
+					if (dr != DialogResult.Yes)
+					{
+						return;
+					}
+				}
+
+				e.Appointment.StartTime = e.StartTime;
+				e.Appointment.EndTime = e.EndTime;
+				e.Appointment.Resource = e.Resource;
+				e.Appointment.AccessTypeID = e.AccessTypeID;
+				m_Document.CreateAppointment(e.Appointment);
+			
+				string sError = AppointmentDeleteOne(e.Appointment.AppointmentKey);
+				if (sError != "")
+				{
+					MessageBox.Show(sError);
+					return;
+				}
+
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to change appointment  " +  ex.Message, "Clinical Scheduling");
+				this.m_DocManager.UpdateViews();
+				return;
+			}
+			finally
+			{
+
+            }
+			try
+			{
+				RaiseRPMSEvent("BSDX SCHEDULE"  , e.Resource);
+				if (e.Resource != e.OldResource)
+					RaiseRPMSEvent("BSDX SCHEDULE", e.OldResource);
+				this.m_DocManager.UpdateViews(e.Resource, e.OldResource);
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}
+
+		private void mnuSchedulingManagment_Click(object sender, System.EventArgs e)
+		{
+			SchedulingManagement();
+		}
+
+		private void mnuFile_Popup(object sender, System.EventArgs e)
+		{
+			this.mnuSchedulingManagment.Enabled = DocManager.ScheduleManager;
+		}
+
+		private void mnuFindAppt_Click(object sender, System.EventArgs e)
+		{
+			FindAvailableAppointment(this.Document.Resources);
+		}
+
+		private void mnuRPMSServer_Click(object sender, System.EventArgs e)
+		{
+			//Handled by DocumentManager class
+		}
+
+		private void mnuRPMSLogin_Click(object sender, System.EventArgs e)
+		{
+			//Handled by DocumentManager class
+		}
+
+		private void CGView_Activated(object sender, System.EventArgs e)
+		{
+			calendarGrid1.GridEnter = true;
+		}
+
+		private void mnuHelpAbout_Click(object sender, System.EventArgs e)
+		{
+			MessageBox.Show("Clinical Scheduling Version " + Application.ProductVersion, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Information);	
+		}
+
+		private void ImplementMsg()
+		{
+			MessageBox.Show("Clinical Scheduling", "TODO: Implement this function");
+		}
+
+		private void mnuClose_Click(object sender, System.EventArgs e)
+		{
+			DialogResult dr = MessageBox.Show("Are you sure you want to close this schedule?", Application.ProductName, MessageBoxButtons.OKCancel);
+			if (dr != DialogResult.OK)
+				return;
+
+			this.Close();
+		}
+
+		private void mnuViewPatientAppts_Click(object sender, System.EventArgs e)
+		{
+			ViewPatientAppointments();
+		}
+
+		private void lstClip_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
+		{
+			bool b = e.Data.GetDataPresent(typeof(CGAppointment));
+			if (b == true)
+			{
+				e.Effect = DragDropEffects.Move;
+			}
+			else
+			{
+				e.Effect = DragDropEffects.None;
+			}
+
+		}
+
+		private void lstClip_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
+		{
+			try
+			{
+				CGAppointment a = (CGAppointment) e.Data.GetData(typeof(CGAppointment));
+				if (m_ClipList.AppointmentTable.Contains((int) a.AppointmentKey))
+				{
+					return;
+				}
+				m_ClipList.AddAppointment(a);
+				lstClip.Items.Add(a);
+			}
+			catch(Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+
+		}
+
+		private void lstClip_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
+		{
+			m_bDragDropStart = false;
+		}
+
+		private void lstClip_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
+		{
+			try
+			{
+				if ((m_bDragDropStart == false)&&(lstClip.SelectedIndex > -1))
+				{
+					CGAppointment a = (CGAppointment) lstClip.Items[lstClip.SelectedIndex];
+					this.calendarGrid1.ApptDragSource = "list";
+					DragDropEffects effect = DoDragDrop(a, DragDropEffects.Move);
+					m_bDragDropStart = true;
+				}
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}
+
+		private void calendarGrid1_CGAppointmentAdded(object sender, IndianHealthService.ClinicalScheduling.CGAppointmentChangedArgs e)
+		{
+			try
+			{
+				string sAccessType = "";
+				string sAvailabilityMessage = "";
+				bool	bSlotsAvailable;
+				bool	bOverbook;
+				bool	bModSchedule;
+				bool	bModAppts;
+
+				if (this.EditAppointmentEnabled(e.Appointment.Resource) == false)
+					return;
+				
+				bModAppts = (bool) this.m_htChangeAppts[e.Resource.ToString()];
+				if (bModAppts == false)
+					return;
+
+				bOverbook = (bool) this.m_htOverbook[e.Resource.ToString()];
+				bModSchedule =  (bool) this.m_htModifySchedule[e.Resource.ToString()];
+				bSlotsAvailable = (m_Document.SlotsAvailable(e.StartTime, e.EndTime, e.Resource, out sAccessType, out sAvailabilityMessage) > 0);
+
+				if (!((bSlotsAvailable) || (bModSchedule) || (bOverbook) ))
+				{
+					MessageBox.Show("There are no appointment slots available for the selected time.");
+					return;
+				}
+
+				/*
+				 * 7-19-05 Added overbook prompt
+				*/
+				if (bSlotsAvailable == false)
+				{
+					DialogResult dr = MessageBox.Show(this, "There are no slots available at the selected time.  Do you want to overbook this appointment?", "Clinical Scheduling",MessageBoxButtons.YesNo);
+					if (dr != DialogResult.Yes)
+					{
+						return;
+					}
+				}
+
+				e.Appointment.StartTime = e.StartTime;
+				e.Appointment.EndTime = e.EndTime;
+				e.Appointment.Resource = e.Resource;
+				e.Appointment.AccessTypeID = e.AccessTypeID;
+				m_Document.CreateAppointment(e.Appointment);
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show("Unable to add new appointment  " +  ex.Message, "Clinical Scheduling");
+				return;
+			}
+			try
+			{
+				RaiseRPMSEvent("BSDX SCHEDULE"  , e.Resource);
+				if (e.Resource != e.OldResource)
+					RaiseRPMSEvent("BSDX SCHEDULE", e.OldResource);
+				this.m_DocManager.UpdateViews(e.Resource, e.OldResource);
+			}
+			catch (Exception ex)
+			{
+				Debug.Write(ex.Message);
+			}
+		}
+
+		private void lstClip_SelectedIndexChanged(object sender, System.EventArgs e)
+		{
+
+		}
+
+		private void mnuPrintClinicSchedules_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				DSelectLetterClinics ds = new DSelectLetterClinics();
+				ds.InitializePage(this.m_DocManager.GlobalDataSet, "Print Clinic Schedules");
+				ds.SetupForReports();
+				if (ds.ShowDialog(this) != DialogResult.OK)
+					return;
+
+				//get the resource names and call the letter printer
+
+				string sClinics = ds.SelectedClinics;
+				DateTime dtBegin = ds.BeginDate;
+				DateTime dtEnd = ds.EndDate;
+
+				DPatientLetter dpl = new DPatientLetter();
+				dpl.InitializeFormClinicSchedule(this.DocManager, sClinics, dtBegin, dtEnd);
+				dpl.ShowDialog(this);
+
+			}
+			catch(Exception ex)
+			{
+				MessageBox.Show(this, ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+			}
+		}
+
+		private void mnuPrintReminderLetters_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				DSelectLetterClinics ds = new DSelectLetterClinics();
+				ds.InitializePage(this.m_DocManager.GlobalDataSet, "Print Reminder Letters");
+				if (ds.ShowDialog(this) != DialogResult.OK)
+					return;
+
+				//get the resource names and call the letter printer
+
+				string sClinics = ds.SelectedClinics;
+				DateTime dtBegin = ds.BeginDate;
+				DateTime dtEnd = ds.EndDate;
+
+				DPatientLetter dpl = new DPatientLetter();
+				dpl.InitializeFormPatientReminderLetters(this.DocManager, sClinics, dtBegin, dtEnd);
+				dpl.ShowDialog(this);
+
+			}
+			catch(Exception ex)
+			{
+				MessageBox.Show(this, ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+			}
+			
+		}
+
+		private void mnuPrintRebookLetters_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				DSelectLetterClinics ds = new DSelectLetterClinics();
+				ds.InitializePage(this.m_DocManager.GlobalDataSet, "Print Clinic Rebook Letters");
+				if (ds.ShowDialog(this) != DialogResult.OK)
+					return;
+
+				//Call the letter printer
+				DPatientLetter dpl = new DPatientLetter();
+                dpl.InitializeFormRebookLetters(this.DocManager, ds.SelectedClinics, ds.BeginDate, ds.EndDate);
+				dpl.ShowDialog(this);
+
+			}
+			catch(Exception ex)
+			{
+				MessageBox.Show(this, ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+			}		
+		}
+
+		private void mnuPrintPatientLetter_Click(object sender, System.EventArgs e)
+		{
+			ViewPatientAppointments();
+		}
+
+		private void mnuRPMSDivision_Click(object sender, System.EventArgs e)
+		{
+			this.DocManager.ChangeDivision(this);
+		}
+
+		private void CGView_CursorChanged(object sender, System.EventArgs e)
+		{
+
+		}
+
+		private void mnuDisplayWalkIns_Click(object sender, System.EventArgs e)
+		{
+			calendarGrid1.DrawWalkIns = !(calendarGrid1.DrawWalkIns);
+			mnuDisplayWalkIns.Checked = calendarGrid1.DrawWalkIns;
+			calendarGrid1.SetOverlapTable();
+			calendarGrid1.Refresh();
+		}
+
+		private void mnuOpenMultipleSchedules_Click(object sender, System.EventArgs e)
+		{
+			
+			try
+			{
+				DSelectSchedules ds = new DSelectSchedules();
+				ds.InitializePage(this.m_DocManager.GlobalDataSet, "Open Multiple Schedules");
+				if (ds.ShowDialog(this) != DialogResult.OK)
+					return;
+
+				//get the resource names and open schedules
+
+				ArrayList sResources = ds.SelectedClinics;
+				if (ds.SingleWindow == true)
+				{
+					m_sDocName = (ds.GroupWindowName == "")?"Multiple Selected Schedules":ds.GroupWindowName;
+					OpenSelectedSchedule( sResources, DateTime.Today);
+				}
+				else
+				{
+					foreach (string sResource in sResources)
+					{
+						ArrayList alSingle = new ArrayList(1);
+						alSingle.Add(sResource);
+						m_sDocName = sResource;
+						OpenSelectedSchedule( alSingle, DateTime.Today);
+					}
+				}
+				return;
+
+			}
+			catch(Exception ex)
+			{
+				MessageBox.Show(this, ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+			}
+
+		}
+
+		private void ctxCalGridWalkin_Click(object sender, System.EventArgs e)
+		{
+			AppointmentAddWalkin();
+		}
+
+		private void mnuWalkIn_Click(object sender, System.EventArgs e)
+		{
+			AppointmentAddWalkin();
+		}
+
+		private void mnuPrintCancellationLetters_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				DSelectLetterClinics ds = new DSelectLetterClinics();
+				ds.InitializePage(this.m_DocManager.GlobalDataSet, "Print Clinic Cancellation Letters");
+				if (ds.ShowDialog(this) != DialogResult.OK)
+					return;
+
+				//get the resource names and call the letter printer
+
+				string sClinics = ds.SelectedClinics;
+				DateTime dtBegin = ds.BeginDate;
+				DateTime dtEnd = ds.EndDate;
+
+				DPatientLetter dpl = new DPatientLetter();
+				
+				dpl.InitializeFormCancellationLetters(this.DocManager, sClinics, dtBegin, dtEnd);
+				dpl.ShowDialog(this);
+			}
+			catch(Exception ex)
+			{
+				MessageBox.Show(this, ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+			}
+        }
+
+        private void printRoutingSlip_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
+        {
+            int nApptID = this.calendarGrid1.SelectedAppointment;
+            CGAppointment a = (CGAppointment)this.Appointments.AppointmentTable[nApptID];
+            ClinicalScheduling.Printing.PrintRoutingSlip(a, "Routing Slip", e);
+        }
+
+
+        #endregion events
+
+
+
+
+
+
+    }//End class
+}
Index: Scheduling/branches/GUI1.2/CGView.resx
===================================================================
--- Scheduling/branches/GUI1.2/CGView.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/CGView.resx	(revision 855)
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="mainMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="contextMenu1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>126, 17</value>
+  </metadata>
+  <metadata name="ctxApptClipMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>248, 17</value>
+  </metadata>
+  <metadata name="ctxCalendarGrid.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>382, 17</value>
+  </metadata>
+  <data name="calendarGrid1.Resources" mimetype="application/x-microsoft.net.object.binary.base64">
+    <value>
+        AAEAAAD/////AQAAAAAAAAAEAQAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuQXJyYXlMaXN0AwAAAAZfaXRl
+        bXMFX3NpemUIX3ZlcnNpb24FAAAICAkCAAAAAAAAAAAAAAAQAgAAAAAAAAAL
+</value>
+  </data>
+  <metadata name="printRoutingSlip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>512, 17</value>
+  </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>75</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAABAAMAICAQAAAAAADoAgAANgAAABAQEAAAAAAAKAEAAB4DAAAwMBAAAAAAAGgGAABGBAAAKAAAACAA
+        AABAAAAAAQAEAAAAAACAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICA
+        AACAgIAAwMDAAAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARE
+        QP////////////////AERED////////////////wCIiA8ADwAPAA8ADwAPAA8AREQP//////////////
+        //AERED////////////////wCIiA8ADwAPAA8ADwAPAA8AREQP////////////////AERED/////////
+        ///////wCIiA8ADwAPAA8ADwAPAA8AREQP////////////////AERED////////////////wCIiA8ADw
+        APAA8ADwAPAA8AREQP////////////////AERED////////////////wCIiA8ADwAPAA8ADwAPAA8ARE
+        QP////////////////AERED////////////////wBERAAAAAAAAAAAAAAAAAAARERESERIREhESERIRE
+        hEAEREREhESERIREhESERIRABERERIREhESERIREhESEQARERESERIREhESERIREhEAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAP////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAD/////////////////////KAAAABAAAAAgAAAAAQAEAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAIAAAIAAAACAgACAAAAAgACAAICAAADAwMAAgICAAAAA/wAA/wAAAP//AP8AAAD/AP8A//8AAP//
+        /wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdw//////AABEDw8PDw8AAHcP/////wAARA8PDw8PAAB3
+        D/////8AAEQPDw8PDwAAdw//////AABEAAAAAAAAAERHR0dHRwAAREdHR0dHAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAP//AAD//wAAgAEAAIABAAiAAcAAgAEAAIABAACAAQAIgAHAAIABAACAAQAAgAEACIAB
+        AACAAQAA//8AAP//AAgoAAAAMAAAAGAAAAABAAQAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        gAAAgAAAAICAAIAAAACAAIAAgIAAAICAgADAwMAAAAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABE
+        REQP////////////////////////8ABEREQP////////////////////////8ABEREQP////////////
+        ////////////8ABIiIQP8AAP8AAP8AAP8AAP8AAP8AAP8ABEREQP////////////////////////8ABE
+        REQP////////////////////////8ABEREQP////////////////////////8ABIiIQP8AAP8AAP8AAP
+        8AAP8AAP8AAP8ABEREQP////////////////////////8ABEREQP////////////////////////8ABE
+        REQP////////////////////////8ABIiIQP8AAP8AAP8AAP8AAP8AAP8AAP8ABEREQP////////////
+        ////////////8ABEREQP////////////////////////8ABEREQP////////////////////////8ABI
+        iIQP8AAP8AAP8AAP8AAP8AAP8AAP8ABEREQP////////////////////////8ABEREQP////////////
+        ////////////8ABEREQP////////////////////////8ABIiIQP8AAP8AAP8AAP8AAP8AAP8AAP8ABE
+        REQP////////////////////////8ABEREQP////////////////////////8ABEREQP////////////
+        ////////////8ABEREQAAAAAAAAAAAAAAAAAAAAAAAAAAABEREREREREREREREREREREREREREREQABE
+        RERERIRERIRERIRERIRERIRERIREQABERERERIRERIRERIRERIRERIRERIREQABERERERIRERIRERIRE
+        RIRERIRERIREQABERERERIRERIRERIRERIRERIRERIREQABEREREREREREREREREREREREREREREQAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+        AAAAAAAAAAAAAP///////wAA////////AAD///////8AAP///////wAA////////AAD///////8AAP//
+        /////wAA////////AAD///////8AAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAgAAAAAAA
+        AACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAA
+        AAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAgAAAAAAA
+        AACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAIAA
+        AAAAAAAAgAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAgAAAAAAAAAD///////8AAP///////wAA////////
+        AAD///////8AAP///////wAA////////AAD///////8AAA==
+</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/CGViewOld.resx
===================================================================
--- Scheduling/branches/GUI1.2/CGViewOld.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/CGViewOld.resx	(revision 855)
@@ -0,0 +1,592 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="mainMenu1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mainMenu1.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </data>
+  <data name="mainMenu1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuFile.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuFile.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuOpenSchedule.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuOpenSchedule.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="menuItem1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="menuItem1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuRPMSServer.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Assembly</value>
+  </data>
+  <data name="mnuRPMSServer.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuRPMSLogin.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Assembly</value>
+  </data>
+  <data name="mnuRPMSLogin.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="menuItem3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="menuItem3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuSchedulingManagment.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuSchedulingManagment.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuPrint.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuPrint.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuClose.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuClose.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuAppointment.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuAppointment.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuNewAppointment.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuNewAppointment.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuEditAppointment.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuEditAppointment.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuDeleteAppointment.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuDeleteAppointment.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuCopyAppointment.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuCopyAppointment.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="menuItem2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="menuItem2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuFindAppt.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuFindAppt.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuCheckIn.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuCheckIn.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuViewPatientAppts.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuViewPatientAppts.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuCalendar.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuCalendar.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu1Day.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu1Day.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu5Day.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu5Day.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu7Day.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu7Day.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="menuItem4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="menuItem4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuTimeScale.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuTimeScale.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu10Minute.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu10Minute.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu15Minute.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu15Minute.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu20Minute.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu20Minute.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu30Minute.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnu30Minute.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuViewScheduleTree.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuViewScheduleTree.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuViewRightPanel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuViewRightPanel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuHelp.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuHelp.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuHelpAbout.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuHelpAbout.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuTest.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuTest.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuTest1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuTest1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tvSchedules.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tvSchedules.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tvSchedules.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="contextMenu1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="contextMenu1.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>126, 17</value>
+  </data>
+  <data name="contextMenu1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxOpenSchedule.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxOpenSchedule.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxEditAvailability.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxEditAvailability.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxProperties.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxProperties.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxFindAppt.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxFindAppt.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelRight.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelRight.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panelRight.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelRight.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panelRight.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelRight.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelClip.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelClip.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panelClip.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelClip.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panelClip.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelClip.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lstClip.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lstClip.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lstClip.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxApptClipMenu.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxApptClipMenu.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>248, 17</value>
+  </data>
+  <data name="ctxApptClipMenu.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuRemoveClipItem.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuRemoveClipItem.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuClearClipItems.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="mnuClearClipItems.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelTop.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelTop.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panelTop.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelTop.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panelTop.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelTop.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="dateTimePicker1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="dateTimePicker1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="dateTimePicker1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblResource.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblResource.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblResource.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelCenter.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelCenter.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panelCenter.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelCenter.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panelCenter.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panelCenter.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxCalendarGrid.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxCalendarGrid.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>382, 17</value>
+  </data>
+  <data name="ctxCalendarGrid.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxCalGridAdd.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxCalGridAdd.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxCalGridEdit.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxCalGridEdit.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxCalGridDelete.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxCalGridDelete.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxCalGridCheckIn.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="ctxCalGridCheckIn.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelBottom.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelBottom.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panelBottom.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panelBottom.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panelBottom.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panelBottom.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="statusBar1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="statusBar1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="statusBar1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="splitter1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="splitter1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="splitter1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="splitter2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="splitter2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="splitter2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.Name">
+    <value>CGView</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>75</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/CalendarGrid.cs
===================================================================
--- Scheduling/branches/GUI1.2/CalendarGrid.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/CalendarGrid.cs	(revision 855)
@@ -0,0 +1,1277 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    using System.Collections;
+    using System.ComponentModel;
+    using System.Drawing;
+    using System.Globalization;
+    using System.Runtime.CompilerServices;
+    using System.Runtime.InteropServices;
+    using System.Windows.Forms;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    public class CalendarGrid : Panel
+    {
+        private Container components;
+        private Font fontArial10;
+        private Font fontArial8;
+        private CGAppointments m_Appointments;
+        private Hashtable m_ApptOverlapTable;
+        private bool m_bAutoDrag = true;
+        private bool m_bDragDropStart;
+        private bool m_bDrawWalkIns = true;
+        private bool m_bGridEnter;
+        private bool m_bInitialUpdate;
+        private bool m_bMouseDown;
+        private bool m_bScroll;
+        private bool m_bScrollDown;
+        private bool m_bSelectingRange;
+        private int m_cellHeight;
+        private int m_cellWidth;
+        private int m_col0Width;
+        private Hashtable m_ColumnInfoTable;
+        private CGCell m_currentCell;
+        private DateTime m_dtStart;
+        private Font m_fCell;
+        private string m_GridBackColor;
+        private CGCells m_gridCells;
+        private int m_nColumns = 5;
+        private int m_nSelectID;
+        private int m_nTimeScale = 20;
+        private ArrayList m_pAvArray;
+        private string m_sDragSource;
+        private CGAppointments m_SelectedAppointments;
+        private CGRange m_selectedRange;
+        private StringFormat m_sf;
+        private StringFormat m_sfHour;
+        private StringFormat m_sfRight;
+        private ArrayList m_sResourcesArray;
+        private Timer m_Timer;
+        private ToolTip m_toolTip;
+        private const int WM_HSCROLL = 0x114;
+        private const int WM_VSCROLL = 0x115;
+
+        public event CGAppointmentChangedHandler CGAppointmentAdded;
+
+        public event CGAppointmentChangedHandler CGAppointmentChanged;
+
+        public event CGSelectionChangedHandler CGSelectionChanged;
+
+        public CalendarGrid()
+        {
+            this.InitializeComponent();
+            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
+            base.SetStyle(ControlStyles.UserPaint, true);
+            base.SetStyle(ControlStyles.DoubleBuffer, true);
+            this.m_nColumns = 5;
+            this.m_gridCells = new CGCells();
+            this.m_selectedRange = new CGRange();
+            this.m_SelectedAppointments = new CGAppointments();
+            this.m_dtStart = new DateTime(0x7d3, 1, 0x1b);
+            this.m_ApptOverlapTable = new Hashtable();
+            this.m_ColumnInfoTable = new Hashtable();
+            this.m_sResourcesArray = new ArrayList();
+            base.ResizeRedraw = true;
+            this.m_col0Width = 100;
+            this.fontArial8 = new Font("Arial", 8f);
+            this.fontArial10 = new Font("Arial", 10f);
+            this.m_fCell = this.fontArial10;
+            this.m_sf = new StringFormat();
+            this.m_sfRight = new StringFormat();
+            this.m_sfHour = new StringFormat();
+            this.m_sf.LineAlignment = StringAlignment.Center;
+            this.m_sfRight.LineAlignment = StringAlignment.Center;
+            this.m_sfRight.Alignment = StringAlignment.Far;
+            this.m_sfHour.LineAlignment = StringAlignment.Center;
+            this.m_sfHour.Alignment = StringAlignment.Far;
+            this.m_bInitialUpdate = false;
+        }
+
+        private Rectangle AdjustRectForOverlap()
+        {
+            return new Rectangle();
+        }
+
+        private void AutoDragStart()
+        {
+            this.m_bAutoDrag = true;
+            this.m_Timer = new Timer();
+            this.m_Timer.Interval = 5;
+            this.m_Timer.Tick += new EventHandler(this.tickEventHandler);
+            this.m_Timer.Start();
+        }
+
+        private void AutoDragStop()
+        {
+            this.m_bAutoDrag = false;
+            if (this.m_Timer != null)
+            {
+                this.m_Timer.Stop();
+                this.m_Timer.Dispose();
+                this.m_Timer = null;
+            }
+        }
+
+        private void BuildGridCellsArray(Graphics g)
+        {
+            try
+            {
+                SizeF ef = g.MeasureString("Test", this.m_fCell);
+                this.m_cellHeight = ((int) ef.Height) + 4;
+                int nColumns = this.m_nColumns;
+                int num2 = 60 / this.m_nTimeScale;
+                int num3 = 0x18 * num2;
+                nColumns++;
+                num3++;
+                this.m_cellWidth = 600 / nColumns;
+                if (base.ClientRectangle.Width > 600)
+                {
+                    this.m_cellWidth = (base.ClientRectangle.Width - this.m_col0Width) / (nColumns - 1);
+                }
+                if (this.m_nColumns == 1)
+                {
+                    this.m_cellWidth = base.ClientRectangle.Width - this.m_col0Width;
+                }
+                g.TranslateTransform((float) base.AutoScrollPosition.X, (float) base.AutoScrollPosition.Y);
+                for (int i = num3; i > -1; i--)
+                {
+                    for (int j = 1; j < nColumns; j++)
+                    {
+                        int x = 0;
+                        if (j == 1)
+                        {
+                            x = this.m_col0Width;
+                        }
+                        if (j > 1)
+                        {
+                            x = this.m_col0Width + (this.m_cellWidth * (j - 1));
+                        }
+                        Point point = new Point(x, i * this.m_cellHeight);
+                        Rectangle r = new Rectangle(point.X, point.Y, this.m_cellWidth, this.m_cellHeight);
+                        if (i != 0)
+                        {
+                            CGCell cell = null;
+                            cell = new CGCell(r, i, j);
+                            this.m_gridCells.AddCell(cell);
+                        }
+                    }
+                }
+            }
+            catch (Exception exception)
+            {
+                string message = exception.Message;
+            }
+        }
+
+        private void CalendarGrid_DragDrop(object Sender, DragEventArgs e)
+        {
+            CGAppointment data = (CGAppointment) e.Data.GetData(typeof(CGAppointment));
+            Point point = base.PointToClient(new Point(e.X, e.Y));
+            int x = point.X - base.AutoScrollPosition.X;
+            int y = point.Y - base.AutoScrollPosition.Y;
+            Point pt = new Point(x, y);
+            foreach (DictionaryEntry entry in this.m_gridCells.CellHashTable)
+            {
+                CGCell cgCell = (CGCell) entry.Value;
+                if (cgCell.CellRectangle.Contains(pt))
+                {
+                    DateTime timeFromCell = this.GetTimeFromCell(cgCell);
+                    string resourceFromColumn = this.GetResourceFromColumn(cgCell.CellColumn);
+                    int duration = data.Duration;
+                    TimeSpan span = new TimeSpan(0, duration, 0);
+                    DateTime time2 = timeFromCell + span;
+                    data.Selected = false;
+                    this.m_nSelectID = 0;
+                    CGAppointmentChangedArgs args = new CGAppointmentChangedArgs();
+                    args.Appointment = data;
+                    args.StartTime = timeFromCell;
+                    args.EndTime = time2;
+                    args.Resource = resourceFromColumn;
+                    args.OldResource = data.Resource;
+                    args.AccessTypeID = data.AccessTypeID;
+                    args.Slots = data.Slots;
+                    if (this.ApptDragSource == "grid")
+                    {
+                        this.CGAppointmentChanged(this, args);
+                    }
+                    else
+                    {
+                        this.CGAppointmentAdded(this, args);
+                    }
+                    break;
+                }
+            }
+            this.SetOverlapTable();
+            base.Invalidate();
+        }
+
+        private void CalendarGrid_DragEnter(object Sender, DragEventArgs e)
+        {
+            if (e.Data.GetDataPresent(typeof(CGAppointment)))
+            {
+                if ((e.KeyState & 8) == 8)
+                {
+                    e.Effect = DragDropEffects.Copy;
+                }
+                else
+                {
+                    e.Effect = DragDropEffects.Move;
+                }
+            }
+            else
+            {
+                e.Effect = DragDropEffects.None;
+            }
+        }
+
+        private void CalendarGrid_MouseDown(object sender, MouseEventArgs e)
+        {
+            if (e.Button == MouseButtons.Left)
+            {
+                foreach (DictionaryEntry entry in this.m_gridCells.CellHashTable)
+                {
+                    CGCell cell = (CGCell) entry.Value;
+                    cell.IsSelected = false;
+                }
+                this.m_selectedRange.Cells.ClearAllCells();
+                this.m_bMouseDown = true;
+                this.OnLButtonDown(e.X, e.Y, true);
+            }
+        }
+
+        private void CalendarGrid_MouseMove(object Sender, MouseEventArgs e)
+        {
+            if (this.m_bMouseDown)
+            {
+                if ((e.Y >= base.ClientRectangle.Bottom) || (e.Y <= base.ClientRectangle.Top))
+                {
+                    this.m_bScrollDown = e.Y >= base.ClientRectangle.Bottom;
+                }
+                if ((e.Y < base.ClientRectangle.Bottom) && (e.Y > base.ClientRectangle.Top))
+                {
+                    bool bAutoDrag = this.m_bAutoDrag;
+                }
+                if (this.m_bSelectingRange)
+                {
+                    this.OnLButtonDown(e.X, e.Y, false);
+                }
+                if (this.m_nSelectID != 0)
+                {
+                    if (this.m_bGridEnter)
+                    {
+                        this.m_bGridEnter = false;
+                    }
+                    else if (!this.m_bDragDropStart)
+                    {
+                        CGAppointment data = (CGAppointment) this.m_Appointments.AppointmentTable[this.m_nSelectID];
+                        this.ApptDragSource = "grid";
+                        base.DoDragDrop(data, DragDropEffects.Move);
+                        this.m_bDragDropStart = true;
+                    }
+                }
+            }
+            else
+            {
+                int y = e.Y - base.AutoScrollPosition.Y;
+                int x = e.X - base.AutoScrollPosition.X;
+                Point pt = new Point(x, y);
+                foreach (CGAppointment appointment2 in this.m_Appointments.AppointmentTable.Values)
+                {
+                    if (appointment2.GridRectangle.Contains(pt))
+                    {
+                        this.m_toolTip.SetToolTip(this, appointment2.ToString());
+                        return;
+                    }
+                }
+                this.m_toolTip.RemoveAll();
+            }
+        }
+
+        private void CalendarGrid_MouseUp(object Sender, MouseEventArgs e)
+        {
+            if (this.m_bAutoDrag)
+            {
+                this.m_bAutoDrag = false;
+                this.AutoDragStop();
+            }
+            this.m_bMouseDown = false;
+            if (this.m_bSelectingRange)
+            {
+                CGSelectionChangedArgs args = new CGSelectionChangedArgs();
+                args.StartTime = this.GetTimeFromCell(this.m_selectedRange.StartCell);
+                args.EndTime = this.GetTimeFromCell(this.m_selectedRange.EndCell);
+                args.Resource = this.GetResourceFromColumn(this.m_selectedRange.StartCell.CellColumn);
+                if (args.EndTime < args.StartTime)
+                {
+                    DateTime startTime = args.StartTime;
+                    args.StartTime = args.EndTime;
+                    args.EndTime = startTime;
+                }
+                TimeSpan span = new TimeSpan(0, 0, this.m_nTimeScale, 0, 0);
+                args.EndTime += span;
+                this.CGSelectionChanged(this, args);
+                this.m_bSelectingRange = false;
+            }
+        }
+
+        private void CalendarGrid_Paint(object sender, PaintEventArgs e)
+        {
+            if (e.Graphics != null)
+            {
+                this.DrawGrid(e.Graphics);
+                if (!this.m_bInitialUpdate)
+                {
+                    this.SetAppointmentTypes();
+                    base.Invalidate();
+                    this.m_bInitialUpdate = true;
+                }
+            }
+        }
+
+        public void CloseGrid()
+        {
+            foreach (CGAppointment appointment in this.m_Appointments.AppointmentTable.Values)
+            {
+                appointment.Selected = false;
+            }
+            this.m_nSelectID = 0;
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (this.components != null))
+            {
+                this.components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        private void DrawAppointments(Graphics g, int col0Width, int cellWidth, int cellHeight)
+        {
+            if (!base.DesignMode && (this.m_Appointments != null))
+            {
+                int num = 0;
+                int num2 = 0;
+                int x = 0;
+                ArrayList list = new ArrayList();
+                foreach (CGAppointment appointment in this.m_Appointments.AppointmentTable.Values)
+                {
+                    bool bRet = false;
+                    Rectangle rect = this.GetAppointmentRect(appointment, col0Width, cellWidth, cellHeight, out bRet);
+                    if (bRet && (!appointment.WalkIn || this.m_bDrawWalkIns))
+                    {
+                        rect.Inflate(-10, 0);
+                        num = (int) this.m_ApptOverlapTable[appointment.m_nKey];
+                        num2 = rect.Right - rect.Left;
+                        x = num2 / (num + 1);
+                        rect.Width = x;
+                        if (num > 0)
+                        {
+                            foreach (object obj2 in list)
+                            {
+                                Rectangle rectangle2 = (Rectangle) obj2;
+                                if (rect.IntersectsWith(rectangle2))
+                                {
+                                    rect.Offset(x, 0);
+                                }
+                            }
+                        }
+                        appointment.GridRectangle = rect;
+                        if (appointment.Selected)
+                        {
+                            Pen pen = new Pen(Brushes.Black, 5f);
+                            g.DrawRectangle(pen, rect);
+                            pen.Dispose();
+                        }
+                        else
+                        {
+                            g.DrawRectangle(Pens.Blue, rect);
+                        }
+                        string s = appointment.ToString();
+                        Rectangle rectangle3 = new Rectangle(rect.X + 1, rect.Y + 1, rect.Width - 1, rect.Height - 1);
+                        g.FillRectangle(Brushes.White, rectangle3);
+                        Brush black = Brushes.Black;
+                        if (appointment.CheckInTime.Ticks > 0L)
+                        {
+                            black = Brushes.Green;
+                            g.FillRectangle(Brushes.LightGreen, rectangle3);
+                        }
+                        if (appointment.NoShow)
+                        {
+                            black = Brushes.Red;
+                            g.FillRectangle(Brushes.LightPink, rectangle3);
+                        }
+                        if (appointment.WalkIn)
+                        {
+                            black = Brushes.Blue;
+                            g.FillRectangle(Brushes.LightSteelBlue, rectangle3);
+                        }
+                        g.DrawString(s, this.fontArial8, black, rectangle3);
+                        list.Add(rect);
+                    }
+                }
+            }
+        }
+
+        private void DrawGrid(Graphics g)
+        {
+            try
+            {
+                Pen pen = new Pen(Color.Black);
+                SizeF ef = g.MeasureString("Test", this.m_fCell);
+                int num = 10;
+                this.m_cellHeight = ((int) ef.Height) + num;
+                int nColumns = this.m_nColumns;
+                int num3 = 60 / this.m_nTimeScale;
+                int num4 = 0x18 * num3;
+                nColumns++;
+                num4++;
+                this.m_cellWidth = 600 / nColumns;
+                if (base.ClientRectangle.Width > 600)
+                {
+                    this.m_cellWidth = (base.ClientRectangle.Width - this.m_col0Width) / (nColumns - 1);
+                }
+                if (this.m_nColumns == 1)
+                {
+                    this.m_cellWidth = base.ClientRectangle.Width - this.m_col0Width;
+                }
+                base.AutoScrollMinSize = new Size(600, this.m_cellHeight * num4);
+                g.FillRectangle(Brushes.LightGray, base.ClientRectangle);
+                int num5 = 0;
+                int num6 = 0;
+                bool flag = this.m_gridCells.CellCount == 0;
+                g.TranslateTransform((float) base.AutoScrollPosition.X, (float) base.AutoScrollPosition.Y);
+                for (int i = 1; i < num4; i++)
+                {
+                    int x = 0;
+                    Point point = new Point(x, i * this.m_cellHeight);
+                    Rectangle rectangle2 = new Rectangle(point.X, point.Y, this.m_cellWidth, this.m_cellHeight);
+                    Rectangle rect = new Rectangle(0, rectangle2.Y, this.m_col0Width, rectangle2.Height * num3);
+                    int height = rect.Height;
+                    height = (height > (this.m_col0Width / 4)) ? (this.m_col0Width / 4) : height;
+                    if (num5 == 0)
+                    {
+                        g.FillRectangle(Brushes.LightGray, rect);
+                        g.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height);
+                        string str = string.Format("{0}", num6).PadLeft(2, '0');
+                        Font font = new Font("Arial", (float) height, FontStyle.Bold, GraphicsUnit.Pixel);
+                        Rectangle rectangle3 = new Rectangle(rect.X, rect.Y, rect.Width / 2, rect.Height);
+                        g.DrawString(str, font, Brushes.Black, rectangle3, this.m_sfHour);
+                        num6++;
+                        font.Dispose();
+                    }
+                    string s = string.Format("{0}", num5);
+                    s = ":" + s.PadLeft(2, '0');
+                    Rectangle layoutRectangle = new Rectangle(rect.X + ((rect.Width * 2) / 3), rectangle2.Top, rect.Width / 3, rectangle2.Height);
+                    g.DrawString(s, this.m_fCell, Brushes.Black, layoutRectangle, this.m_sfRight);
+                    Point point2 = new Point(rect.X + ((rect.Width * 2) / 3), rectangle2.Bottom);
+                    Point point3 = new Point(rect.Right, rectangle2.Bottom);
+                    g.DrawLine(pen, point2, point3);
+                    num5 += this.m_nTimeScale;
+                    num5 = (num5 >= 60) ? 0 : num5;
+                    if ((i == (num4 - 1)) && !this.m_bScroll)
+                    {
+                        g.TranslateTransform((float) -base.AutoScrollPosition.X, (float) -base.AutoScrollPosition.Y);
+                        rect = new Rectangle(0, 0, this.m_col0Width, this.m_cellHeight);
+                        g.FillRectangle(Brushes.LightGray, rect);
+                        g.DrawRectangle(pen, rect);
+                        g.TranslateTransform((float) base.AutoScrollPosition.X, (float) base.AutoScrollPosition.Y);
+                    }
+                }
+                for (int j = num4; j > -1; j--)
+                {
+                    for (int k = 1; k < nColumns; k++)
+                    {
+                        int num12 = 0;
+                        if (k == 1)
+                        {
+                            num12 = this.m_col0Width;
+                        }
+                        if (k > 1)
+                        {
+                            num12 = this.m_col0Width + (this.m_cellWidth * (k - 1));
+                        }
+                        Point point4 = new Point(num12, j * this.m_cellHeight);
+                        Rectangle r = new Rectangle(point4.X, point4.Y, this.m_cellWidth, this.m_cellHeight);
+                        if (j != 0)
+                        {
+                            CGCell cellFromRowCol = null;
+                            if (flag)
+                            {
+                                cellFromRowCol = new CGCell(r, j, k);
+                                this.m_gridCells.AddCell(cellFromRowCol);
+                            }
+                            else
+                            {
+                                cellFromRowCol = this.m_gridCells.GetCellFromRowCol(j, k);
+                                cellFromRowCol.CellRectangle = r;
+                            }
+                            if (this.m_sResourcesArray.Count > 0)
+                            {
+                                if (this.m_selectedRange.CellIsInRange(cellFromRowCol))
+                                {
+                                    g.FillRectangle(Brushes.Aquamarine, r);
+                                }
+                                else
+                                {
+                                    g.FillRectangle(cellFromRowCol.AppointmentTypeColor, r);
+                                }
+                                g.DrawRectangle(pen, r.X, r.Y, r.Width, r.Height);
+                                if (j == 1)
+                                {
+                                    this.DrawAppointments(g, this.m_col0Width, this.m_cellWidth, this.m_cellHeight);
+                                }
+                            }
+                            continue;
+                        }
+                        if (!this.m_bScroll)
+                        {
+                            g.TranslateTransform(0f, (float) -base.AutoScrollPosition.Y);
+                            Rectangle rectangle6 = r;
+                            g.FillRectangle(Brushes.LightBlue, rectangle6);
+                            g.DrawRectangle(pen, rectangle6.X, rectangle6.Y, rectangle6.Width, rectangle6.Height);
+                            string str3 = "";
+                            if (this.m_sResourcesArray.Count > 1)
+                            {
+                                foreach (DictionaryEntry entry in this.m_ColumnInfoTable)
+                                {
+                                    int num13 = (int) entry.Value;
+                                    num13++;
+                                    if (num13 == k)
+                                    {
+                                        str3 = entry.Key.ToString();
+                                        break;
+                                    }
+                                }
+                            }
+                            else
+                            {
+                                DateTime dtStart = this.m_dtStart;
+                                if (k > 1)
+                                {
+                                    dtStart = dtStart.AddDays((double) (k - 1));
+                                }
+                                string format = "ddd, MMM d";
+                                str3 = dtStart.ToString(format, DateTimeFormatInfo.InvariantInfo);
+                            }
+                            g.DrawString(str3, this.m_fCell, Brushes.Black, rectangle6, this.m_sf);
+                            g.TranslateTransform(0f, (float) base.AutoScrollPosition.Y);
+                        }
+                    }
+                }
+                this.m_bScroll = false;
+                pen.Dispose();
+            }
+            catch (Exception)
+            {
+            }
+        }
+
+        public Rectangle GetAppointmentRect(CGAppointment a, int col0Width, int cellWidth, int cellHeight, out bool bRet)
+        {
+            DateTime startTime = a.StartTime;
+            DateTime endTime = a.EndTime;
+            string resource = a.Resource;
+            int num = 0;
+            int num2 = 0;
+            int num3 = 0;
+            int num4 = 0;
+            int num5 = 0;
+            Rectangle rectangle = new Rectangle();
+            int totalMinutes = (int) startTime.TimeOfDay.TotalMinutes;
+            int num7 = (int) endTime.TimeOfDay.TotalMinutes;
+            if (this.m_sResourcesArray.Count > 1)
+            {
+                num5 = (int) this.m_ColumnInfoTable[resource];
+                num5++;
+            }
+            else
+            {
+                num5 = ((int) (startTime.DayOfWeek - this.m_dtStart.DayOfWeek)) + 1;
+            }
+            if (num5 < 1)
+            {
+                bRet = false;
+                return rectangle;
+            }
+            num = col0Width + (cellWidth * (num5 - 1));
+            int num8 = totalMinutes + this.m_nTimeScale;
+            int num9 = (num7 > 0) ? num7 : 0x5a0;
+            num9 -= totalMinutes;
+            num2 = (cellHeight * num8) / this.m_nTimeScale;
+            num3 = (cellHeight * num9) / this.m_nTimeScale;
+            num4 = cellWidth;
+            rectangle.X = num;
+            rectangle.Y = num2;
+            rectangle.Width = num4;
+            rectangle.Height = num3;
+            bRet = true;
+            return rectangle;
+        }
+
+        public bool GetCellFromTime(DateTime dDate, ref int nRow, ref int nCol, bool bStartCell, string sResource)
+        {
+            int num = (dDate.Hour * 60) + dDate.Minute;
+            nRow = num / this.m_nTimeScale;
+            if (bStartCell)
+            {
+                nRow++;
+            }
+            if (this.m_sResourcesArray.Count > 1)
+            {
+                if (sResource == "")
+                {
+                    sResource = this.m_sResourcesArray[0].ToString();
+                }
+                nCol = (int) this.m_ColumnInfoTable[sResource];
+                nCol++;
+                return true;
+            }
+            DateTime time = new DateTime(dDate.Year, dDate.Month, dDate.Day);
+            TimeSpan span = (TimeSpan) (time - this.StartDate);
+            int totalDays = 0;
+            totalDays = (int) span.TotalDays;
+            nCol = totalDays;
+            nCol++;
+            return true;
+        }
+
+        private string GetResourceFromColumn(int nCol)
+        {
+            if (this.m_sResourcesArray.Count == 1)
+            {
+                return this.m_sResourcesArray[0].ToString();
+            }
+            foreach (DictionaryEntry entry in this.m_ColumnInfoTable)
+            {
+                int num = (int) entry.Value;
+                num++;
+                if (num == nCol)
+                {
+                    return entry.Key.ToString();
+                }
+            }
+            return "";
+        }
+
+        public bool GetSelectedTime(out DateTime dStart, out DateTime dEnd, out string sResource)
+        {
+            if (this.m_selectedRange.Cells.CellCount == 0)
+            {
+                dEnd = new DateTime();
+                dStart = dEnd;
+                sResource = "";
+                return false;
+            }
+            CGCell startCell = this.m_selectedRange.StartCell;
+            CGCell endCell = this.m_selectedRange.EndCell;
+            if (startCell.CellRow > endCell.CellRow)
+            {
+                CGCell cell3 = startCell;
+                startCell = endCell;
+                endCell = cell3;
+            }
+            dStart = this.GetTimeFromCell(startCell);
+            dEnd = this.GetTimeFromCell(endCell);
+            dEnd = dEnd.AddMinutes((double) this.m_nTimeScale);
+            sResource = this.GetResourceFromColumn(startCell.CellColumn);
+            return true;
+        }
+
+        public bool GetSelectedType(out int nAccessTypeID)
+        {
+            nAccessTypeID = 0;
+            if (this.m_selectedRange.Cells.CellCount == 0)
+            {
+                return false;
+            }
+            CGCell startCell = this.m_selectedRange.StartCell;
+            CGCell endCell = this.m_selectedRange.EndCell;
+            if (startCell.CellRow > endCell.CellRow)
+            {
+                CGCell cell3 = startCell;
+                startCell = endCell;
+                endCell = cell3;
+            }
+            DateTime timeFromCell = this.GetTimeFromCell(startCell);
+            DateTime time2 = this.GetTimeFromCell(endCell).AddMinutes((double) this.m_nTimeScale);
+            foreach (CGAvailability availability in this.m_pAvArray)
+            {
+                if (this.TimesOverlap(availability.StartTime, availability.EndTime, timeFromCell, time2))
+                {
+                    nAccessTypeID = availability.AvailabilityType;
+                    break;
+                }
+            }
+            return (nAccessTypeID > 0);
+        }
+
+        public DateTime GetTimeFromCell(CGCell cgCell)
+        {
+            int cellRow = cgCell.CellRow;
+            int cellColumn = cgCell.CellColumn;
+            DateTime dtStart = this.m_dtStart;
+            int num3 = (cellRow - 1) * this.m_nTimeScale;
+            int num4 = num3 / 60;
+            if (num4 > 0)
+            {
+                num3 = num3 % (num4 * 60);
+            }
+            dtStart = dtStart.AddHours((double) num4).AddMinutes((double) num3);
+            if (this.m_sResourcesArray.Count == 1)
+            {
+                dtStart = dtStart.AddDays((double) (cellColumn - 1));
+            }
+            return dtStart;
+        }
+
+        public bool GetTypeFromCell(CGCell cgCell, out int nAccessTypeID)
+        {
+            nAccessTypeID = 0;
+            CGCell cell = cgCell;
+            CGCell cell2 = cgCell;
+            if (cell.CellRow > cell2.CellRow)
+            {
+                CGCell cell3 = cell;
+                cell = cell2;
+                cell2 = cell3;
+            }
+            DateTime timeFromCell = this.GetTimeFromCell(cell);
+            DateTime time2 = this.GetTimeFromCell(cell2).AddMinutes((double) this.m_nTimeScale);
+            foreach (CGAvailability availability in this.m_pAvArray)
+            {
+                if (this.TimesOverlap(availability.StartTime, availability.EndTime, timeFromCell, time2))
+                {
+                    nAccessTypeID = availability.AvailabilityType;
+                    break;
+                }
+            }
+            return (nAccessTypeID > 0);
+        }
+
+        private bool HitTest(int X, int Y, ref int nRow, ref int nCol)
+        {
+            Y -= base.AutoScrollPosition.Y;
+            X -= base.AutoScrollPosition.X;
+            foreach (DictionaryEntry entry in this.m_gridCells)
+            {
+                CGCell cell = (CGCell) entry.Value;
+                if (cell.CellRectangle.Contains(X, Y))
+                {
+                    nRow = cell.CellRow;
+                    nCol = cell.CellColumn;
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public void InitializeCalendarGrid()
+        {
+            this.AllowDrop = true;
+        }
+
+        private void InitializeComponent()
+        {
+            this.AutoScroll = true;
+            base.AutoScrollMinSize = new Size(600, 400);
+            this.BackColor = SystemColors.Window;
+            base.Paint += new PaintEventHandler(this.CalendarGrid_Paint);
+            base.MouseDown += new MouseEventHandler(this.CalendarGrid_MouseDown);
+            base.MouseUp += new MouseEventHandler(this.CalendarGrid_MouseUp);
+            base.MouseMove += new MouseEventHandler(this.CalendarGrid_MouseMove);
+            base.DragEnter += new DragEventHandler(this.CalendarGrid_DragEnter);
+            base.DragDrop += new DragEventHandler(this.CalendarGrid_DragDrop);
+            this.m_toolTip = new ToolTip();
+        }
+
+        private int MinSince80(DateTime d)
+        {
+            DateTime time = new DateTime(0x7bc, 1, 1, 0, 0, 0);
+            TimeSpan span = (TimeSpan) (d - time);
+            return (int) span.TotalMinutes;
+        }
+
+        private void OnLButtonDown(int X, int Y, bool bStart)
+        {
+            this.m_bDragDropStart = false;
+            this.m_nSelectID = 0;
+            if (!this.m_bSelectingRange)
+            {
+                int y = Y - base.AutoScrollPosition.Y;
+                int x = X - base.AutoScrollPosition.X;
+                Point pt = new Point(x, y);
+                if (Control.ModifierKeys == Keys.Control)
+                {
+                    this.m_bMouseDown = false;
+                    foreach (CGAppointment appointment in this.m_Appointments.AppointmentTable.Values)
+                    {
+                        if (!appointment.GridRectangle.Contains(pt))
+                        {
+                            continue;
+                        }
+                        if (this.m_SelectedAppointments.AppointmentTable.ContainsKey(appointment.AppointmentKey))
+                        {
+                            this.m_SelectedAppointments.RemoveAppointment(appointment.AppointmentKey);
+                            if (this.m_SelectedAppointments.AppointmentTable.Count == 0)
+                            {
+                                this.m_nSelectID = 0;
+                            }
+                            else
+                            {
+                                foreach (CGAppointment appointment2 in this.m_Appointments.AppointmentTable.Values)
+                                {
+                                    this.m_nSelectID = appointment2.AppointmentKey;
+                                }
+                            }
+                        }
+                        else
+                        {
+                            this.m_SelectedAppointments.AddAppointment(appointment);
+                            this.m_nSelectID = appointment.AppointmentKey;
+                        }
+                        appointment.Selected = !appointment.Selected;
+                        break;
+                    }
+                    base.Invalidate();
+                    return;
+                }
+                foreach (CGAppointment appointment3 in this.m_Appointments.AppointmentTable.Values)
+                {
+                    if (!appointment3.GridRectangle.Contains(pt))
+                    {
+                        continue;
+                    }
+                    this.m_bMouseDown = false;
+                    if (appointment3.Selected)
+                    {
+                        appointment3.Selected = false;
+                        this.m_SelectedAppointments.ClearAllAppointments();
+                        this.m_nSelectID = 0;
+                    }
+                    else
+                    {
+                        foreach (CGAppointment appointment4 in this.m_Appointments.AppointmentTable.Values)
+                        {
+                            appointment4.Selected = false;
+                        }
+                        this.m_SelectedAppointments.ClearAllAppointments();
+                        this.m_SelectedAppointments.AddAppointment(appointment3);
+                        appointment3.Selected = true;
+                        this.m_nSelectID = appointment3.AppointmentKey;
+                        this.m_bMouseDown = true;
+                        this.m_bGridEnter = true;
+                    }
+                    base.Invalidate();
+                    return;
+                }
+            }
+            int nRow = -1;
+            int nCol = -1;
+            if (this.HitTest(X, Y, ref nRow, ref nCol))
+            {
+                CGCell cellFromRowCol = this.m_gridCells.GetCellFromRowCol(nRow, nCol);
+                if (cellFromRowCol != null)
+                {
+                    if (bStart)
+                    {
+                        this.m_currentCell = cellFromRowCol;
+                        this.m_selectedRange.StartCell = null;
+                        this.m_selectedRange.EndCell = null;
+                        this.m_selectedRange.CreateRange(this.m_gridCells, cellFromRowCol, cellFromRowCol);
+                        bStart = false;
+                        this.m_bMouseDown = true;
+                        this.m_bSelectingRange = true;
+                    }
+                    else if (cellFromRowCol != this.m_currentCell)
+                    {
+                        if (!this.m_selectedRange.Cells.CellHashTable.ContainsKey(cellFromRowCol.Key))
+                        {
+                            this.m_selectedRange.AppendCell(this.m_gridCells, cellFromRowCol);
+                        }
+                        else
+                        {
+                            bool bUp = cellFromRowCol.CellRow < this.m_currentCell.CellRow;
+                            this.m_selectedRange.SubtractCell(this.m_gridCells, cellFromRowCol, bUp);
+                        }
+                        this.m_currentCell = cellFromRowCol;
+                    }
+                    cellFromRowCol.IsSelected = true;
+                    base.Invalidate();
+                }
+            }
+        }
+
+        public void OnUpdateArrays()
+        {
+            try
+            {
+                this.m_gridCells.ClearAllCells();
+                this.SetColumnInfo();
+                this.SetOverlapTable();
+                Graphics g = base.CreateGraphics();
+                this.BuildGridCellsArray(g);
+                this.SetAppointmentTypes();
+            }
+            catch (Exception exception)
+            {
+                string message = exception.Message;
+            }
+        }
+
+        private void SetAppointmentTypes()
+        {
+            if (this.m_gridCells.CellCount != 0)
+            {
+                foreach (DictionaryEntry entry in this.m_gridCells.CellHashTable)
+                {
+                    CGCell cell = (CGCell) entry.Value;
+                    cell.AppointmentTypeColor = (this.m_GridBackColor == "blue") ? Brushes.CornflowerBlue : Brushes.Khaki;
+                }
+                if ((this.m_pAvArray != null) && (this.m_pAvArray.Count != 0))
+                {
+                    foreach (CGAvailability availability in this.m_pAvArray)
+                    {
+                        int nRow = 0;
+                        int nCol = 0;
+                        int num3 = 0;
+                        int num4 = 0;
+                        Brush brush = new SolidBrush(Color.FromArgb(availability.Red, availability.Green, availability.Blue));
+                        this.GetCellFromTime(availability.StartTime, ref nRow, ref nCol, true, availability.ResourceList);
+                        this.GetCellFromTime(availability.EndTime, ref num3, ref num4, false, availability.ResourceList);
+                        for (int i = nCol; i <= num4; i++)
+                        {
+                            for (int j = nRow; (i == num4) && (j <= num3); j++)
+                            {
+                                string str = "r" + j.ToString() + "c" + i.ToString();
+                                CGCell cell2 = (CGCell) this.m_gridCells.CellHashTable[str];
+                                if (cell2 != null)
+                                {
+                                    cell2.AppointmentTypeColor = brush;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        private void SetColumnInfo()
+        {
+            this.m_ColumnInfoTable.Clear();
+            for (int i = 0; i < this.m_sResourcesArray.Count; i++)
+            {
+                this.m_ColumnInfoTable.Add(this.m_sResourcesArray[i], i);
+            }
+            if (this.m_sResourcesArray.Count > 1)
+            {
+                this.m_nColumns = this.m_sResourcesArray.Count;
+            }
+        }
+
+        public void SetOverlapTable()
+        {
+            Hashtable hashtable = new Hashtable();
+            int y = 0;
+            int num2 = 0;
+            int x = 0;
+            foreach (CGAppointment appointment in this.m_Appointments.AppointmentTable.Values)
+            {
+                if (!appointment.WalkIn || this.m_bDrawWalkIns)
+                {
+                    string resource = appointment.Resource;
+                    y = appointment.StartTime.Minute + (60 * appointment.StartTime.Hour);
+                    num2 = appointment.EndTime.Minute + (60 * appointment.EndTime.Hour);
+                    x = (this.m_sResourcesArray.Count > 1) ? (((int) this.m_ColumnInfoTable[resource]) + 1) : appointment.StartTime.DayOfYear;
+                    Rectangle rectangle = new Rectangle(x, y, 1, num2 - y);
+                    hashtable.Add(appointment.m_nKey, rectangle);
+                }
+            }
+            this.m_ApptOverlapTable.Clear();
+            foreach (int num4 in hashtable.Keys)
+            {
+                this.m_ApptOverlapTable.Add(num4, 0);
+            }
+            if (this.m_ApptOverlapTable.Count != 0)
+            {
+                int num5 = (this.m_sResourcesArray.Count > 1) ? 1 : this.StartDate.DayOfYear;
+                int num6 = (this.m_sResourcesArray.Count > 1) ? (this.m_sResourcesArray.Count + 1) : (this.Columns + this.StartDate.DayOfYear);
+                for (int i = num5; i < num6; i++)
+                {
+                    ArrayList list = new ArrayList();
+                    for (int j = 1; j < this.Rows; j++)
+                    {
+                        Rectangle rectangle2 = new Rectangle(i, j * this.m_nTimeScale, 1, this.m_nTimeScale);
+                        int num9 = -1;
+                        list.Clear();
+                        foreach (int num10 in hashtable.Keys)
+                        {
+                            Rectangle rect = (Rectangle) hashtable[num10];
+                            if (rectangle2.IntersectsWith(rect))
+                            {
+                                num9++;
+                                list.Add(num10);
+                            }
+                        }
+                        if (num9 > 0)
+                        {
+                            foreach (object obj2 in list)
+                            {
+                                int num11 = (int) obj2;
+                                if (((int) this.m_ApptOverlapTable[num11]) < num9)
+                                {
+                                    this.m_ApptOverlapTable[num11] = num9;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        private void tickEventHandler(object o, EventArgs e)
+        {
+            Point point = new Point(base.AutoScrollPosition.X, base.AutoScrollPosition.Y);
+            int x = point.X;
+            int num = point.Y * -1;
+            num = this.m_bScrollDown ? (num + 5) : (num - 5);
+            point.Y = num;
+            base.AutoScrollPosition = point;
+            base.Invalidate();
+        }
+
+        private bool TimesOverlap(DateTime dStart1, DateTime dEnd1, DateTime dStart2, DateTime dEnd2)
+        {
+            long ticks = dEnd1.Ticks - dStart1.Ticks;
+            TimeSpan ts = new TimeSpan(ticks);
+            ticks = dEnd2.Ticks - dStart2.Ticks;
+            new TimeSpan(ticks).Subtract(ts);
+            Rectangle rect = new Rectangle();
+            Rectangle rectangle2 = new Rectangle();
+            rect.X = 0;
+            rectangle2.X = 0;
+            rect.Width = 1;
+            rectangle2.Width = 1;
+            rect.Y = this.MinSince80(dStart1);
+            rect.Height = this.MinSince80(dEnd1) - rect.Y;
+            rectangle2.Y = this.MinSince80(dStart2);
+            rectangle2.Height = this.MinSince80(dEnd2) - rectangle2.Y;
+            return rectangle2.IntersectsWith(rect);
+        }
+
+        protected override void WndProc(ref Message msg)
+        {
+            try
+            {
+                if (msg.Msg == 0x115)
+                {
+                    this.m_bScroll = true;
+                    base.Invalidate(false);
+                    this.m_bScroll = false;
+                }
+                if (msg.Msg == 0x114)
+                {
+                    base.Invalidate(false);
+                }
+                base.WndProc(ref msg);
+            }
+            catch (Exception exception)
+            {
+                MessageBox.Show("CalendarGrid::WndProc:  " + exception.Message + "\nStack: " + exception.StackTrace);
+            }
+        }
+
+        public CGAppointments Appointments
+        {
+            get
+            {
+                return this.m_Appointments;
+            }
+            set
+            {
+                this.m_Appointments = value;
+            }
+        }
+
+        public string ApptDragSource
+        {
+            get
+            {
+                return this.m_sDragSource;
+            }
+            set
+            {
+                this.m_sDragSource = value;
+            }
+        }
+
+        public ArrayList AvailabilityArray
+        {
+            get
+            {
+                return this.m_pAvArray;
+            }
+            set
+            {
+                this.m_pAvArray = value;
+            }
+        }
+
+        public int CellHeight
+        {
+            get
+            {
+                return this.m_cellHeight;
+            }
+        }
+
+        public ToolTip CGToolTip
+        {
+            get
+            {
+                return this.m_toolTip;
+            }
+        }
+
+        public int Columns
+        {
+            get
+            {
+                return this.m_nColumns;
+            }
+            set
+            {
+                if ((value > 0) && (value < 11))
+                {
+                    this.m_nColumns = value;
+                    this.m_gridCells.ClearAllCells();
+                    this.m_selectedRange.Cells.ClearAllCells();
+                    Graphics g = base.CreateGraphics();
+                    this.BuildGridCellsArray(g);
+                    this.SetAppointmentTypes();
+                    base.Invalidate();
+                }
+            }
+        }
+
+        public bool DrawWalkIns
+        {
+            get
+            {
+                return this.m_bDrawWalkIns;
+            }
+            set
+            {
+                this.m_bDrawWalkIns = value;
+            }
+        }
+
+        public string GridBackColor
+        {
+            get
+            {
+                return this.m_GridBackColor;
+            }
+            set
+            {
+                this.m_GridBackColor = value;
+            }
+        }
+
+        public bool GridEnter
+        {
+            get
+            {
+                return this.m_bGridEnter;
+            }
+            set
+            {
+                this.m_bGridEnter = value;
+            }
+        }
+
+        public ArrayList Resources
+        {
+            get
+            {
+                return this.m_sResourcesArray;
+            }
+            set
+            {
+                this.m_sResourcesArray = value;
+            }
+        }
+
+        public int Rows
+        {
+            get
+            {
+                return (0x5a0 / this.m_nTimeScale);
+            }
+        }
+
+        public int SelectedAppointment
+        {
+            get
+            {
+                return this.m_nSelectID;
+            }
+            set
+            {
+                this.m_nSelectID = value;
+            }
+        }
+
+        public CGAppointments SelectedAppointments
+        {
+            get
+            {
+                return this.m_SelectedAppointments;
+            }
+        }
+
+        public CGRange SelectedRange
+        {
+            get
+            {
+                return this.m_selectedRange;
+            }
+        }
+
+        public DateTime StartDate
+        {
+            get
+            {
+                return this.m_dtStart;
+            }
+            set
+            {
+                this.m_dtStart = value;
+            }
+        }
+
+        public int TimeScale
+        {
+            get
+            {
+                return this.m_nTimeScale;
+            }
+            set
+            {
+                if ((((value == 5) || (value == 10)) || ((value == 15) || (value == 20))) || ((value == 30) || (value == 60)))
+                {
+                    this.m_nTimeScale = value;
+                    this.m_gridCells.ClearAllCells();
+                    this.m_selectedRange.Cells.ClearAllCells();
+                    Graphics g = base.CreateGraphics();
+                    this.BuildGridCellsArray(g);
+                    this.SetAppointmentTypes();
+                    base.Invalidate();
+                }
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/ClassDiagram1.cd
===================================================================
--- Scheduling/branches/GUI1.2/ClassDiagram1.cd	(revision 855)
+++ Scheduling/branches/GUI1.2/ClassDiagram1.cd	(revision 855)
@@ -0,0 +1,1 @@
+ 
Index: Scheduling/branches/GUI1.2/ClassDiagram2.cd
===================================================================
--- Scheduling/branches/GUI1.2/ClassDiagram2.cd	(revision 855)
+++ Scheduling/branches/GUI1.2/ClassDiagram2.cd	(revision 855)
@@ -0,0 +1,1 @@
+ 
Index: Scheduling/branches/GUI1.2/ClinicalScheduling.csproj
===================================================================
--- Scheduling/branches/GUI1.2/ClinicalScheduling.csproj	(revision 855)
+++ Scheduling/branches/GUI1.2/ClinicalScheduling.csproj	(revision 855)
@@ -0,0 +1,446 @@
+﻿<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+  <PropertyGroup>
+    <ProjectType>Local</ProjectType>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}</ProjectGuid>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ApplicationIcon>hwIco281.ICO</ApplicationIcon>
+    <AssemblyKeyContainerName>
+    </AssemblyKeyContainerName>
+    <AssemblyName>ClinicalScheduling</AssemblyName>
+    <AssemblyOriginatorKeyFile>
+    </AssemblyOriginatorKeyFile>
+    <DefaultClientScript>JScript</DefaultClientScript>
+    <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+    <DefaultTargetSchema>IE50</DefaultTargetSchema>
+    <DelaySign>false</DelaySign>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>IndianHealthService.ClinicalScheduling</RootNamespace>
+    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
+    <StartupObject>IndianHealthService.ClinicalScheduling.CGDocumentManager</StartupObject>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <SccProjectName>
+    </SccProjectName>
+    <SccLocalPath>
+    </SccLocalPath>
+    <SccAuxPath>
+    </SccAuxPath>
+    <SccProvider>
+    </SccProvider>
+    <OldToolsVersion>2.0</OldToolsVersion>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <TargetFrameworkSubset>
+    </TargetFrameworkSubset>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <ManifestCertificateThumbprint>3202DD11CA9F64F7E52CF7BBED5F17D6E8A1B395</ManifestCertificateThumbprint>
+    <ManifestKeyFile>ClinicalScheduling_TemporaryKey.pfx</ManifestKeyFile>
+    <GenerateManifests>false</GenerateManifests>
+    <SignManifests>false</SignManifests>
+    <TargetZone>LocalIntranet</TargetZone>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>1</ApplicationRevision>
+    <ApplicationVersion>2.1.0.%2a</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <PublishWizardCompleted>true</PublishWizardCompleted>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+    <NoWin32Manifest>true</NoWin32Manifest>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <OutputPath>bin\Debug\</OutputPath>
+    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+    <BaseAddress>285212672</BaseAddress>
+    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+    <ConfigurationOverrideFile>
+    </ConfigurationOverrideFile>
+    <DefineConstants>DEBUG</DefineConstants>
+    <DocumentationFile>bin\Release\ClinicalScheduling.XML</DocumentationFile>
+    <DebugSymbols>false</DebugSymbols>
+    <FileAlignment>4096</FileAlignment>
+    <NoStdLib>false</NoStdLib>
+    <NoWarn>
+    </NoWarn>
+    <Optimize>false</Optimize>
+    <RegisterForComInterop>false</RegisterForComInterop>
+    <RemoveIntegerChecks>false</RemoveIntegerChecks>
+    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+    <WarningLevel>4</WarningLevel>
+    <DebugType>full</DebugType>
+    <ErrorReport>prompt</ErrorReport>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <OutputPath>bin\Release\</OutputPath>
+    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+    <BaseAddress>285212672</BaseAddress>
+    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+    <ConfigurationOverrideFile>
+    </ConfigurationOverrideFile>
+    <DefineConstants>
+    </DefineConstants>
+    <DocumentationFile>bin\Release\ClinicalScheduling.XML</DocumentationFile>
+    <DebugSymbols>false</DebugSymbols>
+    <FileAlignment>4096</FileAlignment>
+    <NoStdLib>false</NoStdLib>
+    <NoWarn>
+    </NoWarn>
+    <Optimize>true</Optimize>
+    <RegisterForComInterop>false</RegisterForComInterop>
+    <RemoveIntegerChecks>false</RemoveIntegerChecks>
+    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+    <WarningLevel>4</WarningLevel>
+    <DebugType>none</DebugType>
+    <ErrorReport>prompt</ErrorReport>
+    <UseVSHostingProcess>false</UseVSHostingProcess>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="BMXNet20, Version=2.0.2459.21970, Culture=neutral, PublicKeyToken=069dc2499aed6a8c, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>bin\Release\BMXNet20.dll</HintPath>
+    </Reference>
+    <Reference Include="System">
+      <Name>System</Name>
+    </Reference>
+    <Reference Include="System.configuration" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data">
+      <Name>System.Data</Name>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Drawing">
+      <Name>System.Drawing</Name>
+    </Reference>
+    <Reference Include="System.Web.Extensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Web.Services">
+      <Name>System.Web.Services</Name>
+    </Reference>
+    <Reference Include="System.Windows.Forms">
+      <Name>System.Windows.Forms</Name>
+    </Reference>
+    <Reference Include="System.Xml">
+      <Name>System.XML</Name>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="app.config" />
+    <None Include="CGView.cd" />
+    <None Include="ClassDiagram1.cd" />
+    <None Include="ClassDiagram2.cd" />
+    <None Include="ClinicalScheduling_TemporaryKey.pfx" />
+    <None Include="dsPatientApptDisplay2.xsc">
+      <DependentUpon>dsPatientApptDisplay2.xsd</DependentUpon>
+    </None>
+    <None Include="dsPatientApptDisplay2.xss">
+      <DependentUpon>dsPatientApptDisplay2.xsd</DependentUpon>
+    </None>
+    <None Include="dsPatientApptDisplay2.xsx">
+      <DependentUpon>dsPatientApptDisplay2.xsd</DependentUpon>
+    </None>
+    <None Include="dsRebookAppts.xsc">
+      <DependentUpon>dsRebookAppts.xsd</DependentUpon>
+    </None>
+    <None Include="dsRebookAppts.xss">
+      <DependentUpon>dsRebookAppts.xsd</DependentUpon>
+    </None>
+    <None Include="dsRebookAppts.xsx">
+      <DependentUpon>dsRebookAppts.xsd</DependentUpon>
+    </None>
+    <Content Include="App.ico" />
+    <Content Include="dsPatientApptDisplay2.xsd">
+      <Generator>MSDataSetGenerator</Generator>
+      <LastGenOutput>dsPatientApptDisplay2.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </Content>
+    <Content Include="dsRebookAppts.xsd">
+      <Generator>MSDataSetGenerator</Generator>
+      <LastGenOutput>dsRebookAppts.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </Content>
+    <Content Include="hwIco281.ICO" />
+    <Compile Include="AssemblyInfo.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="CalendarGrid.cs">
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="CGAppointment.cs" />
+    <Compile Include="CGAppointmentChangedArgs.cs" />
+    <Compile Include="CGAppointmentChangedHandler.cs" />
+    <Compile Include="CGAppointments.cs" />
+    <Compile Include="CGAvailability.cs" />
+    <Compile Include="CGAVDocument.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="CGAVView.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="CGCell.cs" />
+    <Compile Include="CGCells.cs" />
+    <Compile Include="CGDocument.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="CGDocumentManager.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="CGRange.cs" />
+    <Compile Include="CGResource.cs" />
+    <Compile Include="CGSchedLib.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="CGSelectionChangedArgs.cs" />
+    <Compile Include="CGSelectionChangedHandler.cs" />
+    <Compile Include="CGView.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DAccessBlock.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DAccessGroup.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DAccessGroupItem.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DAccessTemplate.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DAccessType.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DAppointPage.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DApptSearch.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DCancelAppt.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DCheckIn.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DCopyAppts.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="dInputText.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DManagement.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DNoShow.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DPatientApptDisplay.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DPatientLetter.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DPatientLookup.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DResource.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DResourceGroup.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DResourceGroupItem.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DResourceUser.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DSelectLetterClinics.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="DSelectSchedules.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="dsPatientApptDisplay2.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>dsPatientApptDisplay2.xsd</DependentUpon>
+    </Compile>
+    <Compile Include="DSplash.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="dsRebookAppts.cs">
+      <DependentUpon>dsRebookAppts.xsd</DependentUpon>
+      <SubType>Component</SubType>
+    </Compile>
+    <Compile Include="dsRebookAppts.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>dsRebookAppts.xsd</DependentUpon>
+    </Compile>
+    <Compile Include="Options.cs" />
+    <Compile Include="Printing.cs" />
+    <Compile Include="UCPatientAppts.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="UCPatientAppts.Designer.cs">
+      <DependentUpon>UCPatientAppts.cs</DependentUpon>
+    </Compile>
+    <EmbeddedResource Include="CGAVView.resx">
+      <DependentUpon>CGAVView.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="CGDocumentManager.resx">
+      <DependentUpon>CGDocumentManager.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="CGView.resx">
+      <DependentUpon>CGView.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DAccessGroup.resx">
+      <DependentUpon>DAccessGroup.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DAccessGroupItem.resx">
+      <DependentUpon>DAccessGroupItem.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DAccessTemplate.resx">
+      <DependentUpon>DAccessTemplate.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DAccessType.resx">
+      <DependentUpon>DAccessType.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DAppointPage.resx">
+      <DependentUpon>DAppointPage.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DApptSearch.resx">
+      <DependentUpon>DApptSearch.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DCancelAppt.resx">
+      <DependentUpon>DCancelAppt.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DCheckIn.resx">
+      <DependentUpon>DCheckIn.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DCopyAppts.resx">
+      <DependentUpon>DCopyAppts.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="dInputText.resx">
+      <DependentUpon>dInputText.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DManagement.resx">
+      <DependentUpon>DManagement.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DNoShow.resx">
+      <DependentUpon>DNoShow.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DPatientLetter.resx">
+      <DependentUpon>DPatientLetter.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DPatientLookup.resx">
+      <DependentUpon>DPatientLookup.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DResource.resx">
+      <DependentUpon>DResource.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DResourceGroup.resx">
+      <DependentUpon>DResourceGroup.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DResourceGroupItem.resx">
+      <DependentUpon>DResourceGroupItem.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DResourceUser.resx">
+      <DependentUpon>DResourceUser.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DSelectLetterClinics.resx">
+      <DependentUpon>DSelectLetterClinics.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DSelectSchedules.resx">
+      <DependentUpon>DSelectSchedules.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="DSplash.resx">
+      <DependentUpon>DSplash.cs</DependentUpon>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <EmbeddedResource Include="UCPatientAppts.resx">
+      <DependentUpon>UCPatientAppts.cs</DependentUpon>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{967B4E0D-AD0C-4609-AB67-0FA40C0206D8}" />
+    <Service Include="{CF845C55-C321-4742-B673-E6212D061ED9}" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Properties\" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent>
+    </PreBuildEvent>
+    <PostBuildEvent>
+    </PostBuildEvent>
+  </PropertyGroup>
+</Project>
Index: Scheduling/branches/GUI1.2/ClinicalScheduling.csproj.user
===================================================================
--- Scheduling/branches/GUI1.2/ClinicalScheduling.csproj.user	(revision 855)
+++ Scheduling/branches/GUI1.2/ClinicalScheduling.csproj.user	(revision 855)
@@ -0,0 +1,68 @@
+﻿<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <LastOpenVersion>7.10.3077</LastOpenVersion>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ReferencePath>
+    </ReferencePath>
+    <CopyProjectDestinationFolder>
+    </CopyProjectDestinationFolder>
+    <CopyProjectUncPath>
+    </CopyProjectUncPath>
+    <CopyProjectOption>0</CopyProjectOption>
+    <ProjectView>ProjectFiles</ProjectView>
+    <ProjectTrust>0</ProjectTrust>
+    <PublishUrlHistory>publish\</PublishUrlHistory>
+    <InstallUrlHistory>
+    </InstallUrlHistory>
+    <SupportUrlHistory>
+    </SupportUrlHistory>
+    <UpdateUrlHistory>
+    </UpdateUrlHistory>
+    <BootstrapperUrlHistory>
+    </BootstrapperUrlHistory>
+    <ErrorReportUrlHistory>
+    </ErrorReportUrlHistory>
+    <FallbackCulture>en-US</FallbackCulture>
+    <VerifyUploadedFiles>false</VerifyUploadedFiles>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <EnableASPDebugging>false</EnableASPDebugging>
+    <EnableASPXDebugging>false</EnableASPXDebugging>
+    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
+    <EnableSQLServerDebugging>false</EnableSQLServerDebugging>
+    <RemoteDebugEnabled>false</RemoteDebugEnabled>
+    <RemoteDebugMachine>
+    </RemoteDebugMachine>
+    <StartAction>Project</StartAction>
+    <StartArguments>/s=s0.sequencemanagers.com /p=8110</StartArguments>
+    <StartPage>
+    </StartPage>
+    <StartProgram>C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\IEExec.exe</StartProgram>
+    <StartURL>
+    </StartURL>
+    <StartWorkingDirectory>
+    </StartWorkingDirectory>
+    <StartWithIE>false</StartWithIE>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <EnableASPDebugging>false</EnableASPDebugging>
+    <EnableASPXDebugging>false</EnableASPXDebugging>
+    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
+    <EnableSQLServerDebugging>false</EnableSQLServerDebugging>
+    <RemoteDebugEnabled>false</RemoteDebugEnabled>
+    <RemoteDebugMachine>
+    </RemoteDebugMachine>
+    <StartAction>Project</StartAction>
+    <StartArguments>/s=s0.sequencemanagers.com /p=8110</StartArguments>
+    <StartPage>
+    </StartPage>
+    <StartProgram>
+    </StartProgram>
+    <StartURL>
+    </StartURL>
+    <StartWorkingDirectory>
+    </StartWorkingDirectory>
+    <StartWithIE>false</StartWithIE>
+  </PropertyGroup>
+</Project>
Index: Scheduling/branches/GUI1.2/ClinicalScheduling.csproj.vspscc
===================================================================
--- Scheduling/branches/GUI1.2/ClinicalScheduling.csproj.vspscc	(revision 855)
+++ Scheduling/branches/GUI1.2/ClinicalScheduling.csproj.vspscc	(revision 855)
@@ -0,0 +1,10 @@
+﻿""
+{
+"FILE_VERSION" = "9237"
+"ENLISTMENT_CHOICE" = "NEVER"
+"PROJECT_FILE_RELATIVE_PATH" = "relative:Documents and Settings\\Horace\\My Documents\\Visual Studio 2005\\Projects\\ClinicalScheduling20\\ClinicalScheduling"
+"NUMBER_OF_EXCLUDED_FILES" = "0"
+"ORIGINAL_PROJECT_FILE_PATH" = ""
+"NUMBER_OF_NESTED_PROJECTS" = "0"
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
+}
Index: Scheduling/branches/GUI1.2/ClinicalScheduling.sln
===================================================================
--- Scheduling/branches/GUI1.2/ClinicalScheduling.sln	(revision 855)
+++ Scheduling/branches/GUI1.2/ClinicalScheduling.sln	(revision 855)
@@ -0,0 +1,20 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C# Express 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClinicalScheduling", "ClinicalScheduling.csproj", "{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: Scheduling/branches/GUI1.2/ConnectInfo.cs
===================================================================
--- Scheduling/branches/GUI1.2/ConnectInfo.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/ConnectInfo.cs	(revision 855)
@@ -0,0 +1,270 @@
+using System;
+using System.Windows.Forms;
+//using RPX20Lib;
+using System.Data;
+//using System.Data.OleDb;
+using System.Text;
+using IndianHealthService.BMXNet;
+using System.Reflection;
+using System.Diagnostics;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Contains information about the RPMS connection
+	/// </summary>
+	public class CGConnectInfo
+	{
+		public CGConnectInfo()
+		{
+			// 
+			// TODO: Add constructor logic here
+			//
+		}
+
+		private	bool	m_bConnected;
+		string			m_sVerify;
+		string			m_sAccess;
+		string			m_sServerAddress;
+		int				m_nServerPort;
+		private	string	m_sDUZ;
+		private string	m_sDUZ2;
+		private	int		m_nDivisionCount = 0;
+		private	string	m_sUserName;
+		private	string	m_sDivision;
+
+
+
+		public bool Connected
+		{
+			get
+			{
+				return m_bConnected;
+			}
+		}
+
+		public bool LoadConnectInfo()
+		{
+			
+			//Returns True if able to connect to RPMS
+
+
+			//Step 1
+			//Get RPMS Server Address and Port from Registry.
+			//Prompt for them if they're not there.
+			//Return False if unable to get address/port
+
+
+
+///////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+			
+			//Old Version Below:
+			//Loads and decypts M Connection info from registry
+			//Tests connection
+			//Sets m_bConnected based on test
+			//returns m_bConnected
+
+			//(see ConnectInfo.cpp)
+
+			string sTempAddress;
+			sTempAddress = "127.0.0.1";
+//			sTempAddress = "161.223.91.10";
+			int nTempPort = 0;
+
+			// Load from registry (HKCU) 
+
+			// Decrypt Access and Verify codes
+
+			string sTempAccess2 = "HMWXXX8"; //TODO: Get from registry
+//			sTempAccess2 = "JANXXX1"; //TODO: Get from registry
+//			if (!DecryptString(pbAccessData, &lAccessSize, sTempAccess2))
+//				return FALSE;
+//
+			string sTempVerify2 = "MOLLYB8"; //TODO: Get from registry
+//			sTempVerify2 = "JANXXX2"; //TODO: Get from registry
+//			if (!DecryptString(pbVerifyData, &lVerifySize, sTempVerify2))
+//				return FALSE;
+
+			m_sAccess = sTempAccess2;
+			m_sVerify = sTempVerify2;
+			m_sServerAddress = sTempAddress;
+			if (m_sServerAddress == "") 
+			{
+				m_sServerAddress = "RPMSWindow";
+				m_sAccess = "";
+				m_sVerify = "";
+			}
+			m_nServerPort = nTempPort;
+			if (m_nServerPort == 0)
+				m_nServerPort = 9200;
+
+//			RPX20Lib.MConnect m;
+//			m = new MConnectClass();
+			BMXNetLib m = new BMXNetLib();
+			m.MServerPort = m_nServerPort;
+			m.AppContext="BMXRPC";
+			bool bRet = false;
+			try 
+			{
+				bRet = m.OpenConnection(sTempAddress, sTempAccess2, sTempVerify2);
+			}
+			catch (BMXNetException exBMX)
+			{
+				throw exBMX;
+			}
+			catch (Exception bmxEx)
+			{
+				string sMessage =  bmxEx.Message + bmxEx.StackTrace;
+				throw new BMXNetException(sMessage);
+			}
+
+			if (bRet == true){
+				try {
+					this.m_sAccess = sTempAccess2;
+					this.m_sVerify = sTempVerify2;
+					this.m_sServerAddress = sTempAddress;
+					this.m_nServerPort = m.MServerPort;
+					this.m_sDUZ = m.DUZ;
+
+					string sRpc = "BMX USER";
+					m_sUserName = m.TransmitRPC(sRpc, m_sDUZ);
+
+					
+					System.Data.DataTable rsDivisions;
+					rsDivisions =  this.GetUserDivisions(m_sAccess, m_sVerify, m_sServerAddress, m_nServerPort);
+					m_nDivisionCount = rsDivisions.Rows.Count;
+
+					foreach (System.Data.DataRow r in rsDivisions.Rows)
+					{
+						string sTemp = r["MOST_RECENT_LOOKUP"].ToString();
+						if (sTemp == "1")
+						{
+							this.m_sDivision = r["FACILITY_NAME"].ToString();
+							this.m_sDUZ2 = r["FACILITY_IEN"].ToString();
+							break;
+						}
+					}
+
+					m_bConnected = true;
+				}
+				catch(Exception bmxEx)
+				{
+					m_bConnected = false;
+					string sMessage =  bmxEx.Message + bmxEx.StackTrace;
+					throw new BMXNetException(sMessage);
+				}
+			}
+
+			return m_bConnected;
+		}
+
+		bool TestConnection(string sAccess, string sVerify, string sAddress, int nPort)
+		{
+			// Try RPMS Connection & set m_bconnected TRUE if successful
+//			RPX20Lib.MConnect m;
+//			m = new MConnectClass();
+			BMXNetLib m = new BMXNetLib();
+			bool bRet = false;
+			try 
+			{
+				//from old MServices->Login
+				m.MServerPort = nPort;
+				bRet = m.OpenConnection(sAddress, sAccess, sVerify);
+				this.m_sDUZ = m.DUZ;
+			}
+			catch(Exception ex)
+			{
+				Debug.Write("CConnectInfo::TestConnection: Error: " + ex.Message);
+				bRet = false;
+			}
+			finally
+			{
+				m.CloseConnection();
+			}
+			return bRet;
+		}
+
+		private DataTable GetUserDivisions(string sTempAccess2, string sTempVerify2, string sTempAddress, int MServerPort)
+		{
+			try
+			{
+				//Connection string model:
+				//"Provider=BMXODB.RPMS.1;Data source=127.0.0.1;Location=9200;Extended Properties=BMXRPC;Password=HMWXXX8^MOLLYB8"
+				string sConn;
+				sConn = "Data source=" + sTempAddress + ";Location=" + MServerPort.ToString() + ";Extended Properties=BMXRPC;Password=" + sTempAccess2 + "^" + sTempVerify2;
+				BMXNetConnection rpmsConn = new BMXNetConnection(sConn);
+				rpmsConn.Open();
+
+				BMXNetCommand cmd = (BMXNetCommand) rpmsConn.CreateCommand();
+				cmd.CommandText = "BMXGetFacRS^" + m_sDUZ;
+
+				BMXNetDataAdapter da = new BMXNetDataAdapter();
+				da.SelectCommand = cmd;
+
+				DataSet dsDivisions = new DataSet("Divisions");
+				da.Fill(dsDivisions, "DivisionTable");
+				DataTable tb = dsDivisions.Tables["DivisionTable"];
+				return tb;
+			}
+			catch (Exception bmxEx)
+			{
+				string sMessage =  bmxEx.Message + bmxEx.StackTrace;
+				throw new BMXNetException(sMessage);
+
+			}
+		}
+
+		public string UserName
+		{
+			get
+			{
+				return this.m_sUserName;
+			}
+		}
+
+		public string DivisionName
+		{
+			get
+			{
+				return this.m_sDivision;
+			}
+		}
+
+		public string GetDSN(string sAppContext)
+		{
+			string sDsn = "Data source=";
+			if (sAppContext == "")
+				sAppContext = "BMXRPC";
+
+			if (this.m_bConnected == false)
+				return sDsn.ToString();
+
+			sDsn += this.m_sServerAddress ;
+			sDsn += ";Location=";
+			sDsn += this.m_nServerPort.ToString();
+			sDsn += ";Extended Properties=";
+			sDsn += sAppContext;
+			sDsn += ";Password=";
+			sDsn += this.m_sAccess;
+			sDsn += "^";
+			sDsn += this.m_sVerify;
+			
+			return sDsn;
+		}
+
+		/// <summary>
+		/// String representation of DUZ
+		/// </summary>
+		public string DUZ
+		{
+			get
+			{
+				return m_sDUZ;
+			}
+		}
+
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DAccessBlock.cs
===================================================================
--- Scheduling/branches/GUI1.2/DAccessBlock.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DAccessBlock.cs	(revision 855)
@@ -0,0 +1,418 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    using System;
+    using System.ComponentModel;
+    using System.Data;
+    using System.Drawing;
+    using System.Windows.Forms;
+    using System.Xml;
+    /// <summary>
+    /// This class was regenerated from Calendargrid.dll using Reflector.exe
+    /// by Sam Habiel for WorldVista. The original source code is lost.
+    /// </summary>
+    public class DAccessBlock : Form
+    {
+        private ComboBox cboAccessTypeFilter;
+        private Button cmdCancel;
+        private Button cmdOK;
+        private Container components;
+        private Label label1;
+        private Label label15;
+        private Label label2;
+        private Label label3;
+        private Label label4;
+        private Label label6;
+        private Label label7;
+        private Label lblClinic;
+        private Label lblEndTime;
+        private Label lblStartTime;
+        private ListBox lstAccessTypes;
+        private DataSet m_dsGlobal;
+        private DataTable m_dtTypes;
+        private DataView m_dvTypes;
+        private CGAppointment m_pAppt;
+        private NumericUpDown nudSlots;
+        private Panel panel1;
+        private Panel panel2;
+        private TextBox txtNote;
+
+        public DAccessBlock()
+        {
+            this.InitializeComponent();
+        }
+
+        private void cboAccessTypeFilter_SelectionChangeCommitted(object sender, EventArgs e)
+        {
+            if (this.cboAccessTypeFilter.Text == "<Show All Access Types>")
+            {
+                this.LoadListBox("ALL");
+            }
+            else
+            {
+                this.LoadListBox("SELECTED");
+            }
+        }
+
+        private void cmdOK_Click(object sender, EventArgs e)
+        {
+            this.UpdateDialogData(false);
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (this.components != null))
+            {
+                this.components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        private void InitializeComponent()
+        {
+            this.panel1 = new Panel();
+            this.cmdCancel = new Button();
+            this.cmdOK = new Button();
+            this.panel2 = new Panel();
+            this.label4 = new Label();
+            this.cboAccessTypeFilter = new ComboBox();
+            this.lstAccessTypes = new ListBox();
+            this.nudSlots = new NumericUpDown();
+            this.label6 = new Label();
+            this.lblEndTime = new Label();
+            this.label7 = new Label();
+            this.label2 = new Label();
+            this.lblClinic = new Label();
+            this.label15 = new Label();
+            this.txtNote = new TextBox();
+            this.label1 = new Label();
+            this.lblStartTime = new Label();
+            this.label3 = new Label();
+            this.panel1.SuspendLayout();
+            this.panel2.SuspendLayout();
+            this.nudSlots.BeginInit();
+            base.SuspendLayout();
+            this.panel1.Controls.Add(this.cmdCancel);
+            this.panel1.Controls.Add(this.cmdOK);
+            this.panel1.Dock = DockStyle.Bottom;
+            this.panel1.Location = new Point(0, 0x14e);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new Size(0x192, 40);
+            this.panel1.TabIndex = 2;
+            this.cmdCancel.DialogResult = DialogResult.Cancel;
+            this.cmdCancel.Location = new Point(0x120, 8);
+            this.cmdCancel.Name = "cmdCancel";
+            this.cmdCancel.Size = new Size(0x40, 0x18);
+            this.cmdCancel.TabIndex = 1;
+            this.cmdCancel.Text = "Cancel";
+            this.cmdOK.DialogResult = DialogResult.OK;
+            this.cmdOK.Location = new Point(0xd0, 8);
+            this.cmdOK.Name = "cmdOK";
+            this.cmdOK.Size = new Size(0x40, 0x18);
+            this.cmdOK.TabIndex = 0;
+            this.cmdOK.Text = "OK";
+            this.cmdOK.Click += new EventHandler(this.cmdOK_Click);
+            this.panel2.Controls.Add(this.label4);
+            this.panel2.Controls.Add(this.cboAccessTypeFilter);
+            this.panel2.Controls.Add(this.lstAccessTypes);
+            this.panel2.Controls.Add(this.nudSlots);
+            this.panel2.Controls.Add(this.label6);
+            this.panel2.Controls.Add(this.lblEndTime);
+            this.panel2.Controls.Add(this.label7);
+            this.panel2.Controls.Add(this.label2);
+            this.panel2.Controls.Add(this.lblClinic);
+            this.panel2.Controls.Add(this.label15);
+            this.panel2.Controls.Add(this.txtNote);
+            this.panel2.Controls.Add(this.label1);
+            this.panel2.Controls.Add(this.lblStartTime);
+            this.panel2.Controls.Add(this.label3);
+            this.panel2.Dock = DockStyle.Fill;
+            this.panel2.Location = new Point(0, 0);
+            this.panel2.Name = "panel2";
+            this.panel2.Size = new Size(0x192, 0x14e);
+            this.panel2.TabIndex = 3;
+            this.label4.Location = new Point(8, 0x88);
+            this.label4.Name = "label4";
+            this.label4.Size = new Size(80, 0x10);
+            this.label4.TabIndex = 0x29;
+            this.label4.Text = "Access Group:";
+            this.label4.TextAlign = ContentAlignment.MiddleRight;
+            this.cboAccessTypeFilter.DropDownStyle = ComboBoxStyle.DropDownList;
+            this.cboAccessTypeFilter.Location = new Point(0x58, 0x88);
+            this.cboAccessTypeFilter.Name = "cboAccessTypeFilter";
+            this.cboAccessTypeFilter.Size = new Size(0x128, 0x15);
+            this.cboAccessTypeFilter.TabIndex = 40;
+            this.cboAccessTypeFilter.SelectionChangeCommitted += new EventHandler(this.cboAccessTypeFilter_SelectionChangeCommitted);
+            this.lstAccessTypes.Location = new Point(0x58, 0xb0);
+            this.lstAccessTypes.Name = "lstAccessTypes";
+            this.lstAccessTypes.Size = new Size(0x128, 0x52);
+            this.lstAccessTypes.TabIndex = 0x26;
+            this.nudSlots.Location = new Point(0x58, 0x38);
+            int[] bits = new int[4];
+            bits[0] = 0x3e6;
+            this.nudSlots.Maximum = new decimal(bits);
+            this.nudSlots.Name = "nudSlots";
+            this.nudSlots.Size = new Size(40, 20);
+            this.nudSlots.TabIndex = 0x25;
+            int[] numArray2 = new int[4];
+            numArray2[0] = 1;
+            this.nudSlots.Value = new decimal(numArray2);
+            this.label6.Location = new Point(40, 0x38);
+            this.label6.Name = "label6";
+            this.label6.Size = new Size(40, 0x10);
+            this.label6.TabIndex = 0x24;
+            this.label6.Text = "Slots:";
+            this.label6.TextAlign = ContentAlignment.MiddleRight;
+            this.lblEndTime.BorderStyle = BorderStyle.Fixed3D;
+            this.lblEndTime.Location = new Point(0x110, 8);
+            this.lblEndTime.Name = "lblEndTime";
+            this.lblEndTime.Size = new Size(0x70, 0x10);
+            this.lblEndTime.TabIndex = 0x22;
+            this.label7.Location = new Point(0xd0, 8);
+            this.label7.Name = "label7";
+            this.label7.Size = new Size(0x40, 0x10);
+            this.label7.TabIndex = 0x21;
+            this.label7.Text = "End Time:";
+            this.label7.TextAlign = ContentAlignment.MiddleRight;
+            this.label2.Location = new Point(0x10, 0xb0);
+            this.label2.Name = "label2";
+            this.label2.Size = new Size(0x48, 0x10);
+            this.label2.TabIndex = 0x1d;
+            this.label2.Text = "Access Type:";
+            this.label2.TextAlign = ContentAlignment.MiddleRight;
+            this.lblClinic.BorderStyle = BorderStyle.Fixed3D;
+            this.lblClinic.Location = new Point(0x58, 0x20);
+            this.lblClinic.Name = "lblClinic";
+            this.lblClinic.Size = new Size(0x128, 0x10);
+            this.lblClinic.TabIndex = 0x1b;
+            this.label15.Location = new Point(40, 0x20);
+            this.label15.Name = "label15";
+            this.label15.Size = new Size(40, 0x10);
+            this.label15.TabIndex = 0x1a;
+            this.label15.Text = "Clinic:";
+            this.label15.TextAlign = ContentAlignment.MiddleRight;
+            this.txtNote.AcceptsReturn = true;
+            this.txtNote.Location = new Point(0x58, 80);
+            this.txtNote.Multiline = true;
+            this.txtNote.Name = "txtNote";
+            this.txtNote.Size = new Size(0x128, 0x30);
+            this.txtNote.TabIndex = 0x19;
+            this.label1.Location = new Point(0x18, 0x58);
+            this.label1.Name = "label1";
+            this.label1.Size = new Size(0x38, 0x10);
+            this.label1.TabIndex = 0x18;
+            this.label1.Text = "Note:";
+            this.label1.TextAlign = ContentAlignment.MiddleRight;
+            this.lblStartTime.BorderStyle = BorderStyle.Fixed3D;
+            this.lblStartTime.Location = new Point(0x58, 8);
+            this.lblStartTime.Name = "lblStartTime";
+            this.lblStartTime.Size = new Size(120, 0x10);
+            this.lblStartTime.TabIndex = 0x16;
+            this.label3.Location = new Point(0x18, 8);
+            this.label3.Name = "label3";
+            this.label3.Size = new Size(0x40, 0x10);
+            this.label3.TabIndex = 20;
+            this.label3.Text = "Start Time:";
+            this.label3.TextAlign = ContentAlignment.MiddleRight;
+            base.AcceptButton = this.cmdOK;
+            this.AutoScaleBaseSize = new Size(5, 13);
+            base.CancelButton = this.cmdCancel;
+            base.ClientSize = new Size(0x192, 0x176);
+            base.Controls.Add(this.panel2);
+            base.Controls.Add(this.panel1);
+            base.FormBorderStyle = FormBorderStyle.FixedDialog;
+            base.Name = "DAccessBlock";
+            base.StartPosition = FormStartPosition.CenterParent;
+            this.Text = "Access Block";
+            this.panel1.ResumeLayout(false);
+            this.panel2.ResumeLayout(false);
+            this.panel2.PerformLayout();
+            this.nudSlots.EndInit();
+            base.ResumeLayout(false);
+        }
+
+        public void InitializePage(CGAppointment pAppt, DataSet dsGlobal)
+        {
+            this.m_pAppt = new CGAppointment();
+            this.m_pAppt.StartTime = pAppt.StartTime;
+            this.m_pAppt.EndTime = pAppt.EndTime;
+            this.m_pAppt.Resource = pAppt.Resource;
+            this.m_pAppt.Note = pAppt.Note;
+            this.m_pAppt.Slots = pAppt.Slots;
+            this.m_pAppt.AccessTypeID = pAppt.AccessTypeID;
+            this.m_pAppt.AccessTypeName = pAppt.AccessTypeName;
+            this.m_dsGlobal = dsGlobal;
+            this.LoadListBox("ALL");
+            DataTable table = dsGlobal.Tables["AccessGroup"];
+            DataSet set = new DataSet("dsTemp");
+            set.Tables.Add(table.Copy());
+            DataTable table2 = set.Tables["AccessGroup"];
+            DataView view = new DataView(table2);
+            view.AddNew()["ACCESS_GROUP"] = "<Show All Access Types>";
+            view.Sort = "ACCESS_GROUP ASC";
+            this.cboAccessTypeFilter.DataSource = view;
+            this.cboAccessTypeFilter.DisplayMember = "ACCESS_GROUP";
+            this.cboAccessTypeFilter.SelectedIndex = this.cboAccessTypeFilter.Items.Count - 1;
+            this.UpdateDialogData(true);
+        }
+
+        public void InitializePage(DateTime dStart, DateTime dEnd, string sClinic, string sNote, DataSet dsGlobal)
+        {
+            this.m_pAppt = new CGAppointment();
+            this.m_pAppt.StartTime = dStart;
+            this.m_pAppt.EndTime = dEnd;
+            this.m_pAppt.Resource = sClinic;
+            this.m_pAppt.Note = sNote;
+            this.m_pAppt.Slots = 1;
+            this.m_dsGlobal = dsGlobal;
+            this.LoadListBox("ALL");
+            DataTable table = dsGlobal.Tables["AccessGroup"];
+            DataSet set = new DataSet("dsTemp");
+            set.Tables.Add(table.Copy());
+            DataTable table2 = set.Tables["AccessGroup"];
+            DataView view = new DataView(table2);
+            view.AddNew()["ACCESS_GROUP"] = "<Show All Access Types>";
+            view.Sort = "ACCESS_GROUP ASC";
+            this.cboAccessTypeFilter.DataSource = view;
+            this.cboAccessTypeFilter.DisplayMember = "ACCESS_GROUP";
+            this.cboAccessTypeFilter.SelectedIndex = this.cboAccessTypeFilter.Items.Count - 1;
+            this.m_pAppt.AccessTypeID = 0;
+            this.UpdateDialogData(true);
+        }
+
+        public void LoadListBox(string sGroup)
+        {
+            string str = "";
+            if (sGroup == "ALL")
+            {
+                this.m_dtTypes = this.m_dsGlobal.Tables["AccessTypes"];
+                this.m_dvTypes = new DataView(this.m_dtTypes);
+                str = "INACTIVE <> 'YES'";
+                this.m_dvTypes.RowFilter = str;
+                this.lstAccessTypes.DataSource = this.m_dvTypes;
+                this.lstAccessTypes.DisplayMember = "ACCESS_TYPE_NAME";
+                this.lstAccessTypes.ValueMember = "BMXIEN";
+            }
+            else
+            {
+                this.m_dtTypes = this.m_dsGlobal.Tables["AccessGroupType"];
+                this.m_dvTypes = new DataView(this.m_dtTypes);
+                str = "ACCESS_GROUP = '" + this.cboAccessTypeFilter.Text + "'";
+                this.m_dvTypes.RowFilter = str;
+                this.lstAccessTypes.DataSource = this.m_dvTypes;
+                this.lstAccessTypes.DisplayMember = "ACCESS_TYPE";
+                this.lstAccessTypes.ValueMember = "ACCESS_TYPE_ID";
+            }
+        }
+
+        private void UpdateDialogData(bool b)
+        {
+            if (b)
+            {
+                this.lblClinic.Text = this.m_pAppt.Resource;
+                this.lblEndTime.Text = this.m_pAppt.EndTime.ToShortDateString() + " " + this.m_pAppt.EndTime.ToShortTimeString();
+                this.lblStartTime.Text = this.m_pAppt.StartTime.ToShortDateString() + " " + this.m_pAppt.StartTime.ToShortTimeString();
+                this.txtNote.Text = this.m_pAppt.Note;
+                this.nudSlots.Value = this.m_pAppt.Slots;
+                if (this.m_pAppt.AccessTypeID != 0)
+                {
+                    this.lstAccessTypes.SelectedValue = this.m_pAppt.AccessTypeID;
+                }
+            }
+            else
+            {
+                this.m_pAppt.Note = this.txtNote.Text;
+                int selectedIndex = this.lstAccessTypes.SelectedIndex;
+                string str = this.lstAccessTypes.SelectedValue.ToString();
+                str = (str == "") ? "-1" : str;
+                int num = Convert.ToInt16(str);
+                this.m_pAppt.AccessTypeID = num;
+                this.m_pAppt.Slots = Convert.ToInt16(this.nudSlots.Value);
+            }
+        }
+
+        public int AccessTypeID
+        {
+            get
+            {
+                return this.m_pAppt.AccessTypeID;
+            }
+            set
+            {
+                this.m_pAppt.AccessTypeID = value;
+            }
+        }
+
+        public CGAppointment Appointment
+        {
+            get
+            {
+                return this.m_pAppt;
+            }
+            set
+            {
+                this.m_pAppt = value;
+            }
+        }
+
+        public DateTime EndTime
+        {
+            get
+            {
+                return this.m_pAppt.EndTime;
+            }
+            set
+            {
+                this.m_pAppt.EndTime = value;
+            }
+        }
+
+        public string Note
+        {
+            get
+            {
+                return this.m_pAppt.Note;
+            }
+            set
+            {
+                this.m_pAppt.Note = value;
+            }
+        }
+
+        public string Resource
+        {
+            get
+            {
+                return this.m_pAppt.Resource;
+            }
+            set
+            {
+                this.m_pAppt.Resource = value;
+            }
+        }
+
+        public int Slots
+        {
+            get
+            {
+                return this.m_pAppt.Slots;
+            }
+            set
+            {
+                this.m_pAppt.Slots = value;
+            }
+        }
+
+        public DateTime StartTime
+        {
+            get
+            {
+                return this.m_pAppt.StartTime;
+            }
+            set
+            {
+                this.m_pAppt.StartTime = value;
+            }
+        }
+    }
+}
+
Index: Scheduling/branches/GUI1.2/DAccessGroup.cs
===================================================================
--- Scheduling/branches/GUI1.2/DAccessGroup.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DAccessGroup.cs	(revision 855)
@@ -0,0 +1,204 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+//using System.Data.OleDb;
+using IndianHealthService.BMXNet;
+using System.Diagnostics;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DAccessGroup.
+	/// </summary>
+	public class DAccessGroup : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel pnlPageBottom;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.TextBox txtAccessGroupName;
+		private System.Windows.Forms.Label label1;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DAccessGroup()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+			m_sAccessGroupName = "";
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.pnlPageBottom = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.txtAccessGroupName = new System.Windows.Forms.TextBox();
+			this.label1 = new System.Windows.Forms.Label();
+			this.pnlPageBottom.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// pnlPageBottom
+			// 
+			this.pnlPageBottom.Controls.Add(this.cmdCancel);
+			this.pnlPageBottom.Controls.Add(this.cmdOK);
+			this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlPageBottom.Location = new System.Drawing.Point(0, 158);
+			this.pnlPageBottom.Name = "pnlPageBottom";
+			this.pnlPageBottom.Size = new System.Drawing.Size(496, 40);
+			this.pnlPageBottom.TabIndex = 7;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(376, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(56, 24);
+			this.cmdCancel.TabIndex = 2;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Enabled = false;
+			this.cmdOK.Location = new System.Drawing.Point(296, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 1;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// txtAccessGroupName
+			// 
+			this.txtAccessGroupName.Location = new System.Drawing.Point(184, 72);
+			this.txtAccessGroupName.Name = "txtAccessGroupName";
+			this.txtAccessGroupName.Size = new System.Drawing.Size(256, 20);
+			this.txtAccessGroupName.TabIndex = 0;
+			this.txtAccessGroupName.Text = "";
+			this.txtAccessGroupName.TextChanged += new System.EventHandler(this.txtAccessGroupName_TextChanged);
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(48, 72);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(136, 16);
+			this.label1.TabIndex = 9;
+			this.label1.Text = "Access Group Name:";
+			// 
+			// DAccessGroup
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.ClientSize = new System.Drawing.Size(496, 198);
+			this.Controls.Add(this.txtAccessGroupName);
+			this.Controls.Add(this.label1);
+			this.Controls.Add(this.pnlPageBottom);
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DAccessGroup";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "Access Group";
+			this.pnlPageBottom.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		private string	m_sAccessGroupName;
+
+		public void InitializePage(int nSelectedRGID, DataSet dsGlobal)
+		{
+
+			if (nSelectedRGID < 0) //then we're in ADD mode
+			{
+				this.Text = "Add New Access Group";
+				this.cmdOK.Enabled = false;
+			}
+			else //we're in EDIT mode
+			{
+				this.Text = "Edit Access Group";
+			}
+			UpdateDialogData(true);
+		}
+
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true)
+			{
+				txtAccessGroupName.Text = m_sAccessGroupName;
+			}
+			else
+			{
+				m_sAccessGroupName = txtAccessGroupName.Text;
+			}
+		}
+
+		private void txtAccessGroupName_TextChanged(object sender, System.EventArgs e)
+		{
+			string sText = txtAccessGroupName.Text;
+			if ((sText.Length > 2) && (sText.Length < 30))
+			{
+				cmdOK.Enabled = true;
+			}
+			else
+			{
+				cmdOK.Enabled = false;
+			}		
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			UpdateDialogData(false);
+		}
+
+		/// <summary>
+		/// Gets the name of the Access Group;
+		/// </summary>
+		public string AccessGroupName
+		{
+			get
+			{
+				return m_sAccessGroupName;
+			}
+			set
+			{
+				m_sAccessGroupName = value;
+			}
+		}
+	}
+}
Index: Scheduling/branches/GUI1.2/DAccessGroup.resx
===================================================================
--- Scheduling/branches/GUI1.2/DAccessGroup.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DAccessGroup.resx	(revision 855)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="pnlPageBottom.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlPageBottom.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlPageBottom.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlPageBottom.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtAccessGroupName.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtAccessGroupName.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtAccessGroupName.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.Name">
+    <value>DAccessGroup</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DAccessGroupItem.cs
===================================================================
--- Scheduling/branches/GUI1.2/DAccessGroupItem.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DAccessGroupItem.cs	(revision 855)
@@ -0,0 +1,212 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+//using System.Data.OleDb;
+using IndianHealthService.BMXNet;
+using System.Diagnostics;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DAccessGroupItem.
+	/// </summary>
+	public class DAccessGroupItem : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel pnlPageBottom;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.ComboBox cboAccessType;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DAccessGroupItem()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.pnlPageBottom = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.label1 = new System.Windows.Forms.Label();
+			this.cboAccessType = new System.Windows.Forms.ComboBox();
+			this.pnlPageBottom.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// pnlPageBottom
+			// 
+			this.pnlPageBottom.Controls.AddRange(new System.Windows.Forms.Control[] {
+																						this.cmdCancel,
+																						this.cmdOK});
+			this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlPageBottom.Location = new System.Drawing.Point(0, 112);
+			this.pnlPageBottom.Name = "pnlPageBottom";
+			this.pnlPageBottom.Size = new System.Drawing.Size(472, 40);
+			this.pnlPageBottom.TabIndex = 6;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(376, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(56, 24);
+			this.cmdCancel.TabIndex = 2;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(296, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 1;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(24, 40);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(120, 16);
+			this.label1.TabIndex = 10;
+			this.label1.Text = "Select Access Type:";
+			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// cboAccessType
+			// 
+			this.cboAccessType.Location = new System.Drawing.Point(152, 40);
+			this.cboAccessType.Name = "cboAccessType";
+			this.cboAccessType.Size = new System.Drawing.Size(248, 21);
+			this.cboAccessType.TabIndex = 9;
+			this.cboAccessType.Text = "cboAccessType";
+			// 
+			// DAccessGroupItem
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(472, 152);
+			this.Controls.AddRange(new System.Windows.Forms.Control[] {
+																		  this.label1,
+																		  this.cboAccessType,
+																		  this.pnlPageBottom});
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DAccessGroupItem";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "DAccessGroupItem";
+			this.pnlPageBottom.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		#region Fields
+		int		m_nAccessTypeID;
+		string	m_sAccessTypeName;
+		#endregion Fields
+
+
+		public void InitializePage(int nSelectedATID, DataSet dsGlobal)
+		{
+
+			//Datasource the ACCESS GROUP combo box
+			DataTable dtAccessType = dsGlobal.Tables["AccessTypes"];
+			DataView dvAccessType = new DataView(dtAccessType);
+
+
+			cboAccessType.DataSource = dvAccessType;
+			cboAccessType.DisplayMember = "ACCESS_TYPE_NAME";
+			cboAccessType.ValueMember = "BMXIEN";
+
+			Debug.Assert(nSelectedATID == -1); //We're always in ADD mode
+
+			this.Text = "Add New Access Type to Group";
+			m_nAccessTypeID = 0;
+			m_sAccessTypeName = "";
+			UpdateDialogData(true);
+		}
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true)
+			{
+				cboAccessType.SelectedValue = m_nAccessTypeID;
+			}
+			else
+			{
+				m_nAccessTypeID = Convert.ToInt16(cboAccessType.SelectedValue);
+				m_sAccessTypeName = cboAccessType.DisplayMember;
+			}
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			UpdateDialogData(false);		
+		}
+
+		#region Properties
+
+		/// <summary>
+		/// Contains the IEN of the AccessType in the BSDX_ACCESS_TYPE file
+		/// </summary>
+		public int AccessTypeID
+		{
+			get
+			{
+				return m_nAccessTypeID;
+			}
+		}
+
+		/// <summary>
+		/// Contains the name of the AccessType
+		/// </summary>
+		public string AccessTypeName
+		{
+			get
+			{
+				return m_sAccessTypeName;
+			}
+		}
+		#endregion Properties
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DAccessGroupItem.resx
===================================================================
--- Scheduling/branches/GUI1.2/DAccessGroupItem.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DAccessGroupItem.resx	(revision 855)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+            Microsoft ResX Schema 
+        
+            Version 1.3
+                
+            The primary goals of this format is to allow a simple XML format 
+            that is mostly human readable. The generation and parsing of the 
+            various data types are done through the TypeConverter classes 
+            associated with the data types.
+        
+            Example:
+        
+                ... ado.net/XML headers & schema ...
+                <resheader name="resmimetype">text/microsoft-resx</resheader>
+                <resheader name="version">1.3</resheader>
+                <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+                <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+                <data name="Name1">this is my long string</data>
+                <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+                <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+                    [base64 mime encoded serialized .NET Framework object]
+                </data>
+                <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+                    [base64 mime encoded string representing a byte array form of the .NET Framework object]
+                </data>
+        
+            There are any number of "resheader" rows that contain simple 
+            name/value pairs.
+            
+            Each data row contains a name, and value. The row also contains a 
+            type or mimetype. Type corresponds to a .NET class that support 
+            text/value conversion through the TypeConverter architecture. 
+            Classes that don't support this are serialized and stored with the 
+            mimetype set.
+                     
+            The mimetype is used for serialized objects, and tells the 
+            ResXResourceReader how to depersist the object. This is currently not 
+            extensible. For a given mimetype the value must be set accordingly:
+        
+            Note - application/x-microsoft.net.object.binary.base64 is the format 
+                   that the ResXResourceWriter will generate, however the reader can 
+                   read any of the formats listed below.
+        
+            mimetype: application/x-microsoft.net.object.binary.base64
+            value   : The object must be serialized with 
+                    : System.Serialization.Formatters.Binary.BinaryFormatter
+                    : and then encoded with base64 encoding.
+        
+            mimetype: application/x-microsoft.net.object.soap.base64
+            value   : The object must be serialized with 
+                    : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+                    : and then encoded with base64 encoding.
+            mimetype: application/x-microsoft.net.object.bytearray.base64
+            value   : The object must be serialized into a byte array 
+                    : using a System.ComponentModel.TypeConverter
+                    : and then encoded with base64 encoding.
+        -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="pnlPageBottom.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Name">
+    <value>DAccessGroupItem</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DAccessTemplate.cs
===================================================================
--- Scheduling/branches/GUI1.2/DAccessTemplate.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DAccessTemplate.cs	(revision 855)
@@ -0,0 +1,392 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DAccessTemplate.
+	/// </summary>
+	public class DAccessTemplate : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel pnlPageBottom;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Panel pnlDescription;
+		private System.Windows.Forms.GroupBox grpDescriptionResourceGroup;
+		private System.Windows.Forms.Label lblDescriptionResourceGroup;
+		private System.Windows.Forms.Button cmdSelectTemplate;
+		private System.Windows.Forms.TextBox txtTemplate;
+		private System.Windows.Forms.DateTimePicker dtpStartDate;
+		private System.Windows.Forms.NumericUpDown udWeeksToApply;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.Label label2;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+
+		#region Methods
+
+		public void InitializePage()
+		{
+
+			UpdateDialogData(true);
+
+		}
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true)
+			{
+				udWeeksToApply.Value = 1;
+			}
+			else
+			{
+				//
+				m_nWeeksToApply = (int) udWeeksToApply.Value;
+				m_dtStart = dtpStartDate.Value;
+			}
+		}
+
+		public DAccessTemplate()
+		{
+			InitializeComponent();
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			//assure that it's a monday in the future
+			DateTime dtStart = dtpStartDate.Value;
+			if ((dtStart.DayOfWeek != System.DayOfWeek.Monday) ||
+				(dtStart < DateTime.Today))
+			{
+				MessageBox.Show("Please select a future Monday.");
+				m_bCancelOK = true;
+				return;
+			}
+
+			if (m_bSelectedFile == false)
+			{
+				MessageBox.Show("Please select a valid template file.");
+				m_bCancelOK = true;
+				return;
+			}
+
+			if ((this.udWeeksToApply.Value > 52)||(this.udWeeksToApply.Value < 1))
+			{
+				MessageBox.Show("For the number of weeks to apply the template, please select a number between 1 and 52.");
+				m_bCancelOK = true;
+				return;
+			}
+			m_bCancelOK = false;
+
+			//Send the values from the controls to the fields
+			this.UpdateDialogData(false);
+
+		}
+		
+		private void cmdSelectTemplate_Click(object sender, System.EventArgs e)
+		{
+			//Open the file dialog and pick a file
+			m_bSelectedFile = false;
+			OpenFileDialog openFileDialog1 = new OpenFileDialog();
+			string sPath = "";
+			sPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+
+			openFileDialog1.InitialDirectory = "c:\\" ;
+			openFileDialog1.InitialDirectory = sPath ;
+			openFileDialog1.Filter = "Schedule Template Files (*.bsdxa)|*.bsdxa|All files (*.*)|*.*" ;
+			openFileDialog1.FilterIndex = 0 ;
+			openFileDialog1.RestoreDirectory = true ;
+
+			if(openFileDialog1.ShowDialog() == DialogResult.OK)
+			{
+				m_bSelectedFile = true;
+				m_ofDialog = openFileDialog1;
+				this.txtTemplate.Text = openFileDialog1.FileName;
+
+			}
+		}		
+
+
+		#endregion Methods
+
+		#region Fields
+		private OpenFileDialog	m_ofDialog;
+		private DateTime		m_dtStart;
+		private int				m_nWeeksToApply;
+		private bool			m_bCancelOK = false;
+		private bool			m_bSelectedFile = false;
+
+		#endregion Fields
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.pnlPageBottom = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.pnlDescription = new System.Windows.Forms.Panel();
+			this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
+			this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
+			this.cmdSelectTemplate = new System.Windows.Forms.Button();
+			this.txtTemplate = new System.Windows.Forms.TextBox();
+			this.dtpStartDate = new System.Windows.Forms.DateTimePicker();
+			this.udWeeksToApply = new System.Windows.Forms.NumericUpDown();
+			this.label1 = new System.Windows.Forms.Label();
+			this.label2 = new System.Windows.Forms.Label();
+			this.pnlPageBottom.SuspendLayout();
+			this.pnlDescription.SuspendLayout();
+			this.grpDescriptionResourceGroup.SuspendLayout();
+			((System.ComponentModel.ISupportInitialize)(this.udWeeksToApply)).BeginInit();
+			this.SuspendLayout();
+			// 
+			// pnlPageBottom
+			// 
+			this.pnlPageBottom.Controls.Add(this.cmdCancel);
+			this.pnlPageBottom.Controls.Add(this.cmdOK);
+			this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlPageBottom.Location = new System.Drawing.Point(0, 264);
+			this.pnlPageBottom.Name = "pnlPageBottom";
+			this.pnlPageBottom.Size = new System.Drawing.Size(440, 40);
+			this.pnlPageBottom.TabIndex = 7;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.CausesValidation = false;
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(360, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(56, 24);
+			this.cmdCancel.TabIndex = 2;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(280, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 1;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// pnlDescription
+			// 
+			this.pnlDescription.Controls.Add(this.grpDescriptionResourceGroup);
+			this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlDescription.Location = new System.Drawing.Point(0, 184);
+			this.pnlDescription.Name = "pnlDescription";
+			this.pnlDescription.Size = new System.Drawing.Size(440, 80);
+			this.pnlDescription.TabIndex = 8;
+			// 
+			// grpDescriptionResourceGroup
+			// 
+			this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
+			this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
+			this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
+			this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(440, 80);
+			this.grpDescriptionResourceGroup.TabIndex = 1;
+			this.grpDescriptionResourceGroup.TabStop = false;
+			this.grpDescriptionResourceGroup.Text = "Description";
+			// 
+			// lblDescriptionResourceGroup
+			// 
+			this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
+			this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
+			this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(434, 61);
+			this.lblDescriptionResourceGroup.TabIndex = 0;
+			this.lblDescriptionResourceGroup.Text = "Use this panel to define an access pattern for future clinic availability.";
+			// 
+			// cmdSelectTemplate
+			// 
+			this.cmdSelectTemplate.Location = new System.Drawing.Point(24, 40);
+			this.cmdSelectTemplate.Name = "cmdSelectTemplate";
+			this.cmdSelectTemplate.Size = new System.Drawing.Size(136, 32);
+			this.cmdSelectTemplate.TabIndex = 9;
+			this.cmdSelectTemplate.Text = "Select Access Template";
+			this.cmdSelectTemplate.Click += new System.EventHandler(this.cmdSelectTemplate_Click);
+			// 
+			// txtTemplate
+			// 
+			this.txtTemplate.Location = new System.Drawing.Point(176, 32);
+			this.txtTemplate.Multiline = true;
+			this.txtTemplate.Name = "txtTemplate";
+			this.txtTemplate.ReadOnly = true;
+			this.txtTemplate.Size = new System.Drawing.Size(248, 48);
+			this.txtTemplate.TabIndex = 10;
+			this.txtTemplate.Text = "";
+			// 
+			// dtpStartDate
+			// 
+			this.dtpStartDate.AllowDrop = true;
+			this.dtpStartDate.Checked = false;
+			this.dtpStartDate.Location = new System.Drawing.Point(176, 104);
+			this.dtpStartDate.Name = "dtpStartDate";
+			this.dtpStartDate.Size = new System.Drawing.Size(184, 20);
+			this.dtpStartDate.TabIndex = 11;
+			// 
+			// udWeeksToApply
+			// 
+			this.udWeeksToApply.Location = new System.Drawing.Point(176, 144);
+			this.udWeeksToApply.Maximum = new System.Decimal(new int[] {
+																		   52,
+																		   0,
+																		   0,
+																		   0});
+			this.udWeeksToApply.Minimum = new System.Decimal(new int[] {
+																		   1,
+																		   0,
+																		   0,
+																		   0});
+			this.udWeeksToApply.Name = "udWeeksToApply";
+			this.udWeeksToApply.Size = new System.Drawing.Size(96, 20);
+			this.udWeeksToApply.TabIndex = 12;
+			this.udWeeksToApply.Value = new System.Decimal(new int[] {
+																		 1,
+																		 0,
+																		 0,
+																		 0});
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(16, 104);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(152, 16);
+			this.label1.TabIndex = 13;
+			this.label1.Text = "Starting Week (Monday):";
+			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// label2
+			// 
+			this.label2.Location = new System.Drawing.Point(16, 144);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(152, 16);
+			this.label2.TabIndex = 13;
+			this.label2.Text = "Number of Weeks to Apply:";
+			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// DAccessTemplate
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(440, 304);
+			this.Controls.Add(this.label1);
+			this.Controls.Add(this.udWeeksToApply);
+			this.Controls.Add(this.dtpStartDate);
+			this.Controls.Add(this.txtTemplate);
+			this.Controls.Add(this.cmdSelectTemplate);
+			this.Controls.Add(this.pnlDescription);
+			this.Controls.Add(this.pnlPageBottom);
+			this.Controls.Add(this.label2);
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DAccessTemplate";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "Apply Access Template";
+			this.Closing += new System.ComponentModel.CancelEventHandler(this.DAccessTemplate_Closing);
+			this.pnlPageBottom.ResumeLayout(false);
+			this.pnlDescription.ResumeLayout(false);
+			this.grpDescriptionResourceGroup.ResumeLayout(false);
+			((System.ComponentModel.ISupportInitialize)(this.udWeeksToApply)).EndInit();
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+
+		private void DAccessTemplate_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+		{
+			if (m_bCancelOK == true)
+			{	
+				e.Cancel = true;
+				m_bCancelOK = false;
+			}
+			else
+			{
+				e.Cancel = false;
+			}
+		}
+
+
+		#region Properties
+
+
+		/// <summary>
+		/// Returns the open file dialog object
+		/// </summary>
+		public OpenFileDialog FileDialog
+		{
+			get
+			{
+				return m_ofDialog;
+			}
+		}
+
+		/// <summary>
+		/// Sets or returns the start date to apply the template
+		/// </summary>
+		public DateTime StartDate
+		{
+			get
+			{
+				return m_dtStart;
+			}
+			set
+			{
+				m_dtStart = value;
+			}
+		}
+
+		/// <summary>
+		/// Sets or returns the number of weeks to apply the template
+		/// </summary>
+		public int WeeksToApply
+		{
+			get
+			{
+				return m_nWeeksToApply;
+			}
+			set
+			{
+				m_nWeeksToApply = value;
+			}
+		}
+		#endregion Properties
+
+
+
+
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DAccessTemplate.resx
===================================================================
--- Scheduling/branches/GUI1.2/DAccessTemplate.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DAccessTemplate.resx	(revision 855)
@@ -0,0 +1,265 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="pnlPageBottom.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlPageBottom.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlPageBottom.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlPageBottom.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdSelectTemplate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdSelectTemplate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdSelectTemplate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtTemplate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtTemplate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtTemplate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="dtpStartDate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="dtpStartDate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="dtpStartDate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="udWeeksToApply.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="udWeeksToApply.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="udWeeksToApply.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Name">
+    <value>DAccessTemplate</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DAccessType.cs
===================================================================
--- Scheduling/branches/GUI1.2/DAccessType.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DAccessType.cs	(revision 855)
@@ -0,0 +1,331 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+//using System.Data.OleDb;
+using IndianHealthService.BMXNet;
+using System.Diagnostics;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DAccessType.
+	/// </summary>
+	public class DAccessType : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel panel1;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Button cmdSelectColor;
+		private System.Windows.Forms.TextBox txtColor;
+		private System.Windows.Forms.CheckBox chkInactivate;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		private DataTable	m_dtTypes;
+		private string		m_sAccessIEN;
+		private string		m_sAccessName;
+		private string		m_sColor;
+		private int			m_nRed;
+		private int			m_nGreen;
+		private int			m_nBlue;
+		private bool		m_bInactive;
+		private System.Windows.Forms.TextBox txtAccessType;
+		private System.Windows.Forms.Label label1;
+
+		public DAccessType()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.panel1 = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.cmdSelectColor = new System.Windows.Forms.Button();
+			this.txtColor = new System.Windows.Forms.TextBox();
+			this.chkInactivate = new System.Windows.Forms.CheckBox();
+			this.txtAccessType = new System.Windows.Forms.TextBox();
+			this.label1 = new System.Windows.Forms.Label();
+			this.panel1.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// panel1
+			// 
+			this.panel1.Controls.Add(this.cmdCancel);
+			this.panel1.Controls.Add(this.cmdOK);
+			this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.panel1.Location = new System.Drawing.Point(0, 144);
+			this.panel1.Name = "panel1";
+			this.panel1.Size = new System.Drawing.Size(370, 40);
+			this.panel1.TabIndex = 99;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(288, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(64, 24);
+			this.cmdCancel.TabIndex = 4;
+			this.cmdCancel.Text = "Cancel";
+			this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click);
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(208, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 3;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// cmdSelectColor
+			// 
+			this.cmdSelectColor.Location = new System.Drawing.Point(8, 48);
+			this.cmdSelectColor.Name = "cmdSelectColor";
+			this.cmdSelectColor.Size = new System.Drawing.Size(96, 32);
+			this.cmdSelectColor.TabIndex = 1;
+			this.cmdSelectColor.Text = "Select Display Color";
+			this.cmdSelectColor.Click += new System.EventHandler(this.cmdSelectColor_Click);
+			// 
+			// txtColor
+			// 
+			this.txtColor.BackColor = System.Drawing.SystemColors.Menu;
+			this.txtColor.BorderStyle = System.Windows.Forms.BorderStyle.None;
+			this.txtColor.ForeColor = System.Drawing.SystemColors.Window;
+			this.txtColor.Location = new System.Drawing.Point(128, 48);
+			this.txtColor.Multiline = true;
+			this.txtColor.Name = "txtColor";
+			this.txtColor.ReadOnly = true;
+			this.txtColor.Size = new System.Drawing.Size(144, 32);
+			this.txtColor.TabIndex = 31;
+			this.txtColor.TabStop = false;
+			this.txtColor.Text = "";
+			// 
+			// chkInactivate
+			// 
+			this.chkInactivate.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
+			this.chkInactivate.Location = new System.Drawing.Point(56, 96);
+			this.chkInactivate.Name = "chkInactivate";
+			this.chkInactivate.Size = new System.Drawing.Size(88, 16);
+			this.chkInactivate.TabIndex = 2;
+			this.chkInactivate.Text = "Inactive:";
+			// 
+			// txtAccessType
+			// 
+			this.txtAccessType.Location = new System.Drawing.Point(128, 16);
+			this.txtAccessType.Name = "txtAccessType";
+			this.txtAccessType.Size = new System.Drawing.Size(144, 20);
+			this.txtAccessType.TabIndex = 0;
+			this.txtAccessType.Text = "";
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(8, 16);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(112, 16);
+			this.label1.TabIndex = 36;
+			this.label1.Text = "Access Type Name:";
+			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// DAccessType
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(370, 184);
+			this.Controls.Add(this.label1);
+			this.Controls.Add(this.txtAccessType);
+			this.Controls.Add(this.chkInactivate);
+			this.Controls.Add(this.txtColor);
+			this.Controls.Add(this.cmdSelectColor);
+			this.Controls.Add(this.panel1);
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DAccessType";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "Manage Access Types";
+			this.panel1.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		private void cmdSelectColor_Click(object sender, System.EventArgs e)
+		{
+			ColorDialog MyDialog = new ColorDialog();
+			// Keeps the user from selecting a custom color.
+			MyDialog.AllowFullOpen = true ;
+			// Allows the user to get help. (The default is false.)
+			MyDialog.ShowHelp = true ;
+			// Sets the initial color select to the current text color,
+			// so that if the user cancels out, the original color is restored.
+			MyDialog.Color = txtColor.BackColor ;
+			MyDialog.ShowDialog();
+			txtColor.BackColor =  MyDialog.Color;
+
+		}
+
+		public void InitializePage(int nRow, DataSet dsGlobal)
+		{
+
+			m_dtTypes = dsGlobal.Tables["AccessTypes"];
+
+			if (nRow < 0) //then we're in ADD mode
+			{
+				m_sAccessIEN = "";
+				m_sAccessName = "";
+				m_sColor = "Gray";
+				Color c = Color.FromKnownColor(KnownColor.AppWorkspace);
+				m_nRed = c.R;
+				m_nBlue = c.B;
+				m_nGreen = c.G;
+				m_bInactive = false;
+
+			}
+			else //we're in EDIT mode
+			{
+				string sTemp;
+				DataRow dr = m_dtTypes.Rows[nRow];
+				m_sAccessIEN = dr["BMXIEN"].ToString();
+				m_sAccessName = dr["ACCESS_TYPE_NAME"].ToString();
+				m_sColor = dr["DISPLAY_COLOR"].ToString();
+				sTemp = dr["RED"].ToString();
+				sTemp = (sTemp == "")?"0":sTemp;
+				m_nRed = Convert.ToInt16(sTemp);
+				sTemp = dr["GREEN"].ToString();
+				sTemp = (sTemp == "")?"0":sTemp;
+				m_nGreen = Convert.ToInt16(sTemp);
+				sTemp = dr["BLUE"].ToString();
+				sTemp = (sTemp == "")?"0":sTemp;
+				m_nBlue = Convert.ToInt16(sTemp);
+				string sInactive = dr["INACTIVE"].ToString();
+				m_bInactive = (sInactive == "YES")?true:false;
+			}
+			UpdateDialogData(true);
+
+		}
+	
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true)
+			{
+				txtAccessType.Text = m_sAccessName;
+				this.chkInactivate.Checked = m_bInactive;
+				this.txtColor.BackColor = Color.FromArgb(m_nRed, m_nGreen, m_nBlue);
+			}
+			else
+			{
+				m_sAccessName = txtAccessType.Text;
+				m_bInactive = this.chkInactivate.Checked;
+				m_nRed = this.txtColor.BackColor.R;
+				m_nGreen = this.txtColor.BackColor.G;
+				m_nBlue = this.txtColor.BackColor.B;
+			}
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			this.UpdateDialogData(false);
+		}
+
+		private void cmdCancel_Click(object sender, System.EventArgs e)
+		{
+		
+		}
+
+		public string AccessIEN
+		{
+			get
+			{
+				return m_sAccessIEN;
+			}
+		}
+
+		public string AccessTypeName
+		{
+			get
+			{
+				return m_sAccessName;
+			}
+		}
+
+		public string DisplayColor
+		{
+			get
+			{
+				return m_sColor;
+			}
+		}
+
+		public bool Inactive
+		{
+			get
+			{
+				return m_bInactive;
+			}
+		}
+
+		public int Red
+		{
+			get
+			{
+				return m_nRed;
+			}
+		}
+
+		public int Green
+		{
+			get
+			{
+				return m_nGreen;
+			}
+		}
+
+		public int Blue
+		{
+			get
+			{
+				return m_nBlue;
+			}
+		}
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DAccessType.resx
===================================================================
--- Scheduling/branches/GUI1.2/DAccessType.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DAccessType.resx	(revision 855)
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="panel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panel1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panel1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panel1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdSelectColor.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdSelectColor.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdSelectColor.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtColor.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtColor.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtColor.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkInactivate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkInactivate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkInactivate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtAccessType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtAccessType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtAccessType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Name">
+    <value>DAccessType</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DAppointPage.cs
===================================================================
--- Scheduling/branches/GUI1.2/DAppointPage.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DAppointPage.cs	(revision 855)
@@ -0,0 +1,694 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+//using System.Data.OleDb;
+using System.Diagnostics;
+using IndianHealthService.BMXNet;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Appointment Info Dialog
+	/// </summary>
+	public class DAppointPage : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.TabControl tabControl1;
+		private System.Windows.Forms.TabPage tabPatientInfo;
+		private System.Windows.Forms.TabPage tabAppointment;
+		private System.Windows.Forms.Panel panel1;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.GroupBox groupBox2;
+		private System.Windows.Forms.TextBox txtCity;
+		private System.Windows.Forms.Label label8;
+		private System.Windows.Forms.Label label9;
+		private System.Windows.Forms.TextBox txtZip;
+		private System.Windows.Forms.Label label10;
+		private System.Windows.Forms.TextBox txtState;
+		private System.Windows.Forms.Label label11;
+		private System.Windows.Forms.TextBox txtStreet;
+		private System.Windows.Forms.Label label12;
+		private System.Windows.Forms.TextBox txtPhoneOffice;
+		private System.Windows.Forms.Label label13;
+		private System.Windows.Forms.TextBox txtPhoneHome;
+        private System.Windows.Forms.GroupBox groupBox1;
+		private System.Windows.Forms.Label label6;
+		private System.Windows.Forms.TextBox txtSSN;
+		private System.Windows.Forms.Label label5;
+		private System.Windows.Forms.TextBox txtDOB;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.TextBox txtPatientName;
+		private System.Windows.Forms.GroupBox groupBox3;
+		private System.Windows.Forms.Label lblClinic;
+		private System.Windows.Forms.Label label15;
+		private System.Windows.Forms.TextBox txtNote;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.Label lblDuration;
+		private System.Windows.Forms.Label lblStartTime;
+		private System.Windows.Forms.Label label4;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.Label label14;
+        private System.Windows.Forms.TextBox txtHRN;
+        private GroupBox groupBox4;
+        private BindingSource dsPatientApptDisplay2BindingSource;
+        private dsPatientApptDisplay2 dsPatientApptDisplay2;
+        private BindingSource patientApptsBindingSource;
+        private IContainer components;
+
+		public DAppointPage()
+		{
+			InitializeComponent();
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+            this.components = new System.ComponentModel.Container();
+            this.tabControl1 = new System.Windows.Forms.TabControl();
+            this.tabAppointment = new System.Windows.Forms.TabPage();
+            this.groupBox4 = new System.Windows.Forms.GroupBox();
+            this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.lblClinic = new System.Windows.Forms.Label();
+            this.label15 = new System.Windows.Forms.Label();
+            this.txtNote = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.lblDuration = new System.Windows.Forms.Label();
+            this.lblStartTime = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.label14 = new System.Windows.Forms.Label();
+            this.txtHRN = new System.Windows.Forms.TextBox();
+            this.label6 = new System.Windows.Forms.Label();
+            this.txtSSN = new System.Windows.Forms.TextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.txtDOB = new System.Windows.Forms.TextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.txtPatientName = new System.Windows.Forms.TextBox();
+            this.tabPatientInfo = new System.Windows.Forms.TabPage();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.label12 = new System.Windows.Forms.Label();
+            this.txtPhoneOffice = new System.Windows.Forms.TextBox();
+            this.label13 = new System.Windows.Forms.Label();
+            this.txtPhoneHome = new System.Windows.Forms.TextBox();
+            this.txtCity = new System.Windows.Forms.TextBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.txtZip = new System.Windows.Forms.TextBox();
+            this.label10 = new System.Windows.Forms.Label();
+            this.txtState = new System.Windows.Forms.TextBox();
+            this.label11 = new System.Windows.Forms.Label();
+            this.txtStreet = new System.Windows.Forms.TextBox();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.cmdCancel = new System.Windows.Forms.Button();
+            this.cmdOK = new System.Windows.Forms.Button();
+            this.patientApptsBindingSource = new System.Windows.Forms.BindingSource(this.components);
+            this.dsPatientApptDisplay2BindingSource = new System.Windows.Forms.BindingSource(this.components);
+            this.dsPatientApptDisplay2 = new IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2();
+            this.tabControl1.SuspendLayout();
+            this.tabAppointment.SuspendLayout();
+            this.groupBox3.SuspendLayout();
+            this.groupBox1.SuspendLayout();
+            this.tabPatientInfo.SuspendLayout();
+            this.groupBox2.SuspendLayout();
+            this.panel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.patientApptsBindingSource)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2BindingSource)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // tabControl1
+            // 
+            this.tabControl1.Controls.Add(this.tabAppointment);
+            this.tabControl1.Controls.Add(this.tabPatientInfo);
+            this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tabControl1.Location = new System.Drawing.Point(0, 0);
+            this.tabControl1.Name = "tabControl1";
+            this.tabControl1.SelectedIndex = 0;
+            this.tabControl1.Size = new System.Drawing.Size(471, 526);
+            this.tabControl1.TabIndex = 0;
+            // 
+            // tabAppointment
+            // 
+            this.tabAppointment.Controls.Add(this.groupBox4);
+            this.tabAppointment.Controls.Add(this.groupBox3);
+            this.tabAppointment.Controls.Add(this.groupBox1);
+            this.tabAppointment.Location = new System.Drawing.Point(4, 22);
+            this.tabAppointment.Name = "tabAppointment";
+            this.tabAppointment.Size = new System.Drawing.Size(463, 500);
+            this.tabAppointment.TabIndex = 1;
+            this.tabAppointment.Text = "Appointment";
+            // 
+            // groupBox4
+            // 
+            this.groupBox4.Location = new System.Drawing.Point(8, 254);
+            this.groupBox4.Name = "groupBox4";
+            this.groupBox4.Size = new System.Drawing.Size(439, 204);
+            this.groupBox4.TabIndex = 14;
+            this.groupBox4.TabStop = false;
+            this.groupBox4.Text = "Other Appointments";
+            // 
+            // groupBox3
+            // 
+            this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+                        | System.Windows.Forms.AnchorStyles.Right)));
+            this.groupBox3.Controls.Add(this.lblClinic);
+            this.groupBox3.Controls.Add(this.label15);
+            this.groupBox3.Controls.Add(this.txtNote);
+            this.groupBox3.Controls.Add(this.label1);
+            this.groupBox3.Controls.Add(this.lblDuration);
+            this.groupBox3.Controls.Add(this.lblStartTime);
+            this.groupBox3.Controls.Add(this.label4);
+            this.groupBox3.Controls.Add(this.label3);
+            this.groupBox3.Location = new System.Drawing.Point(8, 107);
+            this.groupBox3.Name = "groupBox3";
+            this.groupBox3.Size = new System.Drawing.Size(439, 141);
+            this.groupBox3.TabIndex = 13;
+            this.groupBox3.TabStop = false;
+            this.groupBox3.Text = "Appointment";
+            // 
+            // lblClinic
+            // 
+            this.lblClinic.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblClinic.Location = new System.Drawing.Point(200, 48);
+            this.lblClinic.Name = "lblClinic";
+            this.lblClinic.Size = new System.Drawing.Size(233, 16);
+            this.lblClinic.TabIndex = 19;
+            // 
+            // label15
+            // 
+            this.label15.Location = new System.Drawing.Point(152, 48);
+            this.label15.Name = "label15";
+            this.label15.Size = new System.Drawing.Size(40, 16);
+            this.label15.TabIndex = 18;
+            this.label15.Text = "Clinic:";
+            this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // txtNote
+            // 
+            this.txtNote.AcceptsReturn = true;
+            this.txtNote.Location = new System.Drawing.Point(80, 72);
+            this.txtNote.Multiline = true;
+            this.txtNote.Name = "txtNote";
+            this.txtNote.Size = new System.Drawing.Size(353, 60);
+            this.txtNote.TabIndex = 17;
+            // 
+            // label1
+            // 
+            this.label1.Location = new System.Drawing.Point(4, 80);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(56, 16);
+            this.label1.TabIndex = 16;
+            this.label1.Text = "Notes:";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // lblDuration
+            // 
+            this.lblDuration.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblDuration.Location = new System.Drawing.Point(80, 48);
+            this.lblDuration.Name = "lblDuration";
+            this.lblDuration.Size = new System.Drawing.Size(56, 16);
+            this.lblDuration.TabIndex = 15;
+            // 
+            // lblStartTime
+            // 
+            this.lblStartTime.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblStartTime.Location = new System.Drawing.Point(80, 24);
+            this.lblStartTime.Name = "lblStartTime";
+            this.lblStartTime.Size = new System.Drawing.Size(353, 16);
+            this.lblStartTime.TabIndex = 14;
+            // 
+            // label4
+            // 
+            this.label4.Location = new System.Drawing.Point(16, 48);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(56, 16);
+            this.label4.TabIndex = 13;
+            this.label4.Text = "Duration:";
+            this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label3
+            // 
+            this.label3.Location = new System.Drawing.Point(8, 24);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(64, 16);
+            this.label3.TabIndex = 12;
+            this.label3.Text = "Start Time:";
+            this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.label14);
+            this.groupBox1.Controls.Add(this.txtHRN);
+            this.groupBox1.Controls.Add(this.label6);
+            this.groupBox1.Controls.Add(this.txtSSN);
+            this.groupBox1.Controls.Add(this.label5);
+            this.groupBox1.Controls.Add(this.txtDOB);
+            this.groupBox1.Controls.Add(this.label2);
+            this.groupBox1.Controls.Add(this.txtPatientName);
+            this.groupBox1.Location = new System.Drawing.Point(8, 8);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(439, 93);
+            this.groupBox1.TabIndex = 12;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "Patient ID";
+            // 
+            // label14
+            // 
+            this.label14.Location = new System.Drawing.Point(56, 64);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(40, 16);
+            this.label14.TabIndex = 13;
+            this.label14.Text = "HRN:";
+            this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // txtHRN
+            // 
+            this.txtHRN.Location = new System.Drawing.Point(96, 64);
+            this.txtHRN.Name = "txtHRN";
+            this.txtHRN.ReadOnly = true;
+            this.txtHRN.Size = new System.Drawing.Size(120, 20);
+            this.txtHRN.TabIndex = 12;
+            // 
+            // label6
+            // 
+            this.label6.Location = new System.Drawing.Point(224, 40);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(40, 16);
+            this.label6.TabIndex = 9;
+            this.label6.Text = "SSN:";
+            this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // txtSSN
+            // 
+            this.txtSSN.Location = new System.Drawing.Point(272, 40);
+            this.txtSSN.Name = "txtSSN";
+            this.txtSSN.ReadOnly = true;
+            this.txtSSN.Size = new System.Drawing.Size(161, 20);
+            this.txtSSN.TabIndex = 8;
+            // 
+            // label5
+            // 
+            this.label5.Location = new System.Drawing.Point(64, 40);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(32, 16);
+            this.label5.TabIndex = 7;
+            this.label5.Text = "DOB:";
+            this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // txtDOB
+            // 
+            this.txtDOB.Location = new System.Drawing.Point(96, 40);
+            this.txtDOB.Name = "txtDOB";
+            this.txtDOB.ReadOnly = true;
+            this.txtDOB.Size = new System.Drawing.Size(120, 20);
+            this.txtDOB.TabIndex = 6;
+            // 
+            // label2
+            // 
+            this.label2.Location = new System.Drawing.Point(56, 16);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(40, 16);
+            this.label2.TabIndex = 5;
+            this.label2.Text = "Name:";
+            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // txtPatientName
+            // 
+            this.txtPatientName.Location = new System.Drawing.Point(96, 16);
+            this.txtPatientName.Name = "txtPatientName";
+            this.txtPatientName.ReadOnly = true;
+            this.txtPatientName.Size = new System.Drawing.Size(337, 20);
+            this.txtPatientName.TabIndex = 0;
+            // 
+            // tabPatientInfo
+            // 
+            this.tabPatientInfo.Controls.Add(this.groupBox2);
+            this.tabPatientInfo.Location = new System.Drawing.Point(4, 22);
+            this.tabPatientInfo.Name = "tabPatientInfo";
+            this.tabPatientInfo.Size = new System.Drawing.Size(463, 500);
+            this.tabPatientInfo.TabIndex = 0;
+            this.tabPatientInfo.Text = "Contact Information";
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.Controls.Add(this.label12);
+            this.groupBox2.Controls.Add(this.txtPhoneOffice);
+            this.groupBox2.Controls.Add(this.label13);
+            this.groupBox2.Controls.Add(this.txtPhoneHome);
+            this.groupBox2.Controls.Add(this.txtCity);
+            this.groupBox2.Controls.Add(this.label8);
+            this.groupBox2.Controls.Add(this.label9);
+            this.groupBox2.Controls.Add(this.txtZip);
+            this.groupBox2.Controls.Add(this.label10);
+            this.groupBox2.Controls.Add(this.txtState);
+            this.groupBox2.Controls.Add(this.label11);
+            this.groupBox2.Controls.Add(this.txtStreet);
+            this.groupBox2.Location = new System.Drawing.Point(8, 16);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Size = new System.Drawing.Size(444, 128);
+            this.groupBox2.TabIndex = 1;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "Address";
+            // 
+            // label12
+            // 
+            this.label12.Location = new System.Drawing.Point(224, 96);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(40, 16);
+            this.label12.TabIndex = 23;
+            this.label12.Text = "Ofc:";
+            this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // txtPhoneOffice
+            // 
+            this.txtPhoneOffice.Location = new System.Drawing.Point(272, 96);
+            this.txtPhoneOffice.Name = "txtPhoneOffice";
+            this.txtPhoneOffice.ReadOnly = true;
+            this.txtPhoneOffice.Size = new System.Drawing.Size(166, 20);
+            this.txtPhoneOffice.TabIndex = 22;
+            // 
+            // label13
+            // 
+            this.label13.Location = new System.Drawing.Point(8, 96);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(88, 16);
+            this.label13.TabIndex = 21;
+            this.label13.Text = "Phone (Home):";
+            this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // txtPhoneHome
+            // 
+            this.txtPhoneHome.Location = new System.Drawing.Point(96, 96);
+            this.txtPhoneHome.Name = "txtPhoneHome";
+            this.txtPhoneHome.ReadOnly = true;
+            this.txtPhoneHome.Size = new System.Drawing.Size(120, 20);
+            this.txtPhoneHome.TabIndex = 20;
+            // 
+            // txtCity
+            // 
+            this.txtCity.Location = new System.Drawing.Point(96, 48);
+            this.txtCity.Name = "txtCity";
+            this.txtCity.ReadOnly = true;
+            this.txtCity.Size = new System.Drawing.Size(342, 20);
+            this.txtCity.TabIndex = 18;
+            // 
+            // label8
+            // 
+            this.label8.Location = new System.Drawing.Point(16, 48);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(72, 16);
+            this.label8.TabIndex = 19;
+            this.label8.Text = "City:";
+            this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // label9
+            // 
+            this.label9.Location = new System.Drawing.Point(224, 72);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(40, 16);
+            this.label9.TabIndex = 17;
+            this.label9.Text = "Zip:";
+            this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // txtZip
+            // 
+            this.txtZip.Location = new System.Drawing.Point(272, 72);
+            this.txtZip.Name = "txtZip";
+            this.txtZip.ReadOnly = true;
+            this.txtZip.Size = new System.Drawing.Size(166, 20);
+            this.txtZip.TabIndex = 16;
+            // 
+            // label10
+            // 
+            this.label10.Location = new System.Drawing.Point(56, 72);
+            this.label10.Name = "label10";
+            this.label10.Size = new System.Drawing.Size(40, 16);
+            this.label10.TabIndex = 15;
+            this.label10.Text = "State:";
+            this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // txtState
+            // 
+            this.txtState.Location = new System.Drawing.Point(96, 72);
+            this.txtState.Name = "txtState";
+            this.txtState.ReadOnly = true;
+            this.txtState.Size = new System.Drawing.Size(120, 20);
+            this.txtState.TabIndex = 14;
+            // 
+            // label11
+            // 
+            this.label11.Location = new System.Drawing.Point(56, 22);
+            this.label11.Name = "label11";
+            this.label11.Size = new System.Drawing.Size(40, 16);
+            this.label11.TabIndex = 13;
+            this.label11.Text = "Street:";
+            this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            // 
+            // txtStreet
+            // 
+            this.txtStreet.Location = new System.Drawing.Point(96, 22);
+            this.txtStreet.Name = "txtStreet";
+            this.txtStreet.ReadOnly = true;
+            this.txtStreet.Size = new System.Drawing.Size(342, 20);
+            this.txtStreet.TabIndex = 12;
+            // 
+            // panel1
+            // 
+            this.panel1.Controls.Add(this.cmdCancel);
+            this.panel1.Controls.Add(this.cmdOK);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.panel1.Location = new System.Drawing.Point(0, 486);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(471, 40);
+            this.panel1.TabIndex = 1;
+            // 
+            // cmdCancel
+            // 
+            this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.cmdCancel.Location = new System.Drawing.Point(387, 8);
+            this.cmdCancel.Name = "cmdCancel";
+            this.cmdCancel.Size = new System.Drawing.Size(64, 24);
+            this.cmdCancel.TabIndex = 1;
+            this.cmdCancel.Text = "Cancel";
+            // 
+            // cmdOK
+            // 
+            this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.cmdOK.Location = new System.Drawing.Point(317, 8);
+            this.cmdOK.Name = "cmdOK";
+            this.cmdOK.Size = new System.Drawing.Size(64, 24);
+            this.cmdOK.TabIndex = 0;
+            this.cmdOK.Text = "OK";
+            this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+            // 
+            // patientApptsBindingSource
+            // 
+            this.patientApptsBindingSource.DataMember = "PatientAppts";
+            this.patientApptsBindingSource.DataSource = this.dsPatientApptDisplay2BindingSource;
+            // 
+            // dsPatientApptDisplay2BindingSource
+            // 
+            this.dsPatientApptDisplay2BindingSource.DataSource = this.dsPatientApptDisplay2;
+            this.dsPatientApptDisplay2BindingSource.Position = 0;
+            // 
+            // dsPatientApptDisplay2
+            // 
+            this.dsPatientApptDisplay2.DataSetName = "dsPatientApptDisplay2";
+            this.dsPatientApptDisplay2.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
+            // 
+            // DAppointPage
+            // 
+            this.AcceptButton = this.cmdOK;
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.CancelButton = this.cmdCancel;
+            this.ClientSize = new System.Drawing.Size(471, 526);
+            this.Controls.Add(this.panel1);
+            this.Controls.Add(this.tabControl1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+            this.Name = "DAppointPage";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "Patient Appointment";
+            this.tabControl1.ResumeLayout(false);
+            this.tabAppointment.ResumeLayout(false);
+            this.groupBox3.ResumeLayout(false);
+            this.groupBox3.PerformLayout();
+            this.groupBox1.ResumeLayout(false);
+            this.groupBox1.PerformLayout();
+            this.tabPatientInfo.ResumeLayout(false);
+            this.groupBox2.ResumeLayout(false);
+            this.groupBox2.PerformLayout();
+            this.panel1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.patientApptsBindingSource)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2BindingSource)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2)).EndInit();
+            this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		#region Fields
+
+		private CGDocumentManager	m_DocManager;
+
+		private string			m_sPatientName;
+		private string			m_sPatientHRN;
+		private string			m_sPatientIEN;
+		private string			m_sPatientDOB;
+		private string			m_sPatientSSN;
+
+		private string			m_sCity;
+		private string			m_sPhoneHome;
+		private string			m_sPhoneOffice;
+		private string			m_sState;
+		private string			m_sStreet;
+		private string			m_sZip;
+
+		private string			m_sNote;
+		private	DateTime		m_dStartTime;
+		private int				m_nDuration;
+		private string			m_sClinic;
+
+		#endregion //fields
+
+		#region Methods
+
+		public void InitializePage(CGAppointment a)
+		{
+			InitializePage(a.PatientID.ToString(), a.StartTime, a.Duration, "", a.Note);
+		}
+
+		public void InitializePage(string sPatientIEN, DateTime dStart, int nDuration, string sClinic, string sNote)
+		{
+			m_dStartTime = dStart;
+			m_nDuration = nDuration;
+			m_sClinic = sClinic;
+			m_sPatientIEN = sPatientIEN;
+			m_sNote = sNote;
+			try 
+			{
+				string sSql;
+				sSql = "BSDX GET BASIC REG INFO^" + m_sPatientIEN;
+
+				DataTable tb = m_DocManager.RPMSDataTable(sSql, "PatientRegInfo");
+
+				Debug.Assert(tb.Rows.Count == 1);
+				DataRow r = tb.Rows[0];
+				this.m_sPatientName = r["NAME"].ToString();
+				this.m_sPatientHRN = r["HRN"].ToString();
+				this.m_sPatientIEN = r["IEN"].ToString();
+				this.m_sPatientSSN = r["SSN"].ToString();
+				DateTime dDob =(DateTime) r["DOB"]; //what if it's null?
+				this.m_sPatientDOB = dDob.ToShortDateString();
+				this.m_sStreet = r["STREET"].ToString();
+				this.m_sCity = r["CITY"].ToString();
+				this.m_sPhoneOffice = r["OFCPHONE"].ToString();
+				this.m_sState = r["STATE"].ToString();
+				this.m_sZip = r["ZIP"].ToString();
+				this.m_sPhoneHome = r["HOMEPHONE"].ToString();
+
+				this.UpdateDialogData(true);
+                Control UC = new UCPatientAppts(m_DocManager, int.Parse(m_sPatientIEN));
+                UC.Dock = DockStyle.Fill;
+                groupBox4.Controls.Add(UC);
+            }
+			catch(Exception e)
+			{
+				MessageBox.Show("DAppointPage::InitializePage -- Unable to retrieve patient information from VistA.  " + e.Message);
+			}
+
+		}
+		/// <summary>
+		/// Move data from member variables to controls (b == true)
+		/// or from controls to member variables (b == false)
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true) //move member vars into control data
+			{
+				lblClinic.Text = m_sClinic;
+				lblDuration.Text = m_nDuration.ToString();
+				lblStartTime.Text = m_dStartTime.ToShortDateString() + " " + m_dStartTime.ToShortTimeString();
+
+				txtCity.Text = this.m_sCity;
+				txtDOB.Text = this.m_sPatientDOB;
+				txtHRN.Text = this.m_sPatientHRN;
+				txtNote.Text = this.m_sNote;
+				txtPatientName.Text = m_sPatientName;
+				txtPhoneHome.Text = this.m_sPhoneHome;
+				txtPhoneOffice.Text = this.m_sPhoneOffice;
+				txtSSN.Text = this.m_sPatientSSN;
+				txtState.Text = this.m_sState;
+				txtStreet.Text = this.m_sStreet;
+				txtZip.Text = this.m_sZip;
+
+			}
+			else //move control data into member vars
+			{
+				string sNote = txtNote.Text;
+				sNote = sNote.Replace("^", " ");
+				this.m_sNote = sNote;
+			}
+			
+		}
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			this.UpdateDialogData(false);
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+
+		#endregion //Methods
+
+		#region Properties
+	
+		public string Note
+		{
+			get
+			{
+				return m_sNote;
+			}
+			set
+			{
+				m_sNote = value;
+			}
+		}
+
+		public CGDocumentManager DocManager
+		{
+			get
+			{
+				return m_DocManager;
+			}
+			set
+			{
+				m_DocManager = value;
+			}
+		}
+
+		#endregion //Properties
+
+	} //end Class
+}
Index: Scheduling/branches/GUI1.2/DAppointPage.resx
===================================================================
--- Scheduling/branches/GUI1.2/DAppointPage.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DAppointPage.resx	(revision 855)
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="patientApptsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>412, 17</value>
+  </metadata>
+  <metadata name="dsPatientApptDisplay2BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>179, 17</value>
+  </metadata>
+  <metadata name="dsPatientApptDisplay2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>
Index: Scheduling/branches/GUI1.2/DApptSearch.cs
===================================================================
--- Scheduling/branches/GUI1.2/DApptSearch.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DApptSearch.cs	(revision 855)
@@ -0,0 +1,820 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+//using System.Data.OleDb;
+using IndianHealthService.BMXNet;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DApptSearch.
+	/// </summary>
+	public class DApptSearch : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel panel1;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Panel pnlDescription;
+		private System.Windows.Forms.GroupBox grpDescription;
+		private System.Windows.Forms.Label lblDescription;
+		private System.Windows.Forms.GroupBox groupBox1;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.CheckedListBox lstAccessTypes;
+		private System.Windows.Forms.ComboBox cboAccessTypeFilter;
+		private System.Windows.Forms.GroupBox grpDayOfWeek;
+		private System.Windows.Forms.CheckBox chkSun;
+		private System.Windows.Forms.CheckBox chkSat;
+		private System.Windows.Forms.CheckBox chkFri;
+		private System.Windows.Forms.CheckBox chkThu;
+		private System.Windows.Forms.CheckBox chkWed;
+		private System.Windows.Forms.CheckBox chkTue;
+		private System.Windows.Forms.CheckBox chkMon;
+		private System.Windows.Forms.GroupBox grpTimeOfDay;
+		private System.Windows.Forms.RadioButton rdoBoth;
+		private System.Windows.Forms.RadioButton rdoPM;
+		private System.Windows.Forms.RadioButton rdoAM;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.MonthCalendar calStartDate;
+		private System.Windows.Forms.GroupBox groupBox2;
+		private System.Windows.Forms.DataGrid grdResult;
+		private System.Windows.Forms.Button cmdSearch;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DApptSearch()
+		{
+			InitializeComponent();
+		}
+
+		#region Fields
+
+		private CGDocumentManager	m_DocManager;
+		
+		private DataSet	m_dsGlobal;
+		DataTable		m_dtTypes;
+		DataView		m_dvTypes;
+
+		DateTime		m_dStart;
+		DateTime		m_dEnd;
+		ArrayList		m_alResources;
+		ArrayList		m_alAccessTypes;
+		string			m_sWeekDays;
+		string			m_sAmpm;
+
+		DataTable		m_dtResult;
+		DataView		m_dvResult;
+
+		string			m_sSelectedResource;
+		DateTime		m_sSelectedDate;
+
+		#endregion Fields
+
+        #region Methods
+
+        public void LoadListBox(string sGroup)
+		{
+			if (sGroup == "ALL")
+			{
+				//Load the Access Type list box with ALL access types
+				m_dtTypes = m_dsGlobal.Tables["AccessTypes"];
+				m_dvTypes = new DataView(m_dtTypes);
+				lstAccessTypes.DataSource = m_dvTypes;
+				lstAccessTypes.DisplayMember = "ACCESS_TYPE_NAME";
+				lstAccessTypes.Tag = 1; //This holds the column index of the ACCESS_TYPE_NAME column
+				lstAccessTypes.ValueMember = "BMXIEN";
+			}
+			else 
+			{
+				//Load the Access Type list box with active access types belonging
+				//to group sGroup
+
+				//Build AccessGroup table containing *active* AccessTypes and their Groups
+				m_dtTypes = m_dsGlobal.Tables["AccessGroupType"];
+				CGSchedLib.OutputArray(m_dtTypes, "Access Group Type");
+				//Create a view that is filterable on Access Group
+				m_dvTypes = new DataView(m_dtTypes);
+				m_dvTypes.RowFilter = "ACCESS_GROUP = '" + this.cboAccessTypeFilter.Text + "'";
+				lstAccessTypes.DataSource = m_dvTypes;
+				lstAccessTypes.DisplayMember = "ACCESS_TYPE";
+				lstAccessTypes.ValueMember = "ACCESS_TYPE_ID";
+				lstAccessTypes.Tag = 4; //This holds the column index of the ACCESS_TYPE column
+			}
+		}
+
+		public void InitializePage(ArrayList alResources, CGDocumentManager docManager)
+		{
+
+			this.m_DocManager = docManager;
+			this.m_dsGlobal = m_DocManager.GlobalDataSet;
+			System.IntPtr pHandle = this.Handle;
+			LoadListBox("ALL");
+
+			m_dStart = DateTime.Today;
+			m_dEnd = new DateTime(9999);
+			this.m_alResources = alResources;
+			this.m_alAccessTypes = new ArrayList();
+			this.m_sAmpm="both";
+			this.m_sWeekDays = "";
+
+			//Load filter combo with list of access type groups
+			DataTable dtGroup = m_dsGlobal.Tables["AccessGroup"];
+			DataSet dsTemp = new DataSet("dsTemp");
+			dsTemp.Tables.Add(dtGroup.Copy());
+			DataTable dtTemp = dsTemp.Tables["AccessGroup"];
+			DataView dvGroup = new DataView(dtTemp);
+			DataRowView drv = dvGroup.AddNew();
+			drv["ACCESS_GROUP"]="<Show All Access Types>";
+			cboAccessTypeFilter.DataSource = dvGroup;
+			cboAccessTypeFilter.DisplayMember = "ACCESS_GROUP";
+			cboAccessTypeFilter.SelectedText = "<Show All Access Types>";
+			cboAccessTypeFilter.SelectedIndex = cboAccessTypeFilter.Items.Count - 1;
+			cboAccessTypeFilter.Refresh();
+
+			//Create DataGridTableStyle for Result grid
+			DataGridTableStyle tsResult = new DataGridTableStyle();
+			tsResult.MappingName = "Result";
+			tsResult.ReadOnly = true;
+			// Add START_TIME column style.
+			DataGridTextBoxColumn colStartTime = new DataGridTextBoxColumn();
+			colStartTime.MappingName = "START_TIME";
+			colStartTime.HeaderText = "Start Time";
+			colStartTime.Width = 200;
+			colStartTime.Format = "f";
+			tsResult.GridColumnStyles.Add(colStartTime);
+			
+			// Add END_TIME column style.
+			DataGridTextBoxColumn colEndTime = new DataGridTextBoxColumn();
+			colEndTime.MappingName = "END_TIME";
+			colEndTime.HeaderText = "End Time";
+			colEndTime.Width = 75;
+			colEndTime.Format = "h:mm tt";
+			tsResult.GridColumnStyles.Add(colEndTime);
+
+			// Add RESOURCE column style.
+			DataGridTextBoxColumn colResource = new DataGridTextBoxColumn();
+			colResource.MappingName = "RESOURCE";
+			colResource.HeaderText = "Resource";
+			colResource.Width = 200;
+			tsResult.GridColumnStyles.Add(colResource);
+
+			// Add SLOTS column style.
+			DataGridTextBoxColumn colSlots = new DataGridTextBoxColumn();
+			colSlots.MappingName = "SLOTS";
+			colSlots.HeaderText = "Slots";
+			colSlots.Width = 50;
+			tsResult.GridColumnStyles.Add(colSlots);
+
+			// Add AMPM column style.
+			DataGridTextBoxColumn colAccess = new DataGridTextBoxColumn();
+			colAccess.MappingName = "ACCESSNAME";
+			colAccess.HeaderText = "Access Type";
+			colAccess.Width = 200;
+			tsResult.GridColumnStyles.Add(colAccess);
+			grdResult.TableStyles.Add(tsResult);
+
+			this.UpdateDialogData(true);
+		
+		}
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true) //move member vars into controls
+			{
+
+			}
+			else //move control data into member vars
+			{
+
+				//Build AccessType list
+
+				this.m_alAccessTypes.Clear();
+				
+				for (int j = 0; j < this.lstAccessTypes.CheckedItems.Count; j++)
+				{
+					DataRowView drv = (DataRowView) lstAccessTypes.CheckedItems[j];
+					int nIndex = (int) lstAccessTypes.Tag;
+					string sItem = drv.Row.ItemArray[nIndex].ToString();
+					m_alAccessTypes.Add(sItem); 
+				}
+
+				//AM/PM
+				this.m_sAmpm = (this.rdoAM.Checked == true) ? "AM":"BOTH";
+				if (this.m_sAmpm != "AM")
+					this.m_sAmpm = (this.rdoPM.Checked == true) ? "PM":"BOTH";
+
+				
+				//Weekday
+				this.m_sWeekDays = ""; //any
+				if (chkMon.Checked == true)
+					m_sWeekDays += "Monday";
+				if (chkTue.Checked == true)
+					m_sWeekDays += "Tuesday";
+				if (chkWed.Checked == true)
+					m_sWeekDays += "Wednesday";
+				if (chkThu.Checked == true)
+					m_sWeekDays += "Thursday";
+				if (chkFri.Checked == true)
+					m_sWeekDays += "Friday";
+				if (chkSat.Checked == true)
+					m_sWeekDays += "Saturday";
+				if (chkSun.Checked == true)
+					m_sWeekDays += "Sunday";
+
+				//Start
+				this.m_dStart = this.calStartDate.SelectionStart;
+
+				//End
+				m_dEnd = calStartDate.SelectionEnd;
+				m_dEnd = m_dEnd.AddHours(23);
+				m_dEnd = m_dEnd.AddMinutes(59);
+
+			}		
+		}
+
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+        }
+
+        #endregion Methods
+
+        #region Windows Form Designer generated code
+        /// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.panel1 = new System.Windows.Forms.Panel();
+			this.cmdSearch = new System.Windows.Forms.Button();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.pnlDescription = new System.Windows.Forms.Panel();
+			this.grpDescription = new System.Windows.Forms.GroupBox();
+			this.lblDescription = new System.Windows.Forms.Label();
+			this.groupBox1 = new System.Windows.Forms.GroupBox();
+			this.label3 = new System.Windows.Forms.Label();
+			this.label2 = new System.Windows.Forms.Label();
+			this.lstAccessTypes = new System.Windows.Forms.CheckedListBox();
+			this.cboAccessTypeFilter = new System.Windows.Forms.ComboBox();
+			this.grpDayOfWeek = new System.Windows.Forms.GroupBox();
+			this.chkSun = new System.Windows.Forms.CheckBox();
+			this.chkSat = new System.Windows.Forms.CheckBox();
+			this.chkFri = new System.Windows.Forms.CheckBox();
+			this.chkThu = new System.Windows.Forms.CheckBox();
+			this.chkWed = new System.Windows.Forms.CheckBox();
+			this.chkTue = new System.Windows.Forms.CheckBox();
+			this.chkMon = new System.Windows.Forms.CheckBox();
+			this.grpTimeOfDay = new System.Windows.Forms.GroupBox();
+			this.rdoBoth = new System.Windows.Forms.RadioButton();
+			this.rdoPM = new System.Windows.Forms.RadioButton();
+			this.rdoAM = new System.Windows.Forms.RadioButton();
+			this.label1 = new System.Windows.Forms.Label();
+			this.calStartDate = new System.Windows.Forms.MonthCalendar();
+			this.groupBox2 = new System.Windows.Forms.GroupBox();
+			this.grdResult = new System.Windows.Forms.DataGrid();
+			this.panel1.SuspendLayout();
+			this.pnlDescription.SuspendLayout();
+			this.grpDescription.SuspendLayout();
+			this.groupBox1.SuspendLayout();
+			this.grpDayOfWeek.SuspendLayout();
+			this.grpTimeOfDay.SuspendLayout();
+			this.groupBox2.SuspendLayout();
+			((System.ComponentModel.ISupportInitialize)(this.grdResult)).BeginInit();
+			this.SuspendLayout();
+			// 
+			// panel1
+			// 
+			this.panel1.Controls.Add(this.cmdSearch);
+			this.panel1.Controls.Add(this.cmdCancel);
+			this.panel1.Controls.Add(this.cmdOK);
+			this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.panel1.Location = new System.Drawing.Point(0, 456);
+			this.panel1.Name = "panel1";
+			this.panel1.Size = new System.Drawing.Size(730, 40);
+			this.panel1.TabIndex = 4;
+			// 
+			// cmdSearch
+			// 
+			this.cmdSearch.Location = new System.Drawing.Point(536, 8);
+			this.cmdSearch.Name = "cmdSearch";
+			this.cmdSearch.Size = new System.Drawing.Size(72, 24);
+			this.cmdSearch.TabIndex = 2;
+			this.cmdSearch.Text = "Search";
+			this.cmdSearch.Click += new System.EventHandler(this.cmdSearch_Click);
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(616, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(64, 24);
+			this.cmdCancel.TabIndex = 1;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(128, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 0;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Visible = false;
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// pnlDescription
+			// 
+			this.pnlDescription.Controls.Add(this.grpDescription);
+			this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlDescription.Location = new System.Drawing.Point(0, 392);
+			this.pnlDescription.Name = "pnlDescription";
+			this.pnlDescription.Size = new System.Drawing.Size(730, 64);
+			this.pnlDescription.TabIndex = 47;
+			// 
+			// grpDescription
+			// 
+			this.grpDescription.Controls.Add(this.lblDescription);
+			this.grpDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.grpDescription.Location = new System.Drawing.Point(0, 0);
+			this.grpDescription.Name = "grpDescription";
+			this.grpDescription.Size = new System.Drawing.Size(730, 64);
+			this.grpDescription.TabIndex = 0;
+			this.grpDescription.TabStop = false;
+			this.grpDescription.Text = "Description";
+			// 
+			// lblDescription
+			// 
+			this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lblDescription.Location = new System.Drawing.Point(3, 16);
+			this.lblDescription.Name = "lblDescription";
+			this.lblDescription.Size = new System.Drawing.Size(724, 45);
+			this.lblDescription.TabIndex = 1;
+			this.lblDescription.Text = "Search for available appointment times using this panel.  You may narrow your sea" +
+				"rch by selecting an access type or by selecting specific days of the week or tim" +
+				"es of day.";
+			// 
+			// groupBox1
+			// 
+			this.groupBox1.Controls.Add(this.label3);
+			this.groupBox1.Controls.Add(this.label2);
+			this.groupBox1.Controls.Add(this.lstAccessTypes);
+			this.groupBox1.Controls.Add(this.cboAccessTypeFilter);
+			this.groupBox1.Controls.Add(this.grpDayOfWeek);
+			this.groupBox1.Controls.Add(this.grpTimeOfDay);
+			this.groupBox1.Controls.Add(this.label1);
+			this.groupBox1.Controls.Add(this.calStartDate);
+			this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
+			this.groupBox1.Location = new System.Drawing.Point(0, 0);
+			this.groupBox1.Name = "groupBox1";
+			this.groupBox1.Size = new System.Drawing.Size(730, 208);
+			this.groupBox1.TabIndex = 56;
+			this.groupBox1.TabStop = false;
+			this.groupBox1.Text = "Search Parameters";
+			// 
+			// label3
+			// 
+			this.label3.Location = new System.Drawing.Point(472, 72);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(80, 16);
+			this.label3.TabIndex = 63;
+			this.label3.Text = "Access Type:";
+			// 
+			// label2
+			// 
+			this.label2.Location = new System.Drawing.Point(472, 24);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(104, 16);
+			this.label2.TabIndex = 62;
+			this.label2.Text = "Access Group:";
+			// 
+			// lstAccessTypes
+			// 
+			this.lstAccessTypes.CheckOnClick = true;
+			this.lstAccessTypes.HorizontalScrollbar = true;
+			this.lstAccessTypes.Location = new System.Drawing.Point(472, 88);
+			this.lstAccessTypes.MultiColumn = true;
+			this.lstAccessTypes.Name = "lstAccessTypes";
+			this.lstAccessTypes.Size = new System.Drawing.Size(224, 109);
+			this.lstAccessTypes.TabIndex = 61;
+			// 
+			// cboAccessTypeFilter
+			// 
+			this.cboAccessTypeFilter.Location = new System.Drawing.Point(472, 40);
+			this.cboAccessTypeFilter.Name = "cboAccessTypeFilter";
+			this.cboAccessTypeFilter.Size = new System.Drawing.Size(224, 21);
+			this.cboAccessTypeFilter.TabIndex = 60;
+			this.cboAccessTypeFilter.Text = "cboAccessTypeFilter";
+			this.cboAccessTypeFilter.SelectionChangeCommitted += new System.EventHandler(this.cboAccessTypeFilter_SelectionChangeCommitted);
+			// 
+			// grpDayOfWeek
+			// 
+			this.grpDayOfWeek.Controls.Add(this.chkSun);
+			this.grpDayOfWeek.Controls.Add(this.chkSat);
+			this.grpDayOfWeek.Controls.Add(this.chkFri);
+			this.grpDayOfWeek.Controls.Add(this.chkThu);
+			this.grpDayOfWeek.Controls.Add(this.chkWed);
+			this.grpDayOfWeek.Controls.Add(this.chkTue);
+			this.grpDayOfWeek.Controls.Add(this.chkMon);
+			this.grpDayOfWeek.Location = new System.Drawing.Point(224, 96);
+			this.grpDayOfWeek.Name = "grpDayOfWeek";
+			this.grpDayOfWeek.Size = new System.Drawing.Size(240, 96);
+			this.grpDayOfWeek.TabIndex = 59;
+			this.grpDayOfWeek.TabStop = false;
+			this.grpDayOfWeek.Text = "Day of the Week";
+			// 
+			// chkSun
+			// 
+			this.chkSun.Location = new System.Drawing.Point(176, 64);
+			this.chkSun.Name = "chkSun";
+			this.chkSun.Size = new System.Drawing.Size(48, 16);
+			this.chkSun.TabIndex = 6;
+			this.chkSun.Text = "Sun";
+			// 
+			// chkSat
+			// 
+			this.chkSat.Location = new System.Drawing.Point(128, 64);
+			this.chkSat.Name = "chkSat";
+			this.chkSat.Size = new System.Drawing.Size(48, 16);
+			this.chkSat.TabIndex = 5;
+			this.chkSat.Text = "Sat";
+			// 
+			// chkFri
+			// 
+			this.chkFri.Location = new System.Drawing.Point(72, 64);
+			this.chkFri.Name = "chkFri";
+			this.chkFri.Size = new System.Drawing.Size(48, 16);
+			this.chkFri.TabIndex = 4;
+			this.chkFri.Text = "Fri";
+			// 
+			// chkThu
+			// 
+			this.chkThu.Location = new System.Drawing.Point(16, 64);
+			this.chkThu.Name = "chkThu";
+			this.chkThu.Size = new System.Drawing.Size(48, 16);
+			this.chkThu.TabIndex = 3;
+			this.chkThu.Text = "Thu";
+			// 
+			// chkWed
+			// 
+			this.chkWed.Location = new System.Drawing.Point(128, 32);
+			this.chkWed.Name = "chkWed";
+			this.chkWed.Size = new System.Drawing.Size(48, 16);
+			this.chkWed.TabIndex = 2;
+			this.chkWed.Text = "Wed";
+			// 
+			// chkTue
+			// 
+			this.chkTue.Location = new System.Drawing.Point(72, 32);
+			this.chkTue.Name = "chkTue";
+			this.chkTue.Size = new System.Drawing.Size(48, 16);
+			this.chkTue.TabIndex = 1;
+			this.chkTue.Text = "Tue";
+			// 
+			// chkMon
+			// 
+			this.chkMon.Location = new System.Drawing.Point(16, 32);
+			this.chkMon.Name = "chkMon";
+			this.chkMon.Size = new System.Drawing.Size(48, 16);
+			this.chkMon.TabIndex = 0;
+			this.chkMon.Text = "Mon";
+			// 
+			// grpTimeOfDay
+			// 
+			this.grpTimeOfDay.Controls.Add(this.rdoBoth);
+			this.grpTimeOfDay.Controls.Add(this.rdoPM);
+			this.grpTimeOfDay.Controls.Add(this.rdoAM);
+			this.grpTimeOfDay.Location = new System.Drawing.Point(224, 32);
+			this.grpTimeOfDay.Name = "grpTimeOfDay";
+			this.grpTimeOfDay.Size = new System.Drawing.Size(240, 48);
+			this.grpTimeOfDay.TabIndex = 58;
+			this.grpTimeOfDay.TabStop = false;
+			this.grpTimeOfDay.Text = "Time of Day";
+			// 
+			// rdoBoth
+			// 
+			this.rdoBoth.Checked = true;
+			this.rdoBoth.Location = new System.Drawing.Point(176, 24);
+			this.rdoBoth.Name = "rdoBoth";
+			this.rdoBoth.Size = new System.Drawing.Size(48, 16);
+			this.rdoBoth.TabIndex = 2;
+			this.rdoBoth.TabStop = true;
+			this.rdoBoth.Text = "Both";
+			// 
+			// rdoPM
+			// 
+			this.rdoPM.Location = new System.Drawing.Point(96, 24);
+			this.rdoPM.Name = "rdoPM";
+			this.rdoPM.Size = new System.Drawing.Size(72, 16);
+			this.rdoPM.TabIndex = 1;
+			this.rdoPM.Text = "PM Only";
+			// 
+			// rdoAM
+			// 
+			this.rdoAM.Location = new System.Drawing.Point(16, 24);
+			this.rdoAM.Name = "rdoAM";
+			this.rdoAM.Size = new System.Drawing.Size(72, 16);
+			this.rdoAM.TabIndex = 0;
+			this.rdoAM.Text = "AM Only";
+			// 
+			// label1
+			// 
+			this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+			this.label1.Location = new System.Drawing.Point(16, 24);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(136, 16);
+			this.label1.TabIndex = 57;
+			this.label1.Text = "Date Range:";
+			// 
+			// calStartDate
+			// 
+			this.calStartDate.Location = new System.Drawing.Point(16, 40);
+			this.calStartDate.MaxSelectionCount = 62;
+			this.calStartDate.Name = "calStartDate";
+			this.calStartDate.TabIndex = 56;
+			// 
+			// groupBox2
+			// 
+			this.groupBox2.Controls.Add(this.grdResult);
+			this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.groupBox2.Location = new System.Drawing.Point(0, 208);
+			this.groupBox2.Name = "groupBox2";
+			this.groupBox2.Size = new System.Drawing.Size(730, 184);
+			this.groupBox2.TabIndex = 57;
+			this.groupBox2.TabStop = false;
+			this.groupBox2.Text = "Search Result";
+			// 
+			// grdResult
+			// 
+			this.grdResult.CaptionVisible = false;
+			this.grdResult.DataMember = "";
+			this.grdResult.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.grdResult.HeaderForeColor = System.Drawing.SystemColors.ControlText;
+			this.grdResult.Location = new System.Drawing.Point(3, 16);
+			this.grdResult.Name = "grdResult";
+			this.grdResult.ReadOnly = true;
+			this.grdResult.Size = new System.Drawing.Size(724, 165);
+			this.grdResult.TabIndex = 0;
+			this.grdResult.DoubleClick += new System.EventHandler(this.grdResult_DoubleClick);
+			this.grdResult.CurrentCellChanged += new System.EventHandler(this.grdResult_CurrentCellChanged);
+			// 
+			// DApptSearch
+			// 
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(730, 496);
+			this.Controls.Add(this.groupBox2);
+			this.Controls.Add(this.groupBox1);
+			this.Controls.Add(this.pnlDescription);
+			this.Controls.Add(this.panel1);
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DApptSearch";
+			this.Text = "Find Clinic Availability";
+			this.panel1.ResumeLayout(false);
+			this.pnlDescription.ResumeLayout(false);
+			this.grpDescription.ResumeLayout(false);
+			this.groupBox1.ResumeLayout(false);
+			this.grpDayOfWeek.ResumeLayout(false);
+			this.grpTimeOfDay.ResumeLayout(false);
+			this.groupBox2.ResumeLayout(false);
+			((System.ComponentModel.ISupportInitialize)(this.grdResult)).EndInit();
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+        #region Event Handlers
+        private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+
+		}
+
+		private void cmdSearch_Click(object sender, System.EventArgs e)
+		{
+			//Get the control data into local vars
+			UpdateDialogData(false);
+			//Resource array, Begin date, Access type array, MTWTF , AM PM
+			//Assemble |-delimited resource string
+			string sResources = "";
+			for (int j=0; j < m_alResources.Count; j++)
+			{
+				sResources = sResources + m_alResources[j];
+				if (j < (m_alResources.Count - 1))
+					sResources = sResources + "|";
+			}
+
+			//Access Types Array
+			string sTypes = "";
+			if (m_alAccessTypes.Count > 0) 
+			{
+				for (int j=0; j < m_alAccessTypes.Count; j++)
+				{
+					sTypes = sTypes + (string) m_alAccessTypes[j];
+					if (j < (m_alAccessTypes.Count-1))
+						sTypes = sTypes + "|";
+				}
+			}
+
+			string sSearchInfo = "1|" + m_sAmpm + "|" + m_sWeekDays;
+			m_dtResult = CGSchedLib.CreateAvailabilitySchedule(m_DocManager, m_alResources, m_dStart, m_dEnd, m_alAccessTypes, ScheduleType.Resource, sSearchInfo);
+
+			if (m_dtResult.Rows.Count == 0)
+			{
+				MessageBox.Show("No availability found.");
+				return;
+			}
+
+			m_dtResult.TableName = "Result";
+			m_dtResult.Columns.Add("AMPM", System.Type.GetType("System.String") ,"Convert(START_TIME, 'System.String')" );
+			m_dtResult.Columns.Add("DAYOFWEEK", System.Type.GetType("System.String"));
+			m_dtResult.Columns.Add("ACCESSNAME", System.Type.GetType("System.String"));
+
+			DataRow drAT;
+			DateTime dt;
+			string sDOW;
+			int nAccessTypeID;
+			string sAccessType;
+			CGSchedLib.OutputArray(m_dtResult, "Result Grid");
+			foreach (DataRow dr in m_dtResult.Rows)
+			{
+				dt = (DateTime) dr["START_TIME"];
+				sDOW = dt.DayOfWeek.ToString();
+				dr["DAYOFWEEK"] = sDOW;
+				if (dr["ACCESS_TYPE"].ToString() != "") 
+				{
+					nAccessTypeID =Convert.ToInt16(dr["ACCESS_TYPE"].ToString());
+					drAT = m_dsGlobal.Tables["AccessTypes"].Rows.Find(nAccessTypeID);
+					if (drAT != null)
+					{
+						sAccessType = drAT["ACCESS_TYPE_NAME"].ToString();
+						dr["ACCESSNAME"] = sAccessType;
+					}
+				}
+			}
+			CGSchedLib.OutputArray(m_dtResult, "Result Grid");
+
+			m_dvResult = new DataView(m_dtResult);
+
+			string sFilter = "(SLOTS > 0)";
+			if (m_sAmpm != "")
+			{
+				if (m_sAmpm == "AM")
+					sFilter = sFilter + " AND (AMPM LIKE '*AM*')";
+				if (m_sAmpm == "PM")
+					sFilter = sFilter + " AND (AMPM LIKE '*PM*')";
+			}
+
+			bool sOr = false;
+			if (m_sWeekDays != "")
+			{
+				sFilter += " AND (";
+				if (chkMon.Checked == true)
+				{
+					sFilter = sFilter + "(DAYOFWEEK LIKE '*Monday*')";
+					sOr = true;
+				}
+				if (chkTue.Checked == true)
+				{
+					sFilter = (sOr == true)?sFilter + " OR ":sFilter;
+					sFilter = sFilter + "(DAYOFWEEK LIKE '*Tuesday*')";
+					sOr = true;
+				}
+				if (chkWed.Checked == true)
+				{
+					sFilter = (sOr == true)?sFilter + " OR ":sFilter;
+					sFilter = sFilter + "(DAYOFWEEK LIKE '*Wednesday*')";
+					sOr = true;
+				}
+				if (chkThu.Checked == true)
+				{
+					sFilter = (sOr == true)?sFilter + " OR ":sFilter;
+					sFilter = sFilter + "(DAYOFWEEK LIKE '*Thursday*')";
+					sOr = true;
+				}
+				if (chkFri.Checked == true)
+				{
+					sFilter = (sOr == true)?sFilter + " OR ":sFilter;
+					sFilter = sFilter + "(DAYOFWEEK LIKE '*Friday*')";
+					sOr = true;
+				}
+				if (chkSat.Checked == true)
+				{
+					sFilter = (sOr == true)?sFilter + " OR ":sFilter;
+					sFilter = sFilter + "(DAYOFWEEK LIKE '*Saturday*')";
+					sOr = true;
+				}
+				if (chkSun.Checked == true)
+				{
+					sFilter = (sOr == true)?sFilter + " OR ":sFilter;
+					sFilter = sFilter + "(DAYOFWEEK LIKE '*Sunday*')";
+					sOr = true;
+				}
+				sFilter += ")";
+			}
+
+			if (m_alAccessTypes.Count > 0) 
+			{
+				sFilter += " AND (";
+				sOr = false;
+				foreach (string sType in m_alAccessTypes)
+				{
+					if (sOr == true)
+						sFilter += " OR ";
+					sOr = true;
+					sFilter += "(ACCESSNAME = '" + sType + "')";
+				}
+				sFilter += ")";
+			}	
+
+			m_dvResult.RowFilter = sFilter;
+			this.grdResult.DataSource = m_dvResult;
+
+		}
+
+		private void cboAccessTypeFilter_SelectionChangeCommitted(object sender, System.EventArgs e)
+		{
+			//Load Access Types listbox & filter
+			string sGroup = cboAccessTypeFilter.Text;
+			if (sGroup == "<Show All Access Types>")
+			{
+				LoadListBox("ALL");
+			}
+			else 
+			{
+				LoadListBox("SELECTED");
+			}			
+				
+		}
+
+		private void grdResult_DoubleClick(object sender, System.EventArgs e)
+		{
+			if (grdResult.DataSource == null)
+				return;
+
+			DataGridCell dgCell;
+			dgCell = this.grdResult.CurrentCell;
+			dgCell.ColumnNumber = 2;
+			this.m_sSelectedResource = grdResult[dgCell.RowNumber, dgCell.ColumnNumber].ToString();
+			this.m_sSelectedDate = (DateTime) grdResult[dgCell.RowNumber,0];
+			this.DialogResult = DialogResult.OK;
+			this.Close();
+		}
+
+		private void grdResult_CurrentCellChanged(object sender, System.EventArgs e)
+		{
+			DataGridCell dgCell;
+			dgCell = this.grdResult.CurrentCell;
+			this.grdResult.Select(dgCell.RowNumber);
+
+        }
+
+        #endregion  Event Handlers
+
+        #region Properties
+        /// <summary>
+		/// Gets the resource selected by the user
+		/// </summary>
+		public string SelectedResource
+		{
+			get
+			{
+				return this.m_sSelectedResource;
+			}
+		}
+
+		/// <summary>
+		/// Gets the date selected by the user
+		/// </summary>
+		public DateTime SelectedDate
+		{
+			get
+			{
+				return this.m_sSelectedDate;
+			}
+		}
+		#endregion Properties
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DApptSearch.resx
===================================================================
--- Scheduling/branches/GUI1.2/DApptSearch.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DApptSearch.resx	(revision 855)
@@ -0,0 +1,445 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="panel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panel1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panel1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panel1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdSearch.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdSearch.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdSearch.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="groupBox1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="groupBox1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="groupBox1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="groupBox1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="groupBox1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="groupBox1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lstAccessTypes.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lstAccessTypes.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lstAccessTypes.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cboAccessTypeFilter.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cboAccessTypeFilter.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cboAccessTypeFilter.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDayOfWeek.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDayOfWeek.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpDayOfWeek.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDayOfWeek.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpDayOfWeek.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDayOfWeek.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkSun.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkSun.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkSun.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkSat.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkSat.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkSat.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkFri.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkFri.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkFri.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkThu.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkThu.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkThu.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkWed.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkWed.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkWed.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkTue.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkTue.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkTue.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkMon.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkMon.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkMon.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpTimeOfDay.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpTimeOfDay.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpTimeOfDay.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpTimeOfDay.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpTimeOfDay.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpTimeOfDay.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoBoth.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoBoth.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoBoth.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoPM.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoPM.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoPM.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoAM.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoAM.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoAM.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="calStartDate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="calStartDate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="calStartDate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="groupBox2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="groupBox2.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="groupBox2.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="groupBox2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="groupBox2.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="groupBox2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grdResult.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grdResult.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grdResult.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.Name">
+    <value>DApptSearch</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DApptSearchcs.bak
===================================================================
--- Scheduling/branches/GUI1.2/DApptSearchcs.bak	(revision 855)
+++ Scheduling/branches/GUI1.2/DApptSearchcs.bak	(revision 855)
@@ -0,0 +1,531 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+using System.Data.OleDb;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DApptSearch.
+	/// </summary>
+	public class DApptSearch : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel panel1;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Panel pnlDescription;
+		private System.Windows.Forms.GroupBox grpDescription;
+		private System.Windows.Forms.Label lblDescription;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.CheckBox chkMon;
+		private System.Windows.Forms.CheckBox chkTue;
+		private System.Windows.Forms.CheckBox chkWed;
+		private System.Windows.Forms.CheckBox chkThu;
+		private System.Windows.Forms.CheckBox chkFri;
+		private System.Windows.Forms.GroupBox grpTimeOfDay;
+		private System.Windows.Forms.GroupBox grpDayOfWeek;
+		private System.Windows.Forms.CheckBox chkSat;
+		private System.Windows.Forms.CheckBox chkSun;
+		private System.Windows.Forms.RadioButton rdoAM;
+		private System.Windows.Forms.RadioButton rdoPM;
+		private System.Windows.Forms.RadioButton rdoBoth;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.CheckedListBox lstAccessTypes;
+		private System.Windows.Forms.ComboBox cboAccessTypeFilter;
+		private System.Windows.Forms.MonthCalendar calStartDate;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DApptSearch()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+		}
+
+		#region Fields
+
+		private OleDbConnection		m_RPMSConnection;
+		private CGDocumentManager	m_DocManager;
+		
+		private DataSet	m_dsGlobal;
+		DataTable		m_dtTypes;
+		DataView		m_dvTypes;
+
+		DateTime		m_dStart;
+		DateTime		m_dEnd;
+		ArrayList		m_alResources;
+		ArrayList		m_alAccessTypes;
+		string			m_sWeekDays;
+		string			m_sAmpm;
+
+		#endregion Fields
+
+		public void LoadListBox(string sGroup)
+		{
+			if (sGroup == "ALL")
+			{
+				//Load the Access Type list box with ALL access types
+				m_dtTypes = m_dsGlobal.Tables["AccessTypes"];
+				m_dvTypes = new DataView(m_dtTypes);
+				lstAccessTypes.DataSource = m_dvTypes;
+				lstAccessTypes.DisplayMember = "ACCESS_TYPE_NAME";
+				lstAccessTypes.ValueMember = "BMXIEN";
+			}
+			else 
+			{
+				//Load the Access Type list box with active access types belonging
+				//to group sGroup
+
+				//Build AccessGroup table containing *active* AccessTypes and their Groups
+				m_dtTypes = m_dsGlobal.Tables["AccessGroupType"];
+
+				//Create a view that is filterable on Access Group
+				m_dvTypes = new DataView(m_dtTypes);
+				m_dvTypes.RowFilter = "ACCESS_GROUP = '" + this.cboAccessTypeFilter.Text + "'";
+				lstAccessTypes.DataSource = m_dvTypes;
+				lstAccessTypes.DisplayMember = "ACCESS_TYPE";
+				lstAccessTypes.ValueMember = "ACCESS_TYPE_ID";
+			}
+		}
+
+		public void InitializePage(ArrayList alResources, CGDocumentManager docManager)
+		{
+
+			this.m_DocManager = docManager;
+			this.m_dsGlobal = m_DocManager.GlobalDataSet;
+			this.m_RPMSConnection = m_DocManager.ADOConnection;			
+			
+			LoadListBox("ALL");
+
+			m_dStart = DateTime.Today;
+			m_dEnd = new DateTime(9999);
+			this.m_alResources = alResources;
+			this.m_alAccessTypes = new ArrayList();
+			this.m_sAmpm="both";
+			this.m_sWeekDays = "";
+
+
+			//Load filter combo with list of access type groups
+			DataTable dtGroup = m_dsGlobal.Tables["AccessGroup"];
+			DataSet dsTemp = new DataSet("dsTemp");
+			dsTemp.Tables.Add(dtGroup.Copy());
+			DataTable dtTemp = dsTemp.Tables["AccessGroup"];
+			DataView dvGroup = new DataView(dtTemp);
+			DataRowView drv = dvGroup.AddNew();
+			drv["ACCESS_GROUP"]="<Show All Access Types>";
+			dvGroup.Sort = "ACCESS_GROUP ASC";
+			cboAccessTypeFilter.DataSource = dvGroup;
+			cboAccessTypeFilter.DisplayMember = "ACCESS_GROUP";
+			cboAccessTypeFilter.SelectedIndex = cboAccessTypeFilter.Items.Count - 1;
+
+			//TODO: Initialize member vars
+
+			this.UpdateDialogData(true);
+		
+		}
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true) //move member vars into controls
+			{
+
+//				lblClinic.Text = m_pAppt.Resource;
+//				lblEndTime.Text = m_pAppt.EndTime.ToShortDateString() + " " + m_pAppt.EndTime.ToShortTimeString();
+//				lblStartTime.Text = m_pAppt.StartTime.ToShortDateString() + " " + m_pAppt.StartTime.ToShortTimeString();
+//				txtNote.Text = m_pAppt.Note;
+//				nudSlots.Value = m_pAppt.Slots;
+//				if (m_pAppt.AccessTypeID  != 0)
+//				{
+//					lstAccessTypes.SelectedValue = m_pAppt.AccessTypeID;
+//				}
+			}
+			else //move control data into member vars
+			{
+
+				//Build AccessType list
+
+				this.m_alAccessTypes.Clear();
+				for (int j = 0; j < this.lstAccessTypes.CheckedItems.Count; j++)
+				{
+					m_alAccessTypes.Add(this.lstAccessTypes.Items[j].ToString()); 
+				}
+
+				//TODO: AM/PM
+				this.m_sAmpm = "both";
+				
+				//TODO: Weekday
+				this.m_sWeekDays = "any";
+
+//				m_pAppt.Note = txtNote.Text;
+//				int nIndex = this.lstAccessTypes.SelectedIndex;
+//				string sTemp = (string) this.lstAccessTypes.SelectedValue;
+//				sTemp = (sTemp == "")?"-1":sTemp;
+//				m_pAppt.AccessTypeID = Convert.ToInt16(sTemp);
+//				m_pAppt.Slots  = Convert.ToInt16(nudSlots.Value);
+			}		
+		}
+
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.panel1 = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.pnlDescription = new System.Windows.Forms.Panel();
+			this.grpDescription = new System.Windows.Forms.GroupBox();
+			this.lblDescription = new System.Windows.Forms.Label();
+			this.calStartDate = new System.Windows.Forms.MonthCalendar();
+			this.label1 = new System.Windows.Forms.Label();
+			this.grpTimeOfDay = new System.Windows.Forms.GroupBox();
+			this.rdoBoth = new System.Windows.Forms.RadioButton();
+			this.rdoPM = new System.Windows.Forms.RadioButton();
+			this.rdoAM = new System.Windows.Forms.RadioButton();
+			this.grpDayOfWeek = new System.Windows.Forms.GroupBox();
+			this.chkSun = new System.Windows.Forms.CheckBox();
+			this.chkSat = new System.Windows.Forms.CheckBox();
+			this.chkFri = new System.Windows.Forms.CheckBox();
+			this.chkThu = new System.Windows.Forms.CheckBox();
+			this.chkWed = new System.Windows.Forms.CheckBox();
+			this.chkTue = new System.Windows.Forms.CheckBox();
+			this.chkMon = new System.Windows.Forms.CheckBox();
+			this.cboAccessTypeFilter = new System.Windows.Forms.ComboBox();
+			this.lstAccessTypes = new System.Windows.Forms.CheckedListBox();
+			this.label2 = new System.Windows.Forms.Label();
+			this.label3 = new System.Windows.Forms.Label();
+			this.panel1.SuspendLayout();
+			this.pnlDescription.SuspendLayout();
+			this.grpDescription.SuspendLayout();
+			this.grpTimeOfDay.SuspendLayout();
+			this.grpDayOfWeek.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// panel1
+			// 
+			this.panel1.Controls.AddRange(new System.Windows.Forms.Control[] {
+																				 this.cmdCancel,
+																				 this.cmdOK});
+			this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.panel1.Location = new System.Drawing.Point(0, 440);
+			this.panel1.Name = "panel1";
+			this.panel1.Size = new System.Drawing.Size(488, 40);
+			this.panel1.TabIndex = 4;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(416, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(64, 24);
+			this.cmdCancel.TabIndex = 1;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(336, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 0;
+			this.cmdOK.Text = "Search";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// pnlDescription
+			// 
+			this.pnlDescription.Controls.AddRange(new System.Windows.Forms.Control[] {
+																						 this.grpDescription});
+			this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlDescription.Location = new System.Drawing.Point(0, 376);
+			this.pnlDescription.Name = "pnlDescription";
+			this.pnlDescription.Size = new System.Drawing.Size(488, 64);
+			this.pnlDescription.TabIndex = 47;
+			// 
+			// grpDescription
+			// 
+			this.grpDescription.Controls.AddRange(new System.Windows.Forms.Control[] {
+																						 this.lblDescription});
+			this.grpDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.grpDescription.Name = "grpDescription";
+			this.grpDescription.Size = new System.Drawing.Size(488, 64);
+			this.grpDescription.TabIndex = 0;
+			this.grpDescription.TabStop = false;
+			this.grpDescription.Text = "Description";
+			// 
+			// lblDescription
+			// 
+			this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lblDescription.Location = new System.Drawing.Point(3, 16);
+			this.lblDescription.Name = "lblDescription";
+			this.lblDescription.Size = new System.Drawing.Size(482, 45);
+			this.lblDescription.TabIndex = 1;
+			this.lblDescription.Text = "Search for available appointment times using this panel.  You may narrow your sea" +
+				"rch by selecting an access type or by selecting specific days of the week or tim" +
+				"es of day.";
+			// 
+			// calStartDate
+			// 
+			this.calStartDate.Location = new System.Drawing.Point(24, 32);
+			this.calStartDate.Name = "calStartDate";
+			this.calStartDate.TabIndex = 48;
+			// 
+			// label1
+			// 
+			this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
+			this.label1.Location = new System.Drawing.Point(16, 8);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(208, 16);
+			this.label1.TabIndex = 49;
+			this.label1.Text = "Search for first availabiltiy after this date:";
+			// 
+			// grpTimeOfDay
+			// 
+			this.grpTimeOfDay.Controls.AddRange(new System.Windows.Forms.Control[] {
+																					   this.rdoBoth,
+																					   this.rdoPM,
+																					   this.rdoAM});
+			this.grpTimeOfDay.Location = new System.Drawing.Point(240, 16);
+			this.grpTimeOfDay.Name = "grpTimeOfDay";
+			this.grpTimeOfDay.Size = new System.Drawing.Size(240, 48);
+			this.grpTimeOfDay.TabIndex = 50;
+			this.grpTimeOfDay.TabStop = false;
+			this.grpTimeOfDay.Text = "Time of Day";
+			// 
+			// rdoBoth
+			// 
+			this.rdoBoth.Checked = true;
+			this.rdoBoth.Location = new System.Drawing.Point(176, 24);
+			this.rdoBoth.Name = "rdoBoth";
+			this.rdoBoth.Size = new System.Drawing.Size(48, 16);
+			this.rdoBoth.TabIndex = 2;
+			this.rdoBoth.TabStop = true;
+			this.rdoBoth.Text = "Both";
+			// 
+			// rdoPM
+			// 
+			this.rdoPM.Location = new System.Drawing.Point(96, 24);
+			this.rdoPM.Name = "rdoPM";
+			this.rdoPM.Size = new System.Drawing.Size(72, 16);
+			this.rdoPM.TabIndex = 1;
+			this.rdoPM.Text = "PM Only";
+			// 
+			// rdoAM
+			// 
+			this.rdoAM.Location = new System.Drawing.Point(16, 24);
+			this.rdoAM.Name = "rdoAM";
+			this.rdoAM.Size = new System.Drawing.Size(72, 16);
+			this.rdoAM.TabIndex = 0;
+			this.rdoAM.Text = "AM Only";
+			// 
+			// grpDayOfWeek
+			// 
+			this.grpDayOfWeek.Controls.AddRange(new System.Windows.Forms.Control[] {
+																					   this.chkSun,
+																					   this.chkSat,
+																					   this.chkFri,
+																					   this.chkThu,
+																					   this.chkWed,
+																					   this.chkTue,
+																					   this.chkMon});
+			this.grpDayOfWeek.Location = new System.Drawing.Point(240, 80);
+			this.grpDayOfWeek.Name = "grpDayOfWeek";
+			this.grpDayOfWeek.Size = new System.Drawing.Size(240, 104);
+			this.grpDayOfWeek.TabIndex = 51;
+			this.grpDayOfWeek.TabStop = false;
+			this.grpDayOfWeek.Text = "Day of the Week";
+			// 
+			// chkSun
+			// 
+			this.chkSun.Location = new System.Drawing.Point(176, 64);
+			this.chkSun.Name = "chkSun";
+			this.chkSun.Size = new System.Drawing.Size(48, 16);
+			this.chkSun.TabIndex = 6;
+			this.chkSun.Text = "Sun";
+			// 
+			// chkSat
+			// 
+			this.chkSat.Location = new System.Drawing.Point(128, 64);
+			this.chkSat.Name = "chkSat";
+			this.chkSat.Size = new System.Drawing.Size(48, 16);
+			this.chkSat.TabIndex = 5;
+			this.chkSat.Text = "Sat";
+			// 
+			// chkFri
+			// 
+			this.chkFri.Location = new System.Drawing.Point(72, 64);
+			this.chkFri.Name = "chkFri";
+			this.chkFri.Size = new System.Drawing.Size(48, 16);
+			this.chkFri.TabIndex = 4;
+			this.chkFri.Text = "Fri";
+			// 
+			// chkThu
+			// 
+			this.chkThu.Location = new System.Drawing.Point(16, 64);
+			this.chkThu.Name = "chkThu";
+			this.chkThu.Size = new System.Drawing.Size(48, 16);
+			this.chkThu.TabIndex = 3;
+			this.chkThu.Text = "Thu";
+			// 
+			// chkWed
+			// 
+			this.chkWed.Location = new System.Drawing.Point(128, 32);
+			this.chkWed.Name = "chkWed";
+			this.chkWed.Size = new System.Drawing.Size(48, 16);
+			this.chkWed.TabIndex = 2;
+			this.chkWed.Text = "Wed";
+			// 
+			// chkTue
+			// 
+			this.chkTue.Location = new System.Drawing.Point(72, 32);
+			this.chkTue.Name = "chkTue";
+			this.chkTue.Size = new System.Drawing.Size(48, 16);
+			this.chkTue.TabIndex = 1;
+			this.chkTue.Text = "Tue";
+			// 
+			// chkMon
+			// 
+			this.chkMon.Location = new System.Drawing.Point(16, 32);
+			this.chkMon.Name = "chkMon";
+			this.chkMon.Size = new System.Drawing.Size(48, 16);
+			this.chkMon.TabIndex = 0;
+			this.chkMon.Text = "Mon";
+			// 
+			// cboAccessTypeFilter
+			// 
+			this.cboAccessTypeFilter.Location = new System.Drawing.Point(72, 208);
+			this.cboAccessTypeFilter.Name = "cboAccessTypeFilter";
+			this.cboAccessTypeFilter.Size = new System.Drawing.Size(224, 21);
+			this.cboAccessTypeFilter.TabIndex = 52;
+			this.cboAccessTypeFilter.Text = "cboAccessTypeFilter";
+			this.cboAccessTypeFilter.SelectionChangeCommitted += new System.EventHandler(this.cboAccessTypeFilter_SelectionChangeCommitted);
+			// 
+			// lstAccessTypes
+			// 
+			this.lstAccessTypes.CheckOnClick = true;
+			this.lstAccessTypes.HorizontalScrollbar = true;
+			this.lstAccessTypes.Location = new System.Drawing.Point(72, 240);
+			this.lstAccessTypes.MultiColumn = true;
+			this.lstAccessTypes.Name = "lstAccessTypes";
+			this.lstAccessTypes.Size = new System.Drawing.Size(408, 124);
+			this.lstAccessTypes.TabIndex = 53;
+			// 
+			// label2
+			// 
+			this.label2.Location = new System.Drawing.Point(16, 208);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(48, 32);
+			this.label2.TabIndex = 54;
+			this.label2.Text = "Access Group";
+			// 
+			// label3
+			// 
+			this.label3.Location = new System.Drawing.Point(16, 240);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(56, 32);
+			this.label3.TabIndex = 55;
+			this.label3.Text = "Access Type";
+			// 
+			// DApptSearch
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(488, 480);
+			this.Controls.AddRange(new System.Windows.Forms.Control[] {
+																		  this.label3,
+																		  this.label2,
+																		  this.lstAccessTypes,
+																		  this.cboAccessTypeFilter,
+																		  this.grpDayOfWeek,
+																		  this.grpTimeOfDay,
+																		  this.label1,
+																		  this.calStartDate,
+																		  this.pnlDescription,
+																		  this.panel1});
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DApptSearch";
+			this.Text = "DApptSearch";
+			this.panel1.ResumeLayout(false);
+			this.pnlDescription.ResumeLayout(false);
+			this.grpDescription.ResumeLayout(false);
+			this.grpTimeOfDay.ResumeLayout(false);
+			this.grpDayOfWeek.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		private void cboAccessTypeFilter_SelectionChangeCommitted(object sender, System.EventArgs e)
+		{
+			//Load Access Types listbox & filter
+			string sGroup = cboAccessTypeFilter.Text;
+			if (sGroup == "<Show All Access Types>")
+			{
+				LoadListBox("ALL");
+			}
+			else 
+			{
+				LoadListBox("SELECTED");
+			}			
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			//Get the control data into local vars
+			UpdateDialogData(false);
+			
+			//Do the search
+			DataSet rsOut = new DataSet("AvailabilitySearch");
+			OleDbCommand cmd = m_RPMSConnection.CreateCommand();
+			System.Data.OleDb.OleDbDataAdapter da = new OleDbDataAdapter();
+			//Resource array, Begin date, Access type array, MTWTF , AM PM
+//			string sSql = "BSDX SEARCH AVAILABILITY^" + m_nAccessGroupID.ToString() + "^" + nAccessTypeID.ToString();
+//			cmd.CommandText = sSql;
+			da.SelectCommand = cmd;
+			da.Fill(rsOut, "AvailabilitySearch");
+
+			// if the result set count > 0 open the result dialog
+			// else display a "no availability found" messagebox and return
+
+			//if the return from the result dialog is cancel then return to the search dialog
+			//else close the search dialog with dialogresult.oi
+
+		}
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DCancelAppt.cs
===================================================================
--- Scheduling/branches/GUI1.2/DCancelAppt.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DCancelAppt.cs	(revision 855)
@@ -0,0 +1,580 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DCancelAppt.
+	/// </summary>
+	public class DCancelAppt : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel pnlPageBottom;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Panel pnlDescription;
+		private System.Windows.Forms.GroupBox grpDescriptionResourceGroup;
+		private System.Windows.Forms.Label lblDescriptionResourceGroup;
+		private System.Windows.Forms.GroupBox grpCancelledby;
+		private System.Windows.Forms.RadioButton rdoClinic;
+		private System.Windows.Forms.RadioButton rdoPatient;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.ListBox lstReason;
+		private System.Windows.Forms.TextBox txtNote;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.GroupBox grpAutoRebook;
+		private System.Windows.Forms.CheckBox chkAutoRebook;
+		private System.Windows.Forms.NumericUpDown udStart;
+		private System.Windows.Forms.NumericUpDown udMax;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.Label label4;
+		private System.Windows.Forms.RadioButton rdoRebookSameType;
+		private System.Windows.Forms.RadioButton rdoRebookAnyType;
+		private System.Windows.Forms.RadioButton rdoRebookSelectedType;
+		private System.Windows.Forms.Label lblRebookSelectedType;
+		private System.Windows.Forms.Label label6;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DCancelAppt()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+		}
+		#region Fields
+
+		private bool		m_bClinicCancelled = true;
+		private int			m_nReason = 0;
+		private string		m_sNote = "";
+		private DataTable	m_dtCR;
+		private DataView	m_dvCR;
+		private bool		m_bAutoRebook = false;
+		private int			m_nStart = 7;
+		private int			m_nMax = 30;
+
+		// -1: use current, -2: use any non-zero type, >0 use this access type id
+		private int			m_nRebookAccessType = -1;
+
+
+		#endregion Fields
+
+		#region Methods
+
+		public void InitializePage(CGDocumentManager DocManager)
+		{
+			m_bClinicCancelled = true;
+			m_nReason = 0;
+			m_sNote = "";
+
+			//Load Reasons listbox
+
+			m_dtCR = DocManager.RPMSDataTable(@"SELECT BMXIEN, NAME FROM CANCELLATION_REASONS WHERE INACTIVE=''", "CR");
+			m_dvCR = new DataView(m_dtCR);
+			m_dvCR.Sort = "NAME ASC";
+			lstReason.DataSource = m_dvCR;
+			lstReason.DisplayMember = "NAME";
+			lstReason.ValueMember = "BMXIEN";
+
+			UpdateDialogData(true);
+		}
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true)
+			{
+				rdoClinic.Checked = m_bClinicCancelled;
+				if (m_nReason != 0)
+				{
+					lstReason.SelectedValue = m_nReason;
+				}
+				txtNote.Text = m_sNote;
+				chkAutoRebook.Checked = m_bAutoRebook;
+				udStart.Value = m_nStart;
+				udMax.Value = m_nMax;
+
+				this.rdoRebookSameType.Checked = true;
+				this.rdoRebookAnyType.Checked = false;
+				this.rdoRebookSelectedType.Checked = false;
+			}
+			else
+			{
+				m_bClinicCancelled = rdoClinic.Checked;
+				m_nReason = (int) lstReason.SelectedValue;
+				m_sNote = txtNote.Text;
+				m_bAutoRebook = chkAutoRebook.Checked;
+				m_nStart = (int) udStart.Value;
+				m_nMax = (int) udMax.Value;
+				if (this.rdoRebookSameType.Checked == true)
+				{
+					m_nRebookAccessType = -1;
+				}
+				else
+				{
+					m_nRebookAccessType = -2;
+				}
+
+			}
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			this.UpdateDialogData(false);
+		}
+		#endregion Methods
+
+		#region Properties
+
+		/// <summary>
+		/// Sets or returns the rebook access type:  -1 = use current type, -2 = use any type, 0 = prompt for a type
+		/// </summary>
+		public int RebookAccessType
+		{
+			get
+			{
+				return m_nRebookAccessType;
+			}
+			set
+			{
+				m_nRebookAccessType = value;
+				if (m_nRebookAccessType == -1)
+				{
+					this.rdoRebookSameType.Checked = true;
+				}
+				else
+				{
+					this.rdoRebookAnyType.Checked = true;
+				}
+
+			}
+		}
+		/// <summary>
+		/// Returns true if appt cancelled by Clinic, otherwise false
+		/// </summary>
+		public bool ClinicCancelled
+		{
+			get
+			{
+				return m_bClinicCancelled;
+			}
+		}
+
+		/// <summary>
+		/// Returns value of AutoRebook check box
+		/// </summary>
+		public bool AutoRebook
+		{
+			get
+			{
+				return m_bAutoRebook;
+			}
+			set
+			{
+				m_bAutoRebook = value;
+			}
+		}
+
+		/// <summary>
+		/// Returns internal entry in the CANCELLATION REASON file (409.2)
+		/// </summary>
+		public int CancelReason
+		{
+			get
+			{
+				return m_nReason;
+			}
+		}
+
+		/// <summary>
+		/// Returns cancellation remarks.
+		/// </summary>
+		public string CancelRemarks
+		{
+			get
+			{
+				return m_sNote;
+			}
+		}
+
+		/// <summary>
+		/// Sets or returns the number of days in the future to start searching for availability
+		/// </summary>
+		public int RebookStartDays
+		{
+			get
+			{
+				return m_nStart;
+			}
+			set
+			{
+				m_nStart = value;
+			}
+		}
+
+		/// <summary>
+		/// Sets and returns the maximum number of days in the future to look for rebook availability
+		/// </summary>
+		public int RebookMaxDays
+		{
+			get
+			{
+				return m_nMax;
+			}
+			set
+			{
+				m_nMax = value;
+			}
+		}
+
+		#endregion Properties
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.pnlPageBottom = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.pnlDescription = new System.Windows.Forms.Panel();
+			this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
+			this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
+			this.grpCancelledby = new System.Windows.Forms.GroupBox();
+			this.rdoPatient = new System.Windows.Forms.RadioButton();
+			this.rdoClinic = new System.Windows.Forms.RadioButton();
+			this.lstReason = new System.Windows.Forms.ListBox();
+			this.label1 = new System.Windows.Forms.Label();
+			this.txtNote = new System.Windows.Forms.TextBox();
+			this.label2 = new System.Windows.Forms.Label();
+			this.grpAutoRebook = new System.Windows.Forms.GroupBox();
+			this.label6 = new System.Windows.Forms.Label();
+			this.lblRebookSelectedType = new System.Windows.Forms.Label();
+			this.rdoRebookSameType = new System.Windows.Forms.RadioButton();
+			this.label3 = new System.Windows.Forms.Label();
+			this.udMax = new System.Windows.Forms.NumericUpDown();
+			this.udStart = new System.Windows.Forms.NumericUpDown();
+			this.chkAutoRebook = new System.Windows.Forms.CheckBox();
+			this.label4 = new System.Windows.Forms.Label();
+			this.rdoRebookAnyType = new System.Windows.Forms.RadioButton();
+			this.rdoRebookSelectedType = new System.Windows.Forms.RadioButton();
+			this.pnlPageBottom.SuspendLayout();
+			this.pnlDescription.SuspendLayout();
+			this.grpDescriptionResourceGroup.SuspendLayout();
+			this.grpCancelledby.SuspendLayout();
+			this.grpAutoRebook.SuspendLayout();
+			((System.ComponentModel.ISupportInitialize)(this.udMax)).BeginInit();
+			((System.ComponentModel.ISupportInitialize)(this.udStart)).BeginInit();
+			this.SuspendLayout();
+			// 
+			// pnlPageBottom
+			// 
+			this.pnlPageBottom.Controls.Add(this.cmdCancel);
+			this.pnlPageBottom.Controls.Add(this.cmdOK);
+			this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlPageBottom.Location = new System.Drawing.Point(0, 488);
+			this.pnlPageBottom.Name = "pnlPageBottom";
+			this.pnlPageBottom.Size = new System.Drawing.Size(594, 40);
+			this.pnlPageBottom.TabIndex = 6;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(512, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(56, 24);
+			this.cmdCancel.TabIndex = 2;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(432, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 1;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// pnlDescription
+			// 
+			this.pnlDescription.Controls.Add(this.grpDescriptionResourceGroup);
+			this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlDescription.Location = new System.Drawing.Point(0, 416);
+			this.pnlDescription.Name = "pnlDescription";
+			this.pnlDescription.Size = new System.Drawing.Size(594, 72);
+			this.pnlDescription.TabIndex = 7;
+			// 
+			// grpDescriptionResourceGroup
+			// 
+			this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
+			this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
+			this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
+			this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(594, 72);
+			this.grpDescriptionResourceGroup.TabIndex = 1;
+			this.grpDescriptionResourceGroup.TabStop = false;
+			this.grpDescriptionResourceGroup.Text = "Description";
+			// 
+			// lblDescriptionResourceGroup
+			// 
+			this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
+			this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
+			this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(588, 53);
+			this.lblDescriptionResourceGroup.TabIndex = 0;
+			this.lblDescriptionResourceGroup.Text = @"Use this panel to cancel an appointment. Indicate whether the appointment was cancelled by the clinic or by the patient.  Select a reason for the cancellation.  Enter remarks in the text box.  To automatically rebook cancelled appointments, check the Auto Rebook box.  The Start Time in Days and Maximum Days values control the time window for rebooked appointments.";
+			// 
+			// grpCancelledby
+			// 
+			this.grpCancelledby.Controls.Add(this.rdoPatient);
+			this.grpCancelledby.Controls.Add(this.rdoClinic);
+			this.grpCancelledby.Location = new System.Drawing.Point(24, 24);
+			this.grpCancelledby.Name = "grpCancelledby";
+			this.grpCancelledby.Size = new System.Drawing.Size(256, 80);
+			this.grpCancelledby.TabIndex = 8;
+			this.grpCancelledby.TabStop = false;
+			this.grpCancelledby.Text = "Appointment Cancelled By";
+			// 
+			// rdoPatient
+			// 
+			this.rdoPatient.Location = new System.Drawing.Point(24, 48);
+			this.rdoPatient.Name = "rdoPatient";
+			this.rdoPatient.Size = new System.Drawing.Size(160, 16);
+			this.rdoPatient.TabIndex = 1;
+			this.rdoPatient.Text = "Cancelled by Patient";
+			// 
+			// rdoClinic
+			// 
+			this.rdoClinic.Location = new System.Drawing.Point(24, 24);
+			this.rdoClinic.Name = "rdoClinic";
+			this.rdoClinic.Size = new System.Drawing.Size(160, 16);
+			this.rdoClinic.TabIndex = 0;
+			this.rdoClinic.Text = "Cancelled by Clinic";
+			// 
+			// lstReason
+			// 
+			this.lstReason.ColumnWidth = 250;
+			this.lstReason.Location = new System.Drawing.Point(24, 136);
+			this.lstReason.Name = "lstReason";
+			this.lstReason.Size = new System.Drawing.Size(256, 264);
+			this.lstReason.TabIndex = 9;
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(24, 112);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(248, 16);
+			this.label1.TabIndex = 10;
+			this.label1.Text = "Reason for Cancellation (Select one)";
+			// 
+			// txtNote
+			// 
+			this.txtNote.Location = new System.Drawing.Point(312, 304);
+			this.txtNote.Multiline = true;
+			this.txtNote.Name = "txtNote";
+			this.txtNote.Size = new System.Drawing.Size(272, 96);
+			this.txtNote.TabIndex = 11;
+			this.txtNote.Text = "";
+			// 
+			// label2
+			// 
+			this.label2.Location = new System.Drawing.Point(312, 280);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(280, 64);
+			this.label2.TabIndex = 10;
+			this.label2.Text = "Remarks (Optional)";
+			// 
+			// grpAutoRebook
+			// 
+			this.grpAutoRebook.Controls.Add(this.label6);
+			this.grpAutoRebook.Controls.Add(this.lblRebookSelectedType);
+			this.grpAutoRebook.Controls.Add(this.rdoRebookSameType);
+			this.grpAutoRebook.Controls.Add(this.label3);
+			this.grpAutoRebook.Controls.Add(this.udMax);
+			this.grpAutoRebook.Controls.Add(this.udStart);
+			this.grpAutoRebook.Controls.Add(this.chkAutoRebook);
+			this.grpAutoRebook.Controls.Add(this.label4);
+			this.grpAutoRebook.Controls.Add(this.rdoRebookAnyType);
+			this.grpAutoRebook.Controls.Add(this.rdoRebookSelectedType);
+			this.grpAutoRebook.Location = new System.Drawing.Point(312, 24);
+			this.grpAutoRebook.Name = "grpAutoRebook";
+			this.grpAutoRebook.Size = new System.Drawing.Size(272, 248);
+			this.grpAutoRebook.TabIndex = 13;
+			this.grpAutoRebook.TabStop = false;
+			this.grpAutoRebook.Text = "Auto Rebook";
+			// 
+			// label6
+			// 
+			this.label6.Location = new System.Drawing.Point(16, 128);
+			this.label6.Name = "label6";
+			this.label6.Size = new System.Drawing.Size(232, 16);
+			this.label6.TabIndex = 19;
+			this.label6.Text = "Access Type for Rebooked Appointment:";
+			// 
+			// lblRebookSelectedType
+			// 
+			this.lblRebookSelectedType.Enabled = false;
+			this.lblRebookSelectedType.Location = new System.Drawing.Point(64, 224);
+			this.lblRebookSelectedType.Name = "lblRebookSelectedType";
+			this.lblRebookSelectedType.Size = new System.Drawing.Size(168, 16);
+			this.lblRebookSelectedType.TabIndex = 18;
+			// 
+			// rdoRebookSameType
+			// 
+			this.rdoRebookSameType.Location = new System.Drawing.Point(24, 152);
+			this.rdoRebookSameType.Name = "rdoRebookSameType";
+			this.rdoRebookSameType.Size = new System.Drawing.Size(160, 16);
+			this.rdoRebookSameType.TabIndex = 17;
+			this.rdoRebookSameType.Text = "Same as Current";
+			// 
+			// label3
+			// 
+			this.label3.Location = new System.Drawing.Point(88, 56);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(104, 16);
+			this.label3.TabIndex = 16;
+			this.label3.Text = "Start time in Days";
+			// 
+			// udMax
+			// 
+			this.udMax.Increment = new System.Decimal(new int[] {
+																	7,
+																	0,
+																	0,
+																	0});
+			this.udMax.Location = new System.Drawing.Point(16, 88);
+			this.udMax.Maximum = new System.Decimal(new int[] {
+																  730,
+																  0,
+																  0,
+																  0});
+			this.udMax.Minimum = new System.Decimal(new int[] {
+																  1,
+																  0,
+																  0,
+																  0});
+			this.udMax.Name = "udMax";
+			this.udMax.Size = new System.Drawing.Size(56, 20);
+			this.udMax.TabIndex = 15;
+			this.udMax.Value = new System.Decimal(new int[] {
+																30,
+																0,
+																0,
+																0});
+			// 
+			// udStart
+			// 
+			this.udStart.Location = new System.Drawing.Point(16, 54);
+			this.udStart.Maximum = new System.Decimal(new int[] {
+																	730,
+																	0,
+																	0,
+																	0});
+			this.udStart.Name = "udStart";
+			this.udStart.Size = new System.Drawing.Size(56, 20);
+			this.udStart.TabIndex = 14;
+			this.udStart.Value = new System.Decimal(new int[] {
+																  14,
+																  0,
+																  0,
+																  0});
+			// 
+			// chkAutoRebook
+			// 
+			this.chkAutoRebook.Location = new System.Drawing.Point(16, 24);
+			this.chkAutoRebook.Name = "chkAutoRebook";
+			this.chkAutoRebook.Size = new System.Drawing.Size(120, 16);
+			this.chkAutoRebook.TabIndex = 13;
+			this.chkAutoRebook.Text = "Auto Rebook";
+			// 
+			// label4
+			// 
+			this.label4.Location = new System.Drawing.Point(88, 88);
+			this.label4.Name = "label4";
+			this.label4.Size = new System.Drawing.Size(104, 16);
+			this.label4.TabIndex = 16;
+			this.label4.Text = "Maximum Days";
+			// 
+			// rdoRebookAnyType
+			// 
+			this.rdoRebookAnyType.Location = new System.Drawing.Point(24, 176);
+			this.rdoRebookAnyType.Name = "rdoRebookAnyType";
+			this.rdoRebookAnyType.Size = new System.Drawing.Size(160, 16);
+			this.rdoRebookAnyType.TabIndex = 17;
+			this.rdoRebookAnyType.Text = "Any Access Type";
+			// 
+			// rdoRebookSelectedType
+			// 
+			this.rdoRebookSelectedType.Enabled = false;
+			this.rdoRebookSelectedType.Location = new System.Drawing.Point(24, 200);
+			this.rdoRebookSelectedType.Name = "rdoRebookSelectedType";
+			this.rdoRebookSelectedType.Size = new System.Drawing.Size(136, 16);
+			this.rdoRebookSelectedType.TabIndex = 17;
+			this.rdoRebookSelectedType.Text = "Selected Access Type:";
+			// 
+			// DCancelAppt
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(594, 528);
+			this.ControlBox = false;
+			this.Controls.Add(this.grpAutoRebook);
+			this.Controls.Add(this.txtNote);
+			this.Controls.Add(this.label1);
+			this.Controls.Add(this.lstReason);
+			this.Controls.Add(this.grpCancelledby);
+			this.Controls.Add(this.pnlDescription);
+			this.Controls.Add(this.pnlPageBottom);
+			this.Controls.Add(this.label2);
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DCancelAppt";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "Cancel Appointment";
+			this.pnlPageBottom.ResumeLayout(false);
+			this.pnlDescription.ResumeLayout(false);
+			this.grpDescriptionResourceGroup.ResumeLayout(false);
+			this.grpCancelledby.ResumeLayout(false);
+			this.grpAutoRebook.ResumeLayout(false);
+			((System.ComponentModel.ISupportInitialize)(this.udMax)).EndInit();
+			((System.ComponentModel.ISupportInitialize)(this.udStart)).EndInit();
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+
+
+
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DCancelAppt.resx
===================================================================
--- Scheduling/branches/GUI1.2/DCancelAppt.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DCancelAppt.resx	(revision 855)
@@ -0,0 +1,391 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="pnlPageBottom.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlPageBottom.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlPageBottom.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlPageBottom.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpCancelledby.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpCancelledby.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpCancelledby.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpCancelledby.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpCancelledby.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpCancelledby.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoPatient.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoPatient.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoPatient.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoClinic.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoClinic.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoClinic.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lstReason.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lstReason.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lstReason.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtNote.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtNote.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtNote.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpAutoRebook.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpAutoRebook.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpAutoRebook.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpAutoRebook.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpAutoRebook.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpAutoRebook.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label6.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label6.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label6.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblRebookSelectedType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblRebookSelectedType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblRebookSelectedType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookSameType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoRebookSameType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookSameType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="udMax.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="udMax.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="udMax.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="udStart.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="udStart.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="udStart.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkAutoRebook.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkAutoRebook.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkAutoRebook.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label4.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookAnyType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoRebookAnyType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookAnyType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookSelectedType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoRebookSelectedType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookSelectedType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Name">
+    <value>DCancelAppt</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DCheckIn.cs
===================================================================
--- Scheduling/branches/GUI1.2/DCheckIn.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DCheckIn.cs	(revision 855)
@@ -0,0 +1,761 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+using System.Diagnostics;
+using IndianHealthService.BMXNet;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+    /// <summary>
+    /// Summary description for DCheckIn.
+    /// </summary>
+    public class DCheckIn : System.Windows.Forms.Form
+    {
+        private IContainer components;
+
+        public DCheckIn()
+        {
+            //
+            // Required for Windows Form Designer support
+            //
+            InitializeComponent();
+
+            //
+            // TODO: Add any constructor code after InitializeComponent call
+            //
+        }
+
+
+        #region Fields
+        private System.Windows.Forms.Panel pnlPageBottom;
+        private System.Windows.Forms.Button cmdCancel;
+        private System.Windows.Forms.Button cmdOK;
+        private System.Windows.Forms.Panel pnlDescription;
+        private System.Windows.Forms.GroupBox grpDescriptionResourceGroup;
+        private System.Windows.Forms.Label lblDescriptionResourceGroup;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.DateTimePicker dtpCheckIn;
+        private System.Windows.Forms.Label lblAlready;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label lblPatientName;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.ComboBox cboProvider;
+        private System.Windows.Forms.ComboBox cboStopCode;
+        private System.Windows.Forms.Label lblStopCode;
+        private System.Windows.Forms.CheckBox chkRoutingSlip;
+        private System.Windows.Forms.GroupBox grpPCCPlus;
+        private System.Windows.Forms.ComboBox cboPCCPlusClinic;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.ComboBox cboPCCPlusForm;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.CheckBox chkPCCOutGuide;
+
+        private string m_sPatientName;
+        private DateTime m_dCheckIn;
+        private string m_sProvider;
+        private string m_sProviderIEN;
+        private string m_sStopCode;
+        private string m_sStopCodeIEN;
+        private CGDocumentManager m_DocManager;
+        private DataSet m_dsGlobal;
+        private DataTable m_dtProvider;
+        private DataView m_dvCS;
+        private bool m_bProviderRequired;
+        private DataTable m_dtClinic;
+        private DataTable m_dtForm;
+        private DataView m_dvClinic;
+        private DataView m_dvForm;
+        private bool m_bInit;
+        public bool m_bPrintRouteSlip;
+        private DateTime m_dAuxTime;
+
+        /*
+         * PCC Variables
+         */
+        private bool m_bPCC;
+        private string m_sPCCClinicIEN;
+        private string m_sPCCFormIEN;
+        private ToolTip toolTip1;
+        private bool m_bPCCOutGuide;
+
+        #endregion Fields
+
+        #region Properties
+
+        /// <summary>
+        /// Returns string representation of internal entry number of Provider in PROVIDER File
+        /// </summary>
+        public string ProviderIEN
+        {
+            get
+            {
+                return this.m_sProviderIEN;
+            }
+        }
+
+        /// <summary>
+        /// Returns string representation of IEN of Clinic in VEN EHP CLINIC file
+        /// </summary>
+        public string PCCClinicIEN
+        {
+            get
+            {
+                return this.m_sPCCClinicIEN;
+            }
+        }
+
+        /// <summary>
+        /// Returns string representation of IEN of template entry in VEN PCC TEMPLATE
+        /// </summary>
+        public string PCCFormIEN
+        {
+            get
+            {
+                return m_sPCCFormIEN;
+            }
+        }
+
+        /// <summary>
+        /// Returns 'true' if outguide to be printed; otherwise returns 'false'
+        /// </summary>
+        public string PCCOutGuide
+        {
+            get
+            {
+                string sRet = (this.m_bPCCOutGuide == true) ? "true" : "false";
+                return sRet;
+            }
+        }
+
+        /// <summary>
+        /// Returns string representation of IEN of CLINIC STOP
+        /// </summary>
+        public string ClinicStopIEN
+        {
+            get
+            {
+                return this.m_sStopCodeIEN;
+            }
+        }
+
+        /// <summary>
+        /// Returns 'true' if routing slip to be printed; otherwise 'false'
+        /// </summary>
+        public string PrintRouteSlip
+        {
+            get
+            {
+                string sRet = (this.m_bPrintRouteSlip == true) ? "true" : "false";
+                return sRet;
+            }
+        }
+
+        /// <summary>
+        /// Appointment checkin time
+        /// </summary>
+        public DateTime CheckInTime
+        {
+            get
+            {
+                return m_dCheckIn;
+            }
+            set
+            {
+                m_dCheckIn = value;
+            }
+        }
+
+        /// <summary>
+        /// Appointment end time
+        /// </summary>
+        public DateTime AuxTime
+        {
+            get
+            {
+                return m_dAuxTime;
+            }
+            set
+            {
+                m_dAuxTime = value;
+            }
+        }
+        #endregion Properties
+
+        #region Methods
+
+        /// <summary>
+        /// Fill memeber variables before showing dialog
+        /// </summary>
+        /// <param name="a">Appointment</param>
+        /// <param name="docManager">Document Manager</param>
+        /// <param name="sDefaultProvider">Default provider</param>
+        /// <param name="bProviderRequired">not used</param>
+        /// <param name="bGeneratePCCPlus">not used</param>
+        /// <param name="bMultCodes">not used</param>
+        /// <param name="sStopCode">Stop Code</param>
+        public void InitializePage(CGAppointment a, CGDocumentManager docManager,
+            string sDefaultProvider, bool bProviderRequired, bool bGeneratePCCPlus,
+            bool bMultCodes, string sStopCode, int nHospLoc)
+        {
+            m_bInit = true;
+            m_DocManager = docManager;
+            m_dsGlobal = m_DocManager.GlobalDataSet;
+            int nFind = 0;
+
+            //Provider processing
+            m_bProviderRequired = bProviderRequired; //not used in VISTA --remove
+
+            //smh new code
+            //if the resource is linked to a valid hospital location, grab this locations providers
+            //from the provider multiple and put them in the combo box.
+            if (nHospLoc != 0)
+            {
+                //RPC BSDX HOSP LOC PROVIDERS returns Table w/ Columns: 
+                //HOSPITAL_LOCATION_ID^BMXIEN (ie Prov IEN)^NAME^DEFALUT
+                string sCommandText = "BSDX HOSP LOC PROVIDERS^" + nHospLoc;
+                m_dtProvider = docManager.RPMSDataTable(sCommandText, "ClinicProviders");
+                m_dtProvider.DefaultView.Sort = "NAME ASC";
+
+                cboProvider.DataSource = m_dtProvider;
+                cboProvider.DisplayMember = "NAME";
+                cboProvider.ValueMember = "BMXIEN";
+
+                //Add None to the top of the list
+                DataRow drProv = m_dtProvider.NewRow();
+                drProv.BeginEdit();
+                drProv["HOSPITAL_LOCATION_ID"] = 0;
+                drProv["NAME"] = "<None>";
+                drProv["BMXIEN"] = 0;
+                drProv.EndEdit();
+                m_dtProvider.Rows.InsertAt(drProv, 0);
+                cboProvider.SelectedIndex = 0;
+
+                //Find default provider--search for Yes in Field DEFAULT            
+                DataRow[] nRow = m_dtProvider.Select("DEFAULT='YES'", "NAME ASC");
+                if (nRow.Length > 0) nFind = m_dtProvider.Rows.IndexOf(nRow[0]);
+                cboProvider.SelectedIndex = nFind;
+            }
+            //otherwise, just use the default provider table
+            else
+            {
+                m_dtProvider = m_dsGlobal.Tables["Provider"];
+                m_dtProvider.DefaultView.Sort = "NAME ASC";
+
+                cboProvider.DataSource = m_dtProvider;
+                cboProvider.DisplayMember = "NAME";
+                cboProvider.ValueMember = "BMXIEN";
+
+                //Add None to the top of the list
+                DataRow drProv = m_dtProvider.NewRow();
+                drProv.BeginEdit();
+                drProv["NAME"] = "<None>";
+                drProv["BMXIEN"] = 0;
+                drProv.EndEdit();
+                m_dtProvider.Rows.InsertAt(drProv, 0);
+                cboProvider.SelectedIndex = 0;
+            }
+
+
+            //Stop code processing
+            //TODO: Remove... not in VISTA.
+            this.lblStopCode.Visible = false;
+            this.cboStopCode.Visible = false;
+            m_dvCS = new DataView(m_dsGlobal.Tables["ClinicStop"]);
+            m_dvCS.Sort = "NAME ASC";
+            m_sStopCode = sStopCode;
+            m_sStopCodeIEN = "";
+            if (m_sStopCode != "")
+            {
+                //Get the IEN of the clinic stop code
+                nFind = m_dvCS.Find((string)m_sStopCode);
+                Debug.Assert(nFind > -1);
+                if (nFind > -1)
+                {
+                    m_sStopCodeIEN = m_dvCS[nFind].Row["BMXIEN"].ToString();
+                }
+            }
+
+            if (bMultCodes == true)
+            {
+                this.lblStopCode.Visible = true;
+                this.cboStopCode.Visible = true;
+                cboStopCode.DataSource = m_dvCS;
+                cboStopCode.DisplayMember = "NAME";
+                cboStopCode.ValueMember = "BMXIEN";
+                if (m_sStopCode != "")
+                {
+                    nFind = m_dvCS.Find((string)m_sStopCode);
+                    cboStopCode.SelectedIndex = nFind;
+                }
+            }
+
+            m_bPCC = bGeneratePCCPlus;
+            PCCPlus();
+
+            m_sPatientName = a.PatientName;
+            if (a.CheckInTime.Ticks != 0)
+            {
+                m_dCheckIn = a.CheckInTime;
+                dtpCheckIn.Enabled = false;
+                this.cboProvider.Enabled = false;
+                lblAlready.Visible = true;
+            }
+            else
+            {
+                m_dCheckIn = DateTime.Now;
+            }
+            UpdateDialogData(true);
+            m_bInit = false;
+
+            //Synchronize PCCForm with Clinic
+            if (m_bPCC == true)
+            {
+                cboPCCPlusClinic_SelectedIndexChanged(this, new System.EventArgs());
+            }
+        }
+
+        /// <summary>
+        /// Not used in VISTA. Needs to be removed
+        /// <remarks>Not used in VISTA.</remarks>
+        /// </summary>
+        private void PCCPlus()
+        {
+            //PCCPlus processing
+            /*Can't do PCCPlus if no stop code
+                * or if PRINT PCC PLUS FORM field in CLINIC SETUP PARAMETERS is false
+                */
+            if ((m_bPCC == false) || (m_sStopCode == ""))
+            {
+                grpPCCPlus.Enabled = false;
+                return;
+            }
+            else
+            {
+                grpPCCPlus.Enabled = true;
+                //Populate combo box with recordset of clinics based on m_sStopCode
+                string sCmd = "SELECT BMXIEN, NAME, DEPARTMENT, DEFAULT_ENCOUNTER_FORM, NEVER_PRINT_OUTGUIDE FROM VEN_EHP_CLINIC WHERE DEPARTMENT = '" + m_sStopCode + "'";
+                m_dtClinic = m_DocManager.ConnectInfo.RPMSDataTable(sCmd, "CLINIC");
+                m_dvClinic = new DataView(m_dtClinic);
+                m_dvClinic.Sort = "NAME ASC";
+
+                cboPCCPlusClinic.DataSource = m_dvClinic;
+                cboPCCPlusClinic.DisplayMember = "NAME";
+                cboPCCPlusClinic.ValueMember = "BMXIEN";
+
+
+                //Populate combo box with recordset of all forms
+                sCmd = "SELECT BMXIEN, TEMPLATE FROM VEN_EHP_EF_TEMPLATES";
+                m_dtForm = m_DocManager.ConnectInfo.RPMSDataTable(sCmd, "FORM");
+                m_dvForm = new DataView(m_dtForm);
+                m_dvForm.Sort = "TEMPLATE ASC";
+
+                cboPCCPlusForm.DataSource = m_dvForm;
+                cboPCCPlusForm.DisplayMember = "TEMPLATE";
+                cboPCCPlusForm.ValueMember = "BMXIEN";
+
+                if ((m_dtClinic.Rows.Count == 0) || (m_dtForm.Rows.Count == 0))
+                {
+                    //No PCCPlus clinics for current stop code
+                    //or no forms available
+                    grpPCCPlus.Enabled = false;
+                    return;
+                }
+
+                cboPCCPlusClinic.SelectedIndex = 0;
+                cboPCCPlusClinic_SelectedIndexChanged(this, new System.EventArgs());
+
+            }
+        }
+
+        /// <summary>
+        /// If b is true, moves member vars into control data
+        /// otherwise, moves control data into member vars
+        /// </summary>
+        /// <param name="b"></param>
+        private void UpdateDialogData(bool b)
+        {
+            if (b == true) //Move data to dialog controls from member variables
+            {
+                this.lblPatientName.Text = m_sPatientName;
+                this.dtpCheckIn.Value = m_dCheckIn;
+            }
+            else //Move data to member variables from dialog controls
+            {
+
+                /*
+                 * Need to return Provider, ClinicStop, PrintRouteSlip, 
+                 * PCC Clinic, PCC Form, Print OutGuide
+                 */
+
+                m_dCheckIn = this.dtpCheckIn.Value;
+                m_sProviderIEN = this.cboProvider.SelectedValue.ToString();
+                m_bPrintRouteSlip = chkRoutingSlip.Checked;
+
+                /*
+                 * Don't get value from CLINIC STOP combo since
+                 * it may not be enabled, and
+                 * it updates the member variable whenever the selection changes
+                 */
+
+                /*
+                 * PCCPlus
+                 */
+
+                if (grpPCCPlus.Enabled == false)
+                {
+                    m_bPCC = false;
+                    m_sPCCClinicIEN = "";
+                    m_sPCCFormIEN = "";
+                    m_bPCCOutGuide = false;
+                }
+                else
+                {
+                    m_bPCC = true;
+                    m_sPCCClinicIEN = this.cboPCCPlusClinic.SelectedValue.ToString();
+                    m_sPCCFormIEN = this.cboPCCPlusForm.SelectedValue.ToString();
+                    if (chkPCCOutGuide.Enabled == false)
+                    {
+                        m_bPCCOutGuide = false;
+                    }
+                    else
+                    {
+                        m_bPCCOutGuide = this.chkPCCOutGuide.Checked;
+                    }
+                }
+
+            }
+        }
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing)
+            {
+                if (components != null)
+                {
+                    components.Dispose();
+                }
+            }
+            base.Dispose(disposing);
+        }
+        #endregion Methods
+
+        #region Windows Form Designer generated code
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DCheckIn));
+            this.pnlPageBottom = new System.Windows.Forms.Panel();
+            this.cmdCancel = new System.Windows.Forms.Button();
+            this.cmdOK = new System.Windows.Forms.Button();
+            this.pnlDescription = new System.Windows.Forms.Panel();
+            this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
+            this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.dtpCheckIn = new System.Windows.Forms.DateTimePicker();
+            this.lblAlready = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.lblPatientName = new System.Windows.Forms.Label();
+            this.cboProvider = new System.Windows.Forms.ComboBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.cboStopCode = new System.Windows.Forms.ComboBox();
+            this.lblStopCode = new System.Windows.Forms.Label();
+            this.chkRoutingSlip = new System.Windows.Forms.CheckBox();
+            this.grpPCCPlus = new System.Windows.Forms.GroupBox();
+            this.chkPCCOutGuide = new System.Windows.Forms.CheckBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.cboPCCPlusClinic = new System.Windows.Forms.ComboBox();
+            this.cboPCCPlusForm = new System.Windows.Forms.ComboBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
+            this.pnlPageBottom.SuspendLayout();
+            this.pnlDescription.SuspendLayout();
+            this.grpDescriptionResourceGroup.SuspendLayout();
+            this.grpPCCPlus.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // pnlPageBottom
+            // 
+            this.pnlPageBottom.Controls.Add(this.cmdCancel);
+            this.pnlPageBottom.Controls.Add(this.cmdOK);
+            this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlPageBottom.Location = new System.Drawing.Point(0, 360);
+            this.pnlPageBottom.Name = "pnlPageBottom";
+            this.pnlPageBottom.Size = new System.Drawing.Size(520, 40);
+            this.pnlPageBottom.TabIndex = 5;
+            // 
+            // cmdCancel
+            // 
+            this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.cmdCancel.Location = new System.Drawing.Point(440, 8);
+            this.cmdCancel.Name = "cmdCancel";
+            this.cmdCancel.Size = new System.Drawing.Size(56, 24);
+            this.cmdCancel.TabIndex = 2;
+            this.cmdCancel.Text = "Cancel";
+            // 
+            // cmdOK
+            // 
+            this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.cmdOK.Location = new System.Drawing.Point(360, 8);
+            this.cmdOK.Name = "cmdOK";
+            this.cmdOK.Size = new System.Drawing.Size(64, 24);
+            this.cmdOK.TabIndex = 1;
+            this.cmdOK.Text = "OK";
+            this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+            // 
+            // pnlDescription
+            // 
+            this.pnlDescription.Controls.Add(this.grpDescriptionResourceGroup);
+            this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlDescription.Location = new System.Drawing.Point(0, 288);
+            this.pnlDescription.Name = "pnlDescription";
+            this.pnlDescription.Size = new System.Drawing.Size(520, 72);
+            this.pnlDescription.TabIndex = 6;
+            // 
+            // grpDescriptionResourceGroup
+            // 
+            this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
+            this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
+            this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
+            this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(520, 72);
+            this.grpDescriptionResourceGroup.TabIndex = 1;
+            this.grpDescriptionResourceGroup.TabStop = false;
+            this.grpDescriptionResourceGroup.Text = "Description";
+            // 
+            // lblDescriptionResourceGroup
+            // 
+            this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
+            this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
+            this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(514, 53);
+            this.lblDescriptionResourceGroup.TabIndex = 0;
+            this.lblDescriptionResourceGroup.Text = resources.GetString("lblDescriptionResourceGroup.Text");
+            // 
+            // label1
+            // 
+            this.label1.Location = new System.Drawing.Point(16, 16);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(80, 16);
+            this.label1.TabIndex = 7;
+            this.label1.Text = "Patient Name:";
+            // 
+            // dtpCheckIn
+            // 
+            this.dtpCheckIn.AllowDrop = true;
+            this.dtpCheckIn.CustomFormat = "MMMM dd yyyy H:mm";
+            this.dtpCheckIn.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
+            this.dtpCheckIn.Location = new System.Drawing.Point(96, 48);
+            this.dtpCheckIn.Name = "dtpCheckIn";
+            this.dtpCheckIn.ShowUpDown = true;
+            this.dtpCheckIn.Size = new System.Drawing.Size(176, 20);
+            this.dtpCheckIn.TabIndex = 9;
+            // 
+            // lblAlready
+            // 
+            this.lblAlready.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblAlready.ForeColor = System.Drawing.Color.Green;
+            this.lblAlready.Location = new System.Drawing.Point(288, 40);
+            this.lblAlready.Name = "lblAlready";
+            this.lblAlready.Size = new System.Drawing.Size(192, 32);
+            this.lblAlready.TabIndex = 10;
+            this.lblAlready.Text = "This Patient is already checked in.";
+            this.lblAlready.Visible = false;
+            // 
+            // label3
+            // 
+            this.label3.Location = new System.Drawing.Point(16, 48);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(80, 16);
+            this.label3.TabIndex = 7;
+            this.label3.Text = "CheckIn Time:";
+            // 
+            // lblPatientName
+            // 
+            this.lblPatientName.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblPatientName.Location = new System.Drawing.Point(96, 16);
+            this.lblPatientName.Name = "lblPatientName";
+            this.lblPatientName.Size = new System.Drawing.Size(256, 16);
+            this.lblPatientName.TabIndex = 11;
+            // 
+            // cboProvider
+            // 
+            this.cboProvider.Location = new System.Drawing.Point(96, 88);
+            this.cboProvider.Name = "cboProvider";
+            this.cboProvider.Size = new System.Drawing.Size(240, 21);
+            this.cboProvider.TabIndex = 12;
+            // 
+            // label2
+            // 
+            this.label2.Location = new System.Drawing.Point(16, 88);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(80, 16);
+            this.label2.TabIndex = 7;
+            this.label2.Text = "Visit Provider:";
+            // 
+            // cboStopCode
+            // 
+            this.cboStopCode.Location = new System.Drawing.Point(96, 128);
+            this.cboStopCode.Name = "cboStopCode";
+            this.cboStopCode.Size = new System.Drawing.Size(240, 21);
+            this.cboStopCode.TabIndex = 13;
+            this.cboStopCode.SelectedIndexChanged += new System.EventHandler(this.cboStopCode_SelectedIndexChanged);
+            // 
+            // lblStopCode
+            // 
+            this.lblStopCode.Location = new System.Drawing.Point(16, 128);
+            this.lblStopCode.Name = "lblStopCode";
+            this.lblStopCode.Size = new System.Drawing.Size(80, 16);
+            this.lblStopCode.TabIndex = 7;
+            this.lblStopCode.Text = "Stop Code:";
+            // 
+            // chkRoutingSlip
+            // 
+            this.chkRoutingSlip.Location = new System.Drawing.Point(368, 88);
+            this.chkRoutingSlip.Name = "chkRoutingSlip";
+            this.chkRoutingSlip.Size = new System.Drawing.Size(128, 16);
+            this.chkRoutingSlip.TabIndex = 14;
+            this.chkRoutingSlip.Text = "Print Routing Slip";
+            this.toolTip1.SetToolTip(this.chkRoutingSlip, "Prints routing slip to the Windows Default Printer");
+            // 
+            // grpPCCPlus
+            // 
+            this.grpPCCPlus.Controls.Add(this.chkPCCOutGuide);
+            this.grpPCCPlus.Controls.Add(this.label4);
+            this.grpPCCPlus.Controls.Add(this.cboPCCPlusClinic);
+            this.grpPCCPlus.Controls.Add(this.cboPCCPlusForm);
+            this.grpPCCPlus.Controls.Add(this.label5);
+            this.grpPCCPlus.Location = new System.Drawing.Point(8, 168);
+            this.grpPCCPlus.Name = "grpPCCPlus";
+            this.grpPCCPlus.Size = new System.Drawing.Size(488, 104);
+            this.grpPCCPlus.TabIndex = 15;
+            this.grpPCCPlus.TabStop = false;
+            this.grpPCCPlus.Text = "PCC Plus";
+            // 
+            // chkPCCOutGuide
+            // 
+            this.chkPCCOutGuide.Location = new System.Drawing.Point(360, 24);
+            this.chkPCCOutGuide.Name = "chkPCCOutGuide";
+            this.chkPCCOutGuide.Size = new System.Drawing.Size(96, 16);
+            this.chkPCCOutGuide.TabIndex = 15;
+            this.chkPCCOutGuide.Text = "Print Outguide";
+            // 
+            // label4
+            // 
+            this.label4.Location = new System.Drawing.Point(8, 24);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(72, 16);
+            this.label4.TabIndex = 8;
+            this.label4.Text = "PCC+ Clinic:";
+            // 
+            // cboPCCPlusClinic
+            // 
+            this.cboPCCPlusClinic.Location = new System.Drawing.Point(88, 24);
+            this.cboPCCPlusClinic.Name = "cboPCCPlusClinic";
+            this.cboPCCPlusClinic.Size = new System.Drawing.Size(240, 21);
+            this.cboPCCPlusClinic.TabIndex = 0;
+            this.cboPCCPlusClinic.SelectedIndexChanged += new System.EventHandler(this.cboPCCPlusClinic_SelectedIndexChanged);
+            // 
+            // cboPCCPlusForm
+            // 
+            this.cboPCCPlusForm.Location = new System.Drawing.Point(88, 64);
+            this.cboPCCPlusForm.Name = "cboPCCPlusForm";
+            this.cboPCCPlusForm.Size = new System.Drawing.Size(240, 21);
+            this.cboPCCPlusForm.TabIndex = 0;
+            // 
+            // label5
+            // 
+            this.label5.Location = new System.Drawing.Point(8, 64);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(72, 16);
+            this.label5.TabIndex = 8;
+            this.label5.Text = "PCC+ Form:";
+            // 
+            // DCheckIn
+            // 
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(520, 400);
+            this.Controls.Add(this.grpPCCPlus);
+            this.Controls.Add(this.chkRoutingSlip);
+            this.Controls.Add(this.cboStopCode);
+            this.Controls.Add(this.cboProvider);
+            this.Controls.Add(this.lblPatientName);
+            this.Controls.Add(this.lblAlready);
+            this.Controls.Add(this.dtpCheckIn);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.pnlDescription);
+            this.Controls.Add(this.pnlPageBottom);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.lblStopCode);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+            this.Name = "DCheckIn";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "Appointment Check In";
+            this.pnlPageBottom.ResumeLayout(false);
+            this.pnlDescription.ResumeLayout(false);
+            this.grpDescriptionResourceGroup.ResumeLayout(false);
+            this.grpPCCPlus.ResumeLayout(false);
+            this.ResumeLayout(false);
+
+        }
+        #endregion
+
+        #region Events
+
+        private void cmdOK_Click(object sender, System.EventArgs e)
+        {
+            this.UpdateDialogData(false);
+        }
+
+        private void cboStopCode_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            /*
+             * Whenever the stop code changes, the set of PCCPlus Clinic Selections change
+             * except during init.
+             */
+            if (m_bInit == true)
+                return;
+
+            //Change the value of m_sStopCode
+            DataRowView drv = (DataRowView)this.cboStopCode.SelectedItem;
+            string sStopCode = drv.Row["NAME"].ToString();
+            m_sStopCode = sStopCode;
+            m_sStopCodeIEN = drv.Row["BMXIEN"].ToString();
+            PCCPlus();
+        }
+
+        private void cboPCCPlusClinic_SelectedIndexChanged(object sender, System.EventArgs e)
+        {
+            /*
+             * Whenever the PCCPlus Clinic changes, the default EF TEMPLATE changes
+             */
+            if (m_bInit == true)
+                return;
+
+            if (this.cboPCCPlusClinic.SelectedItem == null)
+                return;
+
+            DataRowView drv = (DataRowView)this.cboPCCPlusClinic.SelectedItem;
+            string sDefaultForm = drv.Row["DEFAULT_ENCOUNTER_FORM"].ToString();
+
+            int nFind = this.m_dvForm.Find(sDefaultForm);
+            if (nFind > -1)
+            {
+                this.cboPCCPlusForm.SelectedIndex = nFind;
+            }
+        }
+        #endregion Events
+
+
+    }
+}
Index: Scheduling/branches/GUI1.2/DCheckIn.resx
===================================================================
--- Scheduling/branches/GUI1.2/DCheckIn.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DCheckIn.resx	(revision 855)
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="lblDescriptionResourceGroup.Text" xml:space="preserve">
+    <value>Use this panel to check in an appointment. A PCC visit will automatically be created for this patient at the check in date and time if the clinic is set up to create a visit at checkin.  A patient may only be checked-in once.</value>
+  </data>
+  <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>
Index: Scheduling/branches/GUI1.2/DCopyAppts.cs
===================================================================
--- Scheduling/branches/GUI1.2/DCopyAppts.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DCopyAppts.cs	(revision 855)
@@ -0,0 +1,286 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+using IndianHealthService.BMXNet;
+using System.Threading;
+using System.Net;
+using System.Net.Sockets;
+using System.Diagnostics;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DCopyAppts.
+	/// </summary>
+	public class DCopyAppts : System.Windows.Forms.Form
+    {
+		private System.Windows.Forms.Button cmdOK;
+        private System.Windows.Forms.Panel pnlOKCancel;
+		private System.Windows.Forms.Label lblSummary;
+		private System.Windows.Forms.Label lblProgress;
+		private System.ComponentModel.IContainer components;
+
+        #region Fields
+        private DateTime			m_dtBegin;
+		private DateTime			m_dtEnd;
+		private string				m_HospLocationID;
+		private string				m_HospLocationName;
+		private string				m_ResourceID;
+		private string				m_ResourceName;
+		private string				m_sTask;
+		private CGDocumentManager	m_DocManager;
+
+		private System.Windows.Forms.Timer timerPoll;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.Label label2;
+
+		//protected delegate void UpdateDisplayDelegate(string sText);
+		//protected delegate void RegisterEventDelegate(string sPort, string sEvent);
+
+        #endregion Fields
+
+        public DCopyAppts()
+		{
+			InitializeComponent();
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+            this.components = new System.ComponentModel.Container();
+            this.pnlOKCancel = new System.Windows.Forms.Panel();
+            this.cmdOK = new System.Windows.Forms.Button();
+            this.lblSummary = new System.Windows.Forms.Label();
+            this.lblProgress = new System.Windows.Forms.Label();
+            this.timerPoll = new System.Windows.Forms.Timer(this.components);
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.pnlOKCancel.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // pnlOKCancel
+            // 
+            this.pnlOKCancel.Controls.Add(this.cmdOK);
+            this.pnlOKCancel.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlOKCancel.Location = new System.Drawing.Point(0, 211);
+            this.pnlOKCancel.Name = "pnlOKCancel";
+            this.pnlOKCancel.Size = new System.Drawing.Size(376, 40);
+            this.pnlOKCancel.TabIndex = 4;
+            // 
+            // cmdOK
+            // 
+            this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.cmdOK.Location = new System.Drawing.Point(208, 8);
+            this.cmdOK.Name = "cmdOK";
+            this.cmdOK.Size = new System.Drawing.Size(136, 24);
+            this.cmdOK.TabIndex = 0;
+            this.cmdOK.Text = "OK";
+            // 
+            // lblSummary
+            // 
+            this.lblSummary.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblSummary.Location = new System.Drawing.Point(32, 32);
+            this.lblSummary.Name = "lblSummary";
+            this.lblSummary.Size = new System.Drawing.Size(312, 64);
+            this.lblSummary.TabIndex = 48;
+            this.lblSummary.Text = "lblSummary";
+            // 
+            // lblProgress
+            // 
+            this.lblProgress.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblProgress.Location = new System.Drawing.Point(32, 128);
+            this.lblProgress.Name = "lblProgress";
+            this.lblProgress.Size = new System.Drawing.Size(312, 72);
+            this.lblProgress.TabIndex = 49;
+            this.lblProgress.Text = "lblProgress";
+            // 
+            // timerPoll
+            // 
+            this.timerPoll.Tick += new System.EventHandler(this.timerPoll_Tick);
+            // 
+            // label1
+            // 
+            this.label1.Location = new System.Drawing.Point(32, 112);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(144, 16);
+            this.label1.TabIndex = 50;
+            this.label1.Text = "Status:";
+            // 
+            // label2
+            // 
+            this.label2.Location = new System.Drawing.Point(32, 16);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(144, 16);
+            this.label2.TabIndex = 51;
+            this.label2.Text = "Job Summary:";
+            // 
+            // DCopyAppts
+            // 
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(376, 251);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.lblProgress);
+            this.Controls.Add(this.lblSummary);
+            this.Controls.Add(this.pnlOKCancel);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+            this.MaximizeBox = false;
+            this.Name = "DCopyAppts";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "Copy Appointments";
+            this.Load += new System.EventHandler(this.DCopyAppts_Load);
+            this.Closing += new System.ComponentModel.CancelEventHandler(this.DCopyAppts_Closing);
+            this.pnlOKCancel.ResumeLayout(false);
+            this.ResumeLayout(false);
+
+		}
+		#endregion
+
+        #region Methods and Handlers
+
+		public void InitializePage(DateTime StartDate, DateTime EndDate, 
+			string HospLocationID, string HospLocationName, 
+			string ResourceID, string ResourceName, 
+			CGDocumentManager DocManager)
+		{
+			string sMsg = "Copying appointments from " + HospLocationName + " to " + ResourceName + ", ";
+			sMsg += "beginning with apppointments on " + StartDate.ToLongDateString();
+			sMsg += " and going through " + EndDate.ToLongDateString() + ".";
+			lblSummary.Text = sMsg;
+			m_dtBegin = StartDate;
+			m_dtEnd = EndDate;
+			m_HospLocationID = HospLocationID;
+			m_HospLocationName = HospLocationName;
+			m_ResourceID = ResourceID;
+			m_ResourceName = ResourceName;
+			m_DocManager = DocManager;
+		}
+
+		private void DCopyAppts_Load(object sender, System.EventArgs e)
+		{
+			try
+			{
+				//Start M copy job and get the ZTSK number
+				//this.timerPoll.Stop();
+				lblProgress.Text = "Starting Process... \r\n";
+
+				string sSql = "BSDX COPY APPOINTMENTS^" + m_ResourceID + "^" + m_HospLocationID + "^" + m_dtBegin.ToShortDateString() + "^" + m_dtEnd.ToShortDateString();
+				DataTable dt = m_DocManager.RPMSDataTable(sSql, "ApptCopy");
+				Debug.Assert(dt.Rows.Count == 1);
+
+
+				DataRow dr = dt.Rows[0];
+				m_sTask = "0";
+				Object oTask = dr["TASK_NUMBER"];
+				m_sTask = oTask.ToString();
+
+				Object oError = dr["ERRORID"];
+				string sError = oError.ToString();
+				if (sError != "OK")
+				{
+					//timerPoll.Stop();
+					lblProgress.Text = sError;
+					cmdOK.Enabled = true;
+				}
+				else
+				{
+					lblProgress.Text += "VistA Job queued as Task #" + m_sTask;
+					//this.timerPoll.Start();
+					cmdOK.Enabled = true;	
+				}
+
+			}
+			catch (Exception Ex)
+			{
+				MessageBox.Show(Ex.Message);
+			}
+			
+		}
+
+		private void cmdCancel_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				//Check status and update progress control
+				string sSql = "BSDX COPY APPOINTMENT CANCEL^" + m_sTask;
+				DataTable dt = m_DocManager.RPMSDataTable(sSql, "ApptCopyCancel");
+				Debug.Assert(dt.Rows.Count == 1);
+				DataRow dr = dt.Rows[0];
+				Object oCount = dr["RECORD_COUNT"];
+				string sCount = oCount.ToString();
+
+				lblProgress.Text = "Cancelling job...";
+			}
+			catch (Exception Ex)
+			{
+				MessageBox.Show(Ex.Message);
+			}		
+		}
+
+		private void DCopyAppts_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+		{
+
+        }
+
+		private void timerPoll_Tick(object sender, System.EventArgs e)
+		{
+			try
+			{
+                return;
+				//Check status and update progress control
+                //string sSql = "BSDX COPY APPOINTMENT STATUS^" + m_sTask;
+                //DataTable dt = m_DocManager.RPMSDataTable(sSql, "ApptCopyStatus");
+                //Debug.Assert(dt.Rows.Count == 1);
+                //DataRow dr = dt.Rows[0];
+                //Object oCount = dr["RECORD_COUNT"];
+                //string sCount = oCount.ToString();
+                //Object oError = dr["ERRORID"];
+                //string sError = oError.ToString();
+                //if (sError != "OK")
+                //{
+                //    timerPoll.Stop();
+                //    lblProgress.Text = sError;
+                //}
+                //else if ((sCount.StartsWith("Finished"))||(sCount.StartsWith("Cancelled")))
+                //{
+                //    timerPoll.Stop();
+                //    lblProgress.Text = sCount;
+                //    cmdOK.Enabled = true;
+                //    cmdCancel.Enabled = false;
+                //}
+                //else
+                //{
+                //    lblProgress.Text = "RPMS Job queued as Task #" + m_sTask + ".  " + sCount; // + " records copied so far.";
+                //}
+			}
+			catch (Exception Ex)
+			{
+				MessageBox.Show(Ex.Message);
+			}
+        }
+
+        #endregion Methods and Handlers
+    }
+}
Index: Scheduling/branches/GUI1.2/DCopyAppts.resx
===================================================================
--- Scheduling/branches/GUI1.2/DCopyAppts.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DCopyAppts.resx	(revision 855)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="timerPoll.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>
Index: Scheduling/branches/GUI1.2/DManagement.cs
===================================================================
--- Scheduling/branches/GUI1.2/DManagement.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DManagement.cs	(revision 855)
@@ -0,0 +1,2394 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+using IndianHealthService.BMXNet;
+using System.Diagnostics;
+using System.Threading;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DManagement.
+	/// </summary>
+	public class DManagement : System.Windows.Forms.Form
+	{
+
+		private System.ComponentModel.Container components = null;
+		private System.Windows.Forms.TabPage tpResources;
+		private System.Windows.Forms.TabPage tpAccessTypes;
+		private System.Windows.Forms.GroupBox grpDescription;
+		private System.Windows.Forms.Label lblDescription;
+		private System.Windows.Forms.Panel pnlPageBottom;
+		private System.Windows.Forms.TabControl tabMain;
+		private System.Windows.Forms.Panel pnlAddEdit;
+		private System.Windows.Forms.Button cmdAddResource;
+		private System.Windows.Forms.Button cmdChangeResource;
+		private System.Windows.Forms.Panel pnlDescription;
+		private System.Windows.Forms.Panel pnlResources;
+		private System.Windows.Forms.DataGrid grdResources;
+		private System.Windows.Forms.Panel pnlAddEditAT;
+		private System.Windows.Forms.Button cmdChangeAT;
+		private System.Windows.Forms.Button cmdAddAT;
+		private System.Windows.Forms.Panel pnlDescriptionAT;
+		private System.Windows.Forms.GroupBox grpDescriptionAT;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.TabPage tpAccessGroups;
+		private System.Windows.Forms.Button cmdClose;
+		private System.Windows.Forms.TabPage tpResourceGroups;
+		private System.Windows.Forms.Panel pnlAddEditResourceGroups;
+		private System.Windows.Forms.Panel pnlDescriptionResourceGroup;
+		private System.Windows.Forms.GroupBox grpDescriptionResourceGroup;
+		private System.Windows.Forms.Label lblDescriptionResourceGroup;
+		private System.Windows.Forms.Panel pnlAddEditAccessGroup;
+		private System.Windows.Forms.Button cmdRemoveAccessGroup;
+		private System.Windows.Forms.Button cmdAddAccessGroup;
+		private System.Windows.Forms.Panel pnlDescriptionAccessGroups;
+		private System.Windows.Forms.GroupBox grpDescriptionAccessGroups;
+		private System.Windows.Forms.Label lblDescriptionAccessGroups;
+		private System.Windows.Forms.DataGrid grdAccessGroups;
+		private System.Windows.Forms.Button cmdRemoveUser;
+		private System.Windows.Forms.DataGrid grdResourceGroup;
+		private System.Windows.Forms.Button cmdRemoveResourceGroup;
+		private System.Windows.Forms.Button cmdAddResourceGroup;
+		private System.Windows.Forms.Button cmdChangeResourceGroup;
+		private System.Windows.Forms.Button cmdChangeAccessGroup;
+		private System.Windows.Forms.TabPage tpTransferAppts;
+		private System.Windows.Forms.Panel pnlCmdXfer;
+		private System.Windows.Forms.Panel pnlDescriptionXfer;
+		private System.Windows.Forms.Label lblDescriptionXfer;
+		private System.Windows.Forms.GroupBox grpDescriptionXfer;
+		private System.Windows.Forms.DataGrid grdAccessTypes;
+
+		#region Fields
+		private DataTable			m_dtResources;
+		private DataView			m_dvResources;
+		private DataTable			m_dtHospLoc;
+		private DataView			m_dvHospLoc;
+		private DataTable			m_dtResourceGroup;
+		private DataView			m_dvResourceGroup;
+		private DataTable			m_dtAccessTypes;
+		private DataView			m_dvAccessTypes;
+		private DataTable			m_dtAccessGroup;
+		private DataView			m_dvAccessGroup;
+		private DataTable			m_dtAccessGroupType;
+		private DataView			m_dvAccessGroupType;
+		private int					m_nATRow;
+		private int					m_nResourceRow;
+		private int					m_nResourceGroupRow;
+		private int					m_nAccessGroupRow;
+		private int					m_nResourceID;
+		private int					m_nResourceGroupID;
+		private int					m_nAccessGroupID;
+		private DataSet				m_dsGlobal;
+		private CGDocumentManager	m_DocManager;
+		private bool				m_bEditUsers;
+		private string				m_sMember;
+		private string				m_sGroupMember;
+		private string				m_sAccessGroupMember;
+		private bool				m_bEditGroupItems;
+		private bool				m_bEditAccessGroupItems;
+		private string				m_sResourceGroupName;
+        private string              m_sAccessGroupName;
+        private DataTable           m_dtWSGrid;
+        private System.Windows.Forms.Button cmdCopyAppts;
+		private System.Windows.Forms.ComboBox cboRPMSClinic;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.DateTimePicker dtpBegin;
+		private System.Windows.Forms.Label label4;
+		private System.Windows.Forms.Label label5;
+		private System.Windows.Forms.DateTimePicker dtpEnd;
+		private System.Windows.Forms.ComboBox cboBSDXClinic;
+		private System.Windows.Forms.TabPage tpWorkStations;
+		private System.Windows.Forms.Panel panel1;
+		private System.Windows.Forms.Button cmdWorkStationsMessage;
+		private System.Windows.Forms.Button cmdWorkStationsShutdown;
+		private System.Windows.Forms.Button cmdWorkStationsRefresh;
+		private System.Windows.Forms.Panel pnlWorkstations;
+		private System.Windows.Forms.GroupBox groupBox1;
+		private System.Windows.Forms.Label lblWorkstations;
+		private System.Windows.Forms.DataGrid grdWorkStations;
+		private System.Windows.Forms.TextBox txtSendMessage;
+
+		#endregion Fields
+
+		#region Initialization
+
+		public DManagement()
+		{
+			InitializeComponent();
+
+			m_nATRow = -1;
+			m_nResourceRow = -1;
+			m_nResourceGroupRow = -1;
+			m_nAccessGroupRow = -1;
+			m_nResourceID = 0;
+			m_sMember = "Resource";
+			m_sGroupMember = "Group";
+			m_sAccessGroupMember = "Group";
+
+		}
+
+		public void InitializeDialog(CGDocumentManager docManager)
+		{
+			//System.IntPtr pHandle = this.Handle;
+            //this.m_sMgrHandle = pHandle.ToString()
+			this.m_DocManager = docManager;
+			this.m_dsGlobal = m_DocManager.GlobalDataSet;
+
+			MgrEventDelegate = new BMXNetConnectInfo.BMXNetEventDelegate(MgrEventHandler);
+			m_DocManager.ConnectInfo.BMXNetEvent += MgrEventDelegate;
+			m_DocManager.ConnectInfo.SubscribeEvent("BSDX WORKSTATION REPORT");
+			m_dtWSGrid = new DataTable("WSGrid");
+			m_dtWSGrid.Columns.Add("UserName", typeof(System.String));
+			m_dtWSGrid.Columns.Add("Handle", typeof(System.String));
+			m_dtWSGrid.Columns.Add("Version", typeof(System.String));
+			m_dtWSGrid.Columns.Add("Views", typeof(System.String));
+
+			this.grdWorkStations.DataSource = m_dtWSGrid;
+
+			//Resources
+			m_dtResources = m_dsGlobal.Tables["Resources"];
+			m_dvResources = new DataView(m_dtResources);
+			m_dvResources.Sort = "RESOURCE_NAME ASC";
+			this.grdResources.DataSource = m_dvResources;
+
+			//Reload ResourceUser table with all users
+			m_dsGlobal.Tables["ResourceUser"].Clear();
+			m_DocManager.LoadResourceUserTable(true);
+
+			//Create DataGridTableStyle for ResourceUser table
+			DataGridTableStyle tsRU = new DataGridTableStyle();
+			tsRU.MappingName = "ResourceUser";
+			tsRU.ReadOnly = true;
+			// Add RESOURCEID column style.
+			DataGridColumnStyle colRUID = new DataGridTextBoxColumn();
+			colRUID.MappingName = "RESOURCEID";
+			colRUID.HeaderText = "Resource ID";
+			colRUID.Width = 0;
+			tsRU.GridColumnStyles.Add(colRUID);
+			// Add RESOURCEUSER_ID column style.
+			DataGridColumnStyle colRUserID = new DataGridTextBoxColumn();
+			colRUserID.MappingName = "RESOURCEUSER_ID";
+			colRUserID.HeaderText = "ResourceUser ID";
+			colRUserID.Width = 15;
+			tsRU.GridColumnStyles.Add(colRUserID);
+			// Add USERNAME column style.
+			DataGridColumnStyle colRUName = new DataGridTextBoxColumn();
+			colRUName.MappingName = "USERNAME";
+			colRUName.HeaderText = "Resource User Name";
+			colRUName.Width = 250;
+			tsRU.GridColumnStyles.Add(colRUName);
+
+			grdResources.TableStyles.Add(tsRU);
+
+			//Create DataGridTableStyle for Resources table
+			DataGridTableStyle tsResource = new DataGridTableStyle();
+			tsResource.MappingName = "Resources";
+			tsResource.ReadOnly = true;
+
+			// Add RESOURCEID column style.
+			DataGridColumnStyle colResID = new DataGridTextBoxColumn();
+			colResID.MappingName = "RESOURCEID";
+			colResID.HeaderText = "Resource ID";
+			colResID.Width = 0;
+			tsResource.GridColumnStyles.Add(colResID);
+
+			// Add RESOURCE_NAME column style.
+			DataGridColumnStyle colResName = new DataGridTextBoxColumn();
+			colResName.MappingName = "RESOURCE_NAME";
+			colResName.HeaderText = "Resource Name";
+			colResName.Width = 250;
+			tsResource.GridColumnStyles.Add(colResName);
+			grdResources.TableStyles.Add(tsResource);
+
+			//ResourceGroup
+			m_dtResourceGroup = m_dsGlobal.Tables["ResourceGroup"];
+			m_dvResourceGroup = new DataView(m_dtResourceGroup);
+			this.grdResourceGroup.DataSource = m_dvResourceGroup;
+
+			//Create DataGridTableStyle for ResourceGroup table
+			DataGridTableStyle tsResourceGroup = new DataGridTableStyle();
+			tsResourceGroup.MappingName = "ResourceGroup";
+			tsResourceGroup.ReadOnly = true;
+			// Add RESOURCE_GROUPID column style.
+			DataGridColumnStyle colResGroupID = new DataGridTextBoxColumn();
+			colResGroupID.MappingName = "RESOURCE_GROUPID";
+			colResGroupID.HeaderText = "GroupID";
+			colResGroupID.Width = 50;
+			tsResourceGroup.GridColumnStyles.Add(colResGroupID);
+			// Add RESOURCE_GROUP column style.
+			DataGridColumnStyle colResGroup = new DataGridTextBoxColumn();
+			colResGroup.MappingName = "RESOURCE_GROUP";
+			colResGroup.HeaderText = "Group";
+			colResGroup.Width = 250;
+			tsResourceGroup.GridColumnStyles.Add(colResGroup);
+			grdResourceGroup.TableStyles.Add(tsResourceGroup);
+
+			//Create DataGridTableStyle for GroupResources table
+			DataGridTableStyle tsGroupResources = new DataGridTableStyle();
+			tsGroupResources.MappingName = "GroupResources";
+			tsGroupResources.ReadOnly = true;
+			// Add RESOURCE_GROUPID column style.
+			DataGridColumnStyle colResGroupID2 = new DataGridTextBoxColumn();
+			colResGroupID2.MappingName = "RESOURCE_GROUPID";
+			colResGroupID2.HeaderText = "Resource GroupID";
+			colResGroupID2.Width = 50;
+			tsGroupResources.GridColumnStyles.Add(colResGroupID2);
+			// Add RESOURCE_NAME column style.
+			DataGridColumnStyle colGroupRes = new DataGridTextBoxColumn();
+			colGroupRes.MappingName = "RESOURCE_NAME";
+			colGroupRes.HeaderText = "Resource Name";
+			colGroupRes.Width = 250;
+			tsGroupResources.GridColumnStyles.Add(colGroupRes);
+
+
+			// Add RESOURCE_GROUP_ITEMID column style.
+			DataGridColumnStyle colResGroupItemID = new DataGridTextBoxColumn();
+			colResGroupItemID.MappingName = "RESOURCE_GROUP_ITEMID";
+			colResGroupItemID.HeaderText = "Resource ItemID";
+			colResGroupItemID.Width = 50;
+			tsGroupResources.GridColumnStyles.Add(colResGroupItemID);
+			grdResourceGroup.TableStyles.Add(tsGroupResources);
+
+
+			//Access Types
+			m_dtAccessTypes = m_dsGlobal.Tables["AccessTypes"];
+			m_dvAccessTypes = new DataView(m_dtAccessTypes);
+			this.grdAccessTypes.DataSource = m_dvAccessTypes;
+
+			// Create DataGridTableStyle for AccessTypes table  
+			DataGridTableStyle tsAT = new DataGridTableStyle();
+			tsAT.MappingName = "AccessTypes";
+			tsAT.ReadOnly = true;
+
+			// Add ACCESS_TYPE_NAME column style.
+			DataGridColumnStyle colATName = new DataGridTextBoxColumn();
+			colATName.MappingName = "ACCESS_TYPE_NAME";
+			colATName.HeaderText = "Access Type";
+			colATName.Width = 250;
+			tsAT.GridColumnStyles.Add(colATName);
+      
+			// Add INACTIVE column style.
+			DataGridColumnStyle colATInactive = new DataGridTextBoxColumn();
+			colATInactive.MappingName = "INACTIVE";
+			colATInactive.HeaderText = "Inactive?";
+			colATInactive.Width = 100;
+			tsAT.GridColumnStyles.Add(colATInactive);
+
+			grdAccessTypes.TableStyles.Add(tsAT);
+
+
+			//Access Groups
+			m_dtAccessGroup = m_dsGlobal.Tables["AccessGroup"];
+			m_dvAccessGroup = new DataView(m_dtAccessGroup);
+			this.grdAccessGroups.DataSource = m_dvAccessGroup;
+
+			// Create DataGridTableStyle for AccessGroup table  
+			DataGridTableStyle tsAG = new DataGridTableStyle();
+			tsAG.MappingName = "AccessGroup";
+			tsAG.ReadOnly = true;
+
+			// Add BMXIEN column style.
+			DataGridColumnStyle colAGID = new DataGridTextBoxColumn();
+			colAGID.MappingName = "BMXIEN";
+			colAGID.HeaderText = "Access Group ID";
+			colAGID.Width = 50;
+			tsAG.GridColumnStyles.Add(colAGID);
+      
+			// Add ACCESS_GROUP column style.
+			DataGridColumnStyle colAGNAME = new DataGridTextBoxColumn();
+			colAGNAME.MappingName = "ACCESS_GROUP";
+			colAGNAME.HeaderText = "Access Group";
+			colAGNAME.Width = 150;
+			tsAG.GridColumnStyles.Add(colAGNAME);
+
+			grdAccessGroups.TableStyles.Add(tsAG);
+
+			//Access Group Types
+			m_dtAccessGroupType = m_dsGlobal.Tables["AccessGroupType"];
+			m_dvAccessGroupType = new DataView(m_dtAccessGroupType);
+
+			// Create DataGridTableStyle for AccessGroupType table  
+			DataGridTableStyle tsAGTP = new DataGridTableStyle();
+			tsAGTP.MappingName = "AccessGroupType";
+			tsAGTP.ReadOnly = true;
+
+			// 0 Add ACCESS_GROUP_TYPEID column style.
+			DataGridColumnStyle colAGTPID = new DataGridTextBoxColumn();
+			colAGTPID.MappingName = "ACCESS_GROUP_TYPEID";
+			colAGTPID.HeaderText = "Access Group Type ID";
+			colAGTPID.Width = 0;
+			tsAGTP.GridColumnStyles.Add(colAGTPID);
+      
+			// 1 Add ACCESS_GROUP_ID column style.
+			DataGridColumnStyle colAGTPGroupID = new DataGridTextBoxColumn();
+			colAGTPGroupID.MappingName = "ACCESS_GROUP_ID";
+			colAGTPGroupID.HeaderText = "Access Group ID";
+			colAGTPGroupID.Width = 0;
+			tsAGTP.GridColumnStyles.Add(colAGTPGroupID);
+
+			// 2 Add ACCESS_GROUP column style.
+			DataGridColumnStyle colAGTPGroup = new DataGridTextBoxColumn();
+			colAGTPGroup.MappingName = "ACCESS_GROUP";
+			colAGTPGroup.HeaderText = "Access Group";
+			colAGTPGroup.Width = 0;
+			tsAGTP.GridColumnStyles.Add(colAGTPGroup);
+
+			// 3 Add ACCESS_TYPE_ID column style.
+			DataGridColumnStyle colAGTPTypeID = new DataGridTextBoxColumn();
+			colAGTPTypeID.MappingName = "ACCESS_TYPE_ID";
+			colAGTPTypeID.HeaderText = "Access TypeID";
+			colAGTPTypeID.Width = 0;
+			tsAGTP.GridColumnStyles.Add(colAGTPTypeID);
+
+			// 4 Add ACCESS_TYPE column style.
+			DataGridColumnStyle colAGTPType = new DataGridTextBoxColumn();
+			colAGTPType.MappingName = "ACCESS_TYPE";
+			colAGTPType.HeaderText = "Access Type";
+			colAGTPType.Width = 150;
+			tsAGTP.GridColumnStyles.Add(colAGTPType);
+
+			grdAccessGroups.TableStyles.Add(tsAGTP);
+
+
+			//Find out if there are any grdResources rows and
+			//enable command buttons accordingly
+			int nRows = this.grdResources.VisibleRowCount;
+			if (nRows == 0)
+			{
+				this.cmdChangeResource.Enabled = false;
+				this.cmdRemoveUser.Enabled = false;
+			}
+			else
+			{
+				grdResources.CurrentCell = new DataGridCell(0, 0);
+				this.cmdChangeResource.Enabled = true;
+				this.cmdRemoveUser.Enabled = true;
+
+			}
+
+			//Copy Appointments TabPage
+			m_dtHospLoc = m_dsGlobal.Tables["HospitalLocation"];
+			m_dvHospLoc = new DataView(m_dtHospLoc);
+			m_dvHospLoc.Sort = "HOSPITAL_LOCATION ASC";
+			cboRPMSClinic.DataSource = m_dvHospLoc;
+			cboRPMSClinic.DisplayMember = "HOSPITAL_LOCATION";
+			cboRPMSClinic.ValueMember = "HOSPITAL_LOCATION_ID";
+			cboBSDXClinic.DataSource = m_dvResources;
+			cboBSDXClinic.DisplayMember = "RESOURCE_NAME";
+			cboBSDXClinic.ValueMember = "RESOURCEID";
+
+		}
+
+		private void DManagement_Load(object sender, System.EventArgs e)
+		{
+			this.cmdChangeResource.Enabled = false;
+			this.cmdRemoveUser.Enabled = false;
+			//Select the grid's zeroeth row
+			if (m_dvResources.Count > 0)
+			{
+				this.grdResources.CurrentCell = new DataGridCell(0,0);
+				this.grdResources.Select(0);
+				this.m_nResourceRow=0;
+				Object dgItem = grdResources[0,0];
+				this.m_nResourceID = Convert.ToInt16(dgItem);
+				this.cmdChangeResource.Enabled = true;
+				this.cmdRemoveUser.Enabled = true;
+			}
+
+			this.cmdChangeResourceGroup.Enabled = false;
+			this.cmdRemoveResourceGroup.Enabled = false;
+			if (this.m_dvResourceGroup.Count > 0)
+			{
+				this.m_nResourceGroupRow = 0;
+				this.cmdChangeResourceGroup.Enabled = true;
+				this.cmdRemoveResourceGroup.Enabled = true;
+			}
+			
+			this.cmdChangeAccessGroup.Enabled = false;
+			this.cmdRemoveAccessGroup.Enabled = false;
+			if (this.m_dvAccessGroup.Count > 0)
+			{
+				this.m_nAccessGroupRow = 0;
+				this.cmdChangeAccessGroup.Enabled = true;
+				this.cmdRemoveAccessGroup.Enabled = true;
+			}
+
+			this.cmdChangeAT.Enabled = false;
+			if (this.m_dvAccessTypes.Count > 0)
+			{
+				this.m_nATRow = 0;
+				this.cmdChangeAT.Enabled = true;
+			}
+		}
+
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#endregion Initialization
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DManagement));
+            this.pnlPageBottom = new System.Windows.Forms.Panel();
+            this.cmdClose = new System.Windows.Forms.Button();
+            this.tabMain = new System.Windows.Forms.TabControl();
+            this.tpResources = new System.Windows.Forms.TabPage();
+            this.pnlResources = new System.Windows.Forms.Panel();
+            this.grdResources = new System.Windows.Forms.DataGrid();
+            this.pnlDescription = new System.Windows.Forms.Panel();
+            this.grpDescription = new System.Windows.Forms.GroupBox();
+            this.lblDescription = new System.Windows.Forms.Label();
+            this.pnlAddEdit = new System.Windows.Forms.Panel();
+            this.cmdRemoveUser = new System.Windows.Forms.Button();
+            this.cmdChangeResource = new System.Windows.Forms.Button();
+            this.cmdAddResource = new System.Windows.Forms.Button();
+            this.tpResourceGroups = new System.Windows.Forms.TabPage();
+            this.grdResourceGroup = new System.Windows.Forms.DataGrid();
+            this.pnlDescriptionResourceGroup = new System.Windows.Forms.Panel();
+            this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
+            this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
+            this.pnlAddEditResourceGroups = new System.Windows.Forms.Panel();
+            this.cmdChangeResourceGroup = new System.Windows.Forms.Button();
+            this.cmdRemoveResourceGroup = new System.Windows.Forms.Button();
+            this.cmdAddResourceGroup = new System.Windows.Forms.Button();
+            this.tpAccessTypes = new System.Windows.Forms.TabPage();
+            this.grdAccessTypes = new System.Windows.Forms.DataGrid();
+            this.pnlDescriptionAT = new System.Windows.Forms.Panel();
+            this.grpDescriptionAT = new System.Windows.Forms.GroupBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.pnlAddEditAT = new System.Windows.Forms.Panel();
+            this.cmdChangeAT = new System.Windows.Forms.Button();
+            this.cmdAddAT = new System.Windows.Forms.Button();
+            this.tpAccessGroups = new System.Windows.Forms.TabPage();
+            this.grdAccessGroups = new System.Windows.Forms.DataGrid();
+            this.pnlDescriptionAccessGroups = new System.Windows.Forms.Panel();
+            this.grpDescriptionAccessGroups = new System.Windows.Forms.GroupBox();
+            this.lblDescriptionAccessGroups = new System.Windows.Forms.Label();
+            this.pnlAddEditAccessGroup = new System.Windows.Forms.Panel();
+            this.cmdChangeAccessGroup = new System.Windows.Forms.Button();
+            this.cmdRemoveAccessGroup = new System.Windows.Forms.Button();
+            this.cmdAddAccessGroup = new System.Windows.Forms.Button();
+            this.tpTransferAppts = new System.Windows.Forms.TabPage();
+            this.label5 = new System.Windows.Forms.Label();
+            this.dtpEnd = new System.Windows.Forms.DateTimePicker();
+            this.label4 = new System.Windows.Forms.Label();
+            this.dtpBegin = new System.Windows.Forms.DateTimePicker();
+            this.label3 = new System.Windows.Forms.Label();
+            this.cboBSDXClinic = new System.Windows.Forms.ComboBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.cboRPMSClinic = new System.Windows.Forms.ComboBox();
+            this.pnlDescriptionXfer = new System.Windows.Forms.Panel();
+            this.grpDescriptionXfer = new System.Windows.Forms.GroupBox();
+            this.lblDescriptionXfer = new System.Windows.Forms.Label();
+            this.pnlCmdXfer = new System.Windows.Forms.Panel();
+            this.cmdCopyAppts = new System.Windows.Forms.Button();
+            this.tpWorkStations = new System.Windows.Forms.TabPage();
+            this.grdWorkStations = new System.Windows.Forms.DataGrid();
+            this.pnlWorkstations = new System.Windows.Forms.Panel();
+            this.groupBox1 = new System.Windows.Forms.GroupBox();
+            this.lblWorkstations = new System.Windows.Forms.Label();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.txtSendMessage = new System.Windows.Forms.TextBox();
+            this.cmdWorkStationsMessage = new System.Windows.Forms.Button();
+            this.cmdWorkStationsShutdown = new System.Windows.Forms.Button();
+            this.cmdWorkStationsRefresh = new System.Windows.Forms.Button();
+            this.pnlPageBottom.SuspendLayout();
+            this.tabMain.SuspendLayout();
+            this.tpResources.SuspendLayout();
+            this.pnlResources.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.grdResources)).BeginInit();
+            this.pnlDescription.SuspendLayout();
+            this.grpDescription.SuspendLayout();
+            this.pnlAddEdit.SuspendLayout();
+            this.tpResourceGroups.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.grdResourceGroup)).BeginInit();
+            this.pnlDescriptionResourceGroup.SuspendLayout();
+            this.grpDescriptionResourceGroup.SuspendLayout();
+            this.pnlAddEditResourceGroups.SuspendLayout();
+            this.tpAccessTypes.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.grdAccessTypes)).BeginInit();
+            this.pnlDescriptionAT.SuspendLayout();
+            this.grpDescriptionAT.SuspendLayout();
+            this.pnlAddEditAT.SuspendLayout();
+            this.tpAccessGroups.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.grdAccessGroups)).BeginInit();
+            this.pnlDescriptionAccessGroups.SuspendLayout();
+            this.grpDescriptionAccessGroups.SuspendLayout();
+            this.pnlAddEditAccessGroup.SuspendLayout();
+            this.tpTransferAppts.SuspendLayout();
+            this.pnlDescriptionXfer.SuspendLayout();
+            this.grpDescriptionXfer.SuspendLayout();
+            this.pnlCmdXfer.SuspendLayout();
+            this.tpWorkStations.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.grdWorkStations)).BeginInit();
+            this.pnlWorkstations.SuspendLayout();
+            this.groupBox1.SuspendLayout();
+            this.panel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // pnlPageBottom
+            // 
+            this.pnlPageBottom.Controls.Add(this.cmdClose);
+            this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlPageBottom.Location = new System.Drawing.Point(0, 454);
+            this.pnlPageBottom.Name = "pnlPageBottom";
+            this.pnlPageBottom.Size = new System.Drawing.Size(704, 40);
+            this.pnlPageBottom.TabIndex = 3;
+            // 
+            // cmdClose
+            // 
+            this.cmdClose.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.cmdClose.Location = new System.Drawing.Point(600, 8);
+            this.cmdClose.Name = "cmdClose";
+            this.cmdClose.Size = new System.Drawing.Size(96, 24);
+            this.cmdClose.TabIndex = 0;
+            this.cmdClose.Text = "Close";
+            // 
+            // tabMain
+            // 
+            this.tabMain.Controls.Add(this.tpResources);
+            this.tabMain.Controls.Add(this.tpResourceGroups);
+            this.tabMain.Controls.Add(this.tpAccessTypes);
+            this.tabMain.Controls.Add(this.tpAccessGroups);
+            this.tabMain.Controls.Add(this.tpTransferAppts);
+            this.tabMain.Controls.Add(this.tpWorkStations);
+            this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.tabMain.Location = new System.Drawing.Point(0, 0);
+            this.tabMain.Name = "tabMain";
+            this.tabMain.SelectedIndex = 0;
+            this.tabMain.Size = new System.Drawing.Size(704, 454);
+            this.tabMain.TabIndex = 4;
+            this.tabMain.Click += new System.EventHandler(this.tabMain_Click);
+            // 
+            // tpResources
+            // 
+            this.tpResources.Controls.Add(this.pnlResources);
+            this.tpResources.Controls.Add(this.pnlDescription);
+            this.tpResources.Controls.Add(this.pnlAddEdit);
+            this.tpResources.Location = new System.Drawing.Point(4, 22);
+            this.tpResources.Name = "tpResources";
+            this.tpResources.Size = new System.Drawing.Size(696, 428);
+            this.tpResources.TabIndex = 0;
+            this.tpResources.Text = "Resources and Users";
+            // 
+            // pnlResources
+            // 
+            this.pnlResources.Controls.Add(this.grdResources);
+            this.pnlResources.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.pnlResources.Location = new System.Drawing.Point(0, 0);
+            this.pnlResources.Name = "pnlResources";
+            this.pnlResources.Size = new System.Drawing.Size(696, 316);
+            this.pnlResources.TabIndex = 2;
+            // 
+            // grdResources
+            // 
+            this.grdResources.DataMember = "";
+            this.grdResources.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grdResources.HeaderForeColor = System.Drawing.SystemColors.ControlText;
+            this.grdResources.Location = new System.Drawing.Point(0, 0);
+            this.grdResources.Name = "grdResources";
+            this.grdResources.ReadOnly = true;
+            this.grdResources.Size = new System.Drawing.Size(696, 316);
+            this.grdResources.TabIndex = 0;
+            this.grdResources.CurrentCellChanged += new System.EventHandler(this.grdResources_CurrentCellChanged);
+            this.grdResources.Navigate += new System.Windows.Forms.NavigateEventHandler(this.grdResources_Navigate);
+            // 
+            // pnlDescription
+            // 
+            this.pnlDescription.Controls.Add(this.grpDescription);
+            this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlDescription.Location = new System.Drawing.Point(0, 316);
+            this.pnlDescription.Name = "pnlDescription";
+            this.pnlDescription.Size = new System.Drawing.Size(696, 72);
+            this.pnlDescription.TabIndex = 1;
+            // 
+            // grpDescription
+            // 
+            this.grpDescription.Controls.Add(this.lblDescription);
+            this.grpDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grpDescription.Location = new System.Drawing.Point(0, 0);
+            this.grpDescription.Name = "grpDescription";
+            this.grpDescription.Size = new System.Drawing.Size(696, 72);
+            this.grpDescription.TabIndex = 0;
+            this.grpDescription.TabStop = false;
+            this.grpDescription.Text = "Description";
+            // 
+            // lblDescription
+            // 
+            this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lblDescription.Location = new System.Drawing.Point(3, 16);
+            this.lblDescription.Name = "lblDescription";
+            this.lblDescription.Size = new System.Drawing.Size(690, 53);
+            this.lblDescription.TabIndex = 0;
+            this.lblDescription.Text = resources.GetString("lblDescription.Text");
+            // 
+            // pnlAddEdit
+            // 
+            this.pnlAddEdit.Controls.Add(this.cmdRemoveUser);
+            this.pnlAddEdit.Controls.Add(this.cmdChangeResource);
+            this.pnlAddEdit.Controls.Add(this.cmdAddResource);
+            this.pnlAddEdit.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlAddEdit.Location = new System.Drawing.Point(0, 388);
+            this.pnlAddEdit.Name = "pnlAddEdit";
+            this.pnlAddEdit.Size = new System.Drawing.Size(696, 40);
+            this.pnlAddEdit.TabIndex = 0;
+            // 
+            // cmdRemoveUser
+            // 
+            this.cmdRemoveUser.Location = new System.Drawing.Point(304, 8);
+            this.cmdRemoveUser.Name = "cmdRemoveUser";
+            this.cmdRemoveUser.Size = new System.Drawing.Size(128, 24);
+            this.cmdRemoveUser.TabIndex = 3;
+            this.cmdRemoveUser.Text = "&Remove User";
+            this.cmdRemoveUser.Visible = false;
+            this.cmdRemoveUser.Click += new System.EventHandler(this.cmdRemoveUser_Click);
+            // 
+            // cmdChangeResource
+            // 
+            this.cmdChangeResource.Enabled = false;
+            this.cmdChangeResource.Location = new System.Drawing.Point(160, 8);
+            this.cmdChangeResource.Name = "cmdChangeResource";
+            this.cmdChangeResource.Size = new System.Drawing.Size(128, 24);
+            this.cmdChangeResource.TabIndex = 1;
+            this.cmdChangeResource.Text = "&Change...";
+            this.cmdChangeResource.Click += new System.EventHandler(this.cmdChangeResource_Click);
+            // 
+            // cmdAddResource
+            // 
+            this.cmdAddResource.Location = new System.Drawing.Point(16, 8);
+            this.cmdAddResource.Name = "cmdAddResource";
+            this.cmdAddResource.Size = new System.Drawing.Size(128, 24);
+            this.cmdAddResource.TabIndex = 0;
+            this.cmdAddResource.Text = "&Add...";
+            this.cmdAddResource.Click += new System.EventHandler(this.cmdAddResource_Click);
+            // 
+            // tpResourceGroups
+            // 
+            this.tpResourceGroups.Controls.Add(this.grdResourceGroup);
+            this.tpResourceGroups.Controls.Add(this.pnlDescriptionResourceGroup);
+            this.tpResourceGroups.Controls.Add(this.pnlAddEditResourceGroups);
+            this.tpResourceGroups.Location = new System.Drawing.Point(4, 22);
+            this.tpResourceGroups.Name = "tpResourceGroups";
+            this.tpResourceGroups.Size = new System.Drawing.Size(579, 362);
+            this.tpResourceGroups.TabIndex = 4;
+            this.tpResourceGroups.Text = "Resource Groups";
+            // 
+            // grdResourceGroup
+            // 
+            this.grdResourceGroup.AccessibleName = "DataGrid";
+            this.grdResourceGroup.AccessibleRole = System.Windows.Forms.AccessibleRole.Table;
+            this.grdResourceGroup.DataMember = "";
+            this.grdResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grdResourceGroup.HeaderForeColor = System.Drawing.SystemColors.ControlText;
+            this.grdResourceGroup.Location = new System.Drawing.Point(0, 0);
+            this.grdResourceGroup.Name = "grdResourceGroup";
+            this.grdResourceGroup.ReadOnly = true;
+            this.grdResourceGroup.Size = new System.Drawing.Size(579, 250);
+            this.grdResourceGroup.TabIndex = 4;
+            this.grdResourceGroup.CurrentCellChanged += new System.EventHandler(this.grdResourceGroup_CurrentCellChanged);
+            this.grdResourceGroup.Navigate += new System.Windows.Forms.NavigateEventHandler(this.grdResourceGroup_Navigate);
+            // 
+            // pnlDescriptionResourceGroup
+            // 
+            this.pnlDescriptionResourceGroup.Controls.Add(this.grpDescriptionResourceGroup);
+            this.pnlDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlDescriptionResourceGroup.Location = new System.Drawing.Point(0, 250);
+            this.pnlDescriptionResourceGroup.Name = "pnlDescriptionResourceGroup";
+            this.pnlDescriptionResourceGroup.Size = new System.Drawing.Size(579, 72);
+            this.pnlDescriptionResourceGroup.TabIndex = 3;
+            // 
+            // grpDescriptionResourceGroup
+            // 
+            this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
+            this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
+            this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
+            this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(579, 72);
+            this.grpDescriptionResourceGroup.TabIndex = 0;
+            this.grpDescriptionResourceGroup.TabStop = false;
+            this.grpDescriptionResourceGroup.Text = "Description";
+            // 
+            // lblDescriptionResourceGroup
+            // 
+            this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
+            this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
+            this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(573, 53);
+            this.lblDescriptionResourceGroup.TabIndex = 0;
+            this.lblDescriptionResourceGroup.Text = resources.GetString("lblDescriptionResourceGroup.Text");
+            // 
+            // pnlAddEditResourceGroups
+            // 
+            this.pnlAddEditResourceGroups.Controls.Add(this.cmdChangeResourceGroup);
+            this.pnlAddEditResourceGroups.Controls.Add(this.cmdRemoveResourceGroup);
+            this.pnlAddEditResourceGroups.Controls.Add(this.cmdAddResourceGroup);
+            this.pnlAddEditResourceGroups.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlAddEditResourceGroups.Location = new System.Drawing.Point(0, 322);
+            this.pnlAddEditResourceGroups.Name = "pnlAddEditResourceGroups";
+            this.pnlAddEditResourceGroups.Size = new System.Drawing.Size(579, 40);
+            this.pnlAddEditResourceGroups.TabIndex = 2;
+            // 
+            // cmdChangeResourceGroup
+            // 
+            this.cmdChangeResourceGroup.Enabled = false;
+            this.cmdChangeResourceGroup.Location = new System.Drawing.Point(160, 8);
+            this.cmdChangeResourceGroup.Name = "cmdChangeResourceGroup";
+            this.cmdChangeResourceGroup.Size = new System.Drawing.Size(128, 24);
+            this.cmdChangeResourceGroup.TabIndex = 2;
+            this.cmdChangeResourceGroup.Text = "&Change Group";
+            this.cmdChangeResourceGroup.Click += new System.EventHandler(this.cmdChangeResourceGroup_Click);
+            // 
+            // cmdRemoveResourceGroup
+            // 
+            this.cmdRemoveResourceGroup.Enabled = false;
+            this.cmdRemoveResourceGroup.Location = new System.Drawing.Point(304, 8);
+            this.cmdRemoveResourceGroup.Name = "cmdRemoveResourceGroup";
+            this.cmdRemoveResourceGroup.Size = new System.Drawing.Size(128, 24);
+            this.cmdRemoveResourceGroup.TabIndex = 1;
+            this.cmdRemoveResourceGroup.Text = "&Remove Group";
+            this.cmdRemoveResourceGroup.Click += new System.EventHandler(this.cmdRemoveResourceGroup_Click);
+            // 
+            // cmdAddResourceGroup
+            // 
+            this.cmdAddResourceGroup.Location = new System.Drawing.Point(16, 8);
+            this.cmdAddResourceGroup.Name = "cmdAddResourceGroup";
+            this.cmdAddResourceGroup.Size = new System.Drawing.Size(128, 24);
+            this.cmdAddResourceGroup.TabIndex = 0;
+            this.cmdAddResourceGroup.Text = "&Add Group";
+            this.cmdAddResourceGroup.Click += new System.EventHandler(this.cmdAddResourceGroup_Click);
+            // 
+            // tpAccessTypes
+            // 
+            this.tpAccessTypes.Controls.Add(this.grdAccessTypes);
+            this.tpAccessTypes.Controls.Add(this.pnlDescriptionAT);
+            this.tpAccessTypes.Controls.Add(this.pnlAddEditAT);
+            this.tpAccessTypes.Location = new System.Drawing.Point(4, 22);
+            this.tpAccessTypes.Name = "tpAccessTypes";
+            this.tpAccessTypes.Size = new System.Drawing.Size(579, 362);
+            this.tpAccessTypes.TabIndex = 2;
+            this.tpAccessTypes.Text = "Access Types";
+            // 
+            // grdAccessTypes
+            // 
+            this.grdAccessTypes.DataMember = "";
+            this.grdAccessTypes.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grdAccessTypes.HeaderForeColor = System.Drawing.SystemColors.ControlText;
+            this.grdAccessTypes.Location = new System.Drawing.Point(0, 0);
+            this.grdAccessTypes.Name = "grdAccessTypes";
+            this.grdAccessTypes.ReadOnly = true;
+            this.grdAccessTypes.RowHeadersVisible = false;
+            this.grdAccessTypes.Size = new System.Drawing.Size(579, 250);
+            this.grdAccessTypes.TabIndex = 3;
+            this.grdAccessTypes.CurrentCellChanged += new System.EventHandler(this.grdAccessTypes_CurrentCellChanged);
+            // 
+            // pnlDescriptionAT
+            // 
+            this.pnlDescriptionAT.Controls.Add(this.grpDescriptionAT);
+            this.pnlDescriptionAT.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlDescriptionAT.Location = new System.Drawing.Point(0, 250);
+            this.pnlDescriptionAT.Name = "pnlDescriptionAT";
+            this.pnlDescriptionAT.Size = new System.Drawing.Size(579, 72);
+            this.pnlDescriptionAT.TabIndex = 2;
+            // 
+            // grpDescriptionAT
+            // 
+            this.grpDescriptionAT.Controls.Add(this.label1);
+            this.grpDescriptionAT.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grpDescriptionAT.Location = new System.Drawing.Point(0, 0);
+            this.grpDescriptionAT.Name = "grpDescriptionAT";
+            this.grpDescriptionAT.Size = new System.Drawing.Size(579, 72);
+            this.grpDescriptionAT.TabIndex = 0;
+            this.grpDescriptionAT.TabStop = false;
+            this.grpDescriptionAT.Text = "Description";
+            // 
+            // label1
+            // 
+            this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.label1.Location = new System.Drawing.Point(3, 16);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(573, 53);
+            this.label1.TabIndex = 1;
+            this.label1.Text = " Use the Access Types panel to define the kinds of access available for schedulin" +
+                "g at this facility.  Common types of access include Walkin, Scheduled, Same Day," +
+                " and Dental Expanded Functions.";
+            // 
+            // pnlAddEditAT
+            // 
+            this.pnlAddEditAT.Controls.Add(this.cmdChangeAT);
+            this.pnlAddEditAT.Controls.Add(this.cmdAddAT);
+            this.pnlAddEditAT.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlAddEditAT.Location = new System.Drawing.Point(0, 322);
+            this.pnlAddEditAT.Name = "pnlAddEditAT";
+            this.pnlAddEditAT.Size = new System.Drawing.Size(579, 40);
+            this.pnlAddEditAT.TabIndex = 1;
+            // 
+            // cmdChangeAT
+            // 
+            this.cmdChangeAT.Location = new System.Drawing.Point(160, 8);
+            this.cmdChangeAT.Name = "cmdChangeAT";
+            this.cmdChangeAT.Size = new System.Drawing.Size(128, 24);
+            this.cmdChangeAT.TabIndex = 1;
+            this.cmdChangeAT.Text = "&Change Access Type";
+            this.cmdChangeAT.Click += new System.EventHandler(this.cmdChangeAT_Click);
+            // 
+            // cmdAddAT
+            // 
+            this.cmdAddAT.Location = new System.Drawing.Point(16, 8);
+            this.cmdAddAT.Name = "cmdAddAT";
+            this.cmdAddAT.Size = new System.Drawing.Size(128, 24);
+            this.cmdAddAT.TabIndex = 0;
+            this.cmdAddAT.Text = "&Add Access Type";
+            this.cmdAddAT.Click += new System.EventHandler(this.cmdAddAT_Click);
+            // 
+            // tpAccessGroups
+            // 
+            this.tpAccessGroups.Controls.Add(this.grdAccessGroups);
+            this.tpAccessGroups.Controls.Add(this.pnlDescriptionAccessGroups);
+            this.tpAccessGroups.Controls.Add(this.pnlAddEditAccessGroup);
+            this.tpAccessGroups.Location = new System.Drawing.Point(4, 22);
+            this.tpAccessGroups.Name = "tpAccessGroups";
+            this.tpAccessGroups.Size = new System.Drawing.Size(579, 362);
+            this.tpAccessGroups.TabIndex = 1;
+            this.tpAccessGroups.Text = "Access Groups";
+            // 
+            // grdAccessGroups
+            // 
+            this.grdAccessGroups.AccessibleName = "DataGrid";
+            this.grdAccessGroups.AccessibleRole = System.Windows.Forms.AccessibleRole.Table;
+            this.grdAccessGroups.DataMember = "";
+            this.grdAccessGroups.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grdAccessGroups.HeaderForeColor = System.Drawing.SystemColors.ControlText;
+            this.grdAccessGroups.Location = new System.Drawing.Point(0, 0);
+            this.grdAccessGroups.Name = "grdAccessGroups";
+            this.grdAccessGroups.ReadOnly = true;
+            this.grdAccessGroups.Size = new System.Drawing.Size(579, 250);
+            this.grdAccessGroups.TabIndex = 5;
+            this.grdAccessGroups.CurrentCellChanged += new System.EventHandler(this.grdAccessGroups_CurrentCellChanged);
+            this.grdAccessGroups.Navigate += new System.Windows.Forms.NavigateEventHandler(this.grdAccessGroups_Navigate);
+            // 
+            // pnlDescriptionAccessGroups
+            // 
+            this.pnlDescriptionAccessGroups.Controls.Add(this.grpDescriptionAccessGroups);
+            this.pnlDescriptionAccessGroups.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlDescriptionAccessGroups.Location = new System.Drawing.Point(0, 250);
+            this.pnlDescriptionAccessGroups.Name = "pnlDescriptionAccessGroups";
+            this.pnlDescriptionAccessGroups.Size = new System.Drawing.Size(579, 72);
+            this.pnlDescriptionAccessGroups.TabIndex = 4;
+            // 
+            // grpDescriptionAccessGroups
+            // 
+            this.grpDescriptionAccessGroups.Controls.Add(this.lblDescriptionAccessGroups);
+            this.grpDescriptionAccessGroups.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grpDescriptionAccessGroups.Location = new System.Drawing.Point(0, 0);
+            this.grpDescriptionAccessGroups.Name = "grpDescriptionAccessGroups";
+            this.grpDescriptionAccessGroups.Size = new System.Drawing.Size(579, 72);
+            this.grpDescriptionAccessGroups.TabIndex = 0;
+            this.grpDescriptionAccessGroups.TabStop = false;
+            this.grpDescriptionAccessGroups.Text = "Description";
+            // 
+            // lblDescriptionAccessGroups
+            // 
+            this.lblDescriptionAccessGroups.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lblDescriptionAccessGroups.Location = new System.Drawing.Point(3, 16);
+            this.lblDescriptionAccessGroups.Name = "lblDescriptionAccessGroups";
+            this.lblDescriptionAccessGroups.Size = new System.Drawing.Size(573, 53);
+            this.lblDescriptionAccessGroups.TabIndex = 0;
+            this.lblDescriptionAccessGroups.Text = resources.GetString("lblDescriptionAccessGroups.Text");
+            // 
+            // pnlAddEditAccessGroup
+            // 
+            this.pnlAddEditAccessGroup.Controls.Add(this.cmdChangeAccessGroup);
+            this.pnlAddEditAccessGroup.Controls.Add(this.cmdRemoveAccessGroup);
+            this.pnlAddEditAccessGroup.Controls.Add(this.cmdAddAccessGroup);
+            this.pnlAddEditAccessGroup.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlAddEditAccessGroup.Location = new System.Drawing.Point(0, 322);
+            this.pnlAddEditAccessGroup.Name = "pnlAddEditAccessGroup";
+            this.pnlAddEditAccessGroup.Size = new System.Drawing.Size(579, 40);
+            this.pnlAddEditAccessGroup.TabIndex = 3;
+            // 
+            // cmdChangeAccessGroup
+            // 
+            this.cmdChangeAccessGroup.Enabled = false;
+            this.cmdChangeAccessGroup.Location = new System.Drawing.Point(160, 8);
+            this.cmdChangeAccessGroup.Name = "cmdChangeAccessGroup";
+            this.cmdChangeAccessGroup.Size = new System.Drawing.Size(128, 24);
+            this.cmdChangeAccessGroup.TabIndex = 3;
+            this.cmdChangeAccessGroup.Text = "&Change Group";
+            this.cmdChangeAccessGroup.Click += new System.EventHandler(this.cmdChangeAccessGroup_Click);
+            // 
+            // cmdRemoveAccessGroup
+            // 
+            this.cmdRemoveAccessGroup.Enabled = false;
+            this.cmdRemoveAccessGroup.Location = new System.Drawing.Point(304, 8);
+            this.cmdRemoveAccessGroup.Name = "cmdRemoveAccessGroup";
+            this.cmdRemoveAccessGroup.Size = new System.Drawing.Size(128, 24);
+            this.cmdRemoveAccessGroup.TabIndex = 1;
+            this.cmdRemoveAccessGroup.Text = "&Remove Group";
+            this.cmdRemoveAccessGroup.Click += new System.EventHandler(this.cmdRemoveAccessGroup_Click);
+            // 
+            // cmdAddAccessGroup
+            // 
+            this.cmdAddAccessGroup.Location = new System.Drawing.Point(16, 8);
+            this.cmdAddAccessGroup.Name = "cmdAddAccessGroup";
+            this.cmdAddAccessGroup.Size = new System.Drawing.Size(128, 24);
+            this.cmdAddAccessGroup.TabIndex = 0;
+            this.cmdAddAccessGroup.Text = "&Add Group";
+            this.cmdAddAccessGroup.Click += new System.EventHandler(this.cmdAddAccessGroup_Click);
+            // 
+            // tpTransferAppts
+            // 
+            this.tpTransferAppts.Controls.Add(this.label5);
+            this.tpTransferAppts.Controls.Add(this.dtpEnd);
+            this.tpTransferAppts.Controls.Add(this.label4);
+            this.tpTransferAppts.Controls.Add(this.dtpBegin);
+            this.tpTransferAppts.Controls.Add(this.label3);
+            this.tpTransferAppts.Controls.Add(this.cboBSDXClinic);
+            this.tpTransferAppts.Controls.Add(this.label2);
+            this.tpTransferAppts.Controls.Add(this.cboRPMSClinic);
+            this.tpTransferAppts.Controls.Add(this.pnlDescriptionXfer);
+            this.tpTransferAppts.Controls.Add(this.pnlCmdXfer);
+            this.tpTransferAppts.Location = new System.Drawing.Point(4, 22);
+            this.tpTransferAppts.Name = "tpTransferAppts";
+            this.tpTransferAppts.Size = new System.Drawing.Size(579, 362);
+            this.tpTransferAppts.TabIndex = 5;
+            this.tpTransferAppts.Text = "Copy Appointments";
+            // 
+            // label5
+            // 
+            this.label5.Location = new System.Drawing.Point(8, 128);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(144, 18);
+            this.label5.TabIndex = 10;
+            this.label5.Text = "End with appointments on:";
+            // 
+            // dtpEnd
+            // 
+            this.dtpEnd.Location = new System.Drawing.Point(152, 128);
+            this.dtpEnd.Name = "dtpEnd";
+            this.dtpEnd.Size = new System.Drawing.Size(232, 20);
+            this.dtpEnd.TabIndex = 9;
+            // 
+            // label4
+            // 
+            this.label4.Location = new System.Drawing.Point(8, 94);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(144, 18);
+            this.label4.TabIndex = 8;
+            this.label4.Text = "Start with appointments on:";
+            // 
+            // dtpBegin
+            // 
+            this.dtpBegin.Location = new System.Drawing.Point(152, 93);
+            this.dtpBegin.Name = "dtpBegin";
+            this.dtpBegin.Size = new System.Drawing.Size(232, 20);
+            this.dtpBegin.TabIndex = 7;
+            // 
+            // label3
+            // 
+            this.label3.Location = new System.Drawing.Point(8, 46);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(136, 24);
+            this.label3.TabIndex = 6;
+            this.label3.Text = "Copy To Windows Scheduling Resource:";
+            // 
+            // cboBSDXClinic
+            // 
+            this.cboBSDXClinic.Location = new System.Drawing.Point(152, 48);
+            this.cboBSDXClinic.Name = "cboBSDXClinic";
+            this.cboBSDXClinic.Size = new System.Drawing.Size(232, 21);
+            this.cboBSDXClinic.TabIndex = 5;
+            this.cboBSDXClinic.Text = "cboBSDXClinic";
+            // 
+            // label2
+            // 
+            this.label2.Location = new System.Drawing.Point(8, 18);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(136, 16);
+            this.label2.TabIndex = 4;
+            this.label2.Text = "Copy From VistA Clinic:";
+            // 
+            // cboRPMSClinic
+            // 
+            this.cboRPMSClinic.Location = new System.Drawing.Point(152, 16);
+            this.cboRPMSClinic.Name = "cboRPMSClinic";
+            this.cboRPMSClinic.Size = new System.Drawing.Size(232, 21);
+            this.cboRPMSClinic.TabIndex = 3;
+            this.cboRPMSClinic.Text = "cboRPMSClinic";
+            // 
+            // pnlDescriptionXfer
+            // 
+            this.pnlDescriptionXfer.Controls.Add(this.grpDescriptionXfer);
+            this.pnlDescriptionXfer.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlDescriptionXfer.Location = new System.Drawing.Point(0, 250);
+            this.pnlDescriptionXfer.Name = "pnlDescriptionXfer";
+            this.pnlDescriptionXfer.Size = new System.Drawing.Size(579, 72);
+            this.pnlDescriptionXfer.TabIndex = 2;
+            // 
+            // grpDescriptionXfer
+            // 
+            this.grpDescriptionXfer.Controls.Add(this.lblDescriptionXfer);
+            this.grpDescriptionXfer.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grpDescriptionXfer.Location = new System.Drawing.Point(0, 0);
+            this.grpDescriptionXfer.Name = "grpDescriptionXfer";
+            this.grpDescriptionXfer.Size = new System.Drawing.Size(579, 72);
+            this.grpDescriptionXfer.TabIndex = 0;
+            this.grpDescriptionXfer.TabStop = false;
+            this.grpDescriptionXfer.Text = "Description";
+            // 
+            // lblDescriptionXfer
+            // 
+            this.lblDescriptionXfer.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lblDescriptionXfer.Location = new System.Drawing.Point(3, 16);
+            this.lblDescriptionXfer.Name = "lblDescriptionXfer";
+            this.lblDescriptionXfer.Size = new System.Drawing.Size(573, 53);
+            this.lblDescriptionXfer.TabIndex = 0;
+            this.lblDescriptionXfer.Text = resources.GetString("lblDescriptionXfer.Text");
+            // 
+            // pnlCmdXfer
+            // 
+            this.pnlCmdXfer.Controls.Add(this.cmdCopyAppts);
+            this.pnlCmdXfer.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlCmdXfer.Location = new System.Drawing.Point(0, 322);
+            this.pnlCmdXfer.Name = "pnlCmdXfer";
+            this.pnlCmdXfer.Size = new System.Drawing.Size(579, 40);
+            this.pnlCmdXfer.TabIndex = 1;
+            // 
+            // cmdCopyAppts
+            // 
+            this.cmdCopyAppts.Location = new System.Drawing.Point(16, 8);
+            this.cmdCopyAppts.Name = "cmdCopyAppts";
+            this.cmdCopyAppts.Size = new System.Drawing.Size(128, 24);
+            this.cmdCopyAppts.TabIndex = 0;
+            this.cmdCopyAppts.Text = "&Copy Appointments";
+            this.cmdCopyAppts.Click += new System.EventHandler(this.cmdCopyAppts_Click);
+            // 
+            // tpWorkStations
+            // 
+            this.tpWorkStations.Controls.Add(this.grdWorkStations);
+            this.tpWorkStations.Controls.Add(this.pnlWorkstations);
+            this.tpWorkStations.Controls.Add(this.panel1);
+            this.tpWorkStations.Location = new System.Drawing.Point(4, 22);
+            this.tpWorkStations.Name = "tpWorkStations";
+            this.tpWorkStations.Size = new System.Drawing.Size(579, 362);
+            this.tpWorkStations.TabIndex = 6;
+            this.tpWorkStations.Text = "WorkStations";
+            // 
+            // grdWorkStations
+            // 
+            this.grdWorkStations.AccessibleName = "DataGrid";
+            this.grdWorkStations.AccessibleRole = System.Windows.Forms.AccessibleRole.Table;
+            this.grdWorkStations.DataMember = "";
+            this.grdWorkStations.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grdWorkStations.HeaderForeColor = System.Drawing.SystemColors.ControlText;
+            this.grdWorkStations.Location = new System.Drawing.Point(0, 0);
+            this.grdWorkStations.Name = "grdWorkStations";
+            this.grdWorkStations.ReadOnly = true;
+            this.grdWorkStations.Size = new System.Drawing.Size(579, 250);
+            this.grdWorkStations.TabIndex = 6;
+            // 
+            // pnlWorkstations
+            // 
+            this.pnlWorkstations.Controls.Add(this.groupBox1);
+            this.pnlWorkstations.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlWorkstations.Location = new System.Drawing.Point(0, 250);
+            this.pnlWorkstations.Name = "pnlWorkstations";
+            this.pnlWorkstations.Size = new System.Drawing.Size(579, 72);
+            this.pnlWorkstations.TabIndex = 5;
+            // 
+            // groupBox1
+            // 
+            this.groupBox1.Controls.Add(this.lblWorkstations);
+            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.groupBox1.Location = new System.Drawing.Point(0, 0);
+            this.groupBox1.Name = "groupBox1";
+            this.groupBox1.Size = new System.Drawing.Size(579, 72);
+            this.groupBox1.TabIndex = 0;
+            this.groupBox1.TabStop = false;
+            this.groupBox1.Text = "Description";
+            // 
+            // lblWorkstations
+            // 
+            this.lblWorkstations.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lblWorkstations.Location = new System.Drawing.Point(3, 16);
+            this.lblWorkstations.Name = "lblWorkstations";
+            this.lblWorkstations.Size = new System.Drawing.Size(573, 53);
+            this.lblWorkstations.TabIndex = 0;
+            this.lblWorkstations.Text = resources.GetString("lblWorkstations.Text");
+            // 
+            // panel1
+            // 
+            this.panel1.Controls.Add(this.txtSendMessage);
+            this.panel1.Controls.Add(this.cmdWorkStationsMessage);
+            this.panel1.Controls.Add(this.cmdWorkStationsShutdown);
+            this.panel1.Controls.Add(this.cmdWorkStationsRefresh);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.panel1.Location = new System.Drawing.Point(0, 322);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(579, 40);
+            this.panel1.TabIndex = 4;
+            // 
+            // txtSendMessage
+            // 
+            this.txtSendMessage.Location = new System.Drawing.Point(440, 8);
+            this.txtSendMessage.Name = "txtSendMessage";
+            this.txtSendMessage.Size = new System.Drawing.Size(248, 20);
+            this.txtSendMessage.TabIndex = 4;
+            // 
+            // cmdWorkStationsMessage
+            // 
+            this.cmdWorkStationsMessage.Location = new System.Drawing.Point(160, 8);
+            this.cmdWorkStationsMessage.Name = "cmdWorkStationsMessage";
+            this.cmdWorkStationsMessage.Size = new System.Drawing.Size(128, 24);
+            this.cmdWorkStationsMessage.TabIndex = 3;
+            this.cmdWorkStationsMessage.Text = "Send &Message";
+            this.cmdWorkStationsMessage.Click += new System.EventHandler(this.cmdWorkStationsMessage_Click);
+            // 
+            // cmdWorkStationsShutdown
+            // 
+            this.cmdWorkStationsShutdown.Location = new System.Drawing.Point(304, 8);
+            this.cmdWorkStationsShutdown.Name = "cmdWorkStationsShutdown";
+            this.cmdWorkStationsShutdown.Size = new System.Drawing.Size(128, 24);
+            this.cmdWorkStationsShutdown.TabIndex = 1;
+            this.cmdWorkStationsShutdown.Text = "&Stop Workstations";
+            this.cmdWorkStationsShutdown.Click += new System.EventHandler(this.cmdWorkStationsShutdown_Click);
+            // 
+            // cmdWorkStationsRefresh
+            // 
+            this.cmdWorkStationsRefresh.Location = new System.Drawing.Point(16, 8);
+            this.cmdWorkStationsRefresh.Name = "cmdWorkStationsRefresh";
+            this.cmdWorkStationsRefresh.Size = new System.Drawing.Size(128, 24);
+            this.cmdWorkStationsRefresh.TabIndex = 0;
+            this.cmdWorkStationsRefresh.Text = "&Refresh";
+            this.cmdWorkStationsRefresh.Click += new System.EventHandler(this.cmdWorkStationsRefresh_Click);
+            // 
+            // DManagement
+            // 
+            this.AcceptButton = this.cmdClose;
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(704, 494);
+            this.Controls.Add(this.tabMain);
+            this.Controls.Add(this.pnlPageBottom);
+            this.Name = "DManagement";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "Scheduling Management";
+            this.Load += new System.EventHandler(this.DManagement_Load);
+            this.Closing += new System.ComponentModel.CancelEventHandler(this.DManagement_Closing);
+            this.pnlPageBottom.ResumeLayout(false);
+            this.tabMain.ResumeLayout(false);
+            this.tpResources.ResumeLayout(false);
+            this.pnlResources.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.grdResources)).EndInit();
+            this.pnlDescription.ResumeLayout(false);
+            this.grpDescription.ResumeLayout(false);
+            this.pnlAddEdit.ResumeLayout(false);
+            this.tpResourceGroups.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.grdResourceGroup)).EndInit();
+            this.pnlDescriptionResourceGroup.ResumeLayout(false);
+            this.grpDescriptionResourceGroup.ResumeLayout(false);
+            this.pnlAddEditResourceGroups.ResumeLayout(false);
+            this.tpAccessTypes.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.grdAccessTypes)).EndInit();
+            this.pnlDescriptionAT.ResumeLayout(false);
+            this.grpDescriptionAT.ResumeLayout(false);
+            this.pnlAddEditAT.ResumeLayout(false);
+            this.tpAccessGroups.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.grdAccessGroups)).EndInit();
+            this.pnlDescriptionAccessGroups.ResumeLayout(false);
+            this.grpDescriptionAccessGroups.ResumeLayout(false);
+            this.pnlAddEditAccessGroup.ResumeLayout(false);
+            this.tpTransferAppts.ResumeLayout(false);
+            this.pnlDescriptionXfer.ResumeLayout(false);
+            this.grpDescriptionXfer.ResumeLayout(false);
+            this.pnlCmdXfer.ResumeLayout(false);
+            this.tpWorkStations.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.grdWorkStations)).EndInit();
+            this.pnlWorkstations.ResumeLayout(false);
+            this.groupBox1.ResumeLayout(false);
+            this.panel1.ResumeLayout(false);
+            this.panel1.PerformLayout();
+            this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		#region TabMain
+		private void tabMain_Click(object sender, System.EventArgs e)
+		{
+			TabPage tp = tabMain.SelectedTab;
+			if (tp.Text == "Resource Groups")
+			{
+				//20041109 Added below
+				InitResourceGroupsPage();
+			}
+			//20041109 Added below
+			if (tp.Text == "Access Groups")
+			{
+				InitAccessGroupsPage();
+			}
+		
+		}
+		#endregion TabMain
+
+		#region Resources
+
+		private void cmdAddResource_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				if (m_bEditUsers == true)
+				{
+					AddResourceUser();
+					return;
+				}
+
+				DResource dRes = new DResource();
+				dRes.InitializePage(-1, this.m_dsGlobal);
+				if (dRes.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				//Call RPMS to add new resource
+				bool bInactive = dRes.Inactive;
+				string sInactive = (bInactive == true)?"YES":"NO";
+				string sResourceName = dRes.ResourceName;
+				int nHospLocID = dRes.HospitalLocationID;
+				string sHospLocID = nHospLocID.ToString();
+				int nResourceID = dRes.ResourceID;
+				string sResourceID = nResourceID.ToString();
+
+				int nTimeScale = dRes.TimeScale;
+				string sTimeScale = nTimeScale.ToString();
+				string sLetterText = dRes.LetterText;
+
+				string sNoShowLetter = dRes.NoShowLetterText;
+				string sCancellationLetter = dRes.CancellationLetterText;
+
+				string sSql = "BSDX ADD/EDIT RESOURCE^" + sResourceID + "|" + sResourceName + "|" + sInactive + "|" + sHospLocID + "|" + sTimeScale + "|" + sLetterText + "|" + sNoShowLetter + "|" + sCancellationLetter;
+				DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "Resource");
+
+				Debug.Assert(dtRes.Rows.Count == 1);
+				if (dtRes.Rows.Count != 1)
+				{
+					throw new Exception("DManagement:cmdAddResource_Click: Unable to add new Resource.");
+				}
+				DataRow dr = dtRes.Rows[0];
+				int nErrorID = (int) dr["RESOURCEID"];
+				if (nErrorID == 0)
+				{
+					throw new Exception((string) dr["ERRORTEXT"]);
+				}
+				m_dsGlobal.Tables["GroupResources"].Clear();
+				m_dsGlobal.Tables["ResourceUser"].Clear();
+				m_dsGlobal.Tables["Resources"].Clear();
+				m_DocManager.LoadBSDXResourcesTable();
+
+				m_DocManager.LoadGroupResourcesTable();
+			
+				m_DocManager.LoadResourceUserTable();
+
+				m_DocManager.UpdateViews();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.Message);
+			}
+		}
+
+		private void cmdChangeResource_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				if (m_bEditUsers == true)
+				{
+					ChangeResourceUser();
+					return;
+				}
+			
+				Object oSelectedResourceID = grdResources[grdResources.CurrentRowIndex, 0];
+				int nSelectedResourceID = Convert.ToInt16(oSelectedResourceID);
+
+				DResource dRes = new DResource();
+				dRes.InitializePage(nSelectedResourceID, this.m_dsGlobal);
+
+				if (dRes.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				//Call RPMS to change data for resource
+				bool bInactive = dRes.Inactive;
+				string sInactive = (bInactive == true)?"YES":"NO";
+				string sResourceName = dRes.ResourceName;
+				int nHospLocID = dRes.HospitalLocationID;
+				string sHospLocID = nHospLocID.ToString();
+				int nResourceID = dRes.ResourceID;
+				string sResourceID = nResourceID.ToString();
+
+				int nTimeScale = dRes.TimeScale;
+				string sTimeScale = nTimeScale.ToString();
+				string sLetterText = dRes.LetterText;
+
+				string sNoShowLetter = dRes.NoShowLetterText;
+				string sCancellationLetter = dRes.CancellationLetterText;
+
+				//Replace all crlfs with "@~" character combination
+				//sLetterText = sLetterText.Replace("\r\n","@~");
+
+				string sSql = "BSDX ADD/EDIT RESOURCE^" + sResourceID + "|" + sResourceName + "|" + sInactive + "|" + sHospLocID + "|" + sTimeScale + "|" + sLetterText + "|" + sNoShowLetter + "|" + sCancellationLetter;
+				DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "Resource");
+
+				if (dtRes.Rows.Count != 1)
+				{
+					Exception ex = new Exception("Unable to update Resource file");
+					throw ex;
+				}
+				DataRow rw = dtRes.Rows[0];
+				string sError = rw["ERRORTEXT"].ToString();
+				if (sError != "")
+				{
+					Exception ex = new Exception(sError);
+					throw ex;
+				}
+
+				m_dsGlobal.Tables["ResourceUser"].Clear();
+
+				m_dsGlobal.Tables["Resources"].Clear();
+				m_DocManager.LoadBSDXResourcesTable();
+				m_DocManager.LoadResourceUserTable();
+
+				m_dsGlobal.Tables["GroupResources"].Clear();
+				m_DocManager.LoadGroupResourcesTable();
+			
+				m_DocManager.UpdateViews();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.Message);
+			}
+		}
+
+		private void grdResources_CurrentCellChanged(object sender, System.EventArgs e)
+		{
+			DataGridCell dgCell;
+			dgCell = this.grdResources.CurrentCell;
+			m_nResourceRow = dgCell.RowNumber;
+			this.grdResources.Select(m_nResourceRow);
+			if (m_sMember == "Resource")
+			{
+				Object dgItem = grdResources[dgCell.RowNumber, 0];
+				this.m_nResourceID = Convert.ToInt16(dgItem);
+				Debug.Write("m_nResourceID changed to " + m_nResourceID.ToString() + "\n");
+			}
+			this.cmdChangeResource.Enabled = true;
+		}
+		private void grdResources_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
+		{
+			m_sMember = grdResources.DataMember.ToString();
+			if (m_sMember == "")
+				m_sMember = "Resource";
+
+			if (m_sMember == "ResourceUser")
+			{
+				m_bEditUsers = true;
+				this.cmdAddResource.Text = "Add User...";
+				this.cmdChangeResource.Text = "Change User...";
+				this.cmdRemoveUser.Visible = true;
+				this.lblDescription.Text = "Define the users who can create appointments and establish availability for a particular resource.  Users must first be given basic access to the VistA Scheduling package using standard VistA menu and key management before they can be selected here and assigned to a resource.  Click the left-pointing arrow near the upper right of the window to go back to the list of resources.";
+				int nRows = this.grdResources.VisibleRowCount;
+				if (nRows == 0)
+				{
+					this.cmdChangeResource.Enabled = false;
+					this.cmdRemoveUser.Enabled = false;
+				}
+				else
+				{
+					grdResources.CurrentCell = new DataGridCell(0, 0);
+					this.cmdChangeResource.Enabled = true;
+					this.cmdRemoveUser.Enabled = true;
+				}
+			}
+			else
+			{
+				m_bEditUsers = false;
+				this.cmdAddResource.Text = "Add ...";
+				this.cmdChangeResource.Text = "Change...";
+				this.cmdRemoveUser.Visible = false;
+				this.lblDescription.Text="Use the resources panel to define the set of clinical entities available for scheduling at this facility.  Resources may include care providers (for example, dentists and physicians) or other kinds of scheduled services, facilities or equipment.  Click the small + sign next to the resource name to manage the users who can schedule this resource.";
+				this.cmdChangeResource.Enabled = true;
+			}
+		}
+
+		#endregion Resources
+
+		#region ResourceUser
+
+		private void AddResourceUser()
+		{
+			DResourceUser dRes = new DResourceUser();
+
+			//Find out if there are any rows here
+			int nRows = this.grdResources.VisibleRowCount;
+			if (nRows == 0)
+			{
+				this.cmdChangeResource.Enabled = false;
+				this.cmdRemoveUser.Enabled = false;
+			}
+
+			dRes.InitializePage(-1, this.m_dsGlobal);
+			if (dRes.ShowDialog(this) == DialogResult.Cancel)
+			{
+				return;
+			}
+			//Call RPMS to add new Resource User
+			int nUserID = dRes.UserID;
+			string sUserID = nUserID.ToString();
+			bool bOverbook = dRes.Overbook;
+			string sOverbook = (bOverbook == true)?"YES":"NO";
+			bool bModifySchedule = dRes.ModifySchedule;
+			string sModifySchedule = (bModifySchedule == true)?"YES":"NO";
+			bool bAppointments = dRes.Appoinmtments;
+			string sAppointments = (bAppointments == true)?"YES":"NO";
+
+			string sSql = "BSDX ADD/EDIT RESOURCEUSER^" + "0" + "|" + sOverbook + "|" + sModifySchedule + "|" + m_nResourceID + "|" + sUserID + "|" + sAppointments;
+			DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResourceUser");
+
+			m_dsGlobal.Tables["ResourceUser"].Clear();
+			m_DocManager.LoadResourceUserTable(true);
+			
+			m_DocManager.UpdateViews();
+		}
+
+
+		private void ChangeResourceUser()
+		{
+			Object oSelectedResourceUserID = grdResources[grdResources.CurrentCell.RowNumber, 1];
+			int nSelectedResourceUserID = Convert.ToInt16(oSelectedResourceUserID);
+			DResourceUser dRes = new DResourceUser();
+			dRes.InitializePage(nSelectedResourceUserID, this.m_dsGlobal);
+			if (dRes.ShowDialog(this) != DialogResult.OK)
+			{
+				return;
+			}
+			//Call RPMS to change Resource User
+			int nUserID = dRes.UserID;
+			string sUserID = nUserID.ToString();
+			bool bOverbook = dRes.Overbook;
+			string sOverbook = (bOverbook == true)?"YES":"NO";
+			bool bModifySchedule = dRes.ModifySchedule;
+			string sModifySchedule = (bModifySchedule == true)?"YES":"NO";
+			bool bAppointments = dRes.Appoinmtments;
+			string sAppointments = (bAppointments == true)?"YES":"NO";
+
+			string sSql = "BSDX ADD/EDIT RESOURCEUSER^" + nSelectedResourceUserID.ToString() + "|" + sOverbook + "|" + sModifySchedule + "|" + m_nResourceID + "|" + sUserID + "|" + sAppointments ;
+			DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResourceUser");
+
+			m_dsGlobal.Tables["ResourceUser"].Clear();
+			m_DocManager.LoadResourceUserTable(true);
+			
+			m_DocManager.UpdateViews();
+		}
+
+
+		private void cmdRemoveUser_Click(object sender, System.EventArgs e)
+		{
+			Object oSelectedResourceUserID = grdResources[grdResources.CurrentCell.RowNumber, 1];
+			int nSelectedResourceUserID = Convert.ToInt16(oSelectedResourceUserID);
+
+			string sSql = "BSDX DELETE RESOURCEUSER^" + nSelectedResourceUserID.ToString();
+			DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResUsr");
+
+			m_dsGlobal.Tables["ResourceUser"].Clear();
+			m_DocManager.LoadResourceUserTable(true);
+			
+			m_DocManager.UpdateViews();
+			int nRows = this.grdResources.VisibleRowCount;
+			if (nRows == 0)
+			{
+				this.cmdChangeResource.Enabled = false;
+				this.cmdRemoveUser.Enabled = false;
+			}
+			else
+			{
+				grdResources.Select(0);
+				this.cmdChangeResource.Enabled = true;
+				this.cmdRemoveUser.Enabled = true;
+			}
+		}
+
+		#endregion ResourceUser
+
+		#region ResourceGroups
+
+		//20041109 Added below
+		private void InitResourceGroupsPage()
+		{
+			this.cmdChangeResourceGroup.Enabled = false;
+			this.cmdRemoveResourceGroup.Enabled = false;
+			if (this.m_dvResourceGroup.Count > 0)
+			{
+				this.m_nResourceGroupRow = 0;
+
+				this.grdResourceGroup.CurrentCell = new DataGridCell(0,0);
+				this.grdResourceGroup.Select(0);
+				this.m_nResourceGroupRow = 0;
+				object dgItem = this.grdResourceGroup[0,0];
+				this.m_nResourceGroupID = Convert.ToInt16(dgItem);
+				dgItem = grdResourceGroup[0,1];
+				this.m_sResourceGroupName = dgItem.ToString();
+
+				this.cmdChangeResourceGroup.Enabled = true;
+				this.cmdRemoveResourceGroup.Enabled = true;
+			}		
+		}
+
+		private void cmdAddResourceGroup_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				if (m_bEditGroupItems == true)
+				{
+					AddResourceGroupItem();
+					return;
+				}
+
+				DResourceGroup dRes = new DResourceGroup();
+				dRes.InitializePage(-1, this.m_dsGlobal);
+				if (dRes.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				//Call RPMS to add new resource
+
+				string sResGroupName = dRes.ResourceGroupName;
+
+				string sSql = "BSDX ADD/EDIT RESOURCE GROUP^0|" + sResGroupName;
+				DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "ResourceGroup");
+				
+				Debug.Assert(dtRes.Rows.Count == 1);
+				if (dtRes.Rows.Count != 1)
+				{
+					throw new Exception("DManagement:cmdAddResource_Click: Unable to add new Resource Group.");
+				}
+				DataRow dr = dtRes.Rows[0];
+				int nErrorID = (int) dr["RESOURCEGROUPID"];
+				if (nErrorID == 0)
+				{
+					throw new Exception((string) dr["ERRORTEXT"]);
+				}
+
+				m_dsGlobal.Tables["GroupResources"].Clear();
+				m_DocManager.LoadGroupResourcesTable();
+				m_DocManager.LoadResourceGroupTable();
+			
+				m_DocManager.UpdateViews();
+
+				//20041109 Added below
+				InitResourceGroupsPage();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.Message);
+			}
+		}
+
+		private void grdResourceGroup_CurrentCellChanged(object sender, System.EventArgs e)
+		{
+			DataGridCell dgCell;
+			dgCell = grdResourceGroup.CurrentCell;
+			m_nResourceGroupRow = dgCell.RowNumber;
+			grdResourceGroup.Select(m_nResourceGroupRow);
+			if (m_sGroupMember == "Group")
+			{
+				Object dgItem = grdResourceGroup[dgCell.RowNumber, 1];
+				m_sResourceGroupName = dgItem.ToString();
+				dgItem = grdResourceGroup[dgCell.RowNumber, 0];
+				m_nResourceGroupID = Convert.ToInt16(dgItem);
+				Debug.Write("m_nResourceGroupID changed to " + m_nResourceGroupID.ToString() + "\n");
+			}
+			this.cmdRemoveResourceGroup.Enabled = true;
+			this.cmdChangeResourceGroup.Enabled = true;
+		}
+		
+
+		private void grdResourceGroup_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
+		{
+			m_sGroupMember = grdResourceGroup.DataMember.ToString();
+			if (m_sGroupMember == "")
+				m_sGroupMember = "Group";
+
+			if (m_sGroupMember == "GroupResource")
+			{
+				m_bEditGroupItems = true;
+				cmdAddResourceGroup.Text = "Add Resource";
+				this.cmdRemoveResourceGroup.Text = "Remove Resource";
+				this.cmdChangeResourceGroup.Visible = false;
+				this.cmdRemoveResourceGroup.Visible = true;
+				this.lblDescriptionResourceGroup.Text = "Define the Resource which will be a part of this group.  Click the left-pointing arrow near the upper right of the window to go back to the list of Resource Groups.";
+				int nRows = this.grdResourceGroup.VisibleRowCount;
+				if (nRows == 0)
+				{
+					this.cmdRemoveResourceGroup.Enabled = false;
+					this.cmdChangeResourceGroup.Visible = false;
+				}
+				else
+				{
+					grdResourceGroup.CurrentCell = new DataGridCell(0, 0);
+					this.cmdChangeResourceGroup.Visible = false;
+					this.cmdRemoveResourceGroup.Enabled = true;
+				}
+			}
+			else
+			{
+				m_bEditGroupItems = false;
+				this.cmdAddResourceGroup.Text = "&Add Group";
+				this.cmdRemoveResourceGroup.Text = "&Remove Group";
+				this.cmdChangeResourceGroup.Visible = true;
+				this.lblDescriptionResourceGroup.Text="Use this panel to organize Resources into useful groups.  Resource Groups may include departments, clinics or any other collection of resources.  Resource groups will be visible to all scheduling users.";
+			}		
+		}
+
+		private void cmdRemoveResourceGroup_Click(object sender, System.EventArgs e)
+		{
+			if (m_bEditGroupItems == true)
+			{
+				RemoveResourceGroupItem();
+				return;
+			}
+		
+			string sSql = "BSDX DELETE RESOURCE GROUP^" + m_sResourceGroupName;
+			DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResGrp");
+
+			m_dsGlobal.Tables["GroupResources"].Clear();
+			m_DocManager.LoadGroupResourcesTable();
+			m_DocManager.LoadResourceGroupTable();
+
+			DataTable dt = m_dsGlobal.Tables["ResourceGroup"];
+			DataRow dr = dt.Rows.Find(m_sResourceGroupName);
+			dr.Delete();
+			dr.AcceptChanges();
+			
+			m_DocManager.UpdateViews();
+
+			//20041109 Added below
+			InitResourceGroupsPage();
+
+			//20041109 Removed below
+//			int nRows = this.grdResourceGroup.VisibleRowCount;
+//			if (nRows == 0)
+//			{
+//				this.cmdRemoveResourceGroup.Enabled = false;
+//			}
+//			else
+//			{
+//				grdResourceGroup.Select(0);
+//				this.cmdRemoveResourceGroup.Enabled = true;
+//			}
+
+		}
+
+		private void AddResourceGroupItem()
+		{
+			DResourceGroupItem dRes = new DResourceGroupItem();
+			dRes.InitializePage(-1, this.m_dsGlobal);
+			if (dRes.ShowDialog(this) == DialogResult.Cancel)
+			{
+				return;
+			}
+
+			//Call RPMS to add new resource
+
+			int nResID = dRes.ResourceID;
+
+			string sSql = "BSDX ADD RES GROUP ITEM^" + m_nResourceGroupID.ToString() + "^" + nResID.ToString();
+			DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "ResourceGroupItem");
+
+			this.cmdRemoveResourceGroup.Enabled = true;
+
+			m_dsGlobal.Tables["GroupResources"].Clear();
+			m_DocManager.LoadGroupResourcesTable();
+			
+			m_DocManager.UpdateViews();
+
+		}
+
+		private void RemoveResourceGroupItem()
+		{
+			Object oSelectedResourceName = this.grdResourceGroup[grdResourceGroup.CurrentCell.RowNumber, 1];
+			string sSelectedResourceName = oSelectedResourceName.ToString();
+
+			Object oSelectedResourceGroupID = this.grdResourceGroup[grdResourceGroup.CurrentCell.RowNumber, 0];
+			int nSelectedResourceGroupID = Convert.ToInt16(oSelectedResourceGroupID);
+
+			Object oSelectedResourceItemID = this.grdResourceGroup[grdResourceGroup.CurrentCell.RowNumber, 2];
+			int nSelectedResourceItemID = Convert.ToInt16(oSelectedResourceItemID);
+			
+			string sSql = "BSDX DELETE RES GROUP ITEM^" + nSelectedResourceGroupID.ToString() + "^" + nSelectedResourceItemID.ToString();
+			DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResGrpItem");
+
+			m_dsGlobal.Tables["GroupResources"].Clear();
+			m_DocManager.LoadGroupResourcesTable();
+			
+			m_DocManager.UpdateViews();
+			int nRows = this.grdResourceGroup.VisibleRowCount;
+			if (nRows == 0)
+			{
+				this.cmdRemoveResourceGroup.Enabled = false;
+			}
+			else
+			{
+				grdResourceGroup.Select(0);
+				this.cmdRemoveResourceGroup.Enabled = true;
+			}
+		}
+
+		private void cmdChangeResourceGroup_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				int nRows = this.grdResourceGroup.VisibleRowCount;
+				if (nRows == 0)
+				{
+					Debug.Assert(false, "This code shouldn't execute.");
+					m_sResourceGroupName = "";
+					this.cmdChangeResource.Enabled = false;
+					this.cmdRemoveResourceGroup.Enabled = false;
+					return;
+				}
+				else
+				{
+					DataGridCell dgCell;
+					dgCell = grdResourceGroup.CurrentCell;
+					Object dgItem = grdResourceGroup[dgCell.RowNumber, 1];
+					m_sResourceGroupName = dgItem.ToString();
+					this.cmdChangeResource.Enabled = true;
+					this.cmdRemoveResourceGroup.Enabled = true;
+				}
+
+				DataTable dt = m_dsGlobal.Tables["ResourceGroup"];
+				DataRow dr = dt.Rows.Find(m_sResourceGroupName);
+				int nRGID = Convert.ToInt16(dr["RESOURCE_GROUPID"]);
+
+				DResourceGroup dRes = new DResourceGroup();
+				dRes.ResourceGroupName = m_sResourceGroupName;
+				dRes.InitializePage(nRGID, this.m_dsGlobal);
+				if (dRes.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				//Call RPMS to change resource group
+
+				string sResGroupName = dRes.ResourceGroupName;
+			
+				string sSql = "BSDX ADD/EDIT RESOURCE GROUP^" + nRGID.ToString() + "|" + sResGroupName;
+				DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResGrp");
+
+				Debug.Assert(dtRes.Rows.Count == 1);
+				if (dtRes.Rows.Count != 1)
+				{
+					throw new Exception("DManagement:cmdAddResource_Click: Unable to edit Resource Group.");
+				}
+				dr = dtRes.Rows[0];
+				int nErrorID = (int) dr["RESOURCEGROUPID"];
+				if (nErrorID == 0)
+				{
+					throw new Exception((string) dr["ERRORTEXT"]);
+				}
+
+				m_sResourceGroupName = sResGroupName;
+				m_DocManager.LoadResourceGroupTable();
+				m_dsGlobal.Tables["GroupResources"].Clear();
+				m_DocManager.LoadGroupResourcesTable();
+
+
+				dr.Delete();
+				dr.AcceptChanges();
+			
+				m_DocManager.UpdateViews();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.Message);
+			}
+		}
+
+		#endregion ResourceGroups
+
+		#region AccessTypes
+
+		private void grdAccessTypes_CurrentCellChanged(object sender, System.EventArgs e)
+		{
+			DataGridCell myCell;
+			myCell = this.grdAccessTypes.CurrentCell;
+			m_nATRow = myCell.RowNumber;
+			grdAccessTypes.Select(m_nATRow);
+			this.cmdChangeAT.Enabled = true;
+		}
+
+		private void cmdChangeAT_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				DAccessType dAT = new DAccessType();
+				dAT.InitializePage(m_nATRow, this.m_dsGlobal);
+
+				if (dAT.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+				//Call RPMS to change data for access type
+				bool bInactive = dAT.Inactive;
+				string sInactive = (bInactive == true)?"YES":"NO";
+				string sAccessTypeName = dAT.AccessTypeName;
+				string sColor = dAT.DisplayColor;
+				string sRed = dAT.Red.ToString();
+				string sBlue = dAT.Blue.ToString();
+				string sGreen = dAT.Green.ToString();
+				string sIEN = dAT.AccessIEN;
+			
+			
+				string sSql = "BSDX ADD/EDIT ACCESS TYPE^" + sIEN + "|" + sAccessTypeName + "|" + sInactive + "|" + sColor + "|" + sRed + "|" + sGreen + "|" + sBlue;
+				DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AccessType");
+
+				Debug.Assert(dtAppt.Rows.Count == 1);
+				if (dtAppt.Rows.Count != 1)
+				{
+					throw new Exception("DManagement:cmdChangeAT_Click: Unable to add new Access Type.");
+				}
+				DataRow dr = dtAppt.Rows[0];
+				int nErrorID = (int) dr["ACCESSTYPEID"];
+				if (nErrorID == 0)
+				{
+					throw new Exception((string) dr["ERRORTEXT"]);
+				}
+
+				m_DocManager.LoadAccessTypesTable();
+				m_DocManager.UpdateViews();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.Message);
+			}
+		}
+
+		private void cmdAddAT_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				DAccessType dAT = new DAccessType();
+				dAT.InitializePage(-1, this.m_dsGlobal);
+				if (dAT.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				//Call RPMS to add new access type
+				bool bInactive = dAT.Inactive;
+				string sInactive = (bInactive == true)?"YES":"NO";
+				string sAccessTypeName = dAT.AccessTypeName;
+				string sColor = dAT.DisplayColor;
+				string sRed = dAT.Red.ToString();
+				string sBlue = dAT.Blue.ToString();
+				string sGreen = dAT.Green.ToString();
+
+				string sSql = "BSDX ADD/EDIT ACCESS TYPE^0|" + sAccessTypeName + "|" + sInactive + "|" + sColor + "|" + sRed + "|" + sGreen + "|" + sBlue;
+				DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AccessType");
+
+				Debug.Assert(dtAppt.Rows.Count == 1);
+				if (dtAppt.Rows.Count != 1)
+				{
+					throw new Exception("DManagement:cmdAddAT_Click: Unable to add new Resource.");
+				}
+				DataRow dr = dtAppt.Rows[0];
+				int nErrorID = (int) dr["ACCESSTYPEID"];
+				if (nErrorID == 0)
+				{
+					throw new Exception((string) dr["ERRORTEXT"]);
+				}
+
+				m_DocManager.LoadAccessTypesTable();
+				m_DocManager.UpdateViews();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.Message);
+			}
+		}
+
+		#endregion AccessTypes
+
+		#region AccessGroups
+
+		private void InitAccessGroupsPage()
+		{
+			this.cmdChangeAccessGroup.Enabled = false;
+			this.cmdRemoveAccessGroup.Enabled = false;
+			if (this.m_dvAccessGroup.Count > 0)
+			{
+				this.m_nAccessGroupRow = 0;
+
+				this.grdAccessGroups.CurrentCell = new DataGridCell(0,0);
+				this.grdAccessGroups.Select(0);
+				this.m_nAccessGroupRow = 0;
+				object dgItem = this.grdAccessGroups[0,0];
+				this.m_nAccessGroupID = Convert.ToInt16(dgItem);
+				dgItem = grdAccessGroups[0,1];
+				this.m_sAccessGroupName = dgItem.ToString();
+				this.cmdChangeAccessGroup.Enabled = true;
+				this.cmdRemoveAccessGroup.Enabled = true;
+			}
+		}
+
+		private void grdAccessGroups_CurrentCellChanged(object sender, System.EventArgs e)
+		{
+			DataGridCell dgCell;
+			dgCell = grdAccessGroups.CurrentCell;
+			m_nAccessGroupRow = dgCell.RowNumber;
+			grdAccessGroups.Select(m_nAccessGroupRow);
+			if (m_sAccessGroupMember == "Group")
+			{
+				Object dgItem = grdAccessGroups[dgCell.RowNumber, 0];
+				m_sAccessGroupName = dgItem.ToString();
+				dgItem = grdAccessGroups[dgCell.RowNumber, 0];
+				m_nAccessGroupID = Convert.ToInt16(dgItem);
+				Debug.Write("m_nAccessGroupID changed to " + m_nAccessGroupID.ToString() + "\n");
+				dgItem = grdAccessGroups[dgCell.RowNumber, 1];
+				m_sAccessGroupName = dgItem.ToString();
+				Debug.Write("m_sAccessGroupName changed to " + m_sAccessGroupName + "\n");
+			}
+			cmdRemoveAccessGroup.Enabled = true;
+			cmdChangeAccessGroup.Enabled = true;
+		}
+
+		private void grdAccessGroups_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
+		{
+			m_sAccessGroupMember = grdAccessGroups.DataMember.ToString();
+			if (m_sAccessGroupMember == "")
+			{
+				m_sAccessGroupMember = "Group";
+			}
+
+			if (m_sAccessGroupMember == "AccessGroupType")
+			{
+				m_bEditAccessGroupItems = true;
+				this.cmdAddAccessGroup.Text = "&Add Type";
+				this.cmdRemoveAccessGroup.Text = "&Remove Type";
+				cmdChangeAccessGroup.Visible = false;
+				this.lblDescriptionAccessGroups.Text = "Define the Access Type which will be a part of this group.  Click the left-pointing arrow near the upper right of the window to go back to the list of Access Groups.";
+				int nRows = this.grdAccessGroups.VisibleRowCount;
+				if (nRows == 0)
+				{
+					this.cmdRemoveAccessGroup.Enabled = false;
+					cmdChangeAccessGroup.Visible = false;
+				}
+				else
+				{
+					grdAccessGroups.CurrentCell = new DataGridCell(0, 0);
+					cmdChangeAccessGroup.Visible = false;
+					this.cmdRemoveAccessGroup.Enabled = true;
+				}
+			}
+			else
+			{
+				m_bEditAccessGroupItems = false;
+				this.cmdAddAccessGroup.Text = "&Add Group";
+				this.cmdRemoveAccessGroup.Text = "&Remove Group";
+				cmdChangeAccessGroup.Visible = true;
+				this.lblDescriptionAccessGroups.Text="Use this panel to organize Access Types into convenient groups.  Access Groups are useful when selecting the Access Type (Walk-in, Same-Day, etc) to use when setting up the schedule for a resource.  Access Type Groups will be visible to all scheduling users.";
+			}			
+		}
+
+		private void cmdAddAccessGroup_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				if (m_bEditAccessGroupItems == true)
+				{
+					AddAccessGroupItem();
+					return;
+				}
+
+				DAccessGroup dRes = new DAccessGroup();
+				dRes.InitializePage(-1, this.m_dsGlobal);
+				if (dRes.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				//Call RPMS to add new Acccess Group
+				string sAccessGroupName = dRes.AccessGroupName;
+				string sSql = "BSDX ADD/EDIT ACCESS GROUP^0|" + sAccessGroupName;
+				DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AccessGroup");
+
+				Debug.Assert(dtAppt.Rows.Count == 1);
+				if (dtAppt.Rows.Count != 1)
+				{
+					throw new Exception("DManagement:cmdAddAccessGroup_Click: Unable to add new Resource.");
+				}
+				DataRow dr = dtAppt.Rows[0];
+				int nErrorID = (int) dr["ACCESSGROUPID"];
+				if (nErrorID == 0)
+				{
+					throw new Exception((string) dr["ERRORTEXT"]);
+				}
+
+				m_dsGlobal.Tables["AccessGroupType"].Clear();
+				m_dsGlobal.Tables["AccessGroup"].Clear();
+				m_DocManager.LoadAccessGroupsTable();
+				m_DocManager.LoadAccessGroupTypesTable();
+			
+				m_DocManager.UpdateViews();
+				
+				//20041109 Added
+				InitAccessGroupsPage();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.Message);
+			}
+
+		}
+
+		private void cmdRemoveAccessGroup_Click(object sender, System.EventArgs e)
+		{
+			if (m_bEditAccessGroupItems == true)
+			{
+				RemoveAccessGroupItem();
+				return;
+			}
+		
+			string sSql = "BSDX DELETE ACCESS GROUP^" + this.m_nAccessGroupID;
+			DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AccessGroup");
+
+			m_dsGlobal.Tables["AccessGroupType"].Clear();
+			m_dsGlobal.Tables["AccessGroup"].Clear();
+			m_DocManager.LoadAccessGroupsTable();
+			m_DocManager.LoadAccessGroupTypesTable();
+			m_DocManager.UpdateViews();
+
+			//20041109 Added
+			InitAccessGroupsPage();	
+		}
+
+		private void cmdChangeAccessGroup_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				int nRows = this.grdAccessGroups.VisibleRowCount;
+				int nAccessGroupID;
+				if (nRows == 0)
+				{
+					Debug.Assert(false, "This code shouldn't execute.");
+					return;
+				}
+				else
+				{
+					DataGridCell dgCell;
+					dgCell = grdAccessGroups.CurrentCell;
+					Object dgItem = grdAccessGroups[dgCell.RowNumber, 1];
+					m_sAccessGroupName = dgItem.ToString();
+					dgItem = grdAccessGroups[dgCell.RowNumber, 0];
+					nAccessGroupID = Convert.ToInt16(dgItem);
+				}
+
+				DAccessGroup dRes = new DAccessGroup();
+				dRes.AccessGroupName = m_sAccessGroupName;
+				dRes.InitializePage(nAccessGroupID, this.m_dsGlobal);
+				if (dRes.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				//Call RPMS to change resource group
+
+				string sAccessGroupName = dRes.AccessGroupName;
+			
+				string sSql = "BSDX ADD/EDIT ACCESS GROUP^" + nAccessGroupID.ToString() + "|" + sAccessGroupName;
+				DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "TempAccGrp");
+
+				Debug.Assert(dtAppt.Rows.Count == 1);
+				if (dtAppt.Rows.Count != 1)
+				{
+					throw new Exception("DManagement:cmdChangeAccessGroup_Click: Unable to add new Resource.");
+				}
+				DataRow dr = dtAppt.Rows[0];
+				int nErrorID = (int) dr["ACCESSGROUPID"];
+				if (nErrorID == 0)
+				{
+					throw new Exception((string) dr["ERRORTEXT"]);
+				}
+
+				m_sAccessGroupName = sAccessGroupName;
+				m_dsGlobal.Tables["AccessGroupType"].Clear();
+				m_dsGlobal.Tables["AccessGroup"].Clear();
+				m_DocManager.LoadAccessGroupsTable();
+				m_DocManager.LoadAccessGroupTypesTable();
+			
+				m_DocManager.UpdateViews();	
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.Message);
+			}
+		}
+
+		private void AddAccessGroupItem()
+		{
+			try
+			{
+				DAccessGroupItem dRes = new DAccessGroupItem();
+				dRes.InitializePage(-1, this.m_dsGlobal);
+				if (dRes.ShowDialog(this) == DialogResult.Cancel)
+				{
+					return;
+				}
+
+				//Call RPMS to add new AccessGroupItem
+
+				int nAccessTypeID = dRes.AccessTypeID;
+
+				string sSql = "BSDX ADD ACCESS GROUP ITEM^" + m_nAccessGroupID.ToString() + "^" + nAccessTypeID.ToString();
+				DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AccessGroupItem");
+
+				Debug.Assert(dtAppt.Rows.Count == 1);
+				if (dtAppt.Rows.Count != 1)
+				{
+					throw new Exception("DManagement:AddAccessGroupItem: Unable to add new Access Group Item.");
+				}
+				DataRow dr = dtAppt.Rows[0];
+				int nErrorID = (int) dr["ACCESSGROUPTYPEID"];
+				if (nErrorID == 0)
+				{
+					throw new Exception((string) dr["ERRORTEXT"]);
+				}
+
+
+				this.cmdRemoveAccessGroup.Enabled = true;
+
+				m_dsGlobal.Tables["AccessTypes"].Clear();
+				m_dsGlobal.Tables["AccessGroupType"].Clear();
+				m_DocManager.LoadAccessTypesTable();
+				m_DocManager.LoadAccessGroupTypesTable();
+			
+				m_DocManager.UpdateViews();
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.Message);
+			}
+		}
+
+		private void RemoveAccessGroupItem()
+		{
+			try
+			{
+				Object oSelectedAccessGroupID = this.grdAccessGroups[grdAccessGroups.CurrentCell.RowNumber, 1];
+				int nSelectedAccessGroupID = Convert.ToInt16(oSelectedAccessGroupID);
+
+				Object oSelectedAccessGroupItemID = this.grdAccessGroups[grdAccessGroups.CurrentCell.RowNumber, 3];
+				int nSelectedAccessGroupItemID = Convert.ToInt16(oSelectedAccessGroupItemID);
+			
+				string sSql = "BSDX DELETE ACCESS GROUP ITEM^" + nSelectedAccessGroupID.ToString() + "^" + nSelectedAccessGroupItemID.ToString();
+				DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "TempAccGrpItem");
+
+				Debug.Assert(dtAppt.Rows.Count == 1);
+				if (dtAppt.Rows.Count != 1)
+				{
+					throw new Exception("DManagement:RemoveAccessGroupItem: Unable to add new Access Group Item.");
+				}
+				DataRow dr = dtAppt.Rows[0];
+				int nErrorID = (int) dr["ACCESSGROUPTYPEID"];
+				if (nErrorID == 0)
+				{
+					throw new Exception((string) dr["ERRORTEXT"]);
+				}
+
+				m_dsGlobal.Tables["AccessGroupType"].Clear();
+				m_DocManager.LoadAccessGroupTypesTable();
+			
+				m_DocManager.UpdateViews();
+				int nRows = this.grdAccessGroups.VisibleRowCount;
+				if (nRows == 0)
+				{
+					this.cmdRemoveAccessGroup.Enabled = false;
+				}
+				else
+				{
+					grdResourceGroup.Select(0);
+					this.cmdRemoveAccessGroup.Enabled = true;
+				}
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(ex.Message);
+			}
+		}
+
+		#endregion AccessGroups
+
+		#region TransferAppts
+
+		private void cmdCopyAppts_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				//Show a modeless progress dialog
+				int nHospLocationID = Convert.ToInt32(this.cboRPMSClinic.SelectedValue);
+				int nResourceID = Convert.ToInt32(this.cboBSDXClinic.SelectedValue);
+				
+				ThreadApptCopy tac = new ThreadApptCopy(this.dtpBegin.Value, this.dtpEnd.Value, 
+					nHospLocationID.ToString(), cboRPMSClinic.Text, 
+					nResourceID.ToString(), cboBSDXClinic.Text, 
+					this.m_DocManager);
+
+				Thread threadApptCopy = new Thread(new System.Threading.ThreadStart(tac.ThreadApptCopyProc));
+				//threadApptCopy.ApartmentState = ApartmentState.STA;
+                threadApptCopy.SetApartmentState(ApartmentState.STA);
+				threadApptCopy.Start();
+
+			}
+			catch(Exception ex)
+			{
+				MessageBox.Show(this,ex.Message,"Clinical Scheduling");
+			}
+		
+		}
+
+
+		public class ThreadApptCopy
+		{
+			private						DateTime m_dtBegin;
+			private						DateTime m_dtEnd;
+			private	string				m_HospLocationID;
+			private string				m_HospLocationName;
+			private string				m_ResourceID;
+			private string				m_ResourceName;
+			private CGDocumentManager	m_DocManager;
+
+			public ThreadApptCopy(DateTime dtBegin, DateTime EndDate, 
+				string HospLocationID, string HospLocationName, 
+				string ResourceID, string ResourceName, 
+				CGDocumentManager DocManager)
+			{
+				m_dtBegin = dtBegin;
+				m_dtEnd = EndDate;
+				m_HospLocationID = HospLocationID;
+				m_HospLocationName = HospLocationName;
+				m_ResourceID = ResourceID;
+				m_ResourceName = ResourceName;
+				m_DocManager = DocManager;
+			}
+
+			public void ThreadApptCopyProc()
+			{
+				DCopyAppts dCopy = new DCopyAppts();
+				dCopy.InitializePage(m_dtBegin, m_dtEnd, 
+					m_HospLocationID, m_HospLocationName, 
+					m_ResourceID, m_ResourceName, 
+					m_DocManager);
+				dCopy.ShowDialog();
+			}
+		}
+
+		#endregion TransferAppts
+
+        #region Workstations
+        private void cmdWorkStationsRefresh_Click(object sender, System.EventArgs e)
+		{
+			this.m_dtWSGrid.Clear();
+			this.m_DocManager.ConnectInfo.RaiseEvent("BSDX CALL WORKSTATIONS", "A", true);
+		}
+
+		private BMXNetConnectInfo.BMXNetEventDelegate	MgrEventDelegate;
+		delegate void UpdateWorkstationGridDelegate(string sParam);
+
+		private void MgrEventHandler(Object obj, BMXNet.BMXNetEventArgs e)
+		{
+			try
+			{
+				if (e.BMXEvent == "BSDX WORKSTATION REPORT")
+				{
+					Debug.Write("DManagement Got Workstation Report\n");
+					UpdateWorkstationGridDelegate uWSGd = new UpdateWorkstationGridDelegate(UpdateWorkstationGrid);
+                    if (this.InvokeRequired == true) //ensures that handle is created
+                    {
+                        this.Invoke(uWSGd, new object[] { e.BMXParam });
+                    }
+                    else
+                    {
+                        UpdateWorkstationGrid(e.BMXParam);
+                    }
+				}
+			}
+			catch (Exception ex)
+			{
+				Debug.Write("MgrEventHandler exception: " + ex.Message + "\n");
+			}
+		}
+
+		private void UpdateWorkstationGrid(string sParam)
+		{
+			string sDelim = "~";
+			DataRow dr = this.m_dtWSGrid.NewRow();
+			dr["UserName"] = BMXNetLib.Piece(sParam,sDelim,1);
+			dr["Handle"] = BMXNetLib.Piece(sParam,sDelim,2);
+			dr["Version"] = BMXNetLib.Piece(sParam,sDelim,3);		
+			dr["Views"] = BMXNetLib.Piece(sParam,sDelim,4);
+			m_dtWSGrid.Rows.Add(dr);
+		}
+
+		private void DManagement_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+		{
+			m_DocManager.ConnectInfo.UnSubscribeEvent("BSDX WORKSTATION REPORT");
+		}
+
+		private void cmdWorkStationsMessage_Click(object sender, System.EventArgs e)
+		{
+			string sMessage;
+			dInputText dlg = new dInputText();
+			dlg.DialogTitle = "Clinical Scheduling - Send Message to Scheduling Clients.";
+
+			if (dlg.ShowDialog(this) != DialogResult.OK)
+				return;
+
+			sMessage = dlg.TextValue;
+
+			if (sMessage == "")
+				return;
+
+			this.m_DocManager.ConnectInfo.RaiseEvent("BSDX ADMIN MESSAGE", sMessage, false);
+		}
+
+		private void cmdWorkStationsShutdown_Click(object sender, System.EventArgs e)
+		{
+			if (MessageBox.Show("Are you sure you want to shut down all Clincal Scheduling clients?" ,"Clinical Scheduling Client Shutdown", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
+			{
+				return;
+			}
+			this.m_DocManager.ConnectInfo.RaiseEvent("BSDX ADMIN SHUTDOWN", txtSendMessage.Text, false);
+        }
+        #endregion Workstations
+
+    }
+}
Index: Scheduling/branches/GUI1.2/DManagement.resx
===================================================================
--- Scheduling/branches/GUI1.2/DManagement.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DManagement.resx	(revision 855)
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="lblDescription.Text" xml:space="preserve">
+    <value>Use the resources panel to define the set of clinical entities available for scheduling at this facility.  Resources may include care providers (for example, dentists and physicians) or other kinds of scheduled services, facilities or equipment.  Click the small + sign next to the resource name to manage the users who can schedule this resource.</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.Text" xml:space="preserve">
+    <value>Use this panel to organize Resources into useful groups.  Resource Groups may include departments, clinics or any other collection of resources.  Resource groups will be visible to all scheduling users.</value>
+  </data>
+  <data name="lblDescriptionAccessGroups.Text" xml:space="preserve">
+    <value>Use this panel to organize Access Types into convenient groups.  Access Groups are useful when selecting the Access Type (Walk-in, Same-Day, etc) to use when setting up the schedule for a resource.  Access Type Groups will be visible to all scheduling users.</value>
+  </data>
+  <data name="lblDescriptionXfer.Text" xml:space="preserve">
+    <value>Use this panel to copy appointments from an VistA clinic into a Windows Scheduling clinic.  Select the Beginning and Ending dates for the transfer.  All appointments (except cancelled appointments) during the time between these dates will be copied from VistA to the selected Windows Scheduling resource.</value>
+  </data>
+  <data name="lblWorkstations.Text" xml:space="preserve">
+    <value>From this panel you can view, communicate with and shut down workstations running clinical scheduling software.  Press the Refresh button to show a current list of running workstations.  To stop all scheduling clients, enter a shutdown message in the textbox below and press the Stop Workstations button.</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DNoShow.cs
===================================================================
--- Scheduling/branches/GUI1.2/DNoShow.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DNoShow.cs	(revision 855)
@@ -0,0 +1,446 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DAutoRebook.
+	/// </summary>
+	public class DNoShow : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel pnlPageBottom;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Panel pnlDescription;
+		private System.Windows.Forms.GroupBox grpDescriptionResourceGroup;
+		private System.Windows.Forms.Label lblDescriptionResourceGroup;
+		private System.Windows.Forms.GroupBox grpAutoRebook;
+		private System.Windows.Forms.Label label6;
+		private System.Windows.Forms.Label lblRebookSelectedType;
+		private System.Windows.Forms.RadioButton rdoRebookSameType;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.NumericUpDown udMax;
+		private System.Windows.Forms.NumericUpDown udStart;
+		private System.Windows.Forms.CheckBox chkAutoRebook;
+		private System.Windows.Forms.Label label4;
+		private System.Windows.Forms.RadioButton rdoRebookAnyType;
+		private System.Windows.Forms.RadioButton rdoRebookSelectedType;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+
+		#region Fields
+
+
+		private bool		m_bAutoRebook = false;
+		private int			m_nStart = 7;
+		private int			m_nMax = 30;
+
+		// -1: use current, -2: use any non-zero type, >0 use this access type id
+		private int			m_nRebookAccessType = -1;
+
+
+		#endregion Fields
+
+		#region Methods
+
+		public void InitializePage()
+		{
+			UpdateDialogData(true);
+		}
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true)
+			{
+				chkAutoRebook.Checked = m_bAutoRebook;
+				udStart.Value = m_nStart;
+				udMax.Value = m_nMax;
+
+				this.rdoRebookSameType.Checked = true;
+				this.rdoRebookAnyType.Checked = false;
+				this.rdoRebookSelectedType.Checked = false;
+			}
+			else
+			{
+				m_bAutoRebook = chkAutoRebook.Checked;
+				m_nStart = (int) udStart.Value;
+				m_nMax = (int) udMax.Value;
+				if (this.rdoRebookSameType.Checked == true)
+				{
+					m_nRebookAccessType = -1;
+				}
+				else
+				{
+					m_nRebookAccessType = -2;
+				}
+
+			}
+		}
+
+
+		public DNoShow()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			this.UpdateDialogData(false);
+		}
+		
+		#endregion Methods
+
+		#region Properties
+
+		/// <summary>
+		/// Sets or returns the rebook access type:  -1 = use current type, -2 = use any type, 0 = prompt for a type
+		/// </summary>
+		public int RebookAccessType
+		{
+			get
+			{
+				return m_nRebookAccessType;
+			}
+			set
+			{
+				m_nRebookAccessType = value;
+				if (m_nRebookAccessType == -1)
+				{
+					this.rdoRebookSameType.Checked = true;
+				}
+				else
+				{
+					this.rdoRebookAnyType.Checked = true;
+				}
+
+			}
+		}
+
+		/// <summary>
+		/// Returns value of AutoRebook check box
+		/// </summary>
+		public bool AutoRebook
+		{
+			get
+			{
+				return m_bAutoRebook;
+			}
+			set
+			{
+				m_bAutoRebook = value;
+			}
+		}
+
+		/// <summary>
+		/// Sets or returns the number of days in the future to start searching for availability
+		/// </summary>
+		public int RebookStartDays
+		{
+			get
+			{
+				return m_nStart;
+			}
+			set
+			{
+				m_nStart = value;
+			}
+		}
+
+		/// <summary>
+		/// Sets and returns the maximum number of days in the future to look for rebook availability
+		/// </summary>
+		public int RebookMaxDays
+		{
+			get
+			{
+				return m_nMax;
+			}
+			set
+			{
+				m_nMax = value;
+			}
+		}
+
+
+		#endregion Properties
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.pnlPageBottom = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.pnlDescription = new System.Windows.Forms.Panel();
+			this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
+			this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
+			this.grpAutoRebook = new System.Windows.Forms.GroupBox();
+			this.label6 = new System.Windows.Forms.Label();
+			this.lblRebookSelectedType = new System.Windows.Forms.Label();
+			this.rdoRebookSameType = new System.Windows.Forms.RadioButton();
+			this.label3 = new System.Windows.Forms.Label();
+			this.udMax = new System.Windows.Forms.NumericUpDown();
+			this.udStart = new System.Windows.Forms.NumericUpDown();
+			this.chkAutoRebook = new System.Windows.Forms.CheckBox();
+			this.label4 = new System.Windows.Forms.Label();
+			this.rdoRebookAnyType = new System.Windows.Forms.RadioButton();
+			this.rdoRebookSelectedType = new System.Windows.Forms.RadioButton();
+			this.pnlPageBottom.SuspendLayout();
+			this.pnlDescription.SuspendLayout();
+			this.grpDescriptionResourceGroup.SuspendLayout();
+			this.grpAutoRebook.SuspendLayout();
+			((System.ComponentModel.ISupportInitialize)(this.udMax)).BeginInit();
+			((System.ComponentModel.ISupportInitialize)(this.udStart)).BeginInit();
+			this.SuspendLayout();
+			// 
+			// pnlPageBottom
+			// 
+			this.pnlPageBottom.Controls.Add(this.cmdCancel);
+			this.pnlPageBottom.Controls.Add(this.cmdOK);
+			this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlPageBottom.Location = new System.Drawing.Point(0, 366);
+			this.pnlPageBottom.Name = "pnlPageBottom";
+			this.pnlPageBottom.Size = new System.Drawing.Size(344, 40);
+			this.pnlPageBottom.TabIndex = 7;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(256, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(56, 24);
+			this.cmdCancel.TabIndex = 2;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(176, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 1;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// pnlDescription
+			// 
+			this.pnlDescription.Controls.Add(this.grpDescriptionResourceGroup);
+			this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlDescription.Location = new System.Drawing.Point(0, 294);
+			this.pnlDescription.Name = "pnlDescription";
+			this.pnlDescription.Size = new System.Drawing.Size(344, 72);
+			this.pnlDescription.TabIndex = 8;
+			// 
+			// grpDescriptionResourceGroup
+			// 
+			this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
+			this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
+			this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
+			this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(344, 72);
+			this.grpDescriptionResourceGroup.TabIndex = 1;
+			this.grpDescriptionResourceGroup.TabStop = false;
+			this.grpDescriptionResourceGroup.Text = "Description";
+			// 
+			// lblDescriptionResourceGroup
+			// 
+			this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
+			this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
+			this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(338, 53);
+			this.lblDescriptionResourceGroup.TabIndex = 0;
+			this.lblDescriptionResourceGroup.Text = "Use this panel mark an appointment as a no-show. To automatically rebook no-show " +
+				"appointments, check the Auto Rebook box.  The Start Time in Days and Maximum Day" +
+				"s values control the time window for rebooked appointments.";
+			// 
+			// grpAutoRebook
+			// 
+			this.grpAutoRebook.Controls.Add(this.label6);
+			this.grpAutoRebook.Controls.Add(this.lblRebookSelectedType);
+			this.grpAutoRebook.Controls.Add(this.rdoRebookSameType);
+			this.grpAutoRebook.Controls.Add(this.label3);
+			this.grpAutoRebook.Controls.Add(this.udMax);
+			this.grpAutoRebook.Controls.Add(this.udStart);
+			this.grpAutoRebook.Controls.Add(this.chkAutoRebook);
+			this.grpAutoRebook.Controls.Add(this.label4);
+			this.grpAutoRebook.Controls.Add(this.rdoRebookAnyType);
+			this.grpAutoRebook.Controls.Add(this.rdoRebookSelectedType);
+			this.grpAutoRebook.Location = new System.Drawing.Point(32, 24);
+			this.grpAutoRebook.Name = "grpAutoRebook";
+			this.grpAutoRebook.Size = new System.Drawing.Size(272, 248);
+			this.grpAutoRebook.TabIndex = 14;
+			this.grpAutoRebook.TabStop = false;
+			this.grpAutoRebook.Text = "Auto Rebook";
+			// 
+			// label6
+			// 
+			this.label6.Location = new System.Drawing.Point(16, 128);
+			this.label6.Name = "label6";
+			this.label6.Size = new System.Drawing.Size(232, 16);
+			this.label6.TabIndex = 19;
+			this.label6.Text = "Access Type for Rebooked Appointment:";
+			// 
+			// lblRebookSelectedType
+			// 
+			this.lblRebookSelectedType.Enabled = false;
+			this.lblRebookSelectedType.Location = new System.Drawing.Point(64, 224);
+			this.lblRebookSelectedType.Name = "lblRebookSelectedType";
+			this.lblRebookSelectedType.Size = new System.Drawing.Size(168, 16);
+			this.lblRebookSelectedType.TabIndex = 18;
+			// 
+			// rdoRebookSameType
+			// 
+			this.rdoRebookSameType.Checked = true;
+			this.rdoRebookSameType.Location = new System.Drawing.Point(24, 152);
+			this.rdoRebookSameType.Name = "rdoRebookSameType";
+			this.rdoRebookSameType.Size = new System.Drawing.Size(160, 16);
+			this.rdoRebookSameType.TabIndex = 17;
+			this.rdoRebookSameType.TabStop = true;
+			this.rdoRebookSameType.Text = "Same as Current";
+			// 
+			// label3
+			// 
+			this.label3.Location = new System.Drawing.Point(88, 56);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(104, 16);
+			this.label3.TabIndex = 16;
+			this.label3.Text = "Start time in Days";
+			// 
+			// udMax
+			// 
+			this.udMax.Increment = new System.Decimal(new int[] {
+																	7,
+																	0,
+																	0,
+																	0});
+			this.udMax.Location = new System.Drawing.Point(16, 88);
+			this.udMax.Maximum = new System.Decimal(new int[] {
+																  730,
+																  0,
+																  0,
+																  0});
+			this.udMax.Minimum = new System.Decimal(new int[] {
+																  1,
+																  0,
+																  0,
+																  0});
+			this.udMax.Name = "udMax";
+			this.udMax.Size = new System.Drawing.Size(56, 20);
+			this.udMax.TabIndex = 15;
+			this.udMax.Value = new System.Decimal(new int[] {
+																30,
+																0,
+																0,
+																0});
+			// 
+			// udStart
+			// 
+			this.udStart.Location = new System.Drawing.Point(16, 54);
+			this.udStart.Maximum = new System.Decimal(new int[] {
+																	730,
+																	0,
+																	0,
+																	0});
+			this.udStart.Name = "udStart";
+			this.udStart.Size = new System.Drawing.Size(56, 20);
+			this.udStart.TabIndex = 14;
+			this.udStart.Value = new System.Decimal(new int[] {
+																  14,
+																  0,
+																  0,
+																  0});
+			// 
+			// chkAutoRebook
+			// 
+			this.chkAutoRebook.Location = new System.Drawing.Point(16, 24);
+			this.chkAutoRebook.Name = "chkAutoRebook";
+			this.chkAutoRebook.Size = new System.Drawing.Size(120, 16);
+			this.chkAutoRebook.TabIndex = 13;
+			this.chkAutoRebook.Text = "Auto Rebook";
+			// 
+			// label4
+			// 
+			this.label4.Location = new System.Drawing.Point(88, 88);
+			this.label4.Name = "label4";
+			this.label4.Size = new System.Drawing.Size(104, 16);
+			this.label4.TabIndex = 16;
+			this.label4.Text = "Maximum Days";
+			// 
+			// rdoRebookAnyType
+			// 
+			this.rdoRebookAnyType.Location = new System.Drawing.Point(24, 176);
+			this.rdoRebookAnyType.Name = "rdoRebookAnyType";
+			this.rdoRebookAnyType.Size = new System.Drawing.Size(160, 16);
+			this.rdoRebookAnyType.TabIndex = 17;
+			this.rdoRebookAnyType.Text = "Any Access Type";
+			// 
+			// rdoRebookSelectedType
+			// 
+			this.rdoRebookSelectedType.Enabled = false;
+			this.rdoRebookSelectedType.Location = new System.Drawing.Point(24, 200);
+			this.rdoRebookSelectedType.Name = "rdoRebookSelectedType";
+			this.rdoRebookSelectedType.Size = new System.Drawing.Size(136, 16);
+			this.rdoRebookSelectedType.TabIndex = 17;
+			this.rdoRebookSelectedType.Text = "Selected Access Type:";
+			// 
+			// DNoShow
+			// 
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.ClientSize = new System.Drawing.Size(344, 406);
+			this.Controls.Add(this.grpAutoRebook);
+			this.Controls.Add(this.pnlDescription);
+			this.Controls.Add(this.pnlPageBottom);
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DNoShow";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "No Show Appointment";
+			this.pnlPageBottom.ResumeLayout(false);
+			this.pnlDescription.ResumeLayout(false);
+			this.grpDescriptionResourceGroup.ResumeLayout(false);
+			this.grpAutoRebook.ResumeLayout(false);
+			((System.ComponentModel.ISupportInitialize)(this.udMax)).EndInit();
+			((System.ComponentModel.ISupportInitialize)(this.udStart)).EndInit();
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DNoShow.resx
===================================================================
--- Scheduling/branches/GUI1.2/DNoShow.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DNoShow.resx	(revision 855)
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="pnlPageBottom.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlPageBottom.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlPageBottom.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlPageBottom.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpAutoRebook.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpAutoRebook.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpAutoRebook.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpAutoRebook.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpAutoRebook.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpAutoRebook.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label6.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label6.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label6.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblRebookSelectedType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblRebookSelectedType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblRebookSelectedType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookSameType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoRebookSameType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookSameType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="udMax.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="udMax.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="udMax.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="udStart.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="udStart.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="udStart.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkAutoRebook.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkAutoRebook.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkAutoRebook.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label4.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookAnyType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoRebookAnyType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookAnyType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookSelectedType.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="rdoRebookSelectedType.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="rdoRebookSelectedType.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Name">
+    <value>DNoShow</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DPatientApptDisplay.cs
===================================================================
--- Scheduling/branches/GUI1.2/DPatientApptDisplay.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DPatientApptDisplay.cs	(revision 855)
@@ -0,0 +1,68 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using IndianHealthService.BMXNet;
+using System.Data;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DPatientApptDisplay.
+	/// </summary>
+	public class DPatientApptDisplay : System.Windows.Forms.Form
+	{
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public void InitializeForm(CGDocumentManager docManager, int nPatientID)
+		{
+            Control UC = new UCPatientAppts(docManager, nPatientID);
+            UC.Dock = DockStyle.Fill;
+            this.Controls.Add(UC);
+        }
+
+		public DPatientApptDisplay()
+		{
+			InitializeComponent();
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+
+		private void InitializeComponent()
+		{
+            // DPatientApptDisplay
+            // 
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(664, 478);
+            this.Name = "DPatientApptDisplay";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "Patient Appointments";
+            this.ResumeLayout(false);
+
+		}
+		#endregion
+	}
+}
Index: Scheduling/branches/GUI1.2/DPatientLetter.cs
===================================================================
--- Scheduling/branches/GUI1.2/DPatientLetter.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DPatientLetter.cs	(revision 855)
@@ -0,0 +1,413 @@
+using System;
+using System.Windows.Forms;
+using System.Data;
+using System.Drawing.Printing;
+using System.Drawing;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DPatientLetter.
+	/// </summary>
+	public class DPatientLetter : System.Windows.Forms.PrintPreviewDialog
+    {
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+        private System.ComponentModel.Container components = null;
+        private System.Drawing.Printing.PrintDocument printAppts;
+        private System.Drawing.Printing.PrintDocument printReminderLetters;
+
+		#region Fields
+        DateTime _dtBegin, _dtEnd; //global fields to use in passing to printing method
+        
+        //stuff to track what got printed and where we are -- very ugly, I know
+        //but I don't know if there is a better way to do it.
+        int _currentResourcePrinting = 0;
+        int _currentApptPrinting = 0;
+        int _pageNumber = 0;
+        
+        //dataset to load the results of queries into and set to print routines
+        dsPatientApptDisplay2 _dsApptDisplay;
+        private PrintDocument printCancelLetters;
+        private PrintDocument printRebookLetters;
+        dsRebookAppts _dsRebookAppts;
+		#endregion Fields
+
+		/// <summary>
+		/// Print Clinic Schedules
+		/// </summary>
+		/// <param name="docManager">This docManger</param>
+		/// <param name="sClinicList">Clinics for which to print</param>
+		/// <param name="dtBegin">Beginning Date</param>
+		/// <param name="dtEnd">End Date</param>
+        public void InitializeFormClinicSchedule(CGDocumentManager docManager,
+			string sClinicList,
+			DateTime dtBegin,
+			DateTime dtEnd)
+		{
+			try
+			{
+				if (sClinicList == "")
+				{
+					throw new Exception("At least one clinic must be selected.");
+				}
+                _dtBegin = dtBegin;
+                _dtEnd = dtEnd;
+				string sBegin = dtBegin.ToShortDateString();
+				string sEnd = dtEnd.ToShortDateString();
+				this.Text="Clinic Schedules";
+
+				string sSql = "BSDX CLINIC LETTERS^" + sClinicList + "^" + sBegin + "^" + sEnd;
+                string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
+
+                _dsApptDisplay = new dsPatientApptDisplay2();
+                _dsApptDisplay.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
+                _dsApptDisplay.PatientAppts.Merge(docManager.RPMSDataTable(sSql, "PatientAppts"));
+
+                this.PrintPreviewControl.Document = printAppts;
+            }
+			catch (Exception ex)
+			{
+				throw ex;
+			}
+		}
+
+        /// <summary>
+        /// Print Rebook Letters by Date
+        /// </summary>
+        /// <param name="docManager">This docManger</param>
+        /// <param name="sClinicList">Clinics for which to print</param>
+        /// <param name="dtBegin">Beginning Date</param>
+        /// <param name="dtEnd">End Date</param>
+        public void InitializeFormRebookLetters(CGDocumentManager docManager,
+			string sClinicList,
+		    DateTime dtBegin,
+            DateTime dtEnd)
+		{
+			try
+			{	
+				if (sClinicList == "")
+				{
+					throw new Exception("At least one clinic must be selected.");
+				}
+
+                string sBegin = dtBegin.ToString("M/d/yyyy@HH:mm");
+                string sEnd = dtEnd.ToString("M/d/yyyy@HH:mm");
+
+                //Call RPC to get list of appt ids that have been rebooked for these clinics on these dates
+                string sSql1 = "BSDX REBOOK CLINIC LIST^" + sClinicList + "^" + sBegin + "^" + sEnd;				
+				string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
+
+                _dsRebookAppts = new dsRebookAppts();
+                _dsRebookAppts.PatientAppts.Merge(docManager.RPMSDataTable(sSql1, "PatientAppts"));
+                _dsRebookAppts.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
+
+            }
+			catch (Exception ex)
+			{
+				throw ex;
+			}
+
+            PrintPreviewControl.Document = printRebookLetters;
+
+		}
+
+        /// <summary>
+        /// Print Rebook Letters by Date
+        /// </summary>
+        /// <param name="docManager">This docManger</param>
+        /// <param name="sClinicList">Clinics for which to print</param>
+        /// <param name="sApptIDList">List of appointments IENs in ^BSDXAPPT, delimited by |</param>
+        public void InitializeFormRebookLetters(CGDocumentManager docManager,
+            string sClinicList,
+            string sApptIDList)
+        {
+            try
+            {
+                if (sClinicList == "")
+                {
+                    throw new Exception("At least one clinic must be selected.");
+                }
+
+                string sSql1 = "BSDX REBOOK LIST^" + sApptIDList;
+                string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
+
+                _dsRebookAppts = new dsRebookAppts();
+                _dsRebookAppts.PatientAppts.Merge(docManager.RPMSDataTable(sSql1, "PatientAppts"));
+                _dsRebookAppts.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
+
+
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+
+            PrintPreviewControl.Document = printRebookLetters;
+        }
+
+        /// <summary>
+        /// Print Cancellation letters to mail to patients
+        /// </summary>
+        /// <param name="docManager">This Docmanager</param>
+        /// <param name="sClinicList">| delemited clinic list (IEN's)</param>
+        /// <param name="dtBegin">Beginning Date</param>
+        /// <param name="dtEnd">Ending Date</param>
+		public void InitializeFormCancellationLetters(CGDocumentManager docManager,
+			string sClinicList,
+            DateTime dtBegin,
+            DateTime dtEnd)
+        {
+			try
+			{	
+				if (sClinicList == "")
+				{
+					throw new Exception("At least one clinic must be selected.");
+				}
+
+                string sBegin = dtBegin.ToString("M/d/yyyy@HH:mm");
+                string sEnd = dtEnd.ToString("M/d/yyyy@HH:mm");
+
+                //Call RPC to get list of appt ids that have been cancelled for these clinics on these dates
+                string sSql1 = "BSDX CANCEL CLINIC LIST^" + sClinicList + "^" + sBegin + "^" + sEnd;
+				string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
+
+                _dsRebookAppts = new dsRebookAppts();
+                _dsRebookAppts.PatientAppts.Merge(docManager.RPMSDataTable(sSql1, "PatientAppts"));
+                _dsRebookAppts.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
+
+                PrintPreviewControl.Document = printCancelLetters;
+
+			}
+			catch (Exception ex)
+			{
+				throw ex;
+			}
+		}
+        /// <summary>
+        /// Print Reminder Letters to give or mail to patients
+        /// </summary>
+        /// <param name="docManager">This docManger</param>
+        /// <param name="sClinicList">Clinics for which to print</param>
+        /// <param name="dtBegin">Beginning Date</param>
+        /// <param name="dtEnd">End Date</param>
+        public void InitializeFormPatientReminderLetters(CGDocumentManager docManager,
+			string sClinicList,
+			DateTime dtBegin,
+			DateTime dtEnd)
+		{
+			try
+			{	
+				if (sClinicList == "")
+				{
+					throw new Exception("At least one clinic must be selected.");
+				}
+
+                _dtBegin = dtBegin;
+                _dtEnd = dtEnd;
+                string sBegin = dtBegin.ToShortDateString();
+                string sEnd = dtEnd.ToShortDateString();
+                this.Text = "Clinic Schedules";
+
+                string sSql = "BSDX CLINIC LETTERS^" + sClinicList + "^" + sBegin + "^" + sEnd;
+                string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;
+
+                _dsApptDisplay = new dsPatientApptDisplay2();
+                _dsApptDisplay.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));
+                _dsApptDisplay.PatientAppts.Merge(docManager.RPMSDataTable(sSql, "PatientAppts"));
+
+                this.PrintPreviewControl.Document = printReminderLetters;
+				
+			}
+			catch (Exception ex)
+			{
+				throw ex;
+			}
+		}
+
+        /// <summary>
+        /// Ctor
+        /// </summary>
+		public DPatientLetter() : base()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+            this.printAppts = new System.Drawing.Printing.PrintDocument();
+            this.printReminderLetters = new System.Drawing.Printing.PrintDocument();
+            this.printCancelLetters = new System.Drawing.Printing.PrintDocument();
+            this.printRebookLetters = new System.Drawing.Printing.PrintDocument();
+            this.SuspendLayout();
+            // 
+            // printAppts
+            // 
+            this.printAppts.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printAppts_PrintPage);
+            // 
+            // printReminderLetters
+            // 
+            this.printReminderLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printReminderLetters_PrintPage);
+            // 
+            // printCancelLetters
+            // 
+            this.printCancelLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printCancelLetters_PrintPage);
+            // 
+            // printRebookLetters
+            // 
+            this.printRebookLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printRebookLetters_PrintPage);
+            // 
+            // DPatientLetter
+            // 
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(648, 398);
+            this.Name = "DPatientLetter";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "Patient Letter";
+            this.ResumeLayout(false);
+
+		}
+		#endregion
+
+        private void printAppts_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
+        {
+            //Each time we enter here, we start off with a new page number - we start off with zero
+            _pageNumber++; //becomes one first time through
+            
+            // _currentResourcePrinting starts with zero. There will be at least this one.
+            ClinicalScheduling.Printing.PrintAppointments(_dsApptDisplay, e, _dtBegin, _dtEnd,
+                    _currentResourcePrinting, ref _currentApptPrinting, _pageNumber);
+
+            //If the printing routine says it needs more pages to print the appointments,
+            //return here and have it print again.
+            if (e.HasMorePages == true) return;
+
+            // if there are more resouces to print, increment. Setting HasMorePages to true
+            // calls this routine again, so printing will happen with the incremented _currentResourcePrinting
+            if (_currentResourcePrinting < _dsApptDisplay.BSDXResource.Rows.Count - 1)
+            {
+                _currentResourcePrinting++;
+                //reset _currentApptPrinting
+                _currentApptPrinting = 0;
+                e.HasMorePages = true;
+                return;
+            }
+            
+            // if neither of these conditions is true, then we are done with printing.
+            // So reset counters for next one. Fixes ticket #15 on https://trac.opensourcevista.net/ticket/15
+            _currentResourcePrinting = 0;
+            _currentApptPrinting = 0;
+            _pageNumber = 0;
+        }
+
+        private void printReminderLetters_PrintPage(object sender, PrintPageEventArgs e)
+        {
+            // no patients
+            if (_dsApptDisplay.PatientAppts.Count == 0)
+            {
+                ClinicalScheduling.Printing.PrintMessage("No Appointments found", e);
+                return;
+            }
+            // if there are patients
+            else if (_currentApptPrinting < _dsApptDisplay.PatientAppts.Count)
+            {
+                dsPatientApptDisplay2.BSDXResourceRow c = (dsPatientApptDisplay2.BSDXResourceRow)
+                   _dsApptDisplay.PatientAppts[_currentApptPrinting].GetParentRow(_dsApptDisplay.Relations[0]);
+                ClinicalScheduling.Printing.PrintReminderLetter(_dsApptDisplay.PatientAppts[_currentApptPrinting], e, c.LETTER_TEXT, "Reminder Letter");
+                _currentApptPrinting++;
+                if (_currentApptPrinting < _dsApptDisplay.PatientAppts.Count)
+                {
+                    e.HasMorePages = true;
+                    return;
+                }
+            }
+
+            // If we reach this point, we need to reset the counter (ticket #15 on https://trac.opensourcevista.net/ticket/15)
+            _currentApptPrinting = 0;
+            
+        }
+
+        private void printCancelLetters_PrintPage(object sender, PrintPageEventArgs e)
+        {
+            // no patients
+            if (_dsRebookAppts.PatientAppts.Count == 0)
+            {
+                ClinicalScheduling.Printing.PrintMessage("No Appointments found", e);
+                return;
+            }
+            // if there are patients
+            else if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
+            {
+                dsRebookAppts.BSDXResourceRow c = (dsRebookAppts.BSDXResourceRow)
+                   _dsRebookAppts.PatientAppts[_currentApptPrinting].GetParentRow(_dsRebookAppts.Relations[0]);
+                ClinicalScheduling.Printing.PrintCancelLetter(_dsRebookAppts.PatientAppts[_currentApptPrinting], e, c.CLINIC_CANCELLATION_LETTER, "Cancellation Letter");
+                _currentApptPrinting++;
+                if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
+                {
+                    e.HasMorePages = true;
+                    return;
+                }
+            }
+
+            // If we reach this point, we need to reset the counter (ticket #15 on https://trac.opensourcevista.net/ticket/15)
+            _currentApptPrinting = 0;
+
+        }
+
+        private void printRebookLetters_PrintPage(object sender, PrintPageEventArgs e)
+        {
+            // no patients
+            if (_dsRebookAppts.PatientAppts.Count == 0)
+            {
+                ClinicalScheduling.Printing.PrintMessage("No Appointments found", e);
+                return;
+            }
+            // if there are patients
+            else if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
+            {
+                dsRebookAppts.BSDXResourceRow c = (dsRebookAppts.BSDXResourceRow)
+                   _dsRebookAppts.PatientAppts[_currentApptPrinting].GetParentRow(_dsRebookAppts.Relations[0]);
+                //XXX: Rebook letter rather oddly currently stored in NO SHOW LETTER field. What gives???
+                ClinicalScheduling.Printing.PrintRebookLetter(_dsRebookAppts.PatientAppts[_currentApptPrinting], e, c.NO_SHOW_LETTER, "Rebook Letter");
+                _currentApptPrinting++;
+                if (_currentApptPrinting < _dsRebookAppts.PatientAppts.Count)
+                {
+                    e.HasMorePages = true;
+                    return;
+                }
+            }
+
+            // If we reach this point, we need to reset the counter (ticket #15 on https://trac.opensourcevista.net/ticket/15)
+            _currentApptPrinting = 0;
+
+        }
+	}
+}
Index: Scheduling/branches/GUI1.2/DPatientLetter.resx
===================================================================
--- Scheduling/branches/GUI1.2/DPatientLetter.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DPatientLetter.resx	(revision 855)
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="printAppts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>116, 17</value>
+  </metadata>
+  <metadata name="printReminderLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>218, 17</value>
+  </metadata>
+  <metadata name="printCancelLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>374, 17</value>
+  </metadata>
+  <metadata name="printRebookLetters.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>515, 17</value>
+  </metadata>
+</root>
Index: Scheduling/branches/GUI1.2/DPatientLookup.cs
===================================================================
--- Scheduling/branches/GUI1.2/DPatientLookup.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DPatientLookup.cs	(revision 855)
@@ -0,0 +1,378 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+//using System.Data.OleDb;
+using IndianHealthService.BMXNet;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DPatientLookup.
+	/// </summary>
+	public class DPatientLookup : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel panel1;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Panel panel2;
+		private System.Windows.Forms.Button cmdSearch;
+		private System.Windows.Forms.TextBox txtSearch;
+		private System.Windows.Forms.Panel panel3;
+		private System.Windows.Forms.ListView lvwPatients;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DPatientLookup()
+		{
+			this.m_sPatientName = "";
+			this.m_sPatientIEN = "";
+			m_nMax = 20;
+			InitializeComponent();
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.panel1 = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.panel2 = new System.Windows.Forms.Panel();
+			this.cmdSearch = new System.Windows.Forms.Button();
+			this.txtSearch = new System.Windows.Forms.TextBox();
+			this.panel3 = new System.Windows.Forms.Panel();
+			this.lvwPatients = new System.Windows.Forms.ListView();
+			this.panel1.SuspendLayout();
+			this.panel2.SuspendLayout();
+			this.panel3.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// panel1
+			// 
+			this.panel1.Controls.Add(this.cmdCancel);
+			this.panel1.Controls.Add(this.cmdOK);
+			this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.panel1.Location = new System.Drawing.Point(0, 238);
+			this.panel1.Name = "panel1";
+			this.panel1.Size = new System.Drawing.Size(384, 40);
+			this.panel1.TabIndex = 2;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(304, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(64, 24);
+			this.cmdCancel.TabIndex = 1;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(224, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 0;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// panel2
+			// 
+			this.panel2.Controls.Add(this.cmdSearch);
+			this.panel2.Controls.Add(this.txtSearch);
+			this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
+			this.panel2.Location = new System.Drawing.Point(0, 0);
+			this.panel2.Name = "panel2";
+			this.panel2.Size = new System.Drawing.Size(384, 40);
+			this.panel2.TabIndex = 5;
+			// 
+			// cmdSearch
+			// 
+			this.cmdSearch.Location = new System.Drawing.Point(288, 8);
+			this.cmdSearch.Name = "cmdSearch";
+			this.cmdSearch.Size = new System.Drawing.Size(80, 24);
+			this.cmdSearch.TabIndex = 5;
+			this.cmdSearch.Text = "Search";
+			this.cmdSearch.Click += new System.EventHandler(this.cmdSearch_Click);
+			// 
+			// txtSearch
+			// 
+			this.txtSearch.Location = new System.Drawing.Point(16, 8);
+			this.txtSearch.Name = "txtSearch";
+			this.txtSearch.Size = new System.Drawing.Size(216, 20);
+			this.txtSearch.TabIndex = 4;
+			this.txtSearch.Text = "";
+			this.txtSearch.TextChanged += new System.EventHandler(this.txtSearch_TextChanged);
+			// 
+			// panel3
+			// 
+			this.panel3.Controls.Add(this.lvwPatients);
+			this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.panel3.Location = new System.Drawing.Point(0, 40);
+			this.panel3.Name = "panel3";
+			this.panel3.Size = new System.Drawing.Size(384, 198);
+			this.panel3.TabIndex = 6;
+			// 
+			// lvwPatients
+			// 
+			this.lvwPatients.AllowColumnReorder = true;
+			this.lvwPatients.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lvwPatients.FullRowSelect = true;
+			this.lvwPatients.GridLines = true;
+			this.lvwPatients.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
+			this.lvwPatients.Location = new System.Drawing.Point(0, 0);
+			this.lvwPatients.MultiSelect = false;
+			this.lvwPatients.Name = "lvwPatients";
+			this.lvwPatients.Size = new System.Drawing.Size(384, 198);
+			this.lvwPatients.Sorting = System.Windows.Forms.SortOrder.Ascending;
+			this.lvwPatients.TabIndex = 5;
+			this.lvwPatients.View = System.Windows.Forms.View.Details;
+			this.lvwPatients.ItemActivate += new System.EventHandler(this.lvwPatients_ItemActivate);
+			// 
+			// DPatientLookup
+			// 
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(384, 278);
+			this.Controls.Add(this.panel3);
+			this.Controls.Add(this.panel2);
+			this.Controls.Add(this.panel1);
+			this.Name = "DPatientLookup";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "Select Patient";
+			this.Load += new System.EventHandler(this.DPatientLookup_Load);
+			this.Activated += new System.EventHandler(this.DPatientLookup_Activated);
+			this.panel1.ResumeLayout(false);
+			this.panel2.ResumeLayout(false);
+			this.panel3.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		#region Fields
+
+		private string				m_sPatientName;
+		private	DataTable			m_rsPatients;
+		private CGDocumentManager	m_DocManager;
+		private int					m_nMax;
+		private string				m_sPatientHRN = "";
+		private string				m_sPatientIEN;
+		private string				m_sPatientDOB;
+		private string				m_sPatientSSN;
+
+		#endregion //Fields
+
+		#region Methods
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			if (this.txtSearch.Text == "")
+			{
+				this.DialogResult = DialogResult.Cancel;
+				return;
+			}
+			m_sPatientName = this.txtSearch.Text;
+
+			//Update spacebar lookup value
+			string sSql;
+			sSql = "BSDX SPACEBAR SET^AUPNPAT(^" + m_sPatientIEN;
+			DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "SpaceBarValue");
+			return;
+		}
+
+		private void cmdSearch_Click(object sender, System.EventArgs e)
+		{
+			try
+			{
+				string sSearch = txtSearch.Text;
+				if (sSearch == "")
+					return;
+				this.lvwPatients.Clear();
+				m_rsPatients = this.GetPatientLookupRS(sSearch, m_nMax);
+
+				if (m_rsPatients.Rows.Count == 0)
+				{
+					MessageBox.Show("No matching Patients Found.");
+					this.txtSearch.Focus();
+					return;
+				}
+			
+				if (m_rsPatients.Rows.Count == 1)
+				{
+					DataRow r = m_rsPatients.Rows[0];
+					this.m_sPatientName = r["NAME"].ToString();
+					txtSearch.Text = this.m_sPatientName;
+					this.m_sPatientHRN = r["HRN"].ToString();
+					this.m_sPatientIEN = r["IEN"].ToString();
+					this.m_sPatientSSN = r["SSN"].ToString();
+					this.cmdOK.Enabled = true;
+					this.AcceptButton = cmdOK;
+					this.cmdOK.Focus();
+				}
+				lvwPatients.View = View.Details;
+
+				foreach (DataRow r in m_rsPatients.Rows)
+				{
+					string sPat = r["NAME"].ToString();
+					ListViewItem lv = new ListViewItem(sPat);
+					lv.SubItems.Add(r["HRN"].ToString());
+					lv.SubItems.Add(r["SSN"].ToString());
+					DateTime d = Convert.ToDateTime(r["DOB"]);
+					string sFormat = "MM/dd/yyyy";
+					string sDob = d.ToString(sFormat);
+					lv.SubItems.Add(sDob);
+					lv.SubItems.Add((r["IEN"].ToString()));
+					lvwPatients.Items.Add(lv);
+				}
+
+				lvwPatients.View = View.Details;
+				int w =-1;
+				lvwPatients.Columns.Add("Name", w, HorizontalAlignment.Left);
+				lvwPatients.Columns.Add("HRN", w, HorizontalAlignment.Left);
+				lvwPatients.Columns.Add("SSN", w, HorizontalAlignment.Left);
+				lvwPatients.Columns.Add("DOB",w, HorizontalAlignment.Left);
+
+				lvwPatients.Columns[0].Width = -1;
+				lvwPatients.Columns[1].Width = -1;
+				lvwPatients.Columns[2].Width = -1;
+				lvwPatients.Columns[3].Width = -1;
+				lvwPatients.Select();
+				lvwPatients.Items[0].Selected = true;
+				lvwPatients.Focus();			
+			}
+			catch (Exception ex)
+			{
+				MessageBox.Show(this, ex.Message, "Clinical Scheduling", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+			}
+		}
+
+		private DataTable GetPatientLookupRS(string sLookup, int nMax)
+		{
+			string sSql;
+			sSql = "BSDXPatientLookupRS^" + sLookup + "^" + nMax.ToString();
+			System.Data.DataTable tb = m_DocManager.RPMSDataTable(sSql, "PatientTable");
+			return tb;
+
+		}
+
+		private void lvwPatients_Click(object sender, System.EventArgs e)
+		{
+		
+		}
+
+		private void lvwPatients_ItemActivate(object sender, System.EventArgs e)
+		{
+			ListViewItem v = lvwPatients.SelectedItems[0]; //only one can be selected
+			m_sPatientName = v.SubItems[0].Text;
+			m_sPatientIEN = v.SubItems[4].Text;
+			m_sPatientHRN = v.SubItems[1].Text;
+			m_sPatientDOB = v.SubItems[3].Text;
+			m_sPatientSSN = v.SubItems[2].Text;
+			this.txtSearch.Text = m_sPatientName;
+			this.cmdOK.Enabled = true;
+			this.cmdOK.Focus();
+		}
+
+		private void txtSearch_TextChanged(object sender, System.EventArgs e)
+		{
+			this.cmdOK.Enabled = false;
+			this.AcceptButton = cmdSearch;
+		}
+
+		private void DPatientLookup_Load(object sender, System.EventArgs e)
+		{
+		}
+
+		private void DPatientLookup_Activated(object sender, System.EventArgs e)
+		{
+			System.IntPtr pHandle = this.Handle;
+			this.cmdOK.Enabled = false;
+			this.txtSearch.Focus();			
+		
+		}
+
+		#endregion //Methods
+
+		#region Properties
+
+		/// <summary>
+		/// Gets or sets the name of the selected patient
+		/// </summary>
+		public string PatientName
+		{
+			get
+			{
+				return m_sPatientName;
+			}
+			set
+			{
+				m_sPatientName = value;
+			}
+		}
+
+		public CGDocumentManager DocManager
+		{
+			get
+			{
+				return m_DocManager;
+			}
+			set
+			{
+				m_DocManager = value;
+			}
+		}
+
+		/// <summary>
+		/// RPMS Internal Entry Number in PATIENT file (DFN)
+		/// </summary>
+		public string PatientIEN
+		{
+			get
+			{
+				return this.m_sPatientIEN;
+			}
+		}
+
+		/// <summary>
+		/// The string representation of the Health Record Number
+		/// </summary>
+		public string HealthRecordNumber
+		{
+			get
+			{
+				return m_sPatientHRN;
+			}
+			set
+			{
+				m_sPatientHRN = value;
+			}
+		}
+
+		#endregion //Properties
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DPatientLookup.resx
===================================================================
--- Scheduling/branches/GUI1.2/DPatientLookup.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DPatientLookup.resx	(revision 855)
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="panel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panel1.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panel1.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panel1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panel2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panel2.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panel2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panel2.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panel2.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panel2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdSearch.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdSearch.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdSearch.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtSearch.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtSearch.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtSearch.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panel3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="panel3.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panel3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="panel3.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="panel3.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="panel3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lvwPatients.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lvwPatients.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lvwPatients.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Name">
+    <value>DPatientLookup</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DResource.cs
===================================================================
--- Scheduling/branches/GUI1.2/DResource.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DResource.cs	(revision 855)
@@ -0,0 +1,815 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+//using System.Data.OleDb;
+using IndianHealthService.BMXNet;
+using System.Diagnostics;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DResource.
+	/// </summary>
+	public class DResource : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Panel pnlDescription;
+		private System.Windows.Forms.GroupBox grpDescription;
+		private System.Windows.Forms.Label lblDescription;
+		private System.Windows.Forms.CheckBox chkInactivate;
+		private System.Windows.Forms.GroupBox grpRPMSClinicLink;
+		private System.Windows.Forms.Label lblReactivateDate;
+		private System.Windows.Forms.Label label10;
+		private System.Windows.Forms.Label lblInactivateDate;
+		private System.Windows.Forms.Label label8;
+		private System.Windows.Forms.Label lblClinicCode;
+		private System.Windows.Forms.Label label6;
+		private System.Windows.Forms.Label lblProvider;
+		private System.Windows.Forms.Label label7;
+		private System.Windows.Forms.Label lblVisitServiceCategory;
+		private System.Windows.Forms.Label label3;
+		private System.Windows.Forms.Label lblCreateVisit;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.Label label4;
+		private System.Windows.Forms.ComboBox cboRPMSClinic;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.TextBox txtResourceName;
+		private System.Windows.Forms.TabControl tabResources;
+		private System.Windows.Forms.TabPage tpRPMSLink;
+		private System.Windows.Forms.ComboBox cboTimeInterval;
+		private System.Windows.Forms.Label label5;
+		private System.Windows.Forms.TabPage tpLetter;
+		private System.Windows.Forms.TextBox txtLetter;
+		private System.Windows.Forms.Label label9;
+		private System.Windows.Forms.Label label11;
+		private System.Windows.Forms.Panel pnlOkCancel;
+		private System.Windows.Forms.TabPage tpRebookLetter;
+		private System.Windows.Forms.TabPage tpCancellationLetter;
+		private System.Windows.Forms.Label label12;
+		private System.Windows.Forms.Label label13;
+		private System.Windows.Forms.TextBox txtRebookLetter;
+		private System.Windows.Forms.TextBox txtCancellationLetter;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DResource()
+		{
+			InitializeComponent();
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.pnlOkCancel = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.pnlDescription = new System.Windows.Forms.Panel();
+			this.grpDescription = new System.Windows.Forms.GroupBox();
+			this.lblDescription = new System.Windows.Forms.Label();
+			this.tabResources = new System.Windows.Forms.TabControl();
+			this.tpRPMSLink = new System.Windows.Forms.TabPage();
+			this.label11 = new System.Windows.Forms.Label();
+			this.label5 = new System.Windows.Forms.Label();
+			this.cboTimeInterval = new System.Windows.Forms.ComboBox();
+			this.chkInactivate = new System.Windows.Forms.CheckBox();
+			this.grpRPMSClinicLink = new System.Windows.Forms.GroupBox();
+			this.lblReactivateDate = new System.Windows.Forms.Label();
+			this.label10 = new System.Windows.Forms.Label();
+			this.lblInactivateDate = new System.Windows.Forms.Label();
+			this.label8 = new System.Windows.Forms.Label();
+			this.lblClinicCode = new System.Windows.Forms.Label();
+			this.label6 = new System.Windows.Forms.Label();
+			this.lblProvider = new System.Windows.Forms.Label();
+			this.label7 = new System.Windows.Forms.Label();
+			this.lblVisitServiceCategory = new System.Windows.Forms.Label();
+			this.label3 = new System.Windows.Forms.Label();
+			this.lblCreateVisit = new System.Windows.Forms.Label();
+			this.label2 = new System.Windows.Forms.Label();
+			this.label4 = new System.Windows.Forms.Label();
+			this.cboRPMSClinic = new System.Windows.Forms.ComboBox();
+			this.label1 = new System.Windows.Forms.Label();
+			this.txtResourceName = new System.Windows.Forms.TextBox();
+			this.tpLetter = new System.Windows.Forms.TabPage();
+			this.label9 = new System.Windows.Forms.Label();
+			this.txtLetter = new System.Windows.Forms.TextBox();
+			this.tpRebookLetter = new System.Windows.Forms.TabPage();
+			this.label12 = new System.Windows.Forms.Label();
+			this.txtRebookLetter = new System.Windows.Forms.TextBox();
+			this.tpCancellationLetter = new System.Windows.Forms.TabPage();
+			this.label13 = new System.Windows.Forms.Label();
+			this.txtCancellationLetter = new System.Windows.Forms.TextBox();
+			this.pnlOkCancel.SuspendLayout();
+			this.pnlDescription.SuspendLayout();
+			this.grpDescription.SuspendLayout();
+			this.tabResources.SuspendLayout();
+			this.tpRPMSLink.SuspendLayout();
+			this.grpRPMSClinicLink.SuspendLayout();
+			this.tpLetter.SuspendLayout();
+			this.tpRebookLetter.SuspendLayout();
+			this.tpCancellationLetter.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// pnlOkCancel
+			// 
+			this.pnlOkCancel.Controls.Add(this.cmdCancel);
+			this.pnlOkCancel.Controls.Add(this.cmdOK);
+			this.pnlOkCancel.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlOkCancel.Location = new System.Drawing.Point(0, 424);
+			this.pnlOkCancel.Name = "pnlOkCancel";
+			this.pnlOkCancel.Size = new System.Drawing.Size(498, 40);
+			this.pnlOkCancel.TabIndex = 3;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(416, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(64, 24);
+			this.cmdCancel.TabIndex = 25;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(336, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 20;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// pnlDescription
+			// 
+			this.pnlDescription.Controls.Add(this.grpDescription);
+			this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlDescription.Location = new System.Drawing.Point(0, 344);
+			this.pnlDescription.Name = "pnlDescription";
+			this.pnlDescription.Size = new System.Drawing.Size(498, 80);
+			this.pnlDescription.TabIndex = 46;
+			// 
+			// grpDescription
+			// 
+			this.grpDescription.Controls.Add(this.lblDescription);
+			this.grpDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.grpDescription.Location = new System.Drawing.Point(0, 0);
+			this.grpDescription.Name = "grpDescription";
+			this.grpDescription.Size = new System.Drawing.Size(498, 80);
+			this.grpDescription.TabIndex = 0;
+			this.grpDescription.TabStop = false;
+			this.grpDescription.Text = "Description";
+			// 
+			// lblDescription
+			// 
+			this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lblDescription.Location = new System.Drawing.Point(3, 16);
+			this.lblDescription.Name = "lblDescription";
+			this.lblDescription.Size = new System.Drawing.Size(492, 61);
+			this.lblDescription.TabIndex = 1;
+			this.lblDescription.Text = @"Resources may optionally be linked to a VistA Clinic.  To define the parameters for an VistA clinic, you must log into VistA and use the VistA Scheduling Supervisor's menus.  The Time Interval field controls the increment of time used on the Calendar display.  The Letter Text tab contains the body text of reminder letters for this clinic.";
+			// 
+			// tabResources
+			// 
+			this.tabResources.Controls.Add(this.tpRPMSLink);
+			this.tabResources.Controls.Add(this.tpLetter);
+			this.tabResources.Controls.Add(this.tpRebookLetter);
+			this.tabResources.Controls.Add(this.tpCancellationLetter);
+			this.tabResources.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.tabResources.Location = new System.Drawing.Point(0, 0);
+			this.tabResources.Name = "tabResources";
+			this.tabResources.SelectedIndex = 0;
+			this.tabResources.Size = new System.Drawing.Size(498, 344);
+			this.tabResources.TabIndex = 10;
+			this.tabResources.SelectedIndexChanged += new System.EventHandler(this.tabResources_SelectedIndexChanged);
+			// 
+			// tpRPMSLink
+			// 
+			this.tpRPMSLink.Controls.Add(this.label11);
+			this.tpRPMSLink.Controls.Add(this.label5);
+			this.tpRPMSLink.Controls.Add(this.cboTimeInterval);
+			this.tpRPMSLink.Controls.Add(this.chkInactivate);
+			this.tpRPMSLink.Controls.Add(this.grpRPMSClinicLink);
+			this.tpRPMSLink.Controls.Add(this.label1);
+			this.tpRPMSLink.Controls.Add(this.txtResourceName);
+			this.tpRPMSLink.Location = new System.Drawing.Point(4, 22);
+			this.tpRPMSLink.Name = "tpRPMSLink";
+			this.tpRPMSLink.Size = new System.Drawing.Size(490, 318);
+			this.tpRPMSLink.TabIndex = 0;
+			this.tpRPMSLink.Text = "Resource Link";
+			// 
+			// label11
+			// 
+			this.label11.Location = new System.Drawing.Point(328, 40);
+			this.label11.Name = "label11";
+			this.label11.Size = new System.Drawing.Size(80, 16);
+			this.label11.TabIndex = 52;
+			this.label11.Text = "minutes.";
+			// 
+			// label5
+			// 
+			this.label5.Location = new System.Drawing.Point(192, 40);
+			this.label5.Name = "label5";
+			this.label5.Size = new System.Drawing.Size(64, 16);
+			this.label5.TabIndex = 51;
+			this.label5.Text = "Time Scale:";
+			// 
+			// cboTimeInterval
+			// 
+			this.cboTimeInterval.Items.AddRange(new object[] {
+																 "5",
+																 "10",
+																 "15",
+																 "20",
+																 "30",
+																 "60"});
+			this.cboTimeInterval.Location = new System.Drawing.Point(256, 38);
+			this.cboTimeInterval.MaxDropDownItems = 6;
+			this.cboTimeInterval.Name = "cboTimeInterval";
+			this.cboTimeInterval.Size = new System.Drawing.Size(64, 21);
+			this.cboTimeInterval.TabIndex = 10;
+			// 
+			// chkInactivate
+			// 
+			this.chkInactivate.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
+			this.chkInactivate.Location = new System.Drawing.Point(80, 40);
+			this.chkInactivate.Name = "chkInactivate";
+			this.chkInactivate.Size = new System.Drawing.Size(72, 16);
+			this.chkInactivate.TabIndex = 5;
+			this.chkInactivate.Text = "Inactive:";
+			// 
+			// grpRPMSClinicLink
+			// 
+			this.grpRPMSClinicLink.Controls.Add(this.lblReactivateDate);
+			this.grpRPMSClinicLink.Controls.Add(this.label10);
+			this.grpRPMSClinicLink.Controls.Add(this.lblInactivateDate);
+			this.grpRPMSClinicLink.Controls.Add(this.label8);
+			this.grpRPMSClinicLink.Controls.Add(this.lblClinicCode);
+			this.grpRPMSClinicLink.Controls.Add(this.label6);
+			this.grpRPMSClinicLink.Controls.Add(this.lblProvider);
+			this.grpRPMSClinicLink.Controls.Add(this.label7);
+			this.grpRPMSClinicLink.Controls.Add(this.lblVisitServiceCategory);
+			this.grpRPMSClinicLink.Controls.Add(this.label3);
+			this.grpRPMSClinicLink.Controls.Add(this.lblCreateVisit);
+			this.grpRPMSClinicLink.Controls.Add(this.label2);
+			this.grpRPMSClinicLink.Controls.Add(this.label4);
+			this.grpRPMSClinicLink.Controls.Add(this.cboRPMSClinic);
+			this.grpRPMSClinicLink.Location = new System.Drawing.Point(32, 88);
+			this.grpRPMSClinicLink.Name = "grpRPMSClinicLink";
+			this.grpRPMSClinicLink.Size = new System.Drawing.Size(384, 208);
+			this.grpRPMSClinicLink.TabIndex = 48;
+			this.grpRPMSClinicLink.TabStop = false;
+			this.grpRPMSClinicLink.Text = "VistA Clinic Link";
+			// 
+			// lblReactivateDate
+			// 
+			this.lblReactivateDate.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+			this.lblReactivateDate.Location = new System.Drawing.Point(176, 168);
+			this.lblReactivateDate.Name = "lblReactivateDate";
+			this.lblReactivateDate.Size = new System.Drawing.Size(176, 16);
+			this.lblReactivateDate.TabIndex = 57;
+			// 
+			// label10
+			// 
+			this.label10.Location = new System.Drawing.Point(56, 168);
+			this.label10.Name = "label10";
+			this.label10.Size = new System.Drawing.Size(112, 16);
+			this.label10.TabIndex = 56;
+			this.label10.Text = "Reactivate Date:";
+			this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// lblInactivateDate
+			// 
+			this.lblInactivateDate.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+			this.lblInactivateDate.Location = new System.Drawing.Point(176, 144);
+			this.lblInactivateDate.Name = "lblInactivateDate";
+			this.lblInactivateDate.Size = new System.Drawing.Size(176, 16);
+			this.lblInactivateDate.TabIndex = 55;
+			// 
+			// label8
+			// 
+			this.label8.Location = new System.Drawing.Point(48, 144);
+			this.label8.Name = "label8";
+			this.label8.Size = new System.Drawing.Size(120, 16);
+			this.label8.TabIndex = 54;
+			this.label8.Text = "Inactivate Date:";
+			this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// lblClinicCode
+			// 
+			this.lblClinicCode.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+			this.lblClinicCode.Location = new System.Drawing.Point(176, 120);
+			this.lblClinicCode.Name = "lblClinicCode";
+			this.lblClinicCode.Size = new System.Drawing.Size(176, 16);
+			this.lblClinicCode.TabIndex = 53;
+			// 
+			// label6
+			// 
+			this.label6.Location = new System.Drawing.Point(96, 120);
+			this.label6.Name = "label6";
+			this.label6.Size = new System.Drawing.Size(72, 16);
+			this.label6.TabIndex = 52;
+			this.label6.Text = "Clinic Code:";
+			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// lblProvider
+			// 
+			this.lblProvider.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+			this.lblProvider.Location = new System.Drawing.Point(176, 96);
+			this.lblProvider.Name = "lblProvider";
+			this.lblProvider.Size = new System.Drawing.Size(176, 16);
+			this.lblProvider.TabIndex = 51;
+			// 
+			// label7
+			// 
+			this.label7.Location = new System.Drawing.Point(104, 96);
+			this.label7.Name = "label7";
+			this.label7.Size = new System.Drawing.Size(64, 16);
+			this.label7.TabIndex = 50;
+			this.label7.Text = "Provider:";
+			this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// lblVisitServiceCategory
+			// 
+			this.lblVisitServiceCategory.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+			this.lblVisitServiceCategory.Location = new System.Drawing.Point(176, 72);
+			this.lblVisitServiceCategory.Name = "lblVisitServiceCategory";
+			this.lblVisitServiceCategory.Size = new System.Drawing.Size(176, 16);
+			this.lblVisitServiceCategory.TabIndex = 49;
+			// 
+			// label3
+			// 
+			this.label3.Location = new System.Drawing.Point(48, 72);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(120, 16);
+			this.label3.TabIndex = 48;
+			this.label3.Text = "Visit Sevice Category:";
+			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// lblCreateVisit
+			// 
+			this.lblCreateVisit.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+			this.lblCreateVisit.Location = new System.Drawing.Point(176, 48);
+			this.lblCreateVisit.Name = "lblCreateVisit";
+			this.lblCreateVisit.Size = new System.Drawing.Size(40, 16);
+			this.lblCreateVisit.TabIndex = 47;
+			// 
+			// label2
+			// 
+			this.label2.Location = new System.Drawing.Point(32, 48);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(136, 16);
+			this.label2.TabIndex = 46;
+			this.label2.Text = "Create Visit at Check-In?";
+			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// label4
+			// 
+			this.label4.Location = new System.Drawing.Point(32, 18);
+			this.label4.Name = "label4";
+			this.label4.Size = new System.Drawing.Size(72, 16);
+			this.label4.TabIndex = 45;
+			this.label4.Text = "VistA Clinic:";
+			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// cboRPMSClinic
+			// 
+			this.cboRPMSClinic.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+			this.cboRPMSClinic.Location = new System.Drawing.Point(112, 16);
+			this.cboRPMSClinic.Name = "cboRPMSClinic";
+			this.cboRPMSClinic.Size = new System.Drawing.Size(256, 21);
+			this.cboRPMSClinic.TabIndex = 15;
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(36, 11);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(96, 16);
+			this.label1.TabIndex = 47;
+			this.label1.Text = "Resource Name:";
+			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// txtResourceName
+			// 
+			this.txtResourceName.Location = new System.Drawing.Point(140, 11);
+			this.txtResourceName.MaxLength = 30;
+			this.txtResourceName.Name = "txtResourceName";
+			this.txtResourceName.Size = new System.Drawing.Size(256, 20);
+			this.txtResourceName.TabIndex = 0;
+			this.txtResourceName.Text = "";
+			// 
+			// tpLetter
+			// 
+			this.tpLetter.Controls.Add(this.label9);
+			this.tpLetter.Controls.Add(this.txtLetter);
+			this.tpLetter.Location = new System.Drawing.Point(4, 22);
+			this.tpLetter.Name = "tpLetter";
+			this.tpLetter.Size = new System.Drawing.Size(490, 318);
+			this.tpLetter.TabIndex = 1;
+			this.tpLetter.Text = "Reminder Letter";
+			// 
+			// label9
+			// 
+			this.label9.Location = new System.Drawing.Point(32, 24);
+			this.label9.Name = "label9";
+			this.label9.Size = new System.Drawing.Size(416, 32);
+			this.label9.TabIndex = 1;
+			this.label9.Text = "Enter the text which will appear on reminder letters sent to patients with appoin" +
+				"tments in this clinic.  Use CTRL+Enter to start a new line.";
+			// 
+			// txtLetter
+			// 
+			this.txtLetter.Location = new System.Drawing.Point(32, 72);
+			this.txtLetter.Multiline = true;
+			this.txtLetter.Name = "txtLetter";
+			this.txtLetter.Size = new System.Drawing.Size(416, 216);
+			this.txtLetter.TabIndex = 20;
+			this.txtLetter.Text = "Dear Patient,\r\n\r\nThis letter is to remind you that you have the appointments list" +
+				"ed below.\r\n\r\nPlease contact us at 555-1234 if you are unable to keep this appoin" +
+				"tment.\r\n\r\nThank you,\r\n\r\nThe Clinic";
+			// 
+			// tpRebookLetter
+			// 
+			this.tpRebookLetter.Controls.Add(this.label12);
+			this.tpRebookLetter.Controls.Add(this.txtRebookLetter);
+			this.tpRebookLetter.Location = new System.Drawing.Point(4, 22);
+			this.tpRebookLetter.Name = "tpRebookLetter";
+			this.tpRebookLetter.Size = new System.Drawing.Size(490, 318);
+			this.tpRebookLetter.TabIndex = 2;
+			this.tpRebookLetter.Text = "Rebook Letter";
+			// 
+			// label12
+			// 
+			this.label12.Location = new System.Drawing.Point(37, 27);
+			this.label12.Name = "label12";
+			this.label12.Size = new System.Drawing.Size(416, 32);
+			this.label12.TabIndex = 21;
+			this.label12.Text = "Enter the text which will appear on rebook letters sent to patients with appointm" +
+				"ents in this clinic.  Use CTRL+Enter to start a new line.";
+			// 
+			// txtRebookLetter
+			// 
+			this.txtRebookLetter.Location = new System.Drawing.Point(37, 75);
+			this.txtRebookLetter.Multiline = true;
+			this.txtRebookLetter.Name = "txtRebookLetter";
+			this.txtRebookLetter.Size = new System.Drawing.Size(416, 216);
+			this.txtRebookLetter.TabIndex = 22;
+			this.txtRebookLetter.Text = "Dear Patient,\r\n\r\nThis letter is to inform you that we have changed the appointmen" +
+				"ts listed below.\r\n\r\nPlease contact us at 555-1234 if you are unable to keep your" +
+				" appointment.\r\n\r\nThank you,\r\n\r\nThe Clinic";
+			// 
+			// tpCancellationLetter
+			// 
+			this.tpCancellationLetter.Controls.Add(this.label13);
+			this.tpCancellationLetter.Controls.Add(this.txtCancellationLetter);
+			this.tpCancellationLetter.Location = new System.Drawing.Point(4, 22);
+			this.tpCancellationLetter.Name = "tpCancellationLetter";
+			this.tpCancellationLetter.Size = new System.Drawing.Size(490, 318);
+			this.tpCancellationLetter.TabIndex = 3;
+			this.tpCancellationLetter.Text = "Cancellation Letter";
+			// 
+			// label13
+			// 
+			this.label13.Location = new System.Drawing.Point(37, 27);
+			this.label13.Name = "label13";
+			this.label13.Size = new System.Drawing.Size(416, 32);
+			this.label13.TabIndex = 21;
+			this.label13.Text = "Enter the text which will appear on cancellation letters sent to patients with ap" +
+				"pointments in this clinic.  Use CTRL+Enter to start a new line.";
+			// 
+			// txtCancellationLetter
+			// 
+			this.txtCancellationLetter.Location = new System.Drawing.Point(37, 75);
+			this.txtCancellationLetter.Multiline = true;
+			this.txtCancellationLetter.Name = "txtCancellationLetter";
+			this.txtCancellationLetter.Size = new System.Drawing.Size(416, 216);
+			this.txtCancellationLetter.TabIndex = 22;
+			this.txtCancellationLetter.Text = "Dear Patient,\r\n\r\nThis letter is to inform you that the appointments listed below " +
+				"have been cancelled.\r\n\r\nPlease contact us at 555-1234 if you have questions abou" +
+				"t your appointments.\r\n\r\nThank you,\r\n\r\nThe Clinic";
+			// 
+			// DResource
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(498, 464);
+			this.Controls.Add(this.tabResources);
+			this.Controls.Add(this.pnlDescription);
+			this.Controls.Add(this.pnlOkCancel);
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DResource";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "Manage Resource";
+			this.Activated += new System.EventHandler(this.DResource_Activated);
+			this.pnlOkCancel.ResumeLayout(false);
+			this.pnlDescription.ResumeLayout(false);
+			this.grpDescription.ResumeLayout(false);
+			this.tabResources.ResumeLayout(false);
+			this.tpRPMSLink.ResumeLayout(false);
+			this.grpRPMSClinicLink.ResumeLayout(false);
+			this.tpLetter.ResumeLayout(false);
+			this.tpRebookLetter.ResumeLayout(false);
+			this.tpCancellationLetter.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		#region Fields
+
+		private DataTable			m_dtResources;
+		private CGResource			m_pResource;
+		private DataView			m_dvHospLoc;
+		private DataView			m_dvClinicParams;
+		
+		#endregion Fields
+
+		#region Methods
+
+		public void InitializePage(int nSelectedResourceID, DataSet dsGlobal)
+		{
+			m_dtResources = dsGlobal.Tables["Resources"];
+
+			//Datasource the HOSPITAL LOCATION combo box
+			DataTable dtHospLoc = dsGlobal.Tables["HospitalLocation"];
+			m_dvHospLoc = new DataView(dtHospLoc);
+			m_dvHospLoc.Sort = "HOSPITAL_LOCATION_ID ASC";
+			int nFind = m_dvHospLoc.Find((int) 0);
+			if (nFind < 0)
+			{
+				DataRowView drv = m_dvHospLoc.AddNew();
+				drv.BeginEdit();
+				drv["HOSPITAL_LOCATION"]="<None>";
+				drv["HOSPITAL_LOCATION_ID"]=0;
+				drv.EndEdit();
+			}
+
+//			DataTable dtClinicParams = dsGlobal.Tables["ClinicSetupParameters"];
+//			m_dvClinicParams = new DataView(dtClinicParams);
+//			m_dvClinicParams.Sort = "HOSPITAL_LOCATION_ID ASC";
+//			m_dvClinicParams.Sort = "HOSPITAL_LOCATION ASC";
+//			string sFind = "<None>";
+//			nFind = m_dvClinicParams.Find((int) 0);
+/*			nFind = m_dvClinicParams.Find((string) sFind);
+
+			if (nFind < 0)
+			{
+				DataRowView drv = m_dvClinicParams.AddNew();
+				drv.BeginEdit();
+				drv["HOSPITAL_LOCATION"]="<None>";
+				drv["HOSPITAL_LOCATION_ID"]="0";
+				drv["CREATE_VISIT"]="";
+				drv["VISIT_SERVICE_CATEGORY"]="";
+				drv.EndEdit();
+			}
+*/
+//smh       cboRPMSClinic.DataSource = m_dvClinicParams;
+            cboRPMSClinic.DataSource = m_dvHospLoc;
+			cboRPMSClinic.DisplayMember = "HOSPITAL_LOCATION";
+			cboRPMSClinic.ValueMember = "HOSPITAL_LOCATION_ID";
+//			cboRPMSClinic.SelectedItem = nFind;
+			cboRPMSClinic.SelectedIndex = nFind;
+
+			//Set databindings of the label boxes
+
+//smh		lblCreateVisit.DataBindings.Add("Text", m_dvClinicParams, "CREATE_VISIT");
+//smh   	lblClinicCode.DataBindings.Add("Text", m_dvClinicParams, "CLINIC_STOP");
+            lblClinicCode.DataBindings.Add("Text", m_dvHospLoc, "STOP_CODE_NUMBER"); //smh
+//smh		lblProvider.DataBindings.Add("Text", m_dvClinicParams, "PROVIDER");
+            lblProvider.DataBindings.Add("Text", m_dvHospLoc, "DEFAULT_PROVIDER"); //smh
+//smh		lblInactivateDate.DataBindings.Add("Text", m_dvClinicParams, "INACTIVATE_DATE");
+            lblInactivateDate.DataBindings.Add("Text", m_dvHospLoc, "INACTIVATE_DATE"); //smh
+//smh		lblReactivateDate.DataBindings.Add("Text", m_dvClinicParams, "REACTIVATE_DATE");
+            lblReactivateDate.DataBindings.Add("Text", m_dvHospLoc, "REACTIVATE_DATE"); //smh
+			//create new instance of Resource class
+			m_pResource = new CGResource();
+
+			if (nSelectedResourceID < 0) //then we're in ADD mode
+			{
+				this.Text = "Add New Scheduling Resource";
+				m_pResource.ResourceID = 0;
+				m_pResource.ResourceName = "";
+				m_pResource.Inactive = false;
+				m_pResource.HospitalLocationID = 0;
+				m_pResource.HospitalLocation = "";
+				m_pResource.TimeScale = 15;
+			}
+			else //we're in EDIT mode
+			{
+				this.Text = "Edit Scheduling Resource";
+//				DataRow dr = m_dtResources.Rows[nSelectedResourceID];
+
+				DataRow dr = m_dtResources.Rows.Find(nSelectedResourceID);
+				//TODO: test dr for validity
+
+				string sID = dr["RESOURCEID"].ToString();
+				sID = (sID == "")?"0":sID;
+				m_pResource.ResourceID = Convert.ToInt16(sID);
+				m_pResource.ResourceName = dr["RESOURCE_NAME"].ToString();
+
+				string sInactive = dr["INACTIVE"].ToString();
+				m_pResource.Inactive = (sInactive == "1")?true:false;
+
+				sID = dr["HOSPITAL_LOCATION_ID"].ToString();
+				sID = (sID == "")?"0":sID;
+				m_pResource.HospitalLocationID = Convert.ToInt16(sID);
+
+				if (dr["TIMESCALE"].ToString() != "")
+				{
+					m_pResource.TimeScale = (int) dr["TIMESCALE"];
+				}
+				m_pResource.LetterText = dr["LETTER_TEXT"].ToString();
+				m_pResource.NoShowLetterText = dr["NO_SHOW_LETTER"].ToString();
+				m_pResource.CancellationLetterText = dr["CLINIC_CANCELLATION_LETTER"].ToString();
+
+				dr = dsGlobal.Tables["HospitalLocation"].Rows.Find(m_pResource.HospitalLocationID);
+				//TODO: test dr validity
+				m_pResource.HospitalLocation = dr["HOSPITAL_LOCATION"].ToString();
+
+
+			}
+			UpdateDialogData(true);
+		}
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true)
+			{
+				txtResourceName.Text = m_pResource.ResourceName;
+				chkInactivate.Checked = m_pResource.Inactive;
+				cboRPMSClinic.SelectedValue = m_pResource.HospitalLocationID;
+				txtLetter.Text = m_pResource.LetterText;
+				txtRebookLetter.Text = m_pResource.NoShowLetterText;
+				txtCancellationLetter.Text = m_pResource.CancellationLetterText;
+				cboTimeInterval.Text = m_pResource.TimeScale.ToString();
+
+			}
+			else
+			{
+				m_pResource.ResourceName = this.txtResourceName.Text;
+				m_pResource.Inactive = this.chkInactivate.Checked;
+				m_pResource.HospitalLocationID  = Convert.ToInt16(this.cboRPMSClinic.SelectedValue);
+				m_pResource.LetterText = txtLetter.Text;
+				m_pResource.CancellationLetterText = txtCancellationLetter.Text;
+				m_pResource.NoShowLetterText = txtRebookLetter.Text;
+				if (cboTimeInterval.Text != "")
+					m_pResource.TimeScale = Convert.ToInt16(cboTimeInterval.Text);
+
+			}
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			this.UpdateDialogData(false);
+		}
+
+		private void tabResources_SelectedIndexChanged(object sender, System.EventArgs e)
+		{
+			if (tabResources.SelectedIndex == 0)
+			{
+				txtResourceName.Focus();
+			}
+			else
+			{
+				txtLetter.Focus();
+			}
+		}
+
+		private void DResource_Activated(object sender, System.EventArgs e)
+		{
+			txtResourceName.Focus();	
+		}
+		
+		#endregion Methods
+
+		#region Properties
+		public bool Inactive
+		{
+			get
+			{
+				return m_pResource.Inactive;
+			}
+			set
+			{
+				m_pResource.Inactive = value;
+			}
+		}
+
+		public int HospitalLocationID
+		{
+			get
+			{
+				return m_pResource.HospitalLocationID;
+			}
+			set
+			{
+				m_pResource.HospitalLocationID = value;
+			}
+		}
+
+		public string ResourceName
+		{
+			get
+			{
+				return m_pResource.ResourceName;
+			}
+			set
+			{
+				m_pResource.ResourceName = value;
+			}
+		}
+
+		public string LetterText
+		{
+			get
+			{
+				return m_pResource.LetterText;
+			}
+			set
+			{
+				m_pResource.LetterText = value;
+			}
+		}
+
+		public string NoShowLetterText
+		{
+			get
+			{
+				return m_pResource.NoShowLetterText;
+			}
+			set
+			{
+				m_pResource.NoShowLetterText = value;
+			}
+		}
+
+		public string CancellationLetterText
+		{
+			get
+			{
+				return m_pResource.CancellationLetterText;
+			}
+			set
+			{
+				m_pResource.CancellationLetterText = value;
+			}
+		}
+
+		public int ResourceID
+		{
+			get
+			{
+				return m_pResource.ResourceID;
+			}
+			set
+			{
+				m_pResource.ResourceID = value;
+			}
+		}
+
+		public int TimeScale
+		{
+			get
+			{
+				return m_pResource.TimeScale;
+			}
+			set
+			{
+				m_pResource.TimeScale = value;
+			}
+		}
+
+		#endregion Properties
+
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DResource.resx
===================================================================
--- Scheduling/branches/GUI1.2/DResource.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DResource.resx	(revision 855)
@@ -0,0 +1,553 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="pnlOkCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlOkCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlOkCancel.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlOkCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlOkCancel.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlOkCancel.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tabResources.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="tabResources.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="tabResources.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="tabResources.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tabResources.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tabResources.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="tpRPMSLink.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="tpRPMSLink.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="tpRPMSLink.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="tpRPMSLink.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpRPMSLink.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpRPMSLink.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="label11.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label11.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label11.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label5.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label5.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label5.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cboTimeInterval.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cboTimeInterval.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cboTimeInterval.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkInactivate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkInactivate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkInactivate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpRPMSClinicLink.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpRPMSClinicLink.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpRPMSClinicLink.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpRPMSClinicLink.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpRPMSClinicLink.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpRPMSClinicLink.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblReactivateDate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblReactivateDate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblReactivateDate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label10.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label10.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label10.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblInactivateDate.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblInactivateDate.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblInactivateDate.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label8.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label8.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label8.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblClinicCode.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblClinicCode.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblClinicCode.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label6.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label6.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label6.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblProvider.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblProvider.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblProvider.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label7.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label7.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label7.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblVisitServiceCategory.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblVisitServiceCategory.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblVisitServiceCategory.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblCreateVisit.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblCreateVisit.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblCreateVisit.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label4.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cboRPMSClinic.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cboRPMSClinic.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cboRPMSClinic.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtResourceName.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtResourceName.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtResourceName.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpLetter.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="tpLetter.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="tpLetter.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="tpLetter.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpLetter.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpLetter.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="label9.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label9.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label9.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtLetter.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtLetter.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtLetter.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpRebookLetter.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="tpRebookLetter.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="tpRebookLetter.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="tpRebookLetter.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpRebookLetter.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpRebookLetter.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="label12.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label12.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label12.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtRebookLetter.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtRebookLetter.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtRebookLetter.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpCancellationLetter.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="tpCancellationLetter.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="tpCancellationLetter.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="tpCancellationLetter.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpCancellationLetter.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="tpCancellationLetter.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="label13.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label13.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label13.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtCancellationLetter.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtCancellationLetter.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtCancellationLetter.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.Name">
+    <value>DResource</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DResourceGroup.cs
===================================================================
--- Scheduling/branches/GUI1.2/DResourceGroup.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DResourceGroup.cs	(revision 855)
@@ -0,0 +1,206 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+//using System.Data.OleDb;
+using IndianHealthService.BMXNet;
+using System.Diagnostics;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DResourceGroup.
+	/// </summary>
+	public class DResourceGroup : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel pnlPageBottom;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.TextBox txtResourceGroupName;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DResourceGroup()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+			m_sResourceGroupName = "";
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.pnlPageBottom = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.label1 = new System.Windows.Forms.Label();
+			this.txtResourceGroupName = new System.Windows.Forms.TextBox();
+			this.pnlPageBottom.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// pnlPageBottom
+			// 
+			this.pnlPageBottom.Controls.Add(this.cmdCancel);
+			this.pnlPageBottom.Controls.Add(this.cmdOK);
+			this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlPageBottom.Location = new System.Drawing.Point(0, 120);
+			this.pnlPageBottom.Name = "pnlPageBottom";
+			this.pnlPageBottom.Size = new System.Drawing.Size(472, 40);
+			this.pnlPageBottom.TabIndex = 6;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(376, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(56, 24);
+			this.cmdCancel.TabIndex = 2;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Enabled = false;
+			this.cmdOK.Location = new System.Drawing.Point(296, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 1;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(40, 48);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(136, 16);
+			this.label1.TabIndex = 7;
+			this.label1.Text = "Resource Group Name:";
+			// 
+			// txtResourceGroupName
+			// 
+			this.txtResourceGroupName.Location = new System.Drawing.Point(176, 48);
+			this.txtResourceGroupName.Name = "txtResourceGroupName";
+			this.txtResourceGroupName.Size = new System.Drawing.Size(256, 20);
+			this.txtResourceGroupName.TabIndex = 0;
+			this.txtResourceGroupName.Text = "";
+			this.txtResourceGroupName.TextChanged += new System.EventHandler(this.txtResourceGroupName_TextChanged);
+			// 
+			// DResourceGroup
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(472, 160);
+			this.Controls.Add(this.txtResourceGroupName);
+			this.Controls.Add(this.label1);
+			this.Controls.Add(this.pnlPageBottom);
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DResourceGroup";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "Add Resource Group";
+			this.pnlPageBottom.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		private string	m_sResourceGroupName;
+
+		public void InitializePage(int nSelectedRGID, DataSet dsGlobal)
+		{
+
+			if (nSelectedRGID < 0) //then we're in ADD mode
+			{
+				this.Text = "Add New Resource Group";
+				this.cmdOK.Enabled = false;
+			}
+			else //we're in EDIT mode
+			{
+				this.Text = "Edit Resource Group";
+			}
+			UpdateDialogData(true);
+		}
+
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true)
+			{
+				txtResourceGroupName.Text = m_sResourceGroupName;
+			}
+			else
+			{
+				m_sResourceGroupName = txtResourceGroupName.Text;
+			}
+		}
+
+		private void txtResourceGroupName_TextChanged(object sender, System.EventArgs e)
+		{
+			string sText = txtResourceGroupName.Text;
+			if ((sText.Length > 2) && (sText.Length < 30))
+			{
+				cmdOK.Enabled = true;
+			}
+			else
+			{
+				cmdOK.Enabled = false;
+			}
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			UpdateDialogData(false);
+		}
+
+		/// <summary>
+		/// Gets the name of the resource group
+		/// </summary>
+		public String ResourceGroupName
+		{
+			get
+			{
+				return m_sResourceGroupName;
+			}
+			set
+			{
+				m_sResourceGroupName = value;
+			}
+		}
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DResourceGroup.resx
===================================================================
--- Scheduling/branches/GUI1.2/DResourceGroup.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DResourceGroup.resx	(revision 855)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="pnlPageBottom.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlPageBottom.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlPageBottom.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlPageBottom.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtResourceGroupName.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtResourceGroupName.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtResourceGroupName.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.Name">
+    <value>DResourceGroup</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DResourceGroupItem.cs
===================================================================
--- Scheduling/branches/GUI1.2/DResourceGroupItem.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DResourceGroupItem.cs	(revision 855)
@@ -0,0 +1,219 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+//using System.Data.OleDb;
+using IndianHealthService.BMXNet;
+using System.Diagnostics;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DResourceGroup.
+	/// </summary>
+	public class DResourceGroupItem : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel pnlPageBottom;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.ComboBox cboResource;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DResourceGroupItem()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.pnlPageBottom = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.label1 = new System.Windows.Forms.Label();
+			this.cboResource = new System.Windows.Forms.ComboBox();
+			this.pnlPageBottom.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// pnlPageBottom
+			// 
+			this.pnlPageBottom.Controls.AddRange(new System.Windows.Forms.Control[] {
+																						this.cmdCancel,
+																						this.cmdOK});
+			this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlPageBottom.Location = new System.Drawing.Point(0, 112);
+			this.pnlPageBottom.Name = "pnlPageBottom";
+			this.pnlPageBottom.Size = new System.Drawing.Size(456, 40);
+			this.pnlPageBottom.TabIndex = 5;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(376, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(56, 24);
+			this.cmdCancel.TabIndex = 2;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(296, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 1;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(40, 40);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(96, 16);
+			this.label1.TabIndex = 8;
+			this.label1.Text = "Select Resource:";
+			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// cboResource
+			// 
+			this.cboResource.Location = new System.Drawing.Point(144, 40);
+			this.cboResource.Name = "cboResource";
+			this.cboResource.Size = new System.Drawing.Size(248, 21);
+			this.cboResource.TabIndex = 7;
+			this.cboResource.Text = "cboResource";
+			// 
+			// DResourceGroupItem
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(456, 152);
+			this.Controls.AddRange(new System.Windows.Forms.Control[] {
+																		  this.label1,
+																		  this.cboResource,
+																		  this.pnlPageBottom});
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "DResourceGroupItem";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "DResourceGroupItem";
+			this.pnlPageBottom.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		#region Fields
+		int		m_nResourceID;
+		string	m_sResourceName;
+//		DataSet	m_dtResource;
+
+		#endregion Fields
+
+
+		public void InitializePage(int nSelectedRID, DataSet dsGlobal)
+		{
+
+//			m_dtResource = dsGlobal.Tables["Resources"];
+
+			//Datasource the RESOURCE combo box
+			DataTable dtResource = dsGlobal.Tables["Resources"];
+			DataView dvResource = new DataView(dtResource);
+
+
+			cboResource.DataSource = dvResource;
+			cboResource.DisplayMember = "RESOURCE_NAME";
+			cboResource.ValueMember = "RESOURCEID";
+
+			if (nSelectedRID < 0) //then we're in ADD mode
+			{
+				this.Text = "Add New Resource to Group";
+				m_nResourceID = 0;
+				m_sResourceName = "";
+//				this.cmdOK.Enabled = false;
+			}
+			UpdateDialogData(true);
+		}
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true)
+			{
+				cboResource.SelectedValue = m_nResourceID;
+			}
+			else
+			{
+				m_nResourceID = Convert.ToInt16(cboResource.SelectedValue);
+			}
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			UpdateDialogData(false);
+		}
+
+
+		#region Properties
+
+
+		/// <summary>
+		/// Contains the IEN of the Resource in the BSDX_RESOURCE file
+		/// </summary>
+		public int ResourceID
+		{
+			get
+			{
+				return m_nResourceID;
+			}
+		}
+
+		/// <summary>
+		/// Contains the name of the Resource
+		/// </summary>
+		public string ResourceName
+		{
+			get
+			{
+				return m_sResourceName;
+			}
+		}
+		#endregion Properties
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DResourceGroupItem.resx
===================================================================
--- Scheduling/branches/GUI1.2/DResourceGroupItem.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DResourceGroupItem.resx	(revision 855)
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+            Microsoft ResX Schema 
+        
+            Version 1.3
+                
+            The primary goals of this format is to allow a simple XML format 
+            that is mostly human readable. The generation and parsing of the 
+            various data types are done through the TypeConverter classes 
+            associated with the data types.
+        
+            Example:
+        
+                ... ado.net/XML headers & schema ...
+                <resheader name="resmimetype">text/microsoft-resx</resheader>
+                <resheader name="version">1.3</resheader>
+                <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+                <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+                <data name="Name1">this is my long string</data>
+                <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+                <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+                    [base64 mime encoded serialized .NET Framework object]
+                </data>
+                <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+                    [base64 mime encoded string representing a byte array form of the .NET Framework object]
+                </data>
+        
+            There are any number of "resheader" rows that contain simple 
+            name/value pairs.
+            
+            Each data row contains a name, and value. The row also contains a 
+            type or mimetype. Type corresponds to a .NET class that support 
+            text/value conversion through the TypeConverter architecture. 
+            Classes that don't support this are serialized and stored with the 
+            mimetype set.
+                     
+            The mimetype is used for serialized objects, and tells the 
+            ResXResourceReader how to depersist the object. This is currently not 
+            extensible. For a given mimetype the value must be set accordingly:
+        
+            Note - application/x-microsoft.net.object.binary.base64 is the format 
+                   that the ResXResourceWriter will generate, however the reader can 
+                   read any of the formats listed below.
+        
+            mimetype: application/x-microsoft.net.object.binary.base64
+            value   : The object must be serialized with 
+                    : System.Serialization.Formatters.Binary.BinaryFormatter
+                    : and then encoded with base64 encoding.
+        
+            mimetype: application/x-microsoft.net.object.soap.base64
+            value   : The object must be serialized with 
+                    : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+                    : and then encoded with base64 encoding.
+            mimetype: application/x-microsoft.net.object.bytearray.base64
+            value   : The object must be serialized into a byte array 
+                    : using a System.ComponentModel.TypeConverter
+                    : and then encoded with base64 encoding.
+        -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="pnlPageBottom.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Name">
+    <value>DResourceGroupItem</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DResourceUser.cs
===================================================================
--- Scheduling/branches/GUI1.2/DResourceUser.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DResourceUser.cs	(revision 855)
@@ -0,0 +1,378 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+using IndianHealthService.BMXNet;
+using System.Diagnostics;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DResourceUser.
+	/// </summary>
+	public class DResourceUser : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.Panel pnlPageBottom;
+		private System.Windows.Forms.Panel pnlDescription;
+		private System.Windows.Forms.GroupBox grpDescriptionResourceGroup;
+		private System.Windows.Forms.Label lblDescriptionResourceGroup;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.ComboBox cboScheduleUser;
+		private System.Windows.Forms.CheckBox chkModifySchedule;
+		private System.Windows.Forms.CheckBox chkOverbook;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.CheckBox chkAppointments;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DResourceUser()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.cboScheduleUser = new System.Windows.Forms.ComboBox();
+			this.label1 = new System.Windows.Forms.Label();
+			this.pnlPageBottom = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.pnlDescription = new System.Windows.Forms.Panel();
+			this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
+			this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
+			this.chkModifySchedule = new System.Windows.Forms.CheckBox();
+			this.chkOverbook = new System.Windows.Forms.CheckBox();
+			this.chkAppointments = new System.Windows.Forms.CheckBox();
+			this.pnlPageBottom.SuspendLayout();
+			this.pnlDescription.SuspendLayout();
+			this.grpDescriptionResourceGroup.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// cboScheduleUser
+			// 
+			this.cboScheduleUser.Location = new System.Drawing.Point(144, 32);
+			this.cboScheduleUser.Name = "cboScheduleUser";
+			this.cboScheduleUser.Size = new System.Drawing.Size(248, 21);
+			this.cboScheduleUser.TabIndex = 0;
+			this.cboScheduleUser.Text = "cboScheduleUser";
+			this.cboScheduleUser.SelectedIndexChanged += new System.EventHandler(this.cboScheduleUser_SelectedIndexChanged);
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(16, 32);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(120, 16);
+			this.label1.TabIndex = 1;
+			this.label1.Text = "Select Resource User:";
+			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+			// 
+			// pnlPageBottom
+			// 
+			this.pnlPageBottom.Controls.Add(this.cmdCancel);
+			this.pnlPageBottom.Controls.Add(this.cmdOK);
+			this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlPageBottom.Location = new System.Drawing.Point(0, 254);
+			this.pnlPageBottom.Name = "pnlPageBottom";
+			this.pnlPageBottom.Size = new System.Drawing.Size(448, 40);
+			this.pnlPageBottom.TabIndex = 4;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(376, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(56, 24);
+			this.cmdCancel.TabIndex = 2;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(296, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 1;
+			this.cmdOK.Text = "OK";
+			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+			// 
+			// pnlDescription
+			// 
+			this.pnlDescription.Controls.Add(this.grpDescriptionResourceGroup);
+			this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlDescription.Location = new System.Drawing.Point(0, 182);
+			this.pnlDescription.Name = "pnlDescription";
+			this.pnlDescription.Size = new System.Drawing.Size(448, 72);
+			this.pnlDescription.TabIndex = 5;
+			// 
+			// grpDescriptionResourceGroup
+			// 
+			this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
+			this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
+			this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
+			this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(448, 72);
+			this.grpDescriptionResourceGroup.TabIndex = 1;
+			this.grpDescriptionResourceGroup.TabStop = false;
+			this.grpDescriptionResourceGroup.Text = "Description";
+			// 
+			// lblDescriptionResourceGroup
+			// 
+			this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
+			this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
+			this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(442, 53);
+			this.lblDescriptionResourceGroup.TabIndex = 0;
+			this.lblDescriptionResourceGroup.Text = "Use this panel to assign user access to Resources.  Only users who have the BSDXZ" +
+				"MENU key in VistA will appear in the selection list.  If Modify Schedule is check" +
+				"ed, then the user will be able to add and edit the resource\'s availability.";
+			// 
+			// chkModifySchedule
+			// 
+			this.chkModifySchedule.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
+			this.chkModifySchedule.Location = new System.Drawing.Point(96, 136);
+			this.chkModifySchedule.Name = "chkModifySchedule";
+			this.chkModifySchedule.Size = new System.Drawing.Size(152, 16);
+			this.chkModifySchedule.TabIndex = 7;
+			this.chkModifySchedule.Text = "Modify Clinic Availability:";
+			this.chkModifySchedule.CheckedChanged += new System.EventHandler(this.chkModifySchedule_CheckedChanged);
+			// 
+			// chkOverbook
+			// 
+			this.chkOverbook.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
+			this.chkOverbook.Location = new System.Drawing.Point(160, 104);
+			this.chkOverbook.Name = "chkOverbook";
+			this.chkOverbook.Size = new System.Drawing.Size(88, 16);
+			this.chkOverbook.TabIndex = 8;
+			this.chkOverbook.Text = "Overbook:";
+			this.chkOverbook.CheckedChanged += new System.EventHandler(this.chkOverbook_CheckedChanged);
+			// 
+			// chkAppointments
+			// 
+			this.chkAppointments.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
+			this.chkAppointments.Location = new System.Drawing.Point(40, 72);
+			this.chkAppointments.Name = "chkAppointments";
+			this.chkAppointments.Size = new System.Drawing.Size(208, 16);
+			this.chkAppointments.TabIndex = 9;
+			this.chkAppointments.Text = "Add, Edit and Delete appointments:";
+			this.chkAppointments.CheckedChanged += new System.EventHandler(this.chkAppointments_CheckedChanged);
+			// 
+			// DResourceUser
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(448, 294);
+			this.Controls.Add(this.chkAppointments);
+			this.Controls.Add(this.chkOverbook);
+			this.Controls.Add(this.chkModifySchedule);
+			this.Controls.Add(this.pnlDescription);
+			this.Controls.Add(this.pnlPageBottom);
+			this.Controls.Add(this.label1);
+			this.Controls.Add(this.cboScheduleUser);
+			this.Name = "DResourceUser";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "DResourceUser";
+			this.pnlPageBottom.ResumeLayout(false);
+			this.pnlDescription.ResumeLayout(false);
+			this.grpDescriptionResourceGroup.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		#region Fields
+
+		private DataTable	m_dtResourceUser;
+		private int			m_nUserID;
+		private bool		m_bModifySchedule;
+		private bool		m_bOverbook;
+		private bool		m_bAppointments;
+
+		#endregion Fields
+
+		#region Properties
+
+		/// <summary>
+		/// The ID of the Resource User in the NEW PERSON file.
+		/// </summary>
+		public int UserID
+		{
+			get
+			{
+				return m_nUserID;
+			}
+		}
+
+		/// <summary>
+		/// True if the user is allowed to modify the resource's scheduled availability
+		/// </summary>
+		public bool ModifySchedule
+		{
+			get
+			{
+				return m_bModifySchedule;
+			}
+		}
+
+		/// <summary>
+		/// True if the user is allowed to overbook beyond the resource's scheduled availability
+		/// </summary>
+		public bool Overbook
+		{
+			get
+			{
+				return m_bOverbook;
+			}
+		}
+
+		/// <summary>
+		/// True if the user is allowed to create, edit and delete appointments
+		/// </summary>
+		public bool Appoinmtments
+		{
+			get
+			{
+				return m_bAppointments;
+			}
+		}		
+		#endregion Properties
+
+
+		public void InitializePage(int nSelectedRUID, DataSet dsGlobal)
+		{
+
+			m_dtResourceUser = dsGlobal.Tables["ResourceUser"];
+
+			//Datasource the SCHEDULE USER combo box
+			DataTable dtSchedUser = dsGlobal.Tables["ScheduleUser"];
+			DataView dvSchedUser = new DataView(dtSchedUser);
+			dvSchedUser.Sort = "USERNAME ASC";
+
+
+			cboScheduleUser.DataSource = dvSchedUser;
+			cboScheduleUser.DisplayMember = "USERNAME";
+			cboScheduleUser.ValueMember = "USERID";
+
+			if (nSelectedRUID < 0) //then we're in ADD mode
+			{
+				this.Text = "Add New Resource User";
+				m_nUserID = 0;
+				m_bModifySchedule = false;
+				m_bOverbook = false;
+				m_bAppointments = false;
+				this.cmdOK.Enabled = false;
+			}
+			else //we're in EDIT mode
+			{
+				this.Text = "Edit Scheduling Resource";
+				this.cboScheduleUser.Enabled = false;
+				DataRow dr = m_dtResourceUser.Rows.Find(nSelectedRUID);	
+				m_nUserID = Convert.ToInt16(dr["USERID"]);//CHANGED FROM USERID1
+				string sOverbook = dr["OVERBOOK"].ToString();
+				m_bOverbook = (sOverbook == "YES")?true:false;
+				string sModify = dr["MODIFY_SCHEDULE"].ToString();
+				m_bModifySchedule = (sModify == "YES")?true:false;
+				string sAppts = dr["MODIFY_APPOINTMENTS"].ToString();
+				m_bAppointments = (sAppts == "YES")?true:false;
+
+			}
+			UpdateDialogData(true);
+		}
+
+		/// <summary>
+		/// If b is true, moves member vars into control data
+		/// otherwise, moves control data into member vars
+		/// </summary>
+		/// <param name="b"></param>
+		private void UpdateDialogData(bool b)
+		{
+			if (b == true)
+			{
+				this.chkOverbook.Checked = m_bOverbook;
+				this.chkModifySchedule.Checked = m_bModifySchedule;
+				this.cboScheduleUser.SelectedValue = m_nUserID;
+				this.chkAppointments.Checked = m_bAppointments;
+			}
+			else
+			{
+				m_bOverbook = this.chkOverbook.Checked;
+				m_bModifySchedule = this.chkModifySchedule.Checked;
+				m_bAppointments = this.chkAppointments.Checked;
+				m_nUserID = Convert.ToInt16(this.cboScheduleUser.SelectedValue);
+			}
+		}
+
+		private void cmdOK_Click(object sender, System.EventArgs e)
+		{
+			this.UpdateDialogData(false);
+		}
+
+		private void cboScheduleUser_SelectedIndexChanged(object sender, System.EventArgs e)
+		{
+			this.cmdOK.Enabled = true;
+		}
+
+		private void chkModifySchedule_CheckedChanged(object sender, System.EventArgs e)
+		{
+			if (chkModifySchedule.Checked == true)
+			{
+				this.chkAppointments.Checked = true;
+				this.chkOverbook.Checked = true;
+			}
+		}
+
+		private void chkOverbook_CheckedChanged(object sender, System.EventArgs e)
+		{
+			if (chkOverbook.Checked == true)
+			{
+				chkAppointments.Checked = true;
+			}
+			if (chkOverbook.Checked == false)
+			{
+				chkModifySchedule.Checked = false;
+			}
+		}
+
+		private void chkAppointments_CheckedChanged(object sender, System.EventArgs e)
+		{
+			if (chkAppointments.Checked == false)
+			{
+				chkOverbook.Checked = false;
+				chkModifySchedule.Checked = false;
+			}
+		}
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DResourceUser.resx
===================================================================
--- Scheduling/branches/GUI1.2/DResourceUser.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DResourceUser.resx	(revision 855)
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="cboScheduleUser.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cboScheduleUser.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cboScheduleUser.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlPageBottom.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlPageBottom.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlPageBottom.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlPageBottom.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescriptionResourceGroup.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescriptionResourceGroup.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkModifySchedule.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkModifySchedule.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkModifySchedule.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkOverbook.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkOverbook.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkOverbook.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkAppointments.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkAppointments.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkAppointments.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Name">
+    <value>DResourceUser</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DSelectLetterClinics.cs
===================================================================
--- Scheduling/branches/GUI1.2/DSelectLetterClinics.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DSelectLetterClinics.cs	(revision 855)
@@ -0,0 +1,366 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Use this dialog to select resources and dates (begin and end) for their examination.
+    /// <example>
+    /// DSelectLetterClinics ds = new DSelectLetterClinics();
+    /// ds.InitializePage(this.m_DocManager.GlobalDataSet, "Print Clinic Cancellation Letters");
+	///	ds.ShowDialog(this) 					
+    ///
+	/// //get the resource names and call the letter printer
+	///	string sClinics = ds.SelectedClinics;
+	///	DateTime dtBegin = ds.BeginDate;
+	///	DateTime dtEnd = ds.EndDate;
+    /// </example>
+	/// </summary>
+    /// 
+	public class DSelectLetterClinics : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Panel pnlOkCancel;
+		private System.Windows.Forms.Panel pnlDescription;
+		private System.Windows.Forms.GroupBox grpDescription;
+		private System.Windows.Forms.Label lblDescription;
+		private System.Windows.Forms.CheckedListBox lstResource;
+		private System.Windows.Forms.ComboBox cboResourceGroup;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.Label label4;
+		private System.Windows.Forms.Label label5;
+		private System.Windows.Forms.DateTimePicker dtBegin;
+		private System.Windows.Forms.DateTimePicker dtEnd;
+		private System.Windows.Forms.Label lblRange;
+		private System.Windows.Forms.CheckBox chkSelectAll;
+		private System.ComponentModel.Container components = null;
+
+		/// <summary>
+		/// Ctor; also sets default enter and cancel buttons
+		/// </summary>
+        public DSelectLetterClinics()
+		{
+			InitializeComponent();
+            this.AcceptButton = cmdOK;
+            this.CancelButton = cmdCancel;
+            this.chkSelectAll.Focus();
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DSelectLetterClinics));
+            this.pnlOkCancel = new System.Windows.Forms.Panel();
+            this.cmdCancel = new System.Windows.Forms.Button();
+            this.cmdOK = new System.Windows.Forms.Button();
+            this.pnlDescription = new System.Windows.Forms.Panel();
+            this.grpDescription = new System.Windows.Forms.GroupBox();
+            this.lblDescription = new System.Windows.Forms.Label();
+            this.lstResource = new System.Windows.Forms.CheckedListBox();
+            this.cboResourceGroup = new System.Windows.Forms.ComboBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.dtBegin = new System.Windows.Forms.DateTimePicker();
+            this.dtEnd = new System.Windows.Forms.DateTimePicker();
+            this.lblRange = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.chkSelectAll = new System.Windows.Forms.CheckBox();
+            this.pnlOkCancel.SuspendLayout();
+            this.pnlDescription.SuspendLayout();
+            this.grpDescription.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // pnlOkCancel
+            // 
+            this.pnlOkCancel.Controls.Add(this.cmdCancel);
+            this.pnlOkCancel.Controls.Add(this.cmdOK);
+            this.pnlOkCancel.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlOkCancel.Location = new System.Drawing.Point(0, 430);
+            this.pnlOkCancel.Name = "pnlOkCancel";
+            this.pnlOkCancel.Size = new System.Drawing.Size(512, 40);
+            this.pnlOkCancel.TabIndex = 4;
+            // 
+            // cmdCancel
+            // 
+            this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.cmdCancel.Location = new System.Drawing.Point(416, 8);
+            this.cmdCancel.Name = "cmdCancel";
+            this.cmdCancel.Size = new System.Drawing.Size(64, 24);
+            this.cmdCancel.TabIndex = 1;
+            this.cmdCancel.Text = "Cancel";
+            // 
+            // cmdOK
+            // 
+            this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.cmdOK.Location = new System.Drawing.Point(336, 8);
+            this.cmdOK.Name = "cmdOK";
+            this.cmdOK.Size = new System.Drawing.Size(64, 24);
+            this.cmdOK.TabIndex = 0;
+            this.cmdOK.Text = "OK";
+            // 
+            // pnlDescription
+            // 
+            this.pnlDescription.Controls.Add(this.grpDescription);
+            this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlDescription.Location = new System.Drawing.Point(0, 350);
+            this.pnlDescription.Name = "pnlDescription";
+            this.pnlDescription.Size = new System.Drawing.Size(512, 80);
+            this.pnlDescription.TabIndex = 47;
+            // 
+            // grpDescription
+            // 
+            this.grpDescription.Controls.Add(this.lblDescription);
+            this.grpDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grpDescription.Location = new System.Drawing.Point(0, 0);
+            this.grpDescription.Name = "grpDescription";
+            this.grpDescription.Size = new System.Drawing.Size(512, 80);
+            this.grpDescription.TabIndex = 0;
+            this.grpDescription.TabStop = false;
+            this.grpDescription.Text = "Description";
+            // 
+            // lblDescription
+            // 
+            this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lblDescription.Location = new System.Drawing.Point(3, 16);
+            this.lblDescription.Name = "lblDescription";
+            this.lblDescription.Size = new System.Drawing.Size(506, 61);
+            this.lblDescription.TabIndex = 1;
+            this.lblDescription.Text = resources.GetString("lblDescription.Text");
+            // 
+            // lstResource
+            // 
+            this.lstResource.HorizontalScrollbar = true;
+            this.lstResource.Location = new System.Drawing.Point(24, 96);
+            this.lstResource.MultiColumn = true;
+            this.lstResource.Name = "lstResource";
+            this.lstResource.Size = new System.Drawing.Size(448, 124);
+            this.lstResource.TabIndex = 48;
+            // 
+            // cboResourceGroup
+            // 
+            this.cboResourceGroup.Location = new System.Drawing.Point(24, 40);
+            this.cboResourceGroup.Name = "cboResourceGroup";
+            this.cboResourceGroup.Size = new System.Drawing.Size(448, 21);
+            this.cboResourceGroup.TabIndex = 49;
+            this.cboResourceGroup.SelectedIndexChanged += new System.EventHandler(this.cboResourceGroup_SelectedIndexChanged);
+            // 
+            // label1
+            // 
+            this.label1.Location = new System.Drawing.Point(24, 16);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(208, 16);
+            this.label1.TabIndex = 50;
+            this.label1.Text = "Resource Group:";
+            // 
+            // label2
+            // 
+            this.label2.Location = new System.Drawing.Point(24, 72);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(72, 16);
+            this.label2.TabIndex = 51;
+            this.label2.Text = "Resource:";
+            // 
+            // dtBegin
+            // 
+            this.dtBegin.Location = new System.Drawing.Point(24, 312);
+            this.dtBegin.Name = "dtBegin";
+            this.dtBegin.Size = new System.Drawing.Size(200, 20);
+            this.dtBegin.TabIndex = 52;
+            // 
+            // dtEnd
+            // 
+            this.dtEnd.Location = new System.Drawing.Point(280, 312);
+            this.dtEnd.Name = "dtEnd";
+            this.dtEnd.Size = new System.Drawing.Size(192, 20);
+            this.dtEnd.TabIndex = 52;
+            // 
+            // lblRange
+            // 
+            this.lblRange.Location = new System.Drawing.Point(24, 272);
+            this.lblRange.Name = "lblRange";
+            this.lblRange.Size = new System.Drawing.Size(192, 16);
+            this.lblRange.TabIndex = 53;
+            this.lblRange.Text = "Date range for appointment letters:";
+            // 
+            // label4
+            // 
+            this.label4.Location = new System.Drawing.Point(24, 296);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(152, 16);
+            this.label4.TabIndex = 54;
+            this.label4.Text = "Beginning Date:";
+            // 
+            // label5
+            // 
+            this.label5.Location = new System.Drawing.Point(280, 296);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(152, 16);
+            this.label5.TabIndex = 54;
+            this.label5.Text = "Ending  Date:";
+            // 
+            // chkSelectAll
+            // 
+            this.chkSelectAll.Location = new System.Drawing.Point(32, 232);
+            this.chkSelectAll.Name = "chkSelectAll";
+            this.chkSelectAll.Size = new System.Drawing.Size(168, 24);
+            this.chkSelectAll.TabIndex = 55;
+            this.chkSelectAll.Text = "Select &All Resources";
+            this.chkSelectAll.CheckedChanged += new System.EventHandler(this.chkSelectAll_CheckedChanged);
+            // 
+            // DSelectLetterClinics
+            // 
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(512, 470);
+            this.Controls.Add(this.chkSelectAll);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.lblRange);
+            this.Controls.Add(this.dtBegin);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.cboResourceGroup);
+            this.Controls.Add(this.lstResource);
+            this.Controls.Add(this.pnlDescription);
+            this.Controls.Add(this.pnlOkCancel);
+            this.Controls.Add(this.dtEnd);
+            this.Controls.Add(this.label5);
+            this.Name = "DSelectLetterClinics";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "Print Apppointment Letters";
+            this.pnlOkCancel.ResumeLayout(false);
+            this.pnlDescription.ResumeLayout(false);
+            this.grpDescription.ResumeLayout(false);
+            this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		#region Methods
+
+		public void SetupForReports()
+		{
+			lblRange.Text = "Date Range for Appointment List:";
+			lblDescription.Text = "Use this panel to select resources and to specify the time period for appointment lists.  Check each resource (clinic) for which to print lists.  Lists will be printed for appointments between the beginning and ending dates, inclusive.";
+			this.Text = "Print Clinic Schedules";
+		}
+
+		public void InitializePage(DataSet dsGlobal, string sWindowText)
+		{
+			try
+			{
+				m_bInitialized = false;
+				this.Text = sWindowText;
+				m_dtResources = dsGlobal.Tables["GroupResources"];
+				m_dvResources = new DataView(m_dtResources);
+				m_dvResources.Sort = "RESOURCE_NAME ASC";
+				lstResource.DataSource = m_dvResources;
+				lstResource.DisplayMember = "RESOURCE_NAME";
+				lstResource.ValueMember = "RESOURCEID";	
+				
+				m_dtGroups = dsGlobal.Tables["ResourceGroup"];
+				m_dvGroups = new DataView(m_dtGroups);
+				m_dvGroups.Sort = "RESOURCE_GROUP ASC";
+				cboResourceGroup.DataSource = m_dvGroups;
+				cboResourceGroup.DisplayMember = "RESOURCE_GROUP";
+				cboResourceGroup.ValueMember = "RESOURCE_GROUPID";
+
+				m_dvResources.RowFilter = "RESOURCE_GROUPID = " + cboResourceGroup.SelectedValue;
+				m_bInitialized = true;
+				return;
+			}
+			catch(Exception ex)
+			{
+				throw ex;
+			}
+
+		}
+
+		private void cboResourceGroup_SelectedIndexChanged(object sender, System.EventArgs e)
+		{
+			if (m_bInitialized == true)
+				m_dvResources.RowFilter = "RESOURCE_GROUPID = " + cboResourceGroup.SelectedValue;
+			chkSelectAll.Checked = false;
+		}
+
+		private void chkSelectAll_CheckedChanged(object sender, System.EventArgs e)
+		{
+			for(int i=0; i < lstResource.Items.Count; i++)
+			{
+				lstResource.SetItemChecked(i, chkSelectAll.Checked);
+			}
+		}
+
+		#endregion Methods
+
+		#region Fields
+		private DataTable		m_dtGroups;
+		private DataView		m_dvGroups;
+		private DataTable		m_dtResources;
+		private DataView		m_dvResources;
+		private bool			m_bInitialized;
+
+		#endregion Fields
+
+		#region Properties
+
+		/// <summary>
+		/// Returns the |-delimited string of selected resource id's
+		/// </summary>
+		public string SelectedClinics
+		{
+			get
+			{
+				string sRet = "";
+				foreach(DataRowView s in this.lstResource.CheckedItems)
+				{
+					sRet = sRet + s["RESOURCEID"].ToString() + "|";
+				}
+				return sRet;
+			}
+		}
+
+		public DateTime BeginDate
+		{
+			get
+			{
+				return dtBegin.Value;
+			}
+		}
+
+		public DateTime EndDate
+		{
+			get
+			{
+				return dtEnd.Value;
+			}
+		}
+		#endregion Properties
+
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DSelectLetterClinics.resx
===================================================================
--- Scheduling/branches/GUI1.2/DSelectLetterClinics.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DSelectLetterClinics.resx	(revision 855)
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="lblDescription.Text" xml:space="preserve">
+    <value>Use this panel to select resources and to specify the time period for patient reminder letters.  Check each resource (clinic) for which to print letters.  Letters will be printed for appointments between the beginning and ending dates, inclusive.</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DSelectSchedules.cs
===================================================================
--- Scheduling/branches/GUI1.2/DSelectSchedules.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DSelectSchedules.cs	(revision 855)
@@ -0,0 +1,352 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DSelectSchedules.
+	/// </summary>
+	public class DSelectSchedules : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel pnlOkCancel;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.Button cmdOK;
+		private System.Windows.Forms.Panel pnlDescription;
+		private System.Windows.Forms.GroupBox grpDescription;
+		private System.Windows.Forms.Label lblDescription;
+		private System.Windows.Forms.Label label2;
+		private System.Windows.Forms.CheckedListBox lstResource;
+		private System.Windows.Forms.CheckBox chkOneWindow;
+		private System.Windows.Forms.Label label1;
+		private System.Windows.Forms.ComboBox cboResourceGroup;
+		private System.Windows.Forms.TextBox txtGroupWindow;
+		private System.Windows.Forms.Label label3;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DSelectSchedules()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.pnlOkCancel = new System.Windows.Forms.Panel();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.pnlDescription = new System.Windows.Forms.Panel();
+			this.grpDescription = new System.Windows.Forms.GroupBox();
+			this.lblDescription = new System.Windows.Forms.Label();
+			this.label2 = new System.Windows.Forms.Label();
+			this.lstResource = new System.Windows.Forms.CheckedListBox();
+			this.chkOneWindow = new System.Windows.Forms.CheckBox();
+			this.label1 = new System.Windows.Forms.Label();
+			this.cboResourceGroup = new System.Windows.Forms.ComboBox();
+			this.txtGroupWindow = new System.Windows.Forms.TextBox();
+			this.label3 = new System.Windows.Forms.Label();
+			this.pnlOkCancel.SuspendLayout();
+			this.pnlDescription.SuspendLayout();
+			this.grpDescription.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// pnlOkCancel
+			// 
+			this.pnlOkCancel.Controls.Add(this.cmdCancel);
+			this.pnlOkCancel.Controls.Add(this.cmdOK);
+			this.pnlOkCancel.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlOkCancel.Location = new System.Drawing.Point(0, 478);
+			this.pnlOkCancel.Name = "pnlOkCancel";
+			this.pnlOkCancel.Size = new System.Drawing.Size(512, 40);
+			this.pnlOkCancel.TabIndex = 5;
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(416, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(64, 24);
+			this.cmdCancel.TabIndex = 30;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(336, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(64, 24);
+			this.cmdOK.TabIndex = 25;
+			this.cmdOK.Text = "OK";
+			// 
+			// pnlDescription
+			// 
+			this.pnlDescription.Controls.Add(this.grpDescription);
+			this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlDescription.Location = new System.Drawing.Point(0, 398);
+			this.pnlDescription.Name = "pnlDescription";
+			this.pnlDescription.Size = new System.Drawing.Size(512, 80);
+			this.pnlDescription.TabIndex = 48;
+			// 
+			// grpDescription
+			// 
+			this.grpDescription.Controls.Add(this.lblDescription);
+			this.grpDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.grpDescription.Location = new System.Drawing.Point(0, 0);
+			this.grpDescription.Name = "grpDescription";
+			this.grpDescription.Size = new System.Drawing.Size(512, 80);
+			this.grpDescription.TabIndex = 0;
+			this.grpDescription.TabStop = false;
+			this.grpDescription.Text = "Description";
+			// 
+			// lblDescription
+			// 
+			this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.lblDescription.Location = new System.Drawing.Point(3, 16);
+			this.lblDescription.Name = "lblDescription";
+			this.lblDescription.Size = new System.Drawing.Size(506, 61);
+			this.lblDescription.TabIndex = 1;
+			this.lblDescription.Text = "Use this panel to open a group of resource schedules.  You can open each schedule" +
+				" in a separate window or open all schedules in one single group window.  If you " +
+				"use a group window, you can assign a name to identify the window.";
+			// 
+			// label2
+			// 
+			this.label2.Location = new System.Drawing.Point(16, 80);
+			this.label2.Name = "label2";
+			this.label2.Size = new System.Drawing.Size(240, 16);
+			this.label2.TabIndex = 53;
+			this.label2.Text = "Resource:";
+			// 
+			// lstResource
+			// 
+			this.lstResource.HorizontalScrollbar = true;
+			this.lstResource.Location = new System.Drawing.Point(16, 104);
+			this.lstResource.MultiColumn = true;
+			this.lstResource.Name = "lstResource";
+			this.lstResource.Size = new System.Drawing.Size(448, 184);
+			this.lstResource.TabIndex = 10;
+			// 
+			// chkOneWindow
+			// 
+			this.chkOneWindow.Checked = true;
+			this.chkOneWindow.CheckState = System.Windows.Forms.CheckState.Checked;
+			this.chkOneWindow.Location = new System.Drawing.Point(24, 304);
+			this.chkOneWindow.Name = "chkOneWindow";
+			this.chkOneWindow.Size = new System.Drawing.Size(328, 24);
+			this.chkOneWindow.TabIndex = 15;
+			this.chkOneWindow.Text = "Open Schedules in a Single Group Window";
+			this.chkOneWindow.CheckedChanged += new System.EventHandler(this.chkOneWindow_CheckedChanged);
+			// 
+			// label1
+			// 
+			this.label1.Location = new System.Drawing.Point(16, 16);
+			this.label1.Name = "label1";
+			this.label1.Size = new System.Drawing.Size(208, 16);
+			this.label1.TabIndex = 58;
+			this.label1.Text = "Resource Group:";
+			// 
+			// cboResourceGroup
+			// 
+			this.cboResourceGroup.Location = new System.Drawing.Point(16, 40);
+			this.cboResourceGroup.Name = "cboResourceGroup";
+			this.cboResourceGroup.Size = new System.Drawing.Size(448, 21);
+			this.cboResourceGroup.TabIndex = 5;
+			this.cboResourceGroup.SelectionChangeCommitted += new System.EventHandler(this.cboResourceGroup_SelectionChangeCommitted);
+			// 
+			// txtGroupWindow
+			// 
+			this.txtGroupWindow.Location = new System.Drawing.Point(160, 344);
+			this.txtGroupWindow.Name = "txtGroupWindow";
+			this.txtGroupWindow.Size = new System.Drawing.Size(304, 20);
+			this.txtGroupWindow.TabIndex = 20;
+			this.txtGroupWindow.Text = "";
+			// 
+			// label3
+			// 
+			this.label3.Location = new System.Drawing.Point(32, 344);
+			this.label3.Name = "label3";
+			this.label3.Size = new System.Drawing.Size(120, 16);
+			this.label3.TabIndex = 58;
+			this.label3.Text = "Group Window Name:";
+			// 
+			// DSelectSchedules
+			// 
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.ClientSize = new System.Drawing.Size(512, 518);
+			this.Controls.Add(this.txtGroupWindow);
+			this.Controls.Add(this.label1);
+			this.Controls.Add(this.cboResourceGroup);
+			this.Controls.Add(this.chkOneWindow);
+			this.Controls.Add(this.label2);
+			this.Controls.Add(this.lstResource);
+			this.Controls.Add(this.pnlDescription);
+			this.Controls.Add(this.pnlOkCancel);
+			this.Controls.Add(this.label3);
+			this.Name = "DSelectSchedules";
+			this.Text = "Open Selected Schedules";
+			this.pnlOkCancel.ResumeLayout(false);
+			this.pnlDescription.ResumeLayout(false);
+			this.grpDescription.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		#region Fields
+		private DataTable		m_dtGroups;
+		private DataView		m_dvGroups;
+		private DataTable		m_dtResources;
+		private DataView		m_dvResources;
+		private DataSet			m_dsGlobal;
+
+		#endregion Fields
+
+		#region Properties
+
+		/// <summary>
+		/// Returns the an ArrayList of selected resource names
+		/// </summary>
+		public ArrayList SelectedClinics
+		{
+
+			get
+			{
+				System.Collections.ArrayList al = new System.Collections.ArrayList();
+				foreach(DataRowView s in this.lstResource.CheckedItems)
+				{
+					al.Add(s["RESOURCE_NAME"].ToString());
+				}
+				return al;
+			}
+		}
+
+		public bool SingleWindow
+		{
+			get
+			{
+				return this.chkOneWindow.Checked;
+			}
+		}
+
+		public string GroupWindowName
+		{
+			get
+			{
+				return this.txtGroupWindow.Text;
+			}
+		}
+		#endregion Properties
+
+
+		public void InitializePage(DataSet dsGlobal, string sWindowText)
+		{
+			try
+			{
+				m_dsGlobal = dsGlobal;
+				this.Text = sWindowText;
+				m_dtResources = dsGlobal.Tables["Resources"];
+				m_dvResources = new DataView(m_dtResources);
+				m_dvResources.Sort = "RESOURCE_NAME ASC";
+				m_dvResources.RowFilter = "INACTIVE <> 1 AND VIEW = 1";
+				lstResource.DataSource = m_dvResources;
+				lstResource.DisplayMember = "RESOURCE_NAME";
+				lstResource.ValueMember = "RESOURCE_NAME";	
+				
+				m_dtGroups = dsGlobal.Tables["ResourceGroup"].Copy();
+				m_dvGroups = new DataView(m_dtGroups);
+				m_dvGroups.Sort = "RESOURCE_GROUP ASC";
+				this.cboResourceGroup.Items.Add("<Show All Resources & Clinics>");
+				foreach (DataRowView drvG in m_dvGroups)
+				{
+					this.cboResourceGroup.Items.Add(drvG["RESOURCE_GROUP"]);
+				}
+				this.cboResourceGroup.Text = "<Show All Resources & Clinics>";
+				return;
+			}
+			catch(Exception ex)
+			{
+				throw ex;
+			}
+
+		}
+
+		private void cboResourceGroup_SelectionChangeCommitted(object sender, System.EventArgs e)
+		{
+			string sGroup = cboResourceGroup.SelectedItem.ToString();
+			if (sGroup == "<Show All Resources & Clinics>")
+			{
+				LoadListBox("ALL");
+			}
+			else 
+			{
+				LoadListBox("SELECTED");
+			}			
+				
+		}
+
+		private void LoadListBox(string sGroup)
+		{
+			if (sGroup == "ALL")
+			{
+				//Load the Resources list box with ALL resources
+				m_dtResources = m_dsGlobal.Tables["Resources"];
+				m_dvResources = new DataView(m_dtResources);
+				m_dvResources = new DataView(m_dtResources);
+				m_dvResources.Sort = "RESOURCE_NAME ASC";
+				m_dvResources.RowFilter = "INACTIVE <> 1 AND VIEW = 1";
+				lstResource.DataSource = m_dvResources;
+				lstResource.DisplayMember = "RESOURCE_NAME";
+				lstResource.ValueMember = "RESOURCE_NAME";	
+			}
+			else 
+			{
+				//Load the Resources list box with active resources belonging
+				//to group sGroup
+
+				//Build Resource Group table containing *active* Resources and their Groups
+				m_dtResources = m_dsGlobal.Tables["GroupResources"];
+				//Create a view that is filterable on ResourceGroup
+				m_dvResources = new DataView(m_dtResources);
+				m_dvResources.RowFilter = "RESOURCE_GROUP = '" + this.cboResourceGroup.SelectedItem.ToString() + "'";
+				lstResource.DataSource = m_dvResources;
+				lstResource.DisplayMember = "RESOURCE_NAME";
+				lstResource.ValueMember = "RESOURCE_NAME";
+			}
+		}
+
+		private void chkOneWindow_CheckedChanged(object sender, System.EventArgs e)
+		{
+			this.txtGroupWindow.Enabled = this.chkOneWindow.Checked;
+		}
+
+	}
+}
Index: Scheduling/branches/GUI1.2/DSelectSchedules.resx
===================================================================
--- Scheduling/branches/GUI1.2/DSelectSchedules.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DSelectSchedules.resx	(revision 855)
@@ -0,0 +1,274 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="pnlOkCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlOkCancel.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlOkCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlOkCancel.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlOkCancel.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlOkCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="grpDescription.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="grpDescription.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="grpDescription.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="grpDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescription.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lblDescription.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lblDescription.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lstResource.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="lstResource.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="lstResource.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkOneWindow.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="chkOneWindow.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="chkOneWindow.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cboResourceGroup.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cboResourceGroup.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cboResourceGroup.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtGroupWindow.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtGroupWindow.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtGroupWindow.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Name">
+    <value>DSelectSchedules</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/DSplash.cs
===================================================================
--- Scheduling/branches/GUI1.2/DSplash.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/DSplash.cs	(revision 855)
@@ -0,0 +1,133 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for DSplash.
+	/// </summary>
+	public class DSplash : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Label label1;
+        //private System.Windows.Forms.Label lblVersion;
+		private System.Windows.Forms.LinkLabel lnkMail;
+		private System.Windows.Forms.Label lblStatus;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public DSplash()
+		{
+			//
+			// Required for Windows Form Designer support
+			//
+			InitializeComponent();
+
+			//
+			// TODO: Add any constructor code after InitializeComponent call
+			//
+		}
+
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+            this.label1 = new System.Windows.Forms.Label();
+            this.lnkMail = new System.Windows.Forms.LinkLabel();
+            this.lblStatus = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label1.Location = new System.Drawing.Point(24, 32);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(448, 40);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "VistA Clinical Scheduling";
+            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // lnkMail
+            // 
+            this.lnkMail.Location = new System.Drawing.Point(0, 0);
+            this.lnkMail.Name = "lnkMail";
+            this.lnkMail.Size = new System.Drawing.Size(100, 23);
+            this.lnkMail.TabIndex = 4;
+            // 
+            // lblStatus
+            // 
+            this.lblStatus.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.lblStatus.Location = new System.Drawing.Point(88, 160);
+            this.lblStatus.Name = "lblStatus";
+            this.lblStatus.Size = new System.Drawing.Size(328, 16);
+            this.lblStatus.TabIndex = 3;
+            this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+            // 
+            // DSplash
+            // 
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(488, 252);
+            this.ControlBox = false;
+            this.Controls.Add(this.lblStatus);
+            this.Controls.Add(this.lnkMail);
+            this.Controls.Add(this.label1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
+            this.Name = "DSplash";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
+            this.Text = "Clinical Scheduling";
+            this.Load += new System.EventHandler(this.DSplash_Load);
+            this.ResumeLayout(false);
+
+		}
+		#endregion
+
+		public void SetStatus(string sStatus)
+		{
+			this.Status = sStatus;
+		}
+
+		private void DSplash_Load(object sender, System.EventArgs e)
+		{
+			//this.lblVersion.Text = "Version " + Application.ProductVersion;
+		}
+
+		#region Properties
+		/// <summary>
+		/// Gets or sets the value of the Status displayed on the splash screen
+		/// </summary>
+		public String Status
+		{
+			get
+			{
+				return lblStatus.Text;
+			}
+			set
+			{
+				lblStatus.Text = value;
+			}
+		}
+		#endregion Properties
+	}
+}
Index: Scheduling/branches/GUI1.2/DSplash.resx
===================================================================
--- Scheduling/branches/GUI1.2/DSplash.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/DSplash.resx	(revision 855)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
Index: Scheduling/branches/GUI1.2/Options.cs
===================================================================
--- Scheduling/branches/GUI1.2/Options.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/Options.cs	(revision 855)
@@ -0,0 +1,1148 @@
+//
+// Options.cs
+//
+// Authors:
+//  Jonathan Pryor <jpryor@novell.com>
+//  Federico Di Gregorio <fog@initd.org>
+//
+// Copyright (C) 2008 Novell (http://www.novell.com)
+// Copyright (C) 2009 Federico Di Gregorio.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+// Compile With:
+//   gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll
+//   gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll
+//
+// The LINQ version just changes the implementation of
+// OptionSet.Parse(IEnumerable<string>), and confers no semantic changes.
+
+//
+// A Getopt::Long-inspired option parsing library for C#.
+//
+// NDesk.Options.OptionSet is built upon a key/value table, where the
+// key is a option format string and the value is a delegate that is 
+// invoked when the format string is matched.
+//
+// Option format strings:
+//  Regex-like BNF Grammar: 
+//    name: .+
+//    type: [=:]
+//    sep: ( [^{}]+ | '{' .+ '}' )?
+//    aliases: ( name type sep ) ( '|' name type sep )*
+// 
+// Each '|'-delimited name is an alias for the associated action.  If the
+// format string ends in a '=', it has a required value.  If the format
+// string ends in a ':', it has an optional value.  If neither '=' or ':'
+// is present, no value is supported.  `=' or `:' need only be defined on one
+// alias, but if they are provided on more than one they must be consistent.
+//
+// Each alias portion may also end with a "key/value separator", which is used
+// to split option values if the option accepts > 1 value.  If not specified,
+// it defaults to '=' and ':'.  If specified, it can be any character except
+// '{' and '}' OR the *string* between '{' and '}'.  If no separator should be
+// used (i.e. the separate values should be distinct arguments), then "{}"
+// should be used as the separator.
+//
+// Options are extracted either from the current option by looking for
+// the option name followed by an '=' or ':', or is taken from the
+// following option IFF:
+//  - The current option does not contain a '=' or a ':'
+//  - The current option requires a value (i.e. not a Option type of ':')
+//
+// The `name' used in the option format string does NOT include any leading
+// option indicator, such as '-', '--', or '/'.  All three of these are
+// permitted/required on any named option.
+//
+// Option bundling is permitted so long as:
+//   - '-' is used to start the option group
+//   - all of the bundled options are a single character
+//   - at most one of the bundled options accepts a value, and the value
+//     provided starts from the next character to the end of the string.
+//
+// This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value'
+// as '-Dname=value'.
+//
+// Option processing is disabled by specifying "--".  All options after "--"
+// are returned by OptionSet.Parse() unchanged and unprocessed.
+//
+// Unprocessed options are returned from OptionSet.Parse().
+//
+// Examples:
+//  int verbose = 0;
+//  OptionSet p = new OptionSet ()
+//    .Add ("v", v => ++verbose)
+//    .Add ("name=|value=", v => Console.WriteLine (v));
+//  p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"});
+//
+// The above would parse the argument string array, and would invoke the
+// lambda expression three times, setting `verbose' to 3 when complete.  
+// It would also print out "A" and "B" to standard output.
+// The returned array would contain the string "extra".
+//
+// C# 3.0 collection initializers are supported and encouraged:
+//  var p = new OptionSet () {
+//    { "h|?|help", v => ShowHelp () },
+//  };
+//
+// System.ComponentModel.TypeConverter is also supported, allowing the use of
+// custom data types in the callback type; TypeConverter.ConvertFromString()
+// is used to convert the value option to an instance of the specified
+// type:
+//
+//  var p = new OptionSet () {
+//    { "foo=", (Foo f) => Console.WriteLine (f.ToString ()) },
+//  };
+//
+// Random other tidbits:
+//  - Boolean options (those w/o '=' or ':' in the option format string)
+//    are explicitly enabled if they are followed with '+', and explicitly
+//    disabled if they are followed with '-':
+//      string a = null;
+//      var p = new OptionSet () {
+//        { "a", s => a = s },
+//      };
+//      p.Parse (new string[]{"-a"});   // sets v != null
+//      p.Parse (new string[]{"-a+"});  // sets v != null
+//      p.Parse (new string[]{"-a-"});  // sets v == null
+//
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Globalization;
+using System.IO;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
+using System.Text;
+using System.Text.RegularExpressions;
+
+#if LINQ
+using System.Linq;
+#endif
+
+#if TEST
+using NDesk.Options;
+#endif
+
+#if NDESK_OPTIONS
+namespace NDesk.Options
+#else
+namespace Mono.Options
+#endif
+{
+	static class StringCoda {
+
+		public static IEnumerable<string> WrappedLines (string self, params int[] widths)
+		{
+			IEnumerable<int> w = widths;
+			return WrappedLines (self, w);
+		}
+
+		public static IEnumerable<string> WrappedLines (string self, IEnumerable<int> widths)
+		{
+			if (widths == null)
+				throw new ArgumentNullException ("widths");
+			return CreateWrappedLinesIterator (self, widths);
+		}
+
+		private static IEnumerable<string> CreateWrappedLinesIterator (string self, IEnumerable<int> widths)
+		{
+			if (string.IsNullOrEmpty (self)) {
+				yield return string.Empty;
+				yield break;
+			}
+			using (var ewidths = widths.GetEnumerator ()) {
+				bool? hw = null;
+				int width = GetNextWidth (ewidths, int.MaxValue, ref hw);
+				int start = 0, end;
+				do {
+					end = GetLineEnd (start, width, self);
+					char c = self [end-1];
+					if (char.IsWhiteSpace (c))
+						--end;
+					bool needContinuation = end != self.Length && !IsEolChar (c);
+					string continuation = "";
+					if (needContinuation) {
+						--end;
+						continuation = "-";
+					}
+					string line = self.Substring (start, end - start) + continuation;
+					yield return line;
+					start = end;
+					if (char.IsWhiteSpace (c))
+						++start;
+					width = GetNextWidth (ewidths, width, ref hw);
+				} while (end < self.Length);
+			}
+		}
+
+		private static int GetNextWidth (IEnumerator<int> ewidths, int curWidth, ref bool? eValid)
+		{
+			if (!eValid.HasValue || (eValid.HasValue && eValid.Value)) {
+				curWidth = (eValid = ewidths.MoveNext ()).Value ? ewidths.Current : curWidth;
+				// '.' is any character, - is for a continuation
+				const string minWidth = ".-";
+				if (curWidth < minWidth.Length)
+					throw new ArgumentOutOfRangeException ("widths",
+							string.Format ("Element must be >= {0}, was {1}.", minWidth.Length, curWidth));
+				return curWidth;
+			}
+			// no more elements, use the last element.
+			return curWidth;
+		}
+
+		private static bool IsEolChar (char c)
+		{
+			return !char.IsLetterOrDigit (c);
+		}
+
+		private static int GetLineEnd (int start, int length, string description)
+		{
+			int end = System.Math.Min (start + length, description.Length);
+			int sep = -1;
+			for (int i = start; i < end; ++i) {
+				if (description [i] == '\n')
+					return i+1;
+				if (IsEolChar (description [i]))
+					sep = i+1;
+			}
+			if (sep == -1 || end == description.Length)
+				return end;
+			return sep;
+		}
+	}
+
+	public class OptionValueCollection : IList, IList<string> {
+
+		List<string> values = new List<string> ();
+		OptionContext c;
+
+		internal OptionValueCollection (OptionContext c)
+		{
+			this.c = c;
+		}
+
+		#region ICollection
+		void ICollection.CopyTo (Array array, int index)  {(values as ICollection).CopyTo (array, index);}
+		bool ICollection.IsSynchronized                   {get {return (values as ICollection).IsSynchronized;}}
+		object ICollection.SyncRoot                       {get {return (values as ICollection).SyncRoot;}}
+		#endregion
+
+		#region ICollection<T>
+		public void Add (string item)                       {values.Add (item);}
+		public void Clear ()                                {values.Clear ();}
+		public bool Contains (string item)                  {return values.Contains (item);}
+		public void CopyTo (string[] array, int arrayIndex) {values.CopyTo (array, arrayIndex);}
+		public bool Remove (string item)                    {return values.Remove (item);}
+		public int Count                                    {get {return values.Count;}}
+		public bool IsReadOnly                              {get {return false;}}
+		#endregion
+
+		#region IEnumerable
+		IEnumerator IEnumerable.GetEnumerator () {return values.GetEnumerator ();}
+		#endregion
+
+		#region IEnumerable<T>
+		public IEnumerator<string> GetEnumerator () {return values.GetEnumerator ();}
+		#endregion
+
+		#region IList
+		int IList.Add (object value)                {return (values as IList).Add (value);}
+		bool IList.Contains (object value)          {return (values as IList).Contains (value);}
+		int IList.IndexOf (object value)            {return (values as IList).IndexOf (value);}
+		void IList.Insert (int index, object value) {(values as IList).Insert (index, value);}
+		void IList.Remove (object value)            {(values as IList).Remove (value);}
+		void IList.RemoveAt (int index)             {(values as IList).RemoveAt (index);}
+		bool IList.IsFixedSize                      {get {return false;}}
+		object IList.this [int index]               {get {return this [index];} set {(values as IList)[index] = value;}}
+		#endregion
+
+		#region IList<T>
+		public int IndexOf (string item)            {return values.IndexOf (item);}
+		public void Insert (int index, string item) {values.Insert (index, item);}
+		public void RemoveAt (int index)            {values.RemoveAt (index);}
+
+		private void AssertValid (int index)
+		{
+			if (c.Option == null)
+				throw new InvalidOperationException ("OptionContext.Option is null.");
+			if (index >= c.Option.MaxValueCount)
+				throw new ArgumentOutOfRangeException ("index");
+			if (c.Option.OptionValueType == OptionValueType.Required &&
+					index >= values.Count)
+				throw new OptionException (string.Format (
+							c.OptionSet.MessageLocalizer ("Missing required value for option '{0}'."), c.OptionName), 
+						c.OptionName);
+		}
+
+		public string this [int index] {
+			get {
+				AssertValid (index);
+				return index >= values.Count ? null : values [index];
+			}
+			set {
+				values [index] = value;
+			}
+		}
+		#endregion
+
+		public List<string> ToList ()
+		{
+			return new List<string> (values);
+		}
+
+		public string[] ToArray ()
+		{
+			return values.ToArray ();
+		}
+
+		public override string ToString ()
+		{
+			return string.Join (", ", values.ToArray ());
+		}
+	}
+
+	public class OptionContext {
+		private Option                option;
+		private string                name;
+		private int                   index;
+		private OptionSet             set;
+		private OptionValueCollection c;
+
+		public OptionContext (OptionSet set)
+		{
+			this.set = set;
+			this.c   = new OptionValueCollection (this);
+		}
+
+		public Option Option {
+			get {return option;}
+			set {option = value;}
+		}
+
+		public string OptionName { 
+			get {return name;}
+			set {name = value;}
+		}
+
+		public int OptionIndex {
+			get {return index;}
+			set {index = value;}
+		}
+
+		public OptionSet OptionSet {
+			get {return set;}
+		}
+
+		public OptionValueCollection OptionValues {
+			get {return c;}
+		}
+	}
+
+	public enum OptionValueType {
+		None, 
+		Optional,
+		Required,
+	}
+
+	public abstract class Option {
+		string prototype, description;
+		string[] names;
+		OptionValueType type;
+		int count;
+		string[] separators;
+
+		protected Option (string prototype, string description)
+			: this (prototype, description, 1)
+		{
+		}
+
+		protected Option (string prototype, string description, int maxValueCount)
+		{
+			if (prototype == null)
+				throw new ArgumentNullException ("prototype");
+			if (prototype.Length == 0)
+				throw new ArgumentException ("Cannot be the empty string.", "prototype");
+			if (maxValueCount < 0)
+				throw new ArgumentOutOfRangeException ("maxValueCount");
+
+			this.prototype   = prototype;
+			this.names       = prototype.Split ('|');
+			this.description = description;
+			this.count       = maxValueCount;
+			this.type        = ParsePrototype ();
+
+			if (this.count == 0 && type != OptionValueType.None)
+				throw new ArgumentException (
+						"Cannot provide maxValueCount of 0 for OptionValueType.Required or " +
+							"OptionValueType.Optional.",
+						"maxValueCount");
+			if (this.type == OptionValueType.None && maxValueCount > 1)
+				throw new ArgumentException (
+						string.Format ("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount),
+						"maxValueCount");
+			if (Array.IndexOf (names, "<>") >= 0 && 
+					((names.Length == 1 && this.type != OptionValueType.None) ||
+					 (names.Length > 1 && this.MaxValueCount > 1)))
+				throw new ArgumentException (
+						"The default option handler '<>' cannot require values.",
+						"prototype");
+		}
+
+		public string           Prototype       {get {return prototype;}}
+		public string           Description     {get {return description;}}
+		public OptionValueType  OptionValueType {get {return type;}}
+		public int              MaxValueCount   {get {return count;}}
+
+		public string[] GetNames ()
+		{
+			return (string[]) names.Clone ();
+		}
+
+		public string[] GetValueSeparators ()
+		{
+			if (separators == null)
+				return new string [0];
+			return (string[]) separators.Clone ();
+		}
+
+		protected static T Parse<T> (string value, OptionContext c)
+		{
+			Type tt = typeof (T);
+			bool nullable = tt.IsValueType && tt.IsGenericType && 
+				!tt.IsGenericTypeDefinition && 
+				tt.GetGenericTypeDefinition () == typeof (Nullable<>);
+			Type targetType = nullable ? tt.GetGenericArguments () [0] : typeof (T);
+			TypeConverter conv = TypeDescriptor.GetConverter (targetType);
+			T t = default (T);
+			try {
+				if (value != null)
+					t = (T) conv.ConvertFromString (value);
+			}
+			catch (Exception e) {
+				throw new OptionException (
+						string.Format (
+							c.OptionSet.MessageLocalizer ("Could not convert string `{0}' to type {1} for option `{2}'."),
+							value, targetType.Name, c.OptionName),
+						c.OptionName, e);
+			}
+			return t;
+		}
+
+		internal string[] Names           {get {return names;}}
+		internal string[] ValueSeparators {get {return separators;}}
+
+		static readonly char[] NameTerminator = new char[]{'=', ':'};
+
+		private OptionValueType ParsePrototype ()
+		{
+			char type = '\0';
+			List<string> seps = new List<string> ();
+			for (int i = 0; i < names.Length; ++i) {
+				string name = names [i];
+				if (name.Length == 0)
+					throw new ArgumentException ("Empty option names are not supported.", "prototype");
+
+				int end = name.IndexOfAny (NameTerminator);
+				if (end == -1)
+					continue;
+				names [i] = name.Substring (0, end);
+				if (type == '\0' || type == name [end])
+					type = name [end];
+				else 
+					throw new ArgumentException (
+							string.Format ("Conflicting option types: '{0}' vs. '{1}'.", type, name [end]),
+							"prototype");
+				AddSeparators (name, end, seps);
+			}
+
+			if (type == '\0')
+				return OptionValueType.None;
+
+			if (count <= 1 && seps.Count != 0)
+				throw new ArgumentException (
+						string.Format ("Cannot provide key/value separators for Options taking {0} value(s).", count),
+						"prototype");
+			if (count > 1) {
+				if (seps.Count == 0)
+					this.separators = new string[]{":", "="};
+				else if (seps.Count == 1 && seps [0].Length == 0)
+					this.separators = null;
+				else
+					this.separators = seps.ToArray ();
+			}
+
+			return type == '=' ? OptionValueType.Required : OptionValueType.Optional;
+		}
+
+		private static void AddSeparators (string name, int end, ICollection<string> seps)
+		{
+			int start = -1;
+			for (int i = end+1; i < name.Length; ++i) {
+				switch (name [i]) {
+					case '{':
+						if (start != -1)
+							throw new ArgumentException (
+									string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
+									"prototype");
+						start = i+1;
+						break;
+					case '}':
+						if (start == -1)
+							throw new ArgumentException (
+									string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
+									"prototype");
+						seps.Add (name.Substring (start, i-start));
+						start = -1;
+						break;
+					default:
+						if (start == -1)
+							seps.Add (name [i].ToString ());
+						break;
+				}
+			}
+			if (start != -1)
+				throw new ArgumentException (
+						string.Format ("Ill-formed name/value separator found in \"{0}\".", name),
+						"prototype");
+		}
+
+		public void Invoke (OptionContext c)
+		{
+			OnParseComplete (c);
+			c.OptionName  = null;
+			c.Option      = null;
+			c.OptionValues.Clear ();
+		}
+
+		protected abstract void OnParseComplete (OptionContext c);
+
+		public override string ToString ()
+		{
+			return Prototype;
+		}
+	}
+
+	[Serializable]
+	public class OptionException : Exception {
+		private string option;
+
+		public OptionException ()
+		{
+		}
+
+		public OptionException (string message, string optionName)
+			: base (message)
+		{
+			this.option = optionName;
+		}
+
+		public OptionException (string message, string optionName, Exception innerException)
+			: base (message, innerException)
+		{
+			this.option = optionName;
+		}
+
+		protected OptionException (SerializationInfo info, StreamingContext context)
+			: base (info, context)
+		{
+			this.option = info.GetString ("OptionName");
+		}
+
+		public string OptionName {
+			get {return this.option;}
+		}
+
+		[SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
+		public override void GetObjectData (SerializationInfo info, StreamingContext context)
+		{
+			base.GetObjectData (info, context);
+			info.AddValue ("OptionName", option);
+		}
+	}
+
+	public delegate void OptionAction<TKey, TValue> (TKey key, TValue value);
+
+	public class OptionSet : KeyedCollection<string, Option>
+	{
+		public OptionSet ()
+			: this (delegate (string f) {return f;})
+		{
+		}
+
+		public OptionSet (Converter<string, string> localizer)
+		{
+			this.localizer = localizer;
+		}
+
+		Converter<string, string> localizer;
+
+		public Converter<string, string> MessageLocalizer {
+			get {return localizer;}
+		}
+
+		protected override string GetKeyForItem (Option item)
+		{
+			if (item == null)
+				throw new ArgumentNullException ("option");
+			if (item.Names != null && item.Names.Length > 0)
+				return item.Names [0];
+			// This should never happen, as it's invalid for Option to be
+			// constructed w/o any names.
+			throw new InvalidOperationException ("Option has no names!");
+		}
+
+		[Obsolete ("Use KeyedCollection.this[string]")]
+		protected Option GetOptionForName (string option)
+		{
+			if (option == null)
+				throw new ArgumentNullException ("option");
+			try {
+				return base [option];
+			}
+			catch (KeyNotFoundException) {
+				return null;
+			}
+		}
+
+		protected override void InsertItem (int index, Option item)
+		{
+			base.InsertItem (index, item);
+			AddImpl (item);
+		}
+
+		protected override void RemoveItem (int index)
+		{
+			base.RemoveItem (index);
+			Option p = Items [index];
+			// KeyedCollection.RemoveItem() handles the 0th item
+			for (int i = 1; i < p.Names.Length; ++i) {
+				Dictionary.Remove (p.Names [i]);
+			}
+		}
+
+		protected override void SetItem (int index, Option item)
+		{
+			base.SetItem (index, item);
+			RemoveItem (index);
+			AddImpl (item);
+		}
+
+		private void AddImpl (Option option)
+		{
+			if (option == null)
+				throw new ArgumentNullException ("option");
+			List<string> added = new List<string> (option.Names.Length);
+			try {
+				// KeyedCollection.InsertItem/SetItem handle the 0th name.
+				for (int i = 1; i < option.Names.Length; ++i) {
+					Dictionary.Add (option.Names [i], option);
+					added.Add (option.Names [i]);
+				}
+			}
+			catch (Exception) {
+				foreach (string name in added)
+					Dictionary.Remove (name);
+				throw;
+			}
+		}
+
+		public new OptionSet Add (Option option)
+		{
+			base.Add (option);
+			return this;
+		}
+
+		sealed class ActionOption : Option {
+			Action<OptionValueCollection> action;
+
+			public ActionOption (string prototype, string description, int count, Action<OptionValueCollection> action)
+				: base (prototype, description, count)
+			{
+				if (action == null)
+					throw new ArgumentNullException ("action");
+				this.action = action;
+			}
+
+			protected override void OnParseComplete (OptionContext c)
+			{
+				action (c.OptionValues);
+			}
+		}
+
+		public OptionSet Add (string prototype, Action<string> action)
+		{
+			return Add (prototype, null, action);
+		}
+
+		public OptionSet Add (string prototype, string description, Action<string> action)
+		{
+			if (action == null)
+				throw new ArgumentNullException ("action");
+			Option p = new ActionOption (prototype, description, 1, 
+					delegate (OptionValueCollection v) { action (v [0]); });
+			base.Add (p);
+			return this;
+		}
+
+		public OptionSet Add (string prototype, OptionAction<string, string> action)
+		{
+			return Add (prototype, null, action);
+		}
+
+		public OptionSet Add (string prototype, string description, OptionAction<string, string> action)
+		{
+			if (action == null)
+				throw new ArgumentNullException ("action");
+			Option p = new ActionOption (prototype, description, 2, 
+					delegate (OptionValueCollection v) {action (v [0], v [1]);});
+			base.Add (p);
+			return this;
+		}
+
+		sealed class ActionOption<T> : Option {
+			Action<T> action;
+
+			public ActionOption (string prototype, string description, Action<T> action)
+				: base (prototype, description, 1)
+			{
+				if (action == null)
+					throw new ArgumentNullException ("action");
+				this.action = action;
+			}
+
+			protected override void OnParseComplete (OptionContext c)
+			{
+				action (Parse<T> (c.OptionValues [0], c));
+			}
+		}
+
+		sealed class ActionOption<TKey, TValue> : Option {
+			OptionAction<TKey, TValue> action;
+
+			public ActionOption (string prototype, string description, OptionAction<TKey, TValue> action)
+				: base (prototype, description, 2)
+			{
+				if (action == null)
+					throw new ArgumentNullException ("action");
+				this.action = action;
+			}
+
+			protected override void OnParseComplete (OptionContext c)
+			{
+				action (
+						Parse<TKey> (c.OptionValues [0], c),
+						Parse<TValue> (c.OptionValues [1], c));
+			}
+		}
+
+		public OptionSet Add<T> (string prototype, Action<T> action)
+		{
+			return Add (prototype, null, action);
+		}
+
+		public OptionSet Add<T> (string prototype, string description, Action<T> action)
+		{
+			return Add (new ActionOption<T> (prototype, description, action));
+		}
+
+		public OptionSet Add<TKey, TValue> (string prototype, OptionAction<TKey, TValue> action)
+		{
+			return Add (prototype, null, action);
+		}
+
+		public OptionSet Add<TKey, TValue> (string prototype, string description, OptionAction<TKey, TValue> action)
+		{
+			return Add (new ActionOption<TKey, TValue> (prototype, description, action));
+		}
+
+		protected virtual OptionContext CreateOptionContext ()
+		{
+			return new OptionContext (this);
+		}
+
+#if LINQ
+		public List<string> Parse (IEnumerable<string> arguments)
+		{
+			bool process = true;
+			OptionContext c = CreateOptionContext ();
+			c.OptionIndex = -1;
+			var def = GetOptionForName ("<>");
+			var unprocessed = 
+				from argument in arguments
+				where ++c.OptionIndex >= 0 && (process || def != null)
+					? process
+						? argument == "--" 
+							? (process = false)
+							: !Parse (argument, c)
+								? def != null 
+									? Unprocessed (null, def, c, argument) 
+									: true
+								: false
+						: def != null 
+							? Unprocessed (null, def, c, argument)
+							: true
+					: true
+				select argument;
+			List<string> r = unprocessed.ToList ();
+			if (c.Option != null)
+				c.Option.Invoke (c);
+			return r;
+		}
+#else
+		public List<string> Parse (IEnumerable<string> arguments)
+		{
+			OptionContext c = CreateOptionContext ();
+			c.OptionIndex = -1;
+			bool process = true;
+			List<string> unprocessed = new List<string> ();
+			Option def = Contains ("<>") ? this ["<>"] : null;
+			foreach (string argument in arguments) {
+				++c.OptionIndex;
+				if (argument == "--") {
+					process = false;
+					continue;
+				}
+				if (!process) {
+					Unprocessed (unprocessed, def, c, argument);
+					continue;
+				}
+				if (!Parse (argument, c))
+					Unprocessed (unprocessed, def, c, argument);
+			}
+			if (c.Option != null)
+				c.Option.Invoke (c);
+			return unprocessed;
+		}
+#endif
+
+		private static bool Unprocessed (ICollection<string> extra, Option def, OptionContext c, string argument)
+		{
+			if (def == null) {
+				extra.Add (argument);
+				return false;
+			}
+			c.OptionValues.Add (argument);
+			c.Option = def;
+			c.Option.Invoke (c);
+			return false;
+		}
+
+		private readonly Regex ValueOption = new Regex (
+			@"^(?<flag>--|-|/)(?<name>[^:=]+)((?<sep>[:=])(?<value>.*))?$");
+
+		protected bool GetOptionParts (string argument, out string flag, out string name, out string sep, out string value)
+		{
+			if (argument == null)
+				throw new ArgumentNullException ("argument");
+
+			flag = name = sep = value = null;
+			Match m = ValueOption.Match (argument);
+			if (!m.Success) {
+				return false;
+			}
+			flag  = m.Groups ["flag"].Value;
+			name  = m.Groups ["name"].Value;
+			if (m.Groups ["sep"].Success && m.Groups ["value"].Success) {
+				sep   = m.Groups ["sep"].Value;
+				value = m.Groups ["value"].Value;
+			}
+			return true;
+		}
+
+		protected virtual bool Parse (string argument, OptionContext c)
+		{
+			if (c.Option != null) {
+				ParseValue (argument, c);
+				return true;
+			}
+
+			string f, n, s, v;
+			if (!GetOptionParts (argument, out f, out n, out s, out v))
+				return false;
+
+			Option p;
+			if (Contains (n)) {
+				p = this [n];
+				c.OptionName = f + n;
+				c.Option     = p;
+				switch (p.OptionValueType) {
+					case OptionValueType.None:
+						c.OptionValues.Add (n);
+						c.Option.Invoke (c);
+						break;
+					case OptionValueType.Optional:
+					case OptionValueType.Required: 
+						ParseValue (v, c);
+						break;
+				}
+				return true;
+			}
+			// no match; is it a bool option?
+			if (ParseBool (argument, n, c))
+				return true;
+			// is it a bundled option?
+			if (ParseBundledValue (f, string.Concat (n + s + v), c))
+				return true;
+
+			return false;
+		}
+
+		private void ParseValue (string option, OptionContext c)
+		{
+			if (option != null)
+				foreach (string o in c.Option.ValueSeparators != null 
+						? option.Split (c.Option.ValueSeparators, StringSplitOptions.None)
+						: new string[]{option}) {
+					c.OptionValues.Add (o);
+				}
+			if (c.OptionValues.Count == c.Option.MaxValueCount || 
+					c.Option.OptionValueType == OptionValueType.Optional)
+				c.Option.Invoke (c);
+			else if (c.OptionValues.Count > c.Option.MaxValueCount) {
+				throw new OptionException (localizer (string.Format (
+								"Error: Found {0} option values when expecting {1}.", 
+								c.OptionValues.Count, c.Option.MaxValueCount)),
+						c.OptionName);
+			}
+		}
+
+		private bool ParseBool (string option, string n, OptionContext c)
+		{
+			Option p;
+			string rn;
+			if (n.Length >= 1 && (n [n.Length-1] == '+' || n [n.Length-1] == '-') &&
+					Contains ((rn = n.Substring (0, n.Length-1)))) {
+				p = this [rn];
+				string v = n [n.Length-1] == '+' ? option : null;
+				c.OptionName  = option;
+				c.Option      = p;
+				c.OptionValues.Add (v);
+				p.Invoke (c);
+				return true;
+			}
+			return false;
+		}
+
+		private bool ParseBundledValue (string f, string n, OptionContext c)
+		{
+			if (f != "-")
+				return false;
+			for (int i = 0; i < n.Length; ++i) {
+				Option p;
+				string opt = f + n [i].ToString ();
+				string rn = n [i].ToString ();
+				if (!Contains (rn)) {
+					if (i == 0)
+						return false;
+					throw new OptionException (string.Format (localizer (
+									"Cannot bundle unregistered option '{0}'."), opt), opt);
+				}
+				p = this [rn];
+				switch (p.OptionValueType) {
+					case OptionValueType.None:
+						Invoke (c, opt, n, p);
+						break;
+					case OptionValueType.Optional:
+					case OptionValueType.Required: {
+						string v     = n.Substring (i+1);
+						c.Option     = p;
+						c.OptionName = opt;
+						ParseValue (v.Length != 0 ? v : null, c);
+						return true;
+					}
+					default:
+						throw new InvalidOperationException ("Unknown OptionValueType: " + p.OptionValueType);
+				}
+			}
+			return true;
+		}
+
+		private static void Invoke (OptionContext c, string name, string value, Option option)
+		{
+			c.OptionName  = name;
+			c.Option      = option;
+			c.OptionValues.Add (value);
+			option.Invoke (c);
+		}
+
+		private const int OptionWidth = 29;
+
+		public void WriteOptionDescriptions (TextWriter o)
+		{
+			foreach (Option p in this) {
+				int written = 0;
+				if (!WriteOptionPrototype (o, p, ref written))
+					continue;
+
+				if (written < OptionWidth)
+					o.Write (new string (' ', OptionWidth - written));
+				else {
+					o.WriteLine ();
+					o.Write (new string (' ', OptionWidth));
+				}
+
+				bool indent = false;
+				string prefix = new string (' ', OptionWidth+2);
+				foreach (string line in GetLines (localizer (GetDescription (p.Description)))) {
+					if (indent) 
+						o.Write (prefix);
+					o.WriteLine (line);
+					indent = true;
+				}
+			}
+		}
+
+		bool WriteOptionPrototype (TextWriter o, Option p, ref int written)
+		{
+			string[] names = p.Names;
+
+			int i = GetNextOptionIndex (names, 0);
+			if (i == names.Length)
+				return false;
+
+			if (names [i].Length == 1) {
+				Write (o, ref written, "  -");
+				Write (o, ref written, names [0]);
+			}
+			else {
+				Write (o, ref written, "      --");
+				Write (o, ref written, names [0]);
+			}
+
+			for ( i = GetNextOptionIndex (names, i+1); 
+					i < names.Length; i = GetNextOptionIndex (names, i+1)) {
+				Write (o, ref written, ", ");
+				Write (o, ref written, names [i].Length == 1 ? "-" : "--");
+				Write (o, ref written, names [i]);
+			}
+
+			if (p.OptionValueType == OptionValueType.Optional ||
+					p.OptionValueType == OptionValueType.Required) {
+				if (p.OptionValueType == OptionValueType.Optional) {
+					Write (o, ref written, localizer ("["));
+				}
+				Write (o, ref written, localizer ("=" + GetArgumentName (0, p.MaxValueCount, p.Description)));
+				string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 
+					? p.ValueSeparators [0]
+					: " ";
+				for (int c = 1; c < p.MaxValueCount; ++c) {
+					Write (o, ref written, localizer (sep + GetArgumentName (c, p.MaxValueCount, p.Description)));
+				}
+				if (p.OptionValueType == OptionValueType.Optional) {
+					Write (o, ref written, localizer ("]"));
+				}
+			}
+			return true;
+		}
+
+		static int GetNextOptionIndex (string[] names, int i)
+		{
+			while (i < names.Length && names [i] == "<>") {
+				++i;
+			}
+			return i;
+		}
+
+		static void Write (TextWriter o, ref int n, string s)
+		{
+			n += s.Length;
+			o.Write (s);
+		}
+
+		private static string GetArgumentName (int index, int maxIndex, string description)
+		{
+			if (description == null)
+				return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1);
+			string[] nameStart;
+			if (maxIndex == 1)
+				nameStart = new string[]{"{0:", "{"};
+			else
+				nameStart = new string[]{"{" + index + ":"};
+			for (int i = 0; i < nameStart.Length; ++i) {
+				int start, j = 0;
+				do {
+					start = description.IndexOf (nameStart [i], j);
+				} while (start >= 0 && j != 0 ? description [j++ - 1] == '{' : false);
+				if (start == -1)
+					continue;
+				int end = description.IndexOf ("}", start);
+				if (end == -1)
+					continue;
+				return description.Substring (start + nameStart [i].Length, end - start - nameStart [i].Length);
+			}
+			return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1);
+		}
+
+		private static string GetDescription (string description)
+		{
+			if (description == null)
+				return string.Empty;
+			StringBuilder sb = new StringBuilder (description.Length);
+			int start = -1;
+			for (int i = 0; i < description.Length; ++i) {
+				switch (description [i]) {
+					case '{':
+						if (i == start) {
+							sb.Append ('{');
+							start = -1;
+						}
+						else if (start < 0)
+							start = i + 1;
+						break;
+					case '}':
+						if (start < 0) {
+							if ((i+1) == description.Length || description [i+1] != '}')
+								throw new InvalidOperationException ("Invalid option description: " + description);
+							++i;
+							sb.Append ("}");
+						}
+						else {
+							sb.Append (description.Substring (start, i - start));
+							start = -1;
+						}
+						break;
+					case ':':
+						if (start < 0)
+							goto default;
+						start = i + 1;
+						break;
+					default:
+						if (start < 0)
+							sb.Append (description [i]);
+						break;
+				}
+			}
+			return sb.ToString ();
+		}
+
+		private static IEnumerable<string> GetLines (string description)
+		{
+			return StringCoda.WrappedLines (description, 
+					80 - OptionWidth, 
+					80 - OptionWidth - 2);
+		}
+	}
+}
+
Index: Scheduling/branches/GUI1.2/Printing.cs
===================================================================
--- Scheduling/branches/GUI1.2/Printing.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/Printing.cs	(revision 855)
@@ -0,0 +1,340 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing.Printing;
+using System.Drawing;
+using System.Data;
+using System.Drawing.Drawing2D;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+    /// <summary>
+    /// Class that encapsulates printing functions in Clinical Scheduling
+    /// </summary>
+    public static class Printing
+    {
+        /// <summary>
+        /// Print Appointments
+        /// </summary>
+        /// <param name="ds">Strongly Typed DataSet contains Resources and Appointments</param>
+        /// <param name="e">PrintPageEventArgs from PrintDocument Print handler</param>
+        /// <param name="beg">Begin Datetime to print appointments</param>
+        /// <param name="end">End Datetime to print appointments</param
+        /// <param name="resourceToPrint">The resouce to print</param>
+        /// <param name="apptPrinting">Current Appointment printing</param>
+        /// <param name="pageNumber">Current page number</param>
+        /// <remarks>beg and end have no effect on operation--they are there for documentation for user only</remarks>
+        public static void PrintAppointments(dsPatientApptDisplay2 ds, PrintPageEventArgs e, DateTime beg, DateTime end,
+            int resourceToPrint, ref int apptPrinting, int pageNumber)
+        {
+            Graphics g = e.Graphics;
+            //g.PageUnit = GraphicsUnit.Millimeter;
+            //SizeF szVCB = g.VisibleClipBounds.Size;
+            //PointF[] ptszVCB = {new PointF(szVCB.Width,szVCB.Height)};
+            //g.TransformPoints(CoordinateSpace.Page, CoordinateSpace.Device, ptszVCB);
+            //Create Fonts
+            Font f8 = new Font(FontFamily.GenericSerif, 8);
+            Font f10 = new Font(FontFamily.GenericSerif, 10);
+            Font f14bold = new Font(FontFamily.GenericSerif, 14, FontStyle.Bold);
+            
+            //Center Alignment for some stuff
+            StringFormat sf = new StringFormat();
+            sf.Alignment = StringAlignment.Center;
+            
+            //Header
+            g.DrawString("Confidential Patient Information", f8, Brushes.Black, e.PageBounds, sf);
+            
+            //Footer
+            sf.Alignment = StringAlignment.Center;
+            sf.LineAlignment = StringAlignment.Far;
+            g.DrawString("Page " + pageNumber, f8, Brushes.Black, e.PageBounds, sf);
+
+            //Typical manipulable print area
+            Rectangle printArea = e.MarginBounds;
+            
+            //resource we want to print
+            dsPatientApptDisplay2.BSDXResourceRow r = ds.BSDXResource[resourceToPrint];
+            
+            //header
+            string toprint;
+            if (beg == end) toprint = "Appointments for " + r.RESOURCE_NAME + " on " + beg.ToLongDateString();
+            else toprint = "Appointments for " + r.RESOURCE_NAME + " from " + beg.ToShortDateString() + " to "
+                + end.ToShortDateString();
+            g.DrawString(toprint, f14bold, Brushes.Black, printArea);
+            
+            //Move print area down
+            printArea.Height -= (int)f14bold.GetHeight();
+            printArea.Y += (int)f14bold.GetHeight();
+
+            //Draw Line
+            g.DrawLine(new Pen(Brushes.Black, 0), printArea.X, printArea.Y, printArea.X + printArea.Width, printArea.Y);
+            
+            //Move print area down
+            printArea.Y += 5; 
+            printArea.Height -= 5;
+            
+            System.Data.DataRow[] appts = r.GetChildRows(ds.Relations[0]); //ds has only one relation 
+
+            StringFormat sf2 = new StringFormat();                 //sf to hold tab stops
+            sf2.SetTabStops(50, new float[] { 100, 250, 25 });     
+
+            //appt printed starts at zero
+            while (apptPrinting < appts.Length)
+            {
+                dsPatientApptDisplay2.PatientApptsRow a = (dsPatientApptDisplay2.PatientApptsRow)appts[apptPrinting];
+                
+                StringBuilder apptPrintStr = new StringBuilder(200); 
+                apptPrintStr.AppendLine(a.ApptDate.ToString() + "\t" + a.Name + "(" + a.Sex + ")" + "\t" + "DOB: " + a.DOB.ToString("dd-MMM-yyyy") + "\t" + "ID: " + a.HRN);
+                apptPrintStr.AppendLine("P: " + a.HOMEPHONE + "\t" + "Address: " + a.STREET + ", " + a.CITY + ", " + a.STATE + " " + a.ZIP);
+                apptPrintStr.AppendLine("Note: " + a.NOTE);
+                apptPrintStr.AppendLine("Appointment made by " + a.APPT_MADE_BY + " on " + a.DATE_APPT_MADE);
+
+                int printedApptHeight = (int)g.MeasureString(apptPrintStr.ToString(), f10, printArea.Width).Height;
+                if (printedApptHeight > printArea.Height) // too much to print -- move to next page
+                    // but don't increment the appointment to print since we haven't printed it yet.
+                    // i.e. apptPrinting stays the same.
+                {
+                    e.HasMorePages = true;
+                    break;
+                }
+   
+                //otherwise print it
+                g.DrawString(apptPrintStr.ToString(), f10, Brushes.Black, printArea, sf2);
+                
+                //Move print area down
+                printArea.Y += printedApptHeight + 3;
+                printArea.Height -= printedApptHeight + 3;
+
+                //Draw a divider line
+                Point pt1 = new Point((int)(printArea.X + printArea.Width * 0.25), printArea.Y);
+                Point pt2 = new Point((int)(printArea.X + printArea.Width * 0.75), printArea.Y);
+                g.DrawLine(Pens.Gray, pt1, pt2);
+
+                //move down, again
+                printArea.Y += 3;
+                printArea.Height -= 3;
+
+                //go to the next appointment
+                apptPrinting++;
+            }
+        }
+
+        /// <summary>
+        /// Print Letter to be given or mailed to the patient
+        /// </summary>
+        /// <param name="ptrow">Strongly typed PatientApptsRow to pass (just one ApptRow)</param>
+        /// <param name="e">You know what that is</param>
+        /// <param name="letter">Contains letter string</param>
+        /// <param name="title">Title of the letter</param>
+        public static void PrintReminderLetter(dsPatientApptDisplay2.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title)
+        {
+
+            Rectangle printArea = e.MarginBounds;
+            Graphics g = e.Graphics;
+            StringFormat sf = new StringFormat();
+            sf.Alignment = StringAlignment.Center; //for title
+            Font fTitle = new Font(FontFamily.GenericSerif, 24, FontStyle.Bold); //for title
+            Font fBody = new Font(FontFamily.GenericSerif, 12);
+            g.DrawString(title, fTitle, Brushes.Black, printArea, sf); //title
+
+            // move down
+            int titleHeight = (int)g.MeasureString(title, fTitle, printArea.Width).Height;
+            printArea.Y += titleHeight;
+            printArea.Height -= titleHeight;
+            
+            // draw underline
+            g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y));
+            printArea.Y += 15;
+            printArea.Height -= 15;
+
+            // write appointment date
+            string str = "Appointment Date: " + ptRow.ApptDate + "\n\n";
+            g.DrawString(str, fBody, Brushes.Black, printArea);
+
+            // move down
+            int strHeight = (int)g.MeasureString(str, fBody, printArea.Width).Height;
+            printArea.Y += strHeight;
+            printArea.Height -= strHeight;
+
+            // write missive
+            g.DrawString(letter, fBody, Brushes.Black, printArea);
+
+            //print Address in lower left corner for windowed envolopes
+            printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66));
+            printArea.Height = (int)(e.MarginBounds.Height * 0.20);
+            sf.Alignment = StringAlignment.Near;
+            sf.LineAlignment = StringAlignment.Center;
+            StringBuilder address = new StringBuilder(100);
+            address.AppendLine(ptRow.Name);
+            address.AppendLine(ptRow.STREET);
+            address.AppendLine(ptRow.CITY + ", " + ptRow.STATE + " " + ptRow.ZIP);
+            g.DrawString(address.ToString(), fBody, Brushes.Black, printArea, sf);
+        }
+
+        /// <summary>
+        /// Cancellation Letter to be given or mailed to the patient
+        /// </summary>
+        /// <param name="ptRow">Strongly typed PatientApptsRow to pass (just one ApptRow)</param>
+        /// <param name="e">You know what that is</param>
+        /// <param name="letter">Contains letter string</param>
+        /// <param name="title">Title of the letter</param>
+        public static void PrintCancelLetter(dsRebookAppts.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title)
+        {
+            Rectangle printArea = e.MarginBounds;
+            Graphics g = e.Graphics;
+            StringFormat sf = new StringFormat();
+            sf.Alignment = StringAlignment.Center; //for title
+            Font fTitle = new Font(FontFamily.GenericSerif, 24, FontStyle.Bold); //for title
+            Font fBody = new Font(FontFamily.GenericSerif, 12);
+            g.DrawString(title, fTitle, Brushes.Black, printArea, sf); //title
+
+            // move down
+            int titleHeight = (int)g.MeasureString(title, fTitle, printArea.Width).Height;
+            printArea.Y += titleHeight;
+            printArea.Height -= titleHeight;
+
+            // draw underline
+            g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y));
+            printArea.Y += 15;
+            printArea.Height -= 15;
+
+            // write appointment date
+            string str = "Appointment Date: " + ptRow.OldApptDate + "\n\n";
+            g.DrawString(str, fBody, Brushes.Black, printArea);
+
+            // move down
+            int strHeight = (int)g.MeasureString(str, fBody, printArea.Width).Height;
+            printArea.Y += strHeight;
+            printArea.Height -= strHeight;
+
+            // write missive
+            g.DrawString(letter, fBody, Brushes.Black, printArea);
+
+            //print Address in lower left corner for windowed envolopes
+            printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66));
+            printArea.Height = (int)(e.MarginBounds.Height * 0.20);
+            sf.Alignment = StringAlignment.Near;
+            sf.LineAlignment = StringAlignment.Center;
+            StringBuilder address = new StringBuilder(100);
+            address.AppendLine(ptRow.Name);
+            address.AppendLine(ptRow.STREET);
+            address.AppendLine(ptRow.CITY + ", " + ptRow.STATE + " " + ptRow.ZIP);
+            g.DrawString(address.ToString(), fBody, Brushes.Black, printArea, sf);
+        }
+
+        /// <summary>
+        /// Print rebook letters. Prints old and new appointments dates then the missive.
+        /// </summary>
+        /// <param name="ptRow">Strongly typed appointment row</param>
+        /// <param name="e">etc</param>
+        /// <param name="letter">Text of the letter to print</param>
+        /// <param name="title">Title to print at the top of the letter</param>
+        public static void PrintRebookLetter(dsRebookAppts.PatientApptsRow ptRow, PrintPageEventArgs e, string letter, string title)
+        {
+            Rectangle printArea = e.MarginBounds;
+            Graphics g = e.Graphics;
+            StringFormat sf = new StringFormat();
+            sf.Alignment = StringAlignment.Center; //for title
+            Font fTitle = new Font(FontFamily.GenericSerif, 24, FontStyle.Bold); //for title
+            Font fBody = new Font(FontFamily.GenericSerif, 12);
+            g.DrawString(title, fTitle, Brushes.Black, printArea, sf); //title
+
+            // move down
+            int titleHeight = (int)g.MeasureString(title, fTitle, printArea.Width).Height;
+            printArea.Y += titleHeight;
+            printArea.Height -= titleHeight;
+
+            // draw underline
+            g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y));
+            printArea.Y += 15;
+            printArea.Height -= 15;
+
+            // write old and new appointment dates
+            string str = "Old Appointment Date:\t\t" + ptRow.OldApptDate + "\n";
+            str += "New Appointment Date:\t\t" + ptRow.NewApptDate + "\n\n";
+            g.DrawString(str, fBody, Brushes.Black, printArea);
+
+            // move down
+            int strHeight = (int)g.MeasureString(str, fBody, printArea.Width).Height;
+            printArea.Y += strHeight;
+            printArea.Height -= strHeight;
+
+            // write missive
+            g.DrawString(letter, fBody, Brushes.Black, printArea);
+
+            //print Address in lower left corner for windowed envolopes
+            printArea.Location = new Point(e.MarginBounds.X, (int)(e.PageBounds.Height * 0.66));
+            printArea.Height = (int)(e.MarginBounds.Height * 0.20);
+            sf.Alignment = StringAlignment.Near;
+            sf.LineAlignment = StringAlignment.Center;
+            StringBuilder address = new StringBuilder(100);
+            address.AppendLine(ptRow.Name);
+            address.AppendLine(ptRow.STREET);
+            address.AppendLine(ptRow.CITY + ", " + ptRow.STATE + " " + ptRow.ZIP);
+            g.DrawString(address.ToString(), fBody, Brushes.Black, printArea, sf);
+
+        }
+
+        /// <summary>
+        /// Print message on a page; typically that there are no appointments to be found.
+        /// Or just a test message to verify that printing works.
+        /// </summary>
+        /// <param name="msg">The exact string to print.</param>
+        /// <param name="e">Print Page event args</param>
+        public static void PrintMessage(string msg, PrintPageEventArgs e)
+        {
+            e.Graphics.DrawString(msg, new Font(FontFamily.GenericSerif, 14),
+                Brushes.Black, e.MarginBounds);
+        }
+
+        /// <summary>
+        /// Print Routing Slip
+        /// </summary>
+        /// <param name="a">Appointment Data Structure</param>
+        /// <param name="title">String to print for title</param>
+        /// <param name="e">etc</param>
+        public static void PrintRoutingSlip(CGAppointment a, string title, PrintPageEventArgs e)
+        {
+            Rectangle printArea = e.MarginBounds;
+            Graphics g = e.Graphics;
+            StringFormat sf = new StringFormat();
+            sf.Alignment = StringAlignment.Center; //for title
+            Font fTitle = new Font(FontFamily.GenericSerif, 24, FontStyle.Bold); //for title
+            Font fBody = new Font(FontFamily.GenericSerif, 18);
+            Font fBodyEm = new Font(FontFamily.GenericSerif, 18, FontStyle.Bold);
+            g.DrawString(title, fTitle, Brushes.Black, printArea, sf); //title
+
+            // move down
+            int titleHeight = (int)g.MeasureString(title, fTitle, printArea.Width).Height;
+            printArea.Y += titleHeight;
+            printArea.Height -= titleHeight;
+
+            // draw underline
+            g.DrawLine(Pens.Black, printArea.Location, new Point(printArea.Right, printArea.Y));
+            printArea.Y += 15;
+            printArea.Height -= 15;
+
+            //construct what to print
+            string toprint = "Patient: " + a.PatientName + "\t" + "ID: " + a.PatientID;
+            toprint += "\n\n";
+            toprint += "Appointment Time: " + a.StartTime.ToLongDateString() + " " + a.StartTime.ToLongTimeString();
+            toprint += "\n\n";
+            toprint += "Notes:\n" + a.Note;
+
+            //print
+            g.DrawString(toprint, fBody, Brushes.Black, printArea);
+
+            // Print Date Printed
+            //sf to move to bottom center
+            StringFormat sf2 = new StringFormat();
+            sf2.LineAlignment = StringAlignment.Far;
+            sf2.Alignment = StringAlignment.Center;
+
+            //Print
+            Font fFooter = new Font(FontFamily.GenericSerif, 8);
+            g.DrawString("Printed: " + DateTime.Now, fFooter, Brushes.Black, printArea, sf2);
+
+        }
+    }
+}
Index: Scheduling/branches/GUI1.2/UCPatientAppts.Designer.cs
===================================================================
--- Scheduling/branches/GUI1.2/UCPatientAppts.Designer.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/UCPatientAppts.Designer.cs	(revision 855)
@@ -0,0 +1,203 @@
+﻿namespace IndianHealthService.ClinicalScheduling
+{
+    partial class UCPatientAppts
+    {
+        /// <summary> 
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Component Designer generated code
+
+        /// <summary> 
+        /// Required method for Designer support - do not modify 
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.dgAppts = new System.Windows.Forms.DataGridView();
+            this.apptDateDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.clinicDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.aPPTMADEBYDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dATEAPPTMADEDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.nOTEDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.patientApptsBindingSource = new System.Windows.Forms.BindingSource(this.components);
+            this.dsPatientApptDisplay2BindingSource = new System.Windows.Forms.BindingSource(this.components);
+            this.dsPatientApptDisplay2 = new IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.btnPrint = new System.Windows.Forms.Button();
+            this.chkPastAppts = new System.Windows.Forms.CheckBox();
+            this.printDialog1 = new System.Windows.Forms.PrintDialog();
+            this.PrintPtAppts = new System.Drawing.Printing.PrintDocument();
+            ((System.ComponentModel.ISupportInitialize)(this.dgAppts)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.patientApptsBindingSource)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2BindingSource)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2)).BeginInit();
+            this.panel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // dgAppts
+            // 
+            this.dgAppts.AllowUserToAddRows = false;
+            this.dgAppts.AllowUserToDeleteRows = false;
+            this.dgAppts.AutoGenerateColumns = false;
+            this.dgAppts.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.dgAppts.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.apptDateDataGridViewTextBoxColumn,
+            this.clinicDataGridViewTextBoxColumn,
+            this.aPPTMADEBYDataGridViewTextBoxColumn,
+            this.dATEAPPTMADEDataGridViewTextBoxColumn,
+            this.nOTEDataGridViewTextBoxColumn});
+            this.dgAppts.DataSource = this.patientApptsBindingSource;
+            this.dgAppts.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.dgAppts.Location = new System.Drawing.Point(0, 32);
+            this.dgAppts.Name = "dgAppts";
+            this.dgAppts.ReadOnly = true;
+            this.dgAppts.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
+            this.dgAppts.ShowEditingIcon = false;
+            this.dgAppts.Size = new System.Drawing.Size(544, 171);
+            this.dgAppts.TabIndex = 2;
+            // 
+            // apptDateDataGridViewTextBoxColumn
+            // 
+            this.apptDateDataGridViewTextBoxColumn.DataPropertyName = "ApptDate";
+            this.apptDateDataGridViewTextBoxColumn.HeaderText = "Date";
+            this.apptDateDataGridViewTextBoxColumn.Name = "apptDateDataGridViewTextBoxColumn";
+            this.apptDateDataGridViewTextBoxColumn.ReadOnly = true;
+            // 
+            // clinicDataGridViewTextBoxColumn
+            // 
+            this.clinicDataGridViewTextBoxColumn.DataPropertyName = "Clinic";
+            this.clinicDataGridViewTextBoxColumn.HeaderText = "Clinic";
+            this.clinicDataGridViewTextBoxColumn.Name = "clinicDataGridViewTextBoxColumn";
+            this.clinicDataGridViewTextBoxColumn.ReadOnly = true;
+            // 
+            // aPPTMADEBYDataGridViewTextBoxColumn
+            // 
+            this.aPPTMADEBYDataGridViewTextBoxColumn.DataPropertyName = "APPT_MADE_BY";
+            this.aPPTMADEBYDataGridViewTextBoxColumn.HeaderText = "Made By";
+            this.aPPTMADEBYDataGridViewTextBoxColumn.Name = "aPPTMADEBYDataGridViewTextBoxColumn";
+            this.aPPTMADEBYDataGridViewTextBoxColumn.ReadOnly = true;
+            // 
+            // dATEAPPTMADEDataGridViewTextBoxColumn
+            // 
+            this.dATEAPPTMADEDataGridViewTextBoxColumn.DataPropertyName = "DATE_APPT_MADE";
+            this.dATEAPPTMADEDataGridViewTextBoxColumn.HeaderText = "Made on";
+            this.dATEAPPTMADEDataGridViewTextBoxColumn.Name = "dATEAPPTMADEDataGridViewTextBoxColumn";
+            this.dATEAPPTMADEDataGridViewTextBoxColumn.ReadOnly = true;
+            // 
+            // nOTEDataGridViewTextBoxColumn
+            // 
+            this.nOTEDataGridViewTextBoxColumn.DataPropertyName = "NOTE";
+            this.nOTEDataGridViewTextBoxColumn.HeaderText = "Note";
+            this.nOTEDataGridViewTextBoxColumn.Name = "nOTEDataGridViewTextBoxColumn";
+            this.nOTEDataGridViewTextBoxColumn.ReadOnly = true;
+            // 
+            // patientApptsBindingSource
+            // 
+            this.patientApptsBindingSource.DataMember = "PatientAppts";
+            this.patientApptsBindingSource.DataSource = this.dsPatientApptDisplay2BindingSource;
+            // 
+            // dsPatientApptDisplay2BindingSource
+            // 
+            this.dsPatientApptDisplay2BindingSource.DataSource = this.dsPatientApptDisplay2;
+            this.dsPatientApptDisplay2BindingSource.Position = 0;
+            // 
+            // dsPatientApptDisplay2
+            // 
+            this.dsPatientApptDisplay2.DataSetName = "dsPatientApptDisplay2";
+            this.dsPatientApptDisplay2.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
+            // 
+            // panel1
+            // 
+            this.panel1.Controls.Add(this.btnPrint);
+            this.panel1.Controls.Add(this.chkPastAppts);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(544, 32);
+            this.panel1.TabIndex = 3;
+            // 
+            // btnPrint
+            // 
+            this.btnPrint.Location = new System.Drawing.Point(3, 3);
+            this.btnPrint.Name = "btnPrint";
+            this.btnPrint.Size = new System.Drawing.Size(75, 23);
+            this.btnPrint.TabIndex = 1;
+            this.btnPrint.Text = "Print";
+            this.btnPrint.UseVisualStyleBackColor = true;
+            this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
+            // 
+            // chkPastAppts
+            // 
+            this.chkPastAppts.Anchor = System.Windows.Forms.AnchorStyles.Right;
+            this.chkPastAppts.AutoSize = true;
+            this.chkPastAppts.Location = new System.Drawing.Point(389, 3);
+            this.chkPastAppts.Name = "chkPastAppts";
+            this.chkPastAppts.Size = new System.Drawing.Size(152, 17);
+            this.chkPastAppts.TabIndex = 0;
+            this.chkPastAppts.Text = "Include Past Appointments";
+            this.chkPastAppts.UseVisualStyleBackColor = true;
+            this.chkPastAppts.CheckedChanged += new System.EventHandler(this.chkPastAppts_CheckedChanged);
+            // 
+            // printDialog1
+            // 
+            this.printDialog1.Document = this.PrintPtAppts;
+            this.printDialog1.UseEXDialog = true;
+            // 
+            // PrintPtAppts
+            // 
+            this.PrintPtAppts.DocumentName = "Print Patient Appointments";
+            this.PrintPtAppts.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.PrintPtAppts_PrintPage);
+            this.PrintPtAppts.QueryPageSettings += new System.Drawing.Printing.QueryPageSettingsEventHandler(this.PrintPtAppts_QueryPageSettings);
+            // 
+            // UCPatientAppts
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.Controls.Add(this.dgAppts);
+            this.Controls.Add(this.panel1);
+            this.Name = "UCPatientAppts";
+            this.Size = new System.Drawing.Size(544, 203);
+            ((System.ComponentModel.ISupportInitialize)(this.dgAppts)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.patientApptsBindingSource)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2BindingSource)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.dsPatientApptDisplay2)).EndInit();
+            this.panel1.ResumeLayout(false);
+            this.panel1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.DataGridView dgAppts;
+        private System.Windows.Forms.DataGridViewTextBoxColumn apptDateDataGridViewTextBoxColumn;
+        private System.Windows.Forms.DataGridViewTextBoxColumn clinicDataGridViewTextBoxColumn;
+        private System.Windows.Forms.DataGridViewTextBoxColumn aPPTMADEBYDataGridViewTextBoxColumn;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dATEAPPTMADEDataGridViewTextBoxColumn;
+        private System.Windows.Forms.DataGridViewTextBoxColumn nOTEDataGridViewTextBoxColumn;
+        private System.Windows.Forms.BindingSource patientApptsBindingSource;
+        private System.Windows.Forms.BindingSource dsPatientApptDisplay2BindingSource;
+        private dsPatientApptDisplay2 dsPatientApptDisplay2;
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.CheckBox chkPastAppts;
+        private System.Windows.Forms.Button btnPrint;
+        private System.Windows.Forms.PrintDialog printDialog1;
+        private System.Drawing.Printing.PrintDocument PrintPtAppts;
+    }
+}
Index: Scheduling/branches/GUI1.2/UCPatientAppts.cs
===================================================================
--- Scheduling/branches/GUI1.2/UCPatientAppts.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/UCPatientAppts.cs	(revision 855)
@@ -0,0 +1,132 @@
+﻿using System;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using IndianHealthService.BMXNet;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+    /// <summary>
+    /// User Control that shows patient's appointments and allows printing
+    /// </summary>
+    public partial class UCPatientAppts : UserControl
+    {
+        DataTable dtAppt; // Main table
+        DataView dvAppt; // Manipulated view of table
+        int rowToPrint; // Used in printing
+        /// <summary>
+        /// Ctor - Creates control and populates data into datagridview
+        /// </summary>
+        /// <param name="docManager">Document Manager from main context</param>
+        /// <param name="nPatientID">Patient IEN</param>
+        public UCPatientAppts(CGDocumentManager docManager, int nPatientID)
+        {
+            InitializeComponent();
+            try
+            {
+                string sSql = "BSDX PATIENT APPT DISPLAY^" + nPatientID.ToString();
+                dtAppt = docManager.RPMSDataTable(sSql, "PatientAppts");
+            }
+            catch (Exception ex) { MessageBox.Show(ex.Message); }
+
+            dvAppt = new DataView(dtAppt);
+            dvAppt.Sort = "ApptDate ASC";
+            SetPastFilter(false);
+            dgAppts.DataSource = dvAppt;
+
+        }
+        /// <summary>
+        /// Sets the filter for the DataView on whether to show past appointments or not
+        /// </summary>
+        /// <param name="ShowPastAppts">boolean - self explanatory</param>
+        void SetPastFilter(bool ShowPastAppts)
+        {
+            if (ShowPastAppts) dvAppt.RowFilter = "";
+            else dvAppt.RowFilter = "ApptDate > " + "#" + DateTime.Today.ToShortDateString() + "#";
+        }
+
+        private void chkPastAppts_CheckedChanged(object sender, EventArgs e)
+        {
+            if (chkPastAppts.Checked) SetPastFilter(true);
+            else SetPastFilter(false);
+        }
+
+        private void PrintPtAppts_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
+        {
+            Graphics g = e.Graphics;
+            Font Serif12Bold = new Font(FontFamily.GenericSerif, 12, FontStyle.Bold);
+            Font Serif12 = new Font(FontFamily.GenericSerif, 12);
+            Font Serif14 = new Font(FontFamily.GenericSerif, 14);
+            Rectangle startDrawRectangle = e.MarginBounds;
+            int widthPerColumn = e.MarginBounds.Width/dgAppts.Columns.Count;
+            int Serif12Height = (int)Serif12.GetHeight();
+            
+            //Draw Header
+            StringFormat sf1 = new StringFormat();
+            sf1.Alignment = StringAlignment.Center;
+            g.DrawString("Appointment Listing", Serif14, Brushes.Black, startDrawRectangle, sf1);
+
+            startDrawRectangle.Y += (int)Serif14.GetHeight();
+
+            g.DrawString("Confidential Patient Information", Serif12, Brushes.Black, startDrawRectangle, sf1);
+            
+            startDrawRectangle.Y += Serif12Height * 2;
+
+            //Patient Name + Sex + DOB
+            string identifier = "Patient Name: " + dtAppt.Rows[0]["Name"] + "\tSex: " + dtAppt.Rows[0]["Sex"]
+                + "\tDate of Birth: " + dtAppt.Rows[0]["DOB"];
+            g.DrawString(identifier, Serif12, Brushes.Black, startDrawRectangle);
+
+            startDrawRectangle.Y += Serif12Height * 2;
+
+            foreach (DataGridViewColumn col in dgAppts.Columns)
+            {
+                g.DrawString(col.HeaderText, Serif12Bold, Brushes.Black, startDrawRectangle);
+                startDrawRectangle.X += widthPerColumn;
+            }
+            startDrawRectangle.Y += Serif12Height;
+
+            // rowToPrint initialized in print button handler. Helps us keep track of which row we
+            // are on, so that, just in case we need an extra page to print, we would know where
+            // we left off. Royal we of course.
+            for ( ; rowToPrint<dgAppts.Rows.Count; rowToPrint++)
+            {
+                // Post facto statement -- This is starting to look like Mumps...
+                // Start drawing a new page if you hit the bottom margin...
+                // Y incremented at the bottom of the for loop; but checked here
+                // because I need for statement stuff to happen first
+                if (startDrawRectangle.Y > e.MarginBounds.Bottom)
+                {
+                    e.HasMorePages = true;
+                    break;
+                } 
+
+                startDrawRectangle.X = e.MarginBounds.X;
+
+                foreach (DataGridViewCell cell in dgAppts.Rows[rowToPrint].Cells)
+                {
+                    g.DrawString(cell.Value.ToString(), Serif12, Brushes.Black, startDrawRectangle);
+                    startDrawRectangle.X += widthPerColumn;
+                }
+
+                startDrawRectangle.Y += Serif12Height;
+
+            }             
+        }
+
+        private void btnPrint_Click(object sender, EventArgs e)
+        {
+            rowToPrint = 0; //reset row to print
+            DialogResult res = printDialog1.ShowDialog();
+            if (res == DialogResult.OK) this.printDialog1.Document.Print();
+        }
+
+        private void PrintPtAppts_QueryPageSettings(object sender, System.Drawing.Printing.QueryPageSettingsEventArgs e)
+        {
+            e.PageSettings.Landscape = true;
+        }
+
+    }
+}
Index: Scheduling/branches/GUI1.2/UCPatientAppts.resx
===================================================================
--- Scheduling/branches/GUI1.2/UCPatientAppts.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/UCPatientAppts.resx	(revision 855)
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="patientApptsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>412, 17</value>
+  </metadata>
+  <metadata name="dsPatientApptDisplay2BindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>179, 17</value>
+  </metadata>
+  <metadata name="dsPatientApptDisplay2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="printDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>597, 17</value>
+  </metadata>
+  <metadata name="PrintPtAppts.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>709, 17</value>
+  </metadata>
+</root>
Index: Scheduling/branches/GUI1.2/app.config
===================================================================
--- Scheduling/branches/GUI1.2/app.config	(revision 855)
+++ Scheduling/branches/GUI1.2/app.config	(revision 855)
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<configuration>
+  <appSettings>
+    <!--   User application and configured property settings go here.-->
+    <!--   Example: <add key="settingName" value="settingValue"/> -->
+    <add key="mnuNewAppointment.Enabled" value="True" />
+    <add key="ClientSettingsProvider.ServiceUri" value="" />
+  </appSettings>
+  <startup>
+    <supportedRuntime version="v2.0.50727" />
+  </startup>
+  <system.web>
+    <membership defaultProvider="ClientAuthenticationMembershipProvider">
+      <providers>
+        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
+      </providers>
+    </membership>
+    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
+      <providers>
+        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
+      </providers>
+    </roleManager>
+  </system.web>
+</configuration>
Index: Scheduling/branches/GUI1.2/bin/Release/ClinicalScheduling.XML
===================================================================
--- Scheduling/branches/GUI1.2/bin/Release/ClinicalScheduling.XML	(revision 855)
+++ Scheduling/branches/GUI1.2/bin/Release/ClinicalScheduling.XML	(revision 855)
@@ -0,0 +1,1322 @@
+<?xml version="1.0"?>
+<doc>
+    <assembly>
+        <name>ClinicalScheduling</name>
+    </assembly>
+    <members>
+        <member name="T:IndianHealthService.ClinicalScheduling.UCPatientAppts">
+            <summary>
+            User Control that shows patient's appointments and allows printing
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.UCPatientAppts.#ctor(IndianHealthService.ClinicalScheduling.CGDocumentManager,System.Int32)">
+            <summary>
+            Ctor - Creates control and populates data into datagridview
+            </summary>
+            <param name="docManager">Document Manager from main context</param>
+            <param name="nPatientID">Patient IEN</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.UCPatientAppts.SetPastFilter(System.Boolean)">
+            <summary>
+            Sets the filter for the DataView on whether to show past appointments or not
+            </summary>
+            <param name="ShowPastAppts">boolean - self explanatory</param>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.UCPatientAppts.components">
+            <summary> 
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.UCPatientAppts.Dispose(System.Boolean)">
+            <summary> 
+            Clean up any resources being used.
+            </summary>
+            <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.UCPatientAppts.InitializeComponent">
+            <summary> 
+            Required method for Designer support - do not modify 
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DManagement">
+            <summary>
+            Summary description for DManagement.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DManagement.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGSchedLib">
+            <summary>
+            CGSchedLib contains static functions that are called from throughout the 
+            scheduling application.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGRange">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGResource">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGDocumentManager">
+            <summary>
+            Summary description for DocumentManager.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGDocumentManager.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGDocumentManager.GetViewByResource(System.Collections.ArrayList)">
+            <summary>
+            Return the first view having a resource array matching sResourceArray
+            </summary>
+            <param name="sResourceArray"></param>
+            <returns></returns>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGDocumentManager.UpdateViews(System.String,System.String)">
+            <summary>
+            Propogate availability updates to all sRresource's doc/views 
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGDocumentManager.UpdateViews">
+            <summary>
+            Propogate availability updates to all doc/views 
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGDocumentManager.CloseAllViews(IndianHealthService.ClinicalScheduling.CGDocument)">
+            <summary>
+            Calls each view associated with document Doc and closes it.
+            </summary>		
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGDocumentManager.CloseAllViews(IndianHealthService.ClinicalScheduling.CGAVDocument)">
+            <summary>
+            Calls each view associated with Availability Doc and closes it.
+            </summary>		
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocumentManager.ConnectInfo">
+            <summary>
+            Returns the document manager's BMXNetConnectInfo member
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocumentManager.ScheduleManager">
+            <summary>
+            True if the current user holds the BSDXZMGR or XUPROGMODE keys in RPMS
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocumentManager.WindowText">
+            <summary>
+            Holds the user and division
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocumentManager.GlobalDataSet">
+            <summary>
+            This dataset contains tables used by the entire application
+            </summary>		
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocumentManager.Current">
+            <summary>
+            Returns the single CGDocumentManager object
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocumentManager.Views">
+            <summary>
+            Returns the list of currently opened documents
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocumentManager.AvailabilityViews">
+            <summary>
+            Returns the list of currently opened CGAVViews
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DCancelAppt">
+            <summary>
+            Summary description for DCancelAppt.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DCancelAppt.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DCancelAppt.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DCancelAppt.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DCancelAppt.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCancelAppt.RebookAccessType">
+            <summary>
+            Sets or returns the rebook access type:  -1 = use current type, -2 = use any type, 0 = prompt for a type
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCancelAppt.ClinicCancelled">
+            <summary>
+            Returns true if appt cancelled by Clinic, otherwise false
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCancelAppt.AutoRebook">
+            <summary>
+            Returns value of AutoRebook check box
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCancelAppt.CancelReason">
+            <summary>
+            Returns internal entry in the CANCELLATION REASON file (409.2)
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCancelAppt.CancelRemarks">
+            <summary>
+            Returns cancellation remarks.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCancelAppt.RebookStartDays">
+            <summary>
+            Sets or returns the number of days in the future to start searching for availability
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCancelAppt.RebookMaxDays">
+            <summary>
+            Sets and returns the maximum number of days in the future to look for rebook availability
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGView">
+            <summary>
+            Summary description for CGView.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGView.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGView.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGView.AppointmentNoShow(System.Boolean)">
+            <summary>
+            Marks all selected appointments as No Show
+            </summary>
+            <param name="nApptID"></param>
+            <returns></returns>		
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGView.AppointmentDeleteOne(System.Int32)">
+            <summary>
+            Delete appointment ApptID
+            </summary>
+            <param name="nApptID"></param>
+            <returns></returns>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGView.AppointmentDelete">
+            <summary>
+            Delete all selected appointments
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGView.CGrid">
+            <summary>
+            Access the CalendarGrid associated with this view
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGView.Document">
+            <summary>
+            Accesses the document associated with this view
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGAppointments">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DPatientLookup">
+            <summary>
+            Summary description for DPatientLookup.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DPatientLookup.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientLookup.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientLookup.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DPatientLookup.PatientName">
+            <summary>
+            Gets or sets the name of the selected patient
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DPatientLookup.PatientIEN">
+            <summary>
+            RPMS Internal Entry Number in PATIENT file (DFN)
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DPatientLookup.HealthRecordNumber">
+            <summary>
+            The string representation of the Health Record Number
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DAccessGroup">
+            <summary>
+            Summary description for DAccessGroup.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DAccessGroup.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessGroup.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessGroup.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessGroup.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DAccessGroup.AccessGroupName">
+            <summary>
+            Gets the name of the Access Group;
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGSelectionChangedArgs">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGDocument">
+            <summary>
+            Contains the array of appointments and availabily that make up the document class
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGDocument.RefreshDaysSchedule">
+            <summary>
+            Update schedule based on info in RPMS
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGDocument.WeekNeedsRefresh(System.Int32,System.DateTime,System.DateTime@,System.DateTime@)">
+            <summary>
+            Given a selected date,
+            Calculates StartDay and End Day and returns them in output params.  
+            nWeeks == number of Weeks to display
+            nColumnCount is number of days displayed per week.  If 5 columns, begin on
+            Monday, if 7 Columns, begin on Sunday
+            
+            Returns TRUE if the document's data needs refreshing based on 
+            this newly selected date.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGDocument.CreateAppointment(IndianHealthService.ClinicalScheduling.CGAppointment)">
+            <summary>
+            Calls RPMS to create appointment then 
+            adds appointment to the m_appointments collection
+            Returns the IEN of the appointment in the RPMS BSDX APPOINTMENT file.
+            </summary>
+            <param name="rApptInfo"></param>
+            <returns></returns>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGDocument.CreateAppointment(IndianHealthService.ClinicalScheduling.CGAppointment,System.Boolean)">
+            <summary>
+            Use this overload to create a walkin appointment
+            </summary>
+            <param name="rApptInfo"></param>
+            <param name="bWalkin"></param>
+            <returns></returns>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocument.LastRefreshed">
+            <summary>
+            Returns the latest refresh time for this document
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocument.Resources">
+            <summary>
+            The list of Resource names
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocument.AvailabilityArray">
+            <summary>
+            The array of CGAvailabilities that contains appt type and slots
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocument.Appointments">
+            <summary>
+            Contains the hashtable of appointments
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocument.SelectedDate">
+            <summary>
+            Holds the date selected by the user in CGView.dateTimePicker1
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGDocument.StartDate">
+            <summary>
+            Contains the beginning date of the appointment document
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsRebookAppts">
+             <summary>
+            Represents a strongly typed in-memory cache of data.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsRebookAppts.BSDXResourceDataTable">
+             <summary>
+            Represents the strongly named DataTable class.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsRebookAppts.PatientApptsDataTable">
+             <summary>
+            Represents the strongly named DataTable class.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsRebookAppts.PatientApptsRow">
+             <summary>
+            Represents strongly named DataRow class.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsRebookAppts.BSDXResourceRow">
+             <summary>
+            Represents strongly named DataRow class.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsRebookAppts.PatientApptsRowChangeEvent">
+             <summary>
+            Row event argument class
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsRebookAppts.BSDXResourceRowChangeEvent">
+             <summary>
+            Row event argument class
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2">
+             <summary>
+            Represents a strongly typed in-memory cache of data.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2.PatientApptsDataTable">
+             <summary>
+            Represents the strongly named DataTable class.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2.BSDXResourceDataTable">
+             <summary>
+            Represents the strongly named DataTable class.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2.PatientApptsRow">
+             <summary>
+            Represents strongly named DataRow class.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2.BSDXResourceRow">
+             <summary>
+            Represents strongly named DataRow class.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2.PatientApptsRowChangeEvent">
+             <summary>
+            Row event argument class
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2.BSDXResourceRowChangeEvent">
+             <summary>
+            Row event argument class
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DPatientLetter">
+            <summary>
+            Summary description for DPatientLetter.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DPatientLetter.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientLetter.InitializeFormClinicSchedule(IndianHealthService.ClinicalScheduling.CGDocumentManager,System.String,System.DateTime,System.DateTime)">
+            <summary>
+            Print Clinic Schedules
+            </summary>
+            <param name="docManager">This docManger</param>
+            <param name="sClinicList">Clinics for which to print</param>
+            <param name="dtBegin">Beginning Date</param>
+            <param name="dtEnd">End Date</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientLetter.InitializeFormRebookLetters(IndianHealthService.ClinicalScheduling.CGDocumentManager,System.String,System.DateTime,System.DateTime)">
+            <summary>
+            Print Rebook Letters by Date
+            </summary>
+            <param name="docManager">This docManger</param>
+            <param name="sClinicList">Clinics for which to print</param>
+            <param name="dtBegin">Beginning Date</param>
+            <param name="dtEnd">End Date</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientLetter.InitializeFormRebookLetters(IndianHealthService.ClinicalScheduling.CGDocumentManager,System.String,System.String)">
+            <summary>
+            Print Rebook Letters by Date
+            </summary>
+            <param name="docManager">This docManger</param>
+            <param name="sClinicList">Clinics for which to print</param>
+            <param name="sApptIDList">List of appointments IENs in ^BSDXAPPT, delimited by |</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientLetter.InitializeFormCancellationLetters(IndianHealthService.ClinicalScheduling.CGDocumentManager,System.String,System.DateTime,System.DateTime)">
+            <summary>
+            Print Cancellation letters to mail to patients
+            </summary>
+            <param name="docManager">This Docmanager</param>
+            <param name="sClinicList">| delemited clinic list (IEN's)</param>
+            <param name="dtBegin">Beginning Date</param>
+            <param name="dtEnd">Ending Date</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientLetter.InitializeFormPatientReminderLetters(IndianHealthService.ClinicalScheduling.CGDocumentManager,System.String,System.DateTime,System.DateTime)">
+            <summary>
+            Print Reminder Letters to give or mail to patients
+            </summary>
+            <param name="docManager">This docManger</param>
+            <param name="sClinicList">Clinics for which to print</param>
+            <param name="dtBegin">Beginning Date</param>
+            <param name="dtEnd">End Date</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientLetter.#ctor">
+            <summary>
+            Ctor
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientLetter.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientLetter.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DResourceGroup">
+            <summary>
+            Summary description for DResourceGroup.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DResourceGroup.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResourceGroup.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResourceGroup.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResourceGroup.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DResourceGroup.ResourceGroupName">
+            <summary>
+            Gets the name of the resource group
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DNoShow">
+            <summary>
+            Summary description for DAutoRebook.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DNoShow.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DNoShow.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DNoShow.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DNoShow.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DNoShow.RebookAccessType">
+            <summary>
+            Sets or returns the rebook access type:  -1 = use current type, -2 = use any type, 0 = prompt for a type
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DNoShow.AutoRebook">
+            <summary>
+            Returns value of AutoRebook check box
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DNoShow.RebookStartDays">
+            <summary>
+            Sets or returns the number of days in the future to start searching for availability
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DNoShow.RebookMaxDays">
+            <summary>
+            Sets and returns the maximum number of days in the future to look for rebook availability
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DAppointPage">
+            <summary>
+            Appointment Info Dialog
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAppointPage.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAppointPage.UpdateDialogData(System.Boolean)">
+            <summary>
+            Move data from member variables to controls (b == true)
+            or from controls to member variables (b == false)
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAppointPage.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DCopyAppts">
+            <summary>
+            Summary description for DCopyAppts.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DCopyAppts.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DCopyAppts.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGSelectionChangedHandler">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGCells">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGAvailability">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DAccessBlock">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGAppointmentChangedArgs">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DApptSearch">
+            <summary>
+            Summary description for DApptSearch.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DApptSearch.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DApptSearch.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DApptSearch.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DApptSearch.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DApptSearch.SelectedResource">
+            <summary>
+            Gets the resource selected by the user
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DApptSearch.SelectedDate">
+            <summary>
+            Gets the date selected by the user
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DCheckIn">
+            <summary>
+            Summary description for DCheckIn.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DCheckIn.InitializePage(IndianHealthService.ClinicalScheduling.CGAppointment,IndianHealthService.ClinicalScheduling.CGDocumentManager,System.String,System.Boolean,System.Boolean,System.Boolean,System.String,System.Int32)">
+            <summary>
+            Fill memeber variables before showing dialog
+            </summary>
+            <param name="a">Appointment</param>
+            <param name="docManager">Document Manager</param>
+            <param name="sDefaultProvider">Default provider</param>
+            <param name="bProviderRequired">not used</param>
+            <param name="bGeneratePCCPlus">not used</param>
+            <param name="bMultCodes">not used</param>
+            <param name="sStopCode">Stop Code</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DCheckIn.PCCPlus">
+            <summary>
+            Not used in VISTA. Needs to be removed
+            <remarks>Not used in VISTA.</remarks>
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DCheckIn.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DCheckIn.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DCheckIn.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCheckIn.ProviderIEN">
+            <summary>
+            Returns string representation of internal entry number of Provider in PROVIDER File
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCheckIn.PCCClinicIEN">
+            <summary>
+            Returns string representation of IEN of Clinic in VEN EHP CLINIC file
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCheckIn.PCCFormIEN">
+            <summary>
+            Returns string representation of IEN of template entry in VEN PCC TEMPLATE
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCheckIn.PCCOutGuide">
+            <summary>
+            Returns 'true' if outguide to be printed; otherwise returns 'false'
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCheckIn.ClinicStopIEN">
+            <summary>
+            Returns string representation of IEN of CLINIC STOP
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCheckIn.PrintRouteSlip">
+            <summary>
+            Returns 'true' if routing slip to be printed; otherwise 'false'
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCheckIn.CheckInTime">
+            <summary>
+            Appointment checkin time
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DCheckIn.AuxTime">
+            <summary>
+            Appointment end time
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DAccessGroupItem">
+            <summary>
+            Summary description for DAccessGroupItem.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DAccessGroupItem.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessGroupItem.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessGroupItem.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessGroupItem.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DAccessGroupItem.AccessTypeID">
+            <summary>
+            Contains the IEN of the AccessType in the BSDX_ACCESS_TYPE file
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DAccessGroupItem.AccessTypeName">
+            <summary>
+            Contains the name of the AccessType
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGAppointment">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.Printing">
+            <summary>
+            Class that encapsulates printing functions in Clinical Scheduling
+            </summary>
+        </member>
+        <!-- Badly formed XML comment ignored for member "M:IndianHealthService.ClinicalScheduling.Printing.PrintAppointments(IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2,System.Drawing.Printing.PrintPageEventArgs,System.DateTime,System.DateTime,System.Int32,System.Int32@,System.Int32)" -->
+        <member name="M:IndianHealthService.ClinicalScheduling.Printing.PrintReminderLetter(IndianHealthService.ClinicalScheduling.dsPatientApptDisplay2.PatientApptsRow,System.Drawing.Printing.PrintPageEventArgs,System.String,System.String)">
+            <summary>
+            Print Letter to be given or mailed to the patient
+            </summary>
+            <param name="ptrow">Strongly typed PatientApptsRow to pass (just one ApptRow)</param>
+            <param name="e">You know what that is</param>
+            <param name="letter">Contains letter string</param>
+            <param name="title">Title of the letter</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.Printing.PrintCancelLetter(IndianHealthService.ClinicalScheduling.dsRebookAppts.PatientApptsRow,System.Drawing.Printing.PrintPageEventArgs,System.String,System.String)">
+            <summary>
+            Cancellation Letter to be given or mailed to the patient
+            </summary>
+            <param name="ptRow">Strongly typed PatientApptsRow to pass (just one ApptRow)</param>
+            <param name="e">You know what that is</param>
+            <param name="letter">Contains letter string</param>
+            <param name="title">Title of the letter</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.Printing.PrintRebookLetter(IndianHealthService.ClinicalScheduling.dsRebookAppts.PatientApptsRow,System.Drawing.Printing.PrintPageEventArgs,System.String,System.String)">
+            <summary>
+            Print rebook letters. Prints old and new appointments dates then the missive.
+            </summary>
+            <param name="ptRow">Strongly typed appointment row</param>
+            <param name="e">etc</param>
+            <param name="letter">Text of the letter to print</param>
+            <param name="title">Title to print at the top of the letter</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.Printing.PrintMessage(System.String,System.Drawing.Printing.PrintPageEventArgs)">
+            <summary>
+            Print message on a page; typically that there are no appointments to be found.
+            Or just a test message to verify that printing works.
+            </summary>
+            <param name="msg">The exact string to print.</param>
+            <param name="e">Print Page event args</param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.Printing.PrintRoutingSlip(IndianHealthService.ClinicalScheduling.CGAppointment,System.String,System.Drawing.Printing.PrintPageEventArgs)">
+            <summary>
+            Print Routing Slip
+            </summary>
+            <param name="a">Appointment Data Structure</param>
+            <param name="title">String to print for title</param>
+            <param name="e">etc</param>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DSelectSchedules">
+            <summary>
+            Summary description for DSelectSchedules.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DSelectSchedules.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DSelectSchedules.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DSelectSchedules.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DSelectSchedules.SelectedClinics">
+            <summary>
+            Returns the an ArrayList of selected resource names
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DResource">
+            <summary>
+            Summary description for DResource.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DResource.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResource.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResource.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResource.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGCell">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DResourceUser">
+            <summary>
+            Summary description for DResourceUser.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DResourceUser.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResourceUser.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResourceUser.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResourceUser.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DResourceUser.UserID">
+            <summary>
+            The ID of the Resource User in the NEW PERSON file.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DResourceUser.ModifySchedule">
+            <summary>
+            True if the user is allowed to modify the resource's scheduled availability
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DResourceUser.Overbook">
+            <summary>
+            True if the user is allowed to overbook beyond the resource's scheduled availability
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DResourceUser.Appoinmtments">
+            <summary>
+            True if the user is allowed to create, edit and delete appointments
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DResourceGroupItem">
+            <summary>
+            Summary description for DResourceGroup.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DResourceGroupItem.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResourceGroupItem.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResourceGroupItem.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DResourceGroupItem.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DResourceGroupItem.ResourceID">
+            <summary>
+            Contains the IEN of the Resource in the BSDX_RESOURCE file
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DResourceGroupItem.ResourceName">
+            <summary>
+            Contains the name of the Resource
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DPatientApptDisplay">
+            <summary>
+            Summary description for DPatientApptDisplay.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DPatientApptDisplay.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientApptDisplay.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DPatientApptDisplay.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGAVView">
+            <summary>
+            Summary description for CGAVView.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGAVView.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGAVView.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGAVView.CGrid">
+            <summary>
+            Access the CalendarGrid associated with this view
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGAVView.Document">
+            <summary>
+            Accesses the document associated with this view
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DSelectLetterClinics">
+             <summary>
+             Use this dialog to select resources and dates (begin and end) for their examination.
+             <example>
+             DSelectLetterClinics ds = new DSelectLetterClinics();
+             ds.InitializePage(this.m_DocManager.GlobalDataSet, "Print Clinic Cancellation Letters");
+            	ds.ShowDialog(this) 					
+            
+             //get the resource names and call the letter printer
+            	string sClinics = ds.SelectedClinics;
+            	DateTime dtBegin = ds.BeginDate;
+            	DateTime dtEnd = ds.EndDate;
+             </example>
+             </summary>
+             
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DSelectLetterClinics.#ctor">
+            <summary>
+            Ctor; also sets default enter and cancel buttons
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DSelectLetterClinics.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DSelectLetterClinics.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DSelectLetterClinics.SelectedClinics">
+            <summary>
+            Returns the |-delimited string of selected resource id's
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGAppointmentChangedHandler">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CGAVDocument">
+            <summary>
+            Contains array of availability blocks for a scheduling resource
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGAVDocument.CreateAppointmentAuto(IndianHealthService.ClinicalScheduling.CGAppointment)">
+            <summary>
+            Called by LoadTemplate to create Access Block
+            Returns the IEN of the availability block in the RPMS BSDX AVAILABILITY file.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGAVDocument.RefreshDaysSchedule">
+            <summary>
+            Update availability block schedule based on info in RPMS
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGAVDocument.WeekNeedsRefresh(System.Int32,System.DateTime,System.DateTime@,System.DateTime@)">
+            <summary>
+            Given a selected date,
+            Calculates StartDay and End Day and returns them in output params.  
+            nWeeks == number of Weeks to display
+            nColumnCount is number of days displayed per week.  If 5 columns, begin on
+            Monday, if 7 Columns, begin on Sunday
+            
+            Returns TRUE if the document's data needs refreshing based on 
+            this newly selected date.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.CGAVDocument.UpdateAllViews">
+            <summary>
+            Calls each AVview associated with this AVdocument and tells it to update itself
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGAVDocument.ResourceID">
+            <summary>
+            Resource IEN in ^BSDXRES
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGAVDocument.Resources">
+            <summary>
+            The list of Resource names
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGAVDocument.AVBlocks">
+            <summary>
+            Contains the hashtable of Availability Blocks
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGAVDocument.SelectedDate">
+            <summary>
+            Holds the date selected by the user in CGView.dateTimePicker1
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.CGAVDocument.StartDate">
+            <summary>
+            Contains the beginning date of the appointment document
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DSplash">
+            <summary>
+            Summary description for DSplash.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DSplash.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DSplash.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DSplash.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DSplash.Status">
+            <summary>
+            Gets or sets the value of the Status displayed on the splash screen
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DAccessTemplate">
+            <summary>
+            Summary description for DAccessTemplate.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DAccessTemplate.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessTemplate.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessTemplate.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessTemplate.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DAccessTemplate.FileDialog">
+            <summary>
+            Returns the open file dialog object
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DAccessTemplate.StartDate">
+            <summary>
+            Sets or returns the start date to apply the template
+            </summary>
+        </member>
+        <member name="P:IndianHealthService.ClinicalScheduling.DAccessTemplate.WeeksToApply">
+            <summary>
+            Sets or returns the number of weeks to apply the template
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.dInputText">
+            <summary>
+            Summary description for dInputText.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.dInputText.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.dInputText.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.dInputText.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.DAccessType">
+            <summary>
+            Summary description for DAccessType.
+            </summary>
+        </member>
+        <member name="F:IndianHealthService.ClinicalScheduling.DAccessType.components">
+            <summary>
+            Required designer variable.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessType.Dispose(System.Boolean)">
+            <summary>
+            Clean up any resources being used.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessType.InitializeComponent">
+            <summary>
+            Required method for Designer support - do not modify
+            the contents of this method with the code editor.
+            </summary>
+        </member>
+        <member name="M:IndianHealthService.ClinicalScheduling.DAccessType.UpdateDialogData(System.Boolean)">
+            <summary>
+            If b is true, moves member vars into control data
+            otherwise, moves control data into member vars
+            </summary>
+            <param name="b"></param>
+        </member>
+        <member name="T:IndianHealthService.ClinicalScheduling.CalendarGrid">
+            <summary>
+            This class was regenerated from Calendargrid.dll using Reflector.exe
+            by Sam Habiel for WorldVista. The original source code is lost.
+            </summary>
+        </member>
+    </members>
+</doc>
Index: Scheduling/branches/GUI1.2/bin/Release/ClinicalScheduling.exe.config
===================================================================
--- Scheduling/branches/GUI1.2/bin/Release/ClinicalScheduling.exe.config	(revision 855)
+++ Scheduling/branches/GUI1.2/bin/Release/ClinicalScheduling.exe.config	(revision 855)
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<configuration>
+  <appSettings>
+    <!--   User application and configured property settings go here.-->
+    <!--   Example: <add key="settingName" value="settingValue"/> -->
+    <add key="mnuNewAppointment.Enabled" value="True" />
+    <add key="ClientSettingsProvider.ServiceUri" value="" />
+  </appSettings>
+  <startup>
+    <supportedRuntime version="v2.0.50727" />
+  </startup>
+  <system.web>
+    <membership defaultProvider="ClientAuthenticationMembershipProvider">
+      <providers>
+        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
+      </providers>
+    </membership>
+    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
+      <providers>
+        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
+      </providers>
+    </roleManager>
+  </system.web>
+</configuration>
Index: Scheduling/branches/GUI1.2/bsdxctrl.txt
===================================================================
--- Scheduling/branches/GUI1.2/bsdxctrl.txt	(revision 855)
+++ Scheduling/branches/GUI1.2/bsdxctrl.txt	(revision 855)
@@ -0,0 +1,9 @@
+download
+BMXNet.dll
+I
+CalendarGrid.dll
+I
+ClinicalScheduling.exe
+I
+ClinicalScheduling.exe.conig
+A
Index: Scheduling/branches/GUI1.2/csSchema.xsd
===================================================================
--- Scheduling/branches/GUI1.2/csSchema.xsd	(revision 855)
+++ Scheduling/branches/GUI1.2/csSchema.xsd	(revision 855)
@@ -0,0 +1,192 @@
+<?xml version="1.0" standalone="yes" ?>
+<xs:schema id="GlobalDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+	<xs:element name="GlobalDataSet" msdata:IsDataSet="true">
+		<xs:complexType>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="SchedulingUser">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="MANAGER" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="AccessTypes">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="BMXIEN" type="xs:int" />
+							<xs:element name="ACCESS_TYPE_NAME" type="xs:string" minOccurs="0" />
+							<xs:element name="BLUE" type="xs:int" minOccurs="0" />
+							<xs:element name="DEPARTMENT_NAME" type="xs:string" minOccurs="0" />
+							<xs:element name="DISPLAY_COLOR" type="xs:string" minOccurs="0" />
+							<xs:element name="GREEN" type="xs:int" minOccurs="0" />
+							<xs:element name="INACTIVE" type="xs:string" minOccurs="0" />
+							<xs:element name="RED" type="xs:int" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="AccessGroup">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="BMXIEN" type="xs:int" minOccurs="0" />
+							<xs:element name="ACCESS_GROUP" type="xs:string" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="AccessGroupType">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="ACCESS_GROUP_TYPEID" type="xs:int" />
+							<xs:element name="ACCESS_GROUP_ID" type="xs:int" minOccurs="0" />
+							<xs:element name="ACCESS_GROUP" type="xs:string" minOccurs="0" />
+							<xs:element name="ACCESS_TYPE_ID" type="xs:int" minOccurs="0" />
+							<xs:element name="ACCESS_TYPE" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ResourceGroup">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCE_GROUPID" type="xs:int" minOccurs="0" />
+							<xs:element name="RESOURCE_GROUP" type="xs:string" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="Resources">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCEID" type="xs:int" />
+							<xs:element name="RESOURCE_NAME" type="xs:string" minOccurs="0" />
+							<xs:element name="INACTIVE" type="xs:string" minOccurs="0" />
+							<xs:element name="TIMESCALE" type="xs:int" minOccurs="0" />
+							<xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" minOccurs="0" />
+							<xs:element name="LETTER_TEXT" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="GroupResources">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCE_GROUPID" type="xs:int" minOccurs="0" />
+							<xs:element name="RESOURCE_GROUP" type="xs:string" minOccurs="0" />
+							<xs:element name="RESOURCE_GROUP_ITEMID" type="xs:int" minOccurs="0" />
+							<xs:element name="RESOURCE_NAME" type="xs:string" minOccurs="0" />
+							<xs:element name="RESOURCEID" type="xs:int" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="HospitalLocation">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" />
+							<xs:element name="HOSPITAL_LOCATION" type="xs:string" minOccurs="0" />
+							<xs:element name="DEFAULT_PROVIDER" type="xs:string" minOccurs="0" />
+							<xs:element name="STOP_CODE_NUMBER" type="xs:string" minOccurs="0" />
+							<xs:element name="INACTIVATE_DATE" type="xs:dateTime" minOccurs="0" />
+							<xs:element name="REACTIVATE_DATE" type="xs:dateTime" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ClinicSetupParameters">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" />
+							<xs:element name="HOSPITAL_LOCATION" type="xs:string" minOccurs="0" />
+							<xs:element name="CREATE_VISIT" type="xs:string" minOccurs="0" />
+							<xs:element name="VISIT_SERVICE_CATEGORY" type="xs:string" minOccurs="0" />
+							<xs:element name="PROVIDER" msdata:ReadOnly="true" msdata:Expression="Parent.DEFAULT_PROVIDER"
+								type="xs:string" minOccurs="0" />
+							<xs:element name="CLINIC_STOP" msdata:ReadOnly="true" msdata:Expression="Parent.STOP_CODE_NUMBER"
+								type="xs:string" minOccurs="0" />
+							<xs:element name="INACTIVATE_DATE" msdata:ReadOnly="true" msdata:Expression="Parent.INACTIVATE_DATE"
+								type="xs:string" minOccurs="0" />
+							<xs:element name="REACTIVATE_DATE" msdata:ReadOnly="true" msdata:Expression="Parent.REACTIVATE_DATE"
+								type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ScheduleUser">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="USERID" type="xs:int" />
+							<xs:element name="USERNAME" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ResourceUser">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCEUSER_ID" type="xs:int" />
+							<xs:element name="RESOURCEID" type="xs:int" minOccurs="0" />
+							<xs:element name="OVERBOOK" type="xs:string" minOccurs="0" />
+							<xs:element name="MODIFY_SCHEDULE" type="xs:string" minOccurs="0" />
+							<xs:element name="USERID" type="xs:string" minOccurs="0" />
+							<xs:element name="USERID1" type="xs:int" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:choice>
+		</xs:complexType>
+		<xs:unique name="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//AccessTypes" />
+			<xs:field xpath="BMXIEN" />
+		</xs:unique>
+		<xs:unique name="AccessGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//AccessGroup" />
+			<xs:field xpath="ACCESS_GROUP" />
+		</xs:unique>
+		<xs:unique name="Constraint2">
+			<xs:selector xpath=".//AccessGroup" />
+			<xs:field xpath="BMXIEN" />
+		</xs:unique>
+		<xs:unique name="AccessGroupType_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//AccessGroupType" />
+			<xs:field xpath="ACCESS_GROUP_TYPEID" />
+		</xs:unique>
+		<xs:unique name="ResourceGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ResourceGroup" />
+			<xs:field xpath="RESOURCE_GROUP" />
+		</xs:unique>
+		<xs:unique name="Resources_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//Resources" />
+			<xs:field xpath="RESOURCEID" />
+		</xs:unique>
+		<xs:unique name="HospitalLocation_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//HospitalLocation" />
+			<xs:field xpath="HOSPITAL_LOCATION_ID" />
+		</xs:unique>
+		<xs:unique name="ClinicSetupParameters_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ClinicSetupParameters" />
+			<xs:field xpath="HOSPITAL_LOCATION_ID" />
+		</xs:unique>
+		<xs:unique name="ScheduleUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ScheduleUser" />
+			<xs:field xpath="USERID" />
+		</xs:unique>
+		<xs:unique name="ResourceUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ResourceUser" />
+			<xs:field xpath="RESOURCEUSER_ID" />
+		</xs:unique>
+		<xs:keyref name="ResourceUser" refer="Resources_Constraint1">
+			<xs:selector xpath=".//ResourceUser" />
+			<xs:field xpath="RESOURCEID" />
+		</xs:keyref>
+		<xs:keyref name="GroupResource2" refer="Resources_Constraint1">
+			<xs:selector xpath=".//GroupResources" />
+			<xs:field xpath="RESOURCEID" />
+		</xs:keyref>
+		<xs:keyref name="GroupResource" refer="ResourceGroup_Constraint1">
+			<xs:selector xpath=".//GroupResources" />
+			<xs:field xpath="RESOURCE_GROUP" />
+		</xs:keyref>
+		<xs:keyref name="AccessGroupType" refer="Constraint2">
+			<xs:selector xpath=".//AccessGroupType" />
+			<xs:field xpath="ACCESS_GROUP_ID" />
+		</xs:keyref>
+	</xs:element>
+	<xs:annotation>
+		<xs:appinfo>
+			<msdata:Relationship name="HospitalLocationClinic" msdata:parent="HospitalLocation" msdata:child="ClinicSetupParameters"
+				msdata:parentkey="HOSPITAL_LOCATION_ID" msdata:childkey="HOSPITAL_LOCATION_ID" />
+		</xs:appinfo>
+	</xs:annotation>
+</xs:schema>
Index: Scheduling/branches/GUI1.2/csSchema.xsx
===================================================================
--- Scheduling/branches/GUI1.2/csSchema.xsx	(revision 855)
+++ Scheduling/branches/GUI1.2/csSchema.xsx	(revision 855)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.-->
+<XSDDesignerLayout layoutVersion="2" viewPortLeft="19018" viewPortTop="-249" zoom="100">
+    <SchedulingUser_XmlElement left="41930" top="1793" width="5292" height="2963" selected="0" zOrder="1" index="0" expanded="1" />
+    <AccessTypes_XmlElement left="4778" top="980" width="7303" height="4656" selected="0" zOrder="32" index="1" expanded="1" />
+    <AccessGroup_XmlElement left="12885" top="873" width="6192" height="2963" selected="0" zOrder="26" index="2" expanded="1" />
+    <AccessGroupType_XmlElement left="11431" top="6456" width="7673" height="3810" selected="0" zOrder="27" index="3" expanded="1" />
+    <ResourceGroup_XmlElement left="19605" top="1244" width="8625" height="2963" selected="0" zOrder="21" index="4" expanded="1" />
+    <Resources_XmlElement left="30347" top="688" width="8308" height="3810" selected="0" zOrder="2" index="5" expanded="1" />
+    <GroupResources_XmlElement left="19526" top="6350" width="9102" height="3387" selected="0" zOrder="16" index="6" expanded="1" />
+    <HospitalLocation_XmlElement left="48789" top="1297" width="8414" height="3809" selected="0" zOrder="4" index="7" expanded="1" />
+    <ClinicSetupParameters_XmlElement left="48763" top="5529" width="8308" height="4657" selected="0" zOrder="6" index="8" expanded="1" />
+    <ScheduleUser_XmlElement left="41925" top="6345" width="5292" height="2963" selected="0" zOrder="8" index="9" expanded="1" />
+    <ResourceUser_XmlElement left="31063" top="6772" width="7408" height="4233" selected="0" zOrder="10" index="10" expanded="1" />
+    <GroupResource_XmlKeyref left="27812" top="4664" width="503" height="503" selected="0" zOrder="22" />
+    <GroupResource2_XmlKeyref left="29882" top="4564" width="503" height="503" selected="0" zOrder="17" />
+    <ResourceUser_XmlKeyref left="38738" top="4719" width="503" height="503" selected="0" zOrder="12" />
+    <AccessGroupType_XmlKeyref left="18527" top="4745" width="503" height="503" selected="0" zOrder="28" />
+</XSDDesignerLayout>
Index: Scheduling/branches/GUI1.2/csSchema20040213a.xsd
===================================================================
--- Scheduling/branches/GUI1.2/csSchema20040213a.xsd	(revision 855)
+++ Scheduling/branches/GUI1.2/csSchema20040213a.xsd	(revision 855)
@@ -0,0 +1,187 @@
+<?xml version="1.0" standalone="yes" ?>
+<xs:schema id="GlobalDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+	<xs:element name="GlobalDataSet" msdata:IsDataSet="true">
+		<xs:complexType>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="SchedulingUser">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="MANAGER" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="AccessTypes">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="BMXIEN" type="xs:int" />
+							<xs:element name="ACCESS_TYPE_NAME" type="xs:string" minOccurs="0" />
+							<xs:element name="BLUE" type="xs:int" minOccurs="0" />
+							<xs:element name="DEPARTMENT_NAME" type="xs:string" minOccurs="0" />
+							<xs:element name="DISPLAY_COLOR" type="xs:string" minOccurs="0" />
+							<xs:element name="GREEN" type="xs:int" minOccurs="0" />
+							<xs:element name="INACTIVE" type="xs:string" minOccurs="0" />
+							<xs:element name="RED" type="xs:int" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="AccessGroup">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="BMXIEN" type="xs:int" minOccurs="0" />
+							<xs:element name="ACCESS_GROUP" type="xs:string" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="AccessGroupType">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="ACCESS_GROUP_TYPEID" type="xs:int" />
+							<xs:element name="ACCESS_GROUP_ID" type="xs:int" minOccurs="0" />
+							<xs:element name="ACCESS_GROUP" type="xs:string" minOccurs="0" />
+							<xs:element name="ACCESS_TYPE_ID" type="xs:int" minOccurs="0" />
+							<xs:element name="ACCESS_TYPE" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ResourceGroup">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCE_GROUPID" type="xs:int" minOccurs="0" />
+							<xs:element name="RESOURCE_GROUP" type="xs:string" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="Resources">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCEID" type="xs:int" />
+							<xs:element name="RESOURCE_NAME" type="xs:string" minOccurs="0" />
+							<xs:element name="INACTIVE" type="xs:string" minOccurs="0" />
+							<xs:element name="TIMESCALE" type="xs:int" minOccurs="0" />
+							<xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" minOccurs="0" />
+							<xs:element name="LETTER_TEXT" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="GroupResources">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCE_GROUPID" type="xs:int" minOccurs="0" />
+							<xs:element name="RESOURCE_GROUP" type="xs:string" minOccurs="0" />
+							<xs:element name="RESOURCE_GROUP_ITEMID" type="xs:int" minOccurs="0" />
+							<xs:element name="RESOURCE_NAME" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="HospitalLocation">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" />
+							<xs:element name="HOSPITAL_LOCATION" type="xs:string" minOccurs="0" />
+							<xs:element name="DEFAULT_PROVIDER" type="xs:string" minOccurs="0" />
+							<xs:element name="STOP_CODE_NUMBER" type="xs:string" minOccurs="0" />
+							<xs:element name="INACTIVATE_DATE" type="xs:dateTime" minOccurs="0" />
+							<xs:element name="REACTIVATE_DATE" type="xs:dateTime" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ClinicSetupParameters">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" />
+							<xs:element name="HOSPITAL_LOCATION" type="xs:string" minOccurs="0" />
+							<xs:element name="CREATE_VISIT" type="xs:string" minOccurs="0" />
+							<xs:element name="VISIT_SERVICE_CATEGORY" type="xs:string" minOccurs="0" />
+							<xs:element name="PROVIDER" msdata:ReadOnly="true" msdata:Expression="Parent.DEFAULT_PROVIDER"
+								type="xs:string" minOccurs="0" />
+							<xs:element name="CLINIC_STOP" msdata:ReadOnly="true" msdata:Expression="Parent.STOP_CODE_NUMBER"
+								type="xs:string" minOccurs="0" />
+							<xs:element name="INACTIVATE_DATE" msdata:ReadOnly="true" msdata:Expression="Parent.INACTIVATE_DATE"
+								type="xs:string" minOccurs="0" />
+							<xs:element name="REACTIVATE_DATE" msdata:ReadOnly="true" msdata:Expression="Parent.REACTIVATE_DATE"
+								type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ScheduleUser">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="USERID" type="xs:int" />
+							<xs:element name="USERNAME" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ResourceUser">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCEUSER_ID" type="xs:int" />
+							<xs:element name="RESOURCEID" type="xs:int" minOccurs="0" />
+							<xs:element name="OVERBOOK" type="xs:string" minOccurs="0" />
+							<xs:element name="MODIFY_SCHEDULE" type="xs:string" minOccurs="0" />
+							<xs:element name="USERID" type="xs:string" minOccurs="0" />
+							<xs:element name="USERID1" type="xs:int" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:choice>
+		</xs:complexType>
+		<xs:unique name="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//AccessTypes" />
+			<xs:field xpath="BMXIEN" />
+		</xs:unique>
+		<xs:unique name="AccessGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//AccessGroup" />
+			<xs:field xpath="ACCESS_GROUP" />
+		</xs:unique>
+		<xs:unique name="Constraint2">
+			<xs:selector xpath=".//AccessGroup" />
+			<xs:field xpath="BMXIEN" />
+		</xs:unique>
+		<xs:unique name="AccessGroupType_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//AccessGroupType" />
+			<xs:field xpath="ACCESS_GROUP_TYPEID" />
+		</xs:unique>
+		<xs:unique name="ResourceGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ResourceGroup" />
+			<xs:field xpath="RESOURCE_GROUP" />
+		</xs:unique>
+		<xs:unique name="Resources_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//Resources" />
+			<xs:field xpath="RESOURCEID" />
+		</xs:unique>
+		<xs:unique name="HospitalLocation_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//HospitalLocation" />
+			<xs:field xpath="HOSPITAL_LOCATION_ID" />
+		</xs:unique>
+		<xs:unique name="ClinicSetupParameters_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ClinicSetupParameters" />
+			<xs:field xpath="HOSPITAL_LOCATION_ID" />
+		</xs:unique>
+		<xs:unique name="ScheduleUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ScheduleUser" />
+			<xs:field xpath="USERID" />
+		</xs:unique>
+		<xs:unique name="ResourceUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ResourceUser" />
+			<xs:field xpath="RESOURCEUSER_ID" />
+		</xs:unique>
+		<xs:keyref name="ResourceUser" refer="Resources_Constraint1">
+			<xs:selector xpath=".//ResourceUser" />
+			<xs:field xpath="RESOURCEID" />
+		</xs:keyref>
+		<xs:keyref name="GroupResource" refer="ResourceGroup_Constraint1">
+			<xs:selector xpath=".//GroupResources" />
+			<xs:field xpath="RESOURCE_GROUP" />
+		</xs:keyref>
+		<xs:keyref name="AccessGroupType" refer="Constraint2">
+			<xs:selector xpath=".//AccessGroupType" />
+			<xs:field xpath="ACCESS_GROUP_ID" />
+		</xs:keyref>
+	</xs:element>
+	<xs:annotation>
+		<xs:appinfo>
+			<msdata:Relationship name="HospitalLocationClinic" msdata:parent="HospitalLocation" msdata:child="ClinicSetupParameters"
+				msdata:parentkey="HOSPITAL_LOCATION_ID" msdata:childkey="HOSPITAL_LOCATION_ID" />
+		</xs:appinfo>
+	</xs:annotation>
+</xs:schema>
Index: Scheduling/branches/GUI1.2/csSchema20040428.xsd
===================================================================
--- Scheduling/branches/GUI1.2/csSchema20040428.xsd	(revision 855)
+++ Scheduling/branches/GUI1.2/csSchema20040428.xsd	(revision 855)
@@ -0,0 +1,201 @@
+<?xml version="1.0" standalone="yes"?>
+<xs:schema id="GlobalDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+  <xs:element name="GlobalDataSet" msdata:IsDataSet="true">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element name="VersionInfo">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="ERROR" type="xs:string" minOccurs="0" />
+              <xs:element name="MAJOR_VERSION" type="xs:string" minOccurs="0" />
+              <xs:element name="MINOR_VERSION" type="xs:string" minOccurs="0" />
+              <xs:element name="BUILD" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="SchedulingUser">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="MANAGER" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="AccessTypes">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="BMXIEN" type="xs:int" />
+              <xs:element name="ACCESS_TYPE_NAME" type="xs:string" minOccurs="0" />
+              <xs:element name="BLUE" type="xs:int" minOccurs="0" />
+              <xs:element name="DEPARTMENT_NAME" type="xs:string" minOccurs="0" />
+              <xs:element name="DISPLAY_COLOR" type="xs:string" minOccurs="0" />
+              <xs:element name="GREEN" type="xs:int" minOccurs="0" />
+              <xs:element name="INACTIVE" type="xs:string" minOccurs="0" />
+              <xs:element name="RED" type="xs:int" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="AccessGroup">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="BMXIEN" type="xs:int" minOccurs="0" />
+              <xs:element name="ACCESS_GROUP" type="xs:string" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="AccessGroupType">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="ACCESS_GROUP_TYPEID" type="xs:int" />
+              <xs:element name="ACCESS_GROUP_ID" type="xs:int" minOccurs="0" />
+              <xs:element name="ACCESS_GROUP" type="xs:string" minOccurs="0" />
+              <xs:element name="ACCESS_TYPE_ID" type="xs:int" minOccurs="0" />
+              <xs:element name="ACCESS_TYPE" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="ResourceGroup">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="RESOURCE_GROUPID" type="xs:int" minOccurs="0" />
+              <xs:element name="RESOURCE_GROUP" type="xs:string" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="Resources">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="RESOURCEID" type="xs:int" />
+              <xs:element name="RESOURCE_NAME" type="xs:string" minOccurs="0" />
+              <xs:element name="INACTIVE" type="xs:string" minOccurs="0" />
+              <xs:element name="TIMESCALE" type="xs:int" minOccurs="0" />
+              <xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" minOccurs="0" />
+              <xs:element name="LETTER_TEXT" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="GroupResources">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="RESOURCE_GROUPID" type="xs:int" minOccurs="0" />
+              <xs:element name="RESOURCE_GROUP" type="xs:string" minOccurs="0" />
+              <xs:element name="RESOURCE_GROUP_ITEMID" type="xs:int" minOccurs="0" />
+              <xs:element name="RESOURCE_NAME" type="xs:string" minOccurs="0" />
+              <xs:element name="RESOURCEID" type="xs:int" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="HospitalLocation">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" />
+              <xs:element name="HOSPITAL_LOCATION" type="xs:string" minOccurs="0" />
+              <xs:element name="DEFAULT_PROVIDER" type="xs:string" minOccurs="0" />
+              <xs:element name="STOP_CODE_NUMBER" type="xs:string" minOccurs="0" />
+              <xs:element name="INACTIVATE_DATE" type="xs:dateTime" minOccurs="0" />
+              <xs:element name="REACTIVATE_DATE" type="xs:dateTime" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="ClinicSetupParameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" />
+              <xs:element name="HOSPITAL_LOCATION" type="xs:string" minOccurs="0" />
+              <xs:element name="CREATE_VISIT" type="xs:string" minOccurs="0" />
+              <xs:element name="VISIT_SERVICE_CATEGORY" type="xs:string" minOccurs="0" />
+              <xs:element name="PROVIDER" msdata:ReadOnly="true" msdata:Expression="Parent.DEFAULT_PROVIDER" type="xs:string" minOccurs="0" />
+              <xs:element name="CLINIC_STOP" msdata:ReadOnly="true" msdata:Expression="Parent.STOP_CODE_NUMBER" type="xs:string" minOccurs="0" />
+              <xs:element name="INACTIVATE_DATE" msdata:ReadOnly="true" msdata:Expression="Parent.INACTIVATE_DATE" type="xs:string" minOccurs="0" />
+              <xs:element name="REACTIVATE_DATE" msdata:ReadOnly="true" msdata:Expression="Parent.REACTIVATE_DATE" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="ScheduleUser">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="USERID" type="xs:int" />
+              <xs:element name="USERNAME" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="ResourceUser">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="RESOURCEUSER_ID" type="xs:int" />
+              <xs:element name="RESOURCEID" type="xs:int" minOccurs="0" />
+              <xs:element name="OVERBOOK" type="xs:string" minOccurs="0" />
+              <xs:element name="MODIFY_SCHEDULE" type="xs:string" minOccurs="0" />
+              <xs:element name="USERID" type="xs:string" minOccurs="0" />
+              <xs:element name="USERID1" type="xs:int" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="Provider">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="BMXIEN" type="xs:int" minOccurs="0" />
+              <xs:element name="NAME" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//AccessTypes" />
+      <xs:field xpath="BMXIEN" />
+    </xs:unique>
+    <xs:unique name="AccessGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//AccessGroup" />
+      <xs:field xpath="ACCESS_GROUP" />
+    </xs:unique>
+    <xs:unique name="Constraint2">
+      <xs:selector xpath=".//AccessGroup" />
+      <xs:field xpath="BMXIEN" />
+    </xs:unique>
+    <xs:unique name="AccessGroupType_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//AccessGroupType" />
+      <xs:field xpath="ACCESS_GROUP_TYPEID" />
+    </xs:unique>
+    <xs:unique name="ResourceGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//ResourceGroup" />
+      <xs:field xpath="RESOURCE_GROUP" />
+    </xs:unique>
+    <xs:unique name="Resources_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//Resources" />
+      <xs:field xpath="RESOURCEID" />
+    </xs:unique>
+    <xs:unique name="HospitalLocation_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//HospitalLocation" />
+      <xs:field xpath="HOSPITAL_LOCATION_ID" />
+    </xs:unique>
+    <xs:unique name="ClinicSetupParameters_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//ClinicSetupParameters" />
+      <xs:field xpath="HOSPITAL_LOCATION_ID" />
+    </xs:unique>
+    <xs:unique name="ScheduleUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//ScheduleUser" />
+      <xs:field xpath="USERID" />
+    </xs:unique>
+    <xs:unique name="ResourceUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//ResourceUser" />
+      <xs:field xpath="RESOURCEUSER_ID" />
+    </xs:unique>
+    <xs:keyref name="ResourceUser" refer="Resources_Constraint1">
+      <xs:selector xpath=".//ResourceUser" />
+      <xs:field xpath="RESOURCEID" />
+    </xs:keyref>
+    <xs:keyref name="GroupResource" refer="ResourceGroup_Constraint1">
+      <xs:selector xpath=".//GroupResources" />
+      <xs:field xpath="RESOURCE_GROUP" />
+    </xs:keyref>
+    <xs:keyref name="AccessGroupType" refer="Constraint2">
+      <xs:selector xpath=".//AccessGroupType" />
+      <xs:field xpath="ACCESS_GROUP_ID" />
+    </xs:keyref>
+  </xs:element>
+  <xs:annotation>
+    <xs:appinfo>
+      <msdata:Relationship name="HospitalLocationClinic" msdata:parent="HospitalLocation" msdata:child="ClinicSetupParameters" msdata:parentkey="HOSPITAL_LOCATION_ID" msdata:childkey="HOSPITAL_LOCATION_ID" />
+    </xs:appinfo>
+  </xs:annotation>
+</xs:schema>
Index: Scheduling/branches/GUI1.2/csSchema20040428.xsx
===================================================================
--- Scheduling/branches/GUI1.2/csSchema20040428.xsx	(revision 855)
+++ Scheduling/branches/GUI1.2/csSchema20040428.xsx	(revision 855)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.-->
+<XSDDesignerLayout />
Index: Scheduling/branches/GUI1.2/csSchema20060526.xsd
===================================================================
--- Scheduling/branches/GUI1.2/csSchema20060526.xsd	(revision 855)
+++ Scheduling/branches/GUI1.2/csSchema20060526.xsd	(revision 855)
@@ -0,0 +1,230 @@
+<?xml version="1.0" standalone="yes"?>
+<xs:schema id="GlobalDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+  <xs:element name="GlobalDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element name="VersionInfo">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="ERROR" type="xs:string" minOccurs="0" />
+              <xs:element name="MAJOR_VERSION" type="xs:string" minOccurs="0" />
+              <xs:element name="MINOR_VERSION" type="xs:string" minOccurs="0" />
+              <xs:element name="BUILD" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="SchedulingUser">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="MANAGER" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="AccessTypes">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="BMXIEN" type="xs:int" />
+              <xs:element name="ACCESS_TYPE_NAME" type="xs:string" minOccurs="0" />
+              <xs:element name="BLUE" type="xs:int" minOccurs="0" />
+              <xs:element name="DEPARTMENT_NAME" type="xs:string" minOccurs="0" />
+              <xs:element name="DISPLAY_COLOR" type="xs:string" minOccurs="0" />
+              <xs:element name="GREEN" type="xs:int" minOccurs="0" />
+              <xs:element name="INACTIVE" type="xs:string" minOccurs="0" />
+              <xs:element name="RED" type="xs:int" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="AccessGroup">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="BMXIEN" type="xs:int" minOccurs="0" />
+              <xs:element name="ACCESS_GROUP" type="xs:string" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="AccessGroupType">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="ACCESS_GROUP_TYPEID" type="xs:int" />
+              <xs:element name="ACCESS_GROUP_ID" type="xs:int" minOccurs="0" />
+              <xs:element name="ACCESS_GROUP" type="xs:string" minOccurs="0" />
+              <xs:element name="ACCESS_TYPE_ID" type="xs:int" minOccurs="0" />
+              <xs:element name="ACCESS_TYPE" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="ResourceGroup">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="RESOURCE_GROUPID" type="xs:int" minOccurs="0" />
+              <xs:element name="RESOURCE_GROUP" type="xs:string" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="Resources">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="RESOURCEID" type="xs:int" />
+              <xs:element name="RESOURCE_NAME" type="xs:string" minOccurs="0" />
+              <xs:element name="INACTIVE" type="xs:string" minOccurs="0" />
+              <xs:element name="TIMESCALE" type="xs:int" minOccurs="0" />
+              <xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" minOccurs="0" />
+              <xs:element name="LETTER_TEXT" type="xs:string" minOccurs="0" />
+              <xs:element name="NO_SHOW_LETTER" type="xs:string" minOccurs="0" />
+              <xs:element name="CLINIC_CANCELLATION_LETTER" type="xs:string" minOccurs="0" />
+              <xs:element name="VIEW" type="xs:int" minOccurs="0" />
+              <xs:element name="OVERBOOK" type="xs:int" minOccurs="0" />
+              <xs:element name="MODIFY_SCHEDULE" type="xs:int" minOccurs="0" />
+              <xs:element name="MODIFY_APPOINTMENTS" type="xs:int" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="GroupResources">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="RESOURCE_GROUPID" type="xs:int" minOccurs="0" />
+              <xs:element name="RESOURCE_GROUP" type="xs:string" minOccurs="0" />
+              <xs:element name="RESOURCE_GROUP_ITEMID" type="xs:int" minOccurs="0" />
+              <xs:element name="RESOURCE_NAME" type="xs:string" minOccurs="0" />
+              <xs:element name="RESOURCEID" type="xs:int" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="HospitalLocation">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" />
+              <xs:element name="HOSPITAL_LOCATION" type="xs:string" minOccurs="0" />
+              <xs:element name="DEFAULT_PROVIDER" type="xs:string" minOccurs="0" />
+              <xs:element name="STOP_CODE_NUMBER" type="xs:string" minOccurs="0" />
+              <xs:element name="INACTIVATE_DATE" type="xs:dateTime" minOccurs="0" />
+              <xs:element name="REACTIVATE_DATE" type="xs:dateTime" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="ClinicSetupParameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" />
+              <xs:element name="HOSPITAL_LOCATION" type="xs:string" minOccurs="0" />
+              <xs:element name="CREATE_VISIT" type="xs:string" minOccurs="0" />
+              <xs:element name="VISIT_SERVICE_CATEGORY" type="xs:string" minOccurs="0" />
+              <xs:element name="MULTIPLE_CLINIC_CODES_USED_x003F_" type="xs:string" minOccurs="0" />
+              <xs:element name="VISIT_PROVIDER_REQUIRED" type="xs:string" minOccurs="0" />
+              <xs:element name="GENERATE_PCCPLUS_FORMS_x003F_" type="xs:string" minOccurs="0" />
+              <xs:element name="PROVIDER" msdata:ReadOnly="true" msdata:Expression="Parent.DEFAULT_PROVIDER" type="xs:string" minOccurs="0" />
+              <xs:element name="CLINIC_STOP" msdata:ReadOnly="true" msdata:Expression="Parent.STOP_CODE_NUMBER" type="xs:string" minOccurs="0" />
+              <xs:element name="INACTIVATE_DATE" msdata:ReadOnly="true" msdata:Expression="Parent.INACTIVATE_DATE" type="xs:string" minOccurs="0" />
+              <xs:element name="REACTIVATE_DATE" msdata:ReadOnly="true" msdata:Expression="Parent.REACTIVATE_DATE" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="ScheduleUser">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="USERID" type="xs:int" />
+              <xs:element name="USERNAME" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="ResourceUser">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="RESOURCEUSER_ID" type="xs:int" />
+              <xs:element name="RESOURCENAME" type="xs:string" minOccurs="0" />
+              <xs:element name="RESOURCEID" type="xs:int" minOccurs="0" />
+              <xs:element name="OVERBOOK" type="xs:string" minOccurs="0" />
+              <xs:element name="MODIFY_SCHEDULE" type="xs:string" minOccurs="0" />
+              <xs:element name="MODIFY_APPOINTMENTS" type="xs:string" minOccurs="0" />
+              <xs:element name="USERNAME" type="xs:string" minOccurs="0" />
+              <xs:element name="USERID" type="xs:int" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="Provider">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="BMXIEN" type="xs:int" minOccurs="0" />
+              <xs:element name="NAME" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="ClinicStop">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="BMXIEN" type="xs:int" minOccurs="0" />
+              <xs:element name="CODE" type="xs:string" minOccurs="0" />
+              <xs:element name="NAME" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="HOLIDAY">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="NAME" type="xs:string" minOccurs="0" />
+              <xs:element name="DATE" type="xs:dateTime" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//AccessTypes" />
+      <xs:field xpath="BMXIEN" />
+    </xs:unique>
+    <xs:unique name="AccessGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//AccessGroup" />
+      <xs:field xpath="ACCESS_GROUP" />
+    </xs:unique>
+    <xs:unique name="Constraint2">
+      <xs:selector xpath=".//AccessGroup" />
+      <xs:field xpath="BMXIEN" />
+    </xs:unique>
+    <xs:unique name="AccessGroupType_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//AccessGroupType" />
+      <xs:field xpath="ACCESS_GROUP_TYPEID" />
+    </xs:unique>
+    <xs:unique name="ResourceGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//ResourceGroup" />
+      <xs:field xpath="RESOURCE_GROUP" />
+    </xs:unique>
+    <xs:unique name="Resources_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//Resources" />
+      <xs:field xpath="RESOURCEID" />
+    </xs:unique>
+    <xs:unique name="HospitalLocation_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//HospitalLocation" />
+      <xs:field xpath="HOSPITAL_LOCATION_ID" />
+    </xs:unique>
+    <xs:unique name="ClinicSetupParameters_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//ClinicSetupParameters" />
+      <xs:field xpath="HOSPITAL_LOCATION_ID" />
+    </xs:unique>
+    <xs:unique name="ScheduleUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//ScheduleUser" />
+      <xs:field xpath="USERID" />
+    </xs:unique>
+    <xs:unique name="ResourceUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+      <xs:selector xpath=".//ResourceUser" />
+      <xs:field xpath="RESOURCEUSER_ID" />
+    </xs:unique>
+    <xs:keyref name="ResourceUser" refer="Resources_Constraint1">
+      <xs:selector xpath=".//ResourceUser" />
+      <xs:field xpath="RESOURCEID" />
+    </xs:keyref>
+    <xs:keyref name="GroupResource" refer="ResourceGroup_Constraint1">
+      <xs:selector xpath=".//GroupResources" />
+      <xs:field xpath="RESOURCE_GROUP" />
+    </xs:keyref>
+    <xs:keyref name="AccessGroupType" refer="Constraint2">
+      <xs:selector xpath=".//AccessGroupType" />
+      <xs:field xpath="ACCESS_GROUP_ID" />
+    </xs:keyref>
+  </xs:element>
+  <xs:annotation>
+    <xs:appinfo>
+      <msdata:Relationship name="HospitalLocationClinic" msdata:parent="HospitalLocation" msdata:child="ClinicSetupParameters" msdata:parentkey="HOSPITAL_LOCATION_ID" msdata:childkey="HOSPITAL_LOCATION_ID" />
+      <msdata:Relationship name="HospitalLocationResource" msdata:parent="HospitalLocation" msdata:child="Resources" msdata:parentkey="HOSPITAL_LOCATION_ID" msdata:childkey="HOSPITAL_LOCATION_ID" />
+    </xs:appinfo>
+  </xs:annotation>
+</xs:schema>
Index: Scheduling/branches/GUI1.2/csSchemaoRIG.xsd
===================================================================
--- Scheduling/branches/GUI1.2/csSchemaoRIG.xsd	(revision 855)
+++ Scheduling/branches/GUI1.2/csSchemaoRIG.xsd	(revision 855)
@@ -0,0 +1,187 @@
+<?xml version="1.0" standalone="yes" ?>
+<xs:schema id="GlobalDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+	<xs:element name="GlobalDataSet" msdata:IsDataSet="true">
+		<xs:complexType>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="SchedulingUser">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="MANAGER" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="AccessTypes">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="BMXIEN" type="xs:int" />
+							<xs:element name="ACCESS_TYPE_NAME" type="xs:string" minOccurs="0" />
+							<xs:element name="BLUE" type="xs:int" minOccurs="0" />
+							<xs:element name="DEPARTMENT_NAME" type="xs:string" minOccurs="0" />
+							<xs:element name="DISPLAY_COLOR" type="xs:string" minOccurs="0" />
+							<xs:element name="GREEN" type="xs:int" minOccurs="0" />
+							<xs:element name="INACTIVE" type="xs:string" minOccurs="0" />
+							<xs:element name="RED" type="xs:int" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="AccessGroup">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="BMXIEN" type="xs:int" minOccurs="0" />
+							<xs:element name="ACCESS_GROUP" type="xs:string" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="AccessGroupType">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="ACCESS_GROUP_TYPEID" type="xs:int" />
+							<xs:element name="ACCESS_GROUP_ID" type="xs:int" minOccurs="0" />
+							<xs:element name="ACCESS_GROUP" type="xs:string" minOccurs="0" />
+							<xs:element name="ACCESS_TYPE_ID" type="xs:int" minOccurs="0" />
+							<xs:element name="ACCESS_TYPE" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ResourceGroup">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCE_GROUPID" type="xs:int" minOccurs="0" />
+							<xs:element name="RESOURCE_GROUP" type="xs:string" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="Resources">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCEID" type="xs:int" />
+							<xs:element name="RESOURCE_NAME" type="xs:string" minOccurs="0" />
+							<xs:element name="INACTIVE" type="xs:string" minOccurs="0" />
+							<xs:element name="TIMESCALE" type="xs:int" minOccurs="0" />
+							<xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" minOccurs="0" />
+							<xs:element name="LETTER_TEXT" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="GroupResources">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCE_GROUPID" type="xs:int" minOccurs="0" />
+							<xs:element name="RESOURCE_GROUP" type="xs:string" minOccurs="0" />
+							<xs:element name="RESOURCE_GROUP_ITEMID" type="xs:int" minOccurs="0" />
+							<xs:element name="RESOURCE_NAME" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="HospitalLocation">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" />
+							<xs:element name="HOSPITAL_LOCATION" type="xs:string" minOccurs="0" />
+							<xs:element name="DEFAULT_PROVIDER" type="xs:string" minOccurs="0" />
+							<xs:element name="STOP_CODE_NUMBER" type="xs:string" minOccurs="0" />
+							<xs:element name="INACTIVATE_DATE" type="xs:dateTime" minOccurs="0" />
+							<xs:element name="REACTIVATE_DATE" type="xs:dateTime" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ClinicSetupParameters">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="HOSPITAL_LOCATION_ID" type="xs:int" />
+							<xs:element name="HOSPITAL_LOCATION" type="xs:string" minOccurs="0" />
+							<xs:element name="CREATE_VISIT" type="xs:string" minOccurs="0" />
+							<xs:element name="VISIT_SERVICE_CATEGORY" type="xs:string" minOccurs="0" />
+							<xs:element name="PROVIDER" msdata:ReadOnly="true" msdata:Expression="Parent.DEFAULT_PROVIDER"
+								type="xs:string" minOccurs="0" />
+							<xs:element name="CLINIC_STOP" msdata:ReadOnly="true" msdata:Expression="Parent.STOP_CODE_NUMBER"
+								type="xs:string" minOccurs="0" />
+							<xs:element name="INACTIVATE_DATE" msdata:ReadOnly="true" msdata:Expression="Parent.INACTIVATE_DATE"
+								type="xs:string" minOccurs="0" />
+							<xs:element name="REACTIVATE_DATE" msdata:ReadOnly="true" msdata:Expression="Parent.REACTIVATE_DATE"
+								type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ScheduleUser">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="USERID" type="xs:int" />
+							<xs:element name="USERNAME" type="xs:string" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="ResourceUser">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="RESOURCEUSER_ID" type="xs:int" />
+							<xs:element name="RESOURCEID" type="xs:int" minOccurs="0" />
+							<xs:element name="OVERBOOK" type="xs:string" minOccurs="0" />
+							<xs:element name="MODIFY_SCHEDULE" type="xs:string" minOccurs="0" />
+							<xs:element name="USERID" type="xs:string" minOccurs="0" />
+							<xs:element name="USERID1" type="xs:int" minOccurs="0" />
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:choice>
+		</xs:complexType>
+		<xs:unique name="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//AccessTypes" />
+			<xs:field xpath="BMXIEN" />
+		</xs:unique>
+		<xs:unique name="AccessGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//AccessGroup" />
+			<xs:field xpath="ACCESS_GROUP" />
+		</xs:unique>
+		<xs:unique name="Constraint2">
+			<xs:selector xpath=".//AccessGroup" />
+			<xs:field xpath="BMXIEN" />
+		</xs:unique>
+		<xs:unique name="AccessGroupType_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//AccessGroupType" />
+			<xs:field xpath="ACCESS_GROUP_TYPEID" />
+		</xs:unique>
+		<xs:unique name="ResourceGroup_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ResourceGroup" />
+			<xs:field xpath="RESOURCE_GROUP" />
+		</xs:unique>
+		<xs:unique name="Resources_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//Resources" />
+			<xs:field xpath="RESOURCEID" />
+		</xs:unique>
+		<xs:unique name="HospitalLocation_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//HospitalLocation" />
+			<xs:field xpath="HOSPITAL_LOCATION_ID" />
+		</xs:unique>
+		<xs:unique name="ClinicSetupParameters_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ClinicSetupParameters" />
+			<xs:field xpath="HOSPITAL_LOCATION_ID" />
+		</xs:unique>
+		<xs:unique name="ScheduleUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ScheduleUser" />
+			<xs:field xpath="USERID" />
+		</xs:unique>
+		<xs:unique name="ResourceUser_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
+			<xs:selector xpath=".//ResourceUser" />
+			<xs:field xpath="RESOURCEUSER_ID" />
+		</xs:unique>
+		<xs:keyref name="ResourceUser" refer="Resources_Constraint1">
+			<xs:selector xpath=".//ResourceUser" />
+			<xs:field xpath="RESOURCEID" />
+		</xs:keyref>
+		<xs:keyref name="GroupResource" refer="ResourceGroup_Constraint1">
+			<xs:selector xpath=".//GroupResources" />
+			<xs:field xpath="RESOURCE_GROUP" />
+		</xs:keyref>
+		<xs:keyref name="AccessGroupType" refer="Constraint2">
+			<xs:selector xpath=".//AccessGroupType" />
+			<xs:field xpath="ACCESS_GROUP_ID" />
+		</xs:keyref>
+	</xs:element>
+	<xs:annotation>
+		<xs:appinfo>
+			<msdata:Relationship name="HospitalLocationClinic" msdata:parent="HospitalLocation" msdata:child="ClinicSetupParameters"
+				msdata:parentkey="HOSPITAL_LOCATION_ID" msdata:childkey="HOSPITAL_LOCATION_ID" />
+		</xs:appinfo>
+	</xs:annotation>
+</xs:schema>
Index: Scheduling/branches/GUI1.2/dInputText.cs
===================================================================
--- Scheduling/branches/GUI1.2/dInputText.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/dInputText.cs	(revision 855)
@@ -0,0 +1,136 @@
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace IndianHealthService.ClinicalScheduling
+{
+	/// <summary>
+	/// Summary description for dInputText.
+	/// </summary>
+	public class dInputText : System.Windows.Forms.Form
+	{
+		private System.Windows.Forms.Panel pnlPageBottom;
+		private System.Windows.Forms.Button cmdCancel;
+		private System.Windows.Forms.TextBox txtInput;
+		private System.Windows.Forms.Button cmdOK;
+		/// <summary>
+		/// Required designer variable.
+		/// </summary>
+		private System.ComponentModel.Container components = null;
+
+		public dInputText()
+		{
+			InitializeComponent();
+		}
+
+		public string DialogTitle
+		{
+			get
+			{
+				return this.Text;
+			}
+			set
+			{
+				this.Text = value;
+			}
+		}
+
+		public string TextValue
+		{
+			get
+			{
+				return this.txtInput.Text;
+			}
+			set
+			{
+				this.txtInput.Text = value;
+			}
+		}
+		/// <summary>
+		/// Clean up any resources being used.
+		/// </summary>
+		protected override void Dispose( bool disposing )
+		{
+			if( disposing )
+			{
+				if(components != null)
+				{
+					components.Dispose();
+				}
+			}
+			base.Dispose( disposing );
+		}
+
+		#region Windows Form Designer generated code
+		/// <summary>
+		/// Required method for Designer support - do not modify
+		/// the contents of this method with the code editor.
+		/// </summary>
+		private void InitializeComponent()
+		{
+			this.pnlPageBottom = new System.Windows.Forms.Panel();
+			this.cmdOK = new System.Windows.Forms.Button();
+			this.cmdCancel = new System.Windows.Forms.Button();
+			this.txtInput = new System.Windows.Forms.TextBox();
+			this.pnlPageBottom.SuspendLayout();
+			this.SuspendLayout();
+			// 
+			// pnlPageBottom
+			// 
+			this.pnlPageBottom.Controls.Add(this.cmdOK);
+			this.pnlPageBottom.Controls.Add(this.cmdCancel);
+			this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+			this.pnlPageBottom.Location = new System.Drawing.Point(0, 230);
+			this.pnlPageBottom.Name = "pnlPageBottom";
+			this.pnlPageBottom.Size = new System.Drawing.Size(496, 40);
+			this.pnlPageBottom.TabIndex = 4;
+			// 
+			// cmdOK
+			// 
+			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+			this.cmdOK.Location = new System.Drawing.Point(272, 8);
+			this.cmdOK.Name = "cmdOK";
+			this.cmdOK.Size = new System.Drawing.Size(96, 24);
+			this.cmdOK.TabIndex = 1;
+			this.cmdOK.Text = "OK";
+			// 
+			// cmdCancel
+			// 
+			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+			this.cmdCancel.Location = new System.Drawing.Point(384, 8);
+			this.cmdCancel.Name = "cmdCancel";
+			this.cmdCancel.Size = new System.Drawing.Size(96, 24);
+			this.cmdCancel.TabIndex = 2;
+			this.cmdCancel.Text = "Cancel";
+			// 
+			// txtInput
+			// 
+			this.txtInput.Dock = System.Windows.Forms.DockStyle.Fill;
+			this.txtInput.Location = new System.Drawing.Point(0, 0);
+			this.txtInput.Multiline = true;
+			this.txtInput.Name = "txtInput";
+			this.txtInput.Size = new System.Drawing.Size(496, 230);
+			this.txtInput.TabIndex = 0;
+			this.txtInput.Text = "";
+			// 
+			// dInputText
+			// 
+			this.AcceptButton = this.cmdOK;
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+			this.CancelButton = this.cmdCancel;
+			this.ClientSize = new System.Drawing.Size(496, 270);
+			this.Controls.Add(this.txtInput);
+			this.Controls.Add(this.pnlPageBottom);
+			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+			this.Name = "dInputText";
+			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+			this.Text = "Clinical Scheduling";
+			this.pnlPageBottom.ResumeLayout(false);
+			this.ResumeLayout(false);
+
+		}
+		#endregion
+	}
+}
Index: Scheduling/branches/GUI1.2/dInputText.resx
===================================================================
--- Scheduling/branches/GUI1.2/dInputText.resx	(revision 855)
+++ Scheduling/branches/GUI1.2/dInputText.resx	(revision 855)
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 1.3
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">1.3</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1">this is my long string</data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        [base64 mime encoded serialized .NET Framework object]
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        [base64 mime encoded string representing a byte array form of the .NET Framework object]
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used forserialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>1.3</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="pnlPageBottom.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="pnlPageBottom.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="pnlPageBottom.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="pnlPageBottom.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="pnlPageBottom.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="cmdCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="cmdCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtInput.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="txtInput.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="txtInput.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>(Default)</value>
+  </data>
+  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>False</value>
+  </data>
+  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>8, 8</value>
+  </data>
+  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.Name">
+    <value>dInputText</value>
+  </data>
+  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>80</value>
+  </data>
+  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </data>
+  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>Private</value>
+  </data>
+</root>
Index: Scheduling/branches/GUI1.2/dsPatientApptDisplay2.Designer.cs
===================================================================
--- Scheduling/branches/GUI1.2/dsPatientApptDisplay2.Designer.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/dsPatientApptDisplay2.Designer.cs	(revision 855)
@@ -0,0 +1,1568 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.3603
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+#pragma warning disable 1591
+
+namespace IndianHealthService.ClinicalScheduling {
+    
+    
+    /// <summary>
+    ///Represents a strongly typed in-memory cache of data.
+    ///</summary>
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+    [global::System.Serializable()]
+    [global::System.ComponentModel.DesignerCategoryAttribute("code")]
+    [global::System.ComponentModel.ToolboxItem(true)]
+    [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
+    [global::System.Xml.Serialization.XmlRootAttribute("dsPatientApptDisplay2")]
+    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
+    public partial class dsPatientApptDisplay2 : global::System.Data.DataSet {
+        
+        private PatientApptsDataTable tablePatientAppts;
+        
+        private BSDXResourceDataTable tableBSDXResource;
+        
+        private global::System.Data.DataRelation relationFK_BSDXResource_PatientAppts;
+        
+        private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public dsPatientApptDisplay2() {
+            this.BeginInit();
+            this.InitClass();
+            global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
+            base.Tables.CollectionChanged += schemaChangedHandler;
+            base.Relations.CollectionChanged += schemaChangedHandler;
+            this.EndInit();
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected dsPatientApptDisplay2(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                base(info, context, false) {
+            if ((this.IsBinarySerialized(info, context) == true)) {
+                this.InitVars(false);
+                global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
+                this.Tables.CollectionChanged += schemaChangedHandler1;
+                this.Relations.CollectionChanged += schemaChangedHandler1;
+                return;
+            }
+            string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
+            if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
+                global::System.Data.DataSet ds = new global::System.Data.DataSet();
+                ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
+                if ((ds.Tables["PatientAppts"] != null)) {
+                    base.Tables.Add(new PatientApptsDataTable(ds.Tables["PatientAppts"]));
+                }
+                if ((ds.Tables["BSDXResource"] != null)) {
+                    base.Tables.Add(new BSDXResourceDataTable(ds.Tables["BSDXResource"]));
+                }
+                this.DataSetName = ds.DataSetName;
+                this.Prefix = ds.Prefix;
+                this.Namespace = ds.Namespace;
+                this.Locale = ds.Locale;
+                this.CaseSensitive = ds.CaseSensitive;
+                this.EnforceConstraints = ds.EnforceConstraints;
+                this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
+                this.InitVars();
+            }
+            else {
+                this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
+            }
+            this.GetSerializationData(info, context);
+            global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
+            base.Tables.CollectionChanged += schemaChangedHandler;
+            this.Relations.CollectionChanged += schemaChangedHandler;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
+        public PatientApptsDataTable PatientAppts {
+            get {
+                return this.tablePatientAppts;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
+        public BSDXResourceDataTable BSDXResource {
+            get {
+                return this.tableBSDXResource;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.BrowsableAttribute(true)]
+        [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
+        public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
+            get {
+                return this._schemaSerializationMode;
+            }
+            set {
+                this._schemaSerializationMode = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+        public new global::System.Data.DataTableCollection Tables {
+            get {
+                return base.Tables;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+        public new global::System.Data.DataRelationCollection Relations {
+            get {
+                return base.Relations;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override void InitializeDerivedDataSet() {
+            this.BeginInit();
+            this.InitClass();
+            this.EndInit();
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public override global::System.Data.DataSet Clone() {
+            dsPatientApptDisplay2 cln = ((dsPatientApptDisplay2)(base.Clone()));
+            cln.InitVars();
+            cln.SchemaSerializationMode = this.SchemaSerializationMode;
+            return cln;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override bool ShouldSerializeTables() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override bool ShouldSerializeRelations() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
+            if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
+                this.Reset();
+                global::System.Data.DataSet ds = new global::System.Data.DataSet();
+                ds.ReadXml(reader);
+                if ((ds.Tables["PatientAppts"] != null)) {
+                    base.Tables.Add(new PatientApptsDataTable(ds.Tables["PatientAppts"]));
+                }
+                if ((ds.Tables["BSDXResource"] != null)) {
+                    base.Tables.Add(new BSDXResourceDataTable(ds.Tables["BSDXResource"]));
+                }
+                this.DataSetName = ds.DataSetName;
+                this.Prefix = ds.Prefix;
+                this.Namespace = ds.Namespace;
+                this.Locale = ds.Locale;
+                this.CaseSensitive = ds.CaseSensitive;
+                this.EnforceConstraints = ds.EnforceConstraints;
+                this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
+                this.InitVars();
+            }
+            else {
+                this.ReadXml(reader);
+                this.InitVars();
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
+            global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
+            this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
+            stream.Position = 0;
+            return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal void InitVars() {
+            this.InitVars(true);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal void InitVars(bool initTable) {
+            this.tablePatientAppts = ((PatientApptsDataTable)(base.Tables["PatientAppts"]));
+            if ((initTable == true)) {
+                if ((this.tablePatientAppts != null)) {
+                    this.tablePatientAppts.InitVars();
+                }
+            }
+            this.tableBSDXResource = ((BSDXResourceDataTable)(base.Tables["BSDXResource"]));
+            if ((initTable == true)) {
+                if ((this.tableBSDXResource != null)) {
+                    this.tableBSDXResource.InitVars();
+                }
+            }
+            this.relationFK_BSDXResource_PatientAppts = this.Relations["FK_BSDXResource_PatientAppts"];
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitClass() {
+            this.DataSetName = "dsPatientApptDisplay2";
+            this.Prefix = "";
+            this.Namespace = "http://tempuri.org/dsPatientApptDisplay2.xsd";
+            this.EnforceConstraints = true;
+            this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
+            this.tablePatientAppts = new PatientApptsDataTable();
+            base.Tables.Add(this.tablePatientAppts);
+            this.tableBSDXResource = new BSDXResourceDataTable();
+            base.Tables.Add(this.tableBSDXResource);
+            global::System.Data.ForeignKeyConstraint fkc;
+            fkc = new global::System.Data.ForeignKeyConstraint("FK_BSDXResource_PatientAppts", new global::System.Data.DataColumn[] {
+                        this.tableBSDXResource.RESOURCEIDColumn}, new global::System.Data.DataColumn[] {
+                        this.tablePatientAppts.RESOURCEIDColumn});
+            this.tablePatientAppts.Constraints.Add(fkc);
+            fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
+            fkc.DeleteRule = global::System.Data.Rule.Cascade;
+            fkc.UpdateRule = global::System.Data.Rule.Cascade;
+            this.relationFK_BSDXResource_PatientAppts = new global::System.Data.DataRelation("FK_BSDXResource_PatientAppts", new global::System.Data.DataColumn[] {
+                        this.tableBSDXResource.RESOURCEIDColumn}, new global::System.Data.DataColumn[] {
+                        this.tablePatientAppts.RESOURCEIDColumn}, false);
+            this.Relations.Add(this.relationFK_BSDXResource_PatientAppts);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private bool ShouldSerializePatientAppts() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private bool ShouldSerializeBSDXResource() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
+            if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
+                this.InitVars();
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+            dsPatientApptDisplay2 ds = new dsPatientApptDisplay2();
+            global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+            global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+            global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
+            any.Namespace = ds.Namespace;
+            sequence.Items.Add(any);
+            type.Particle = sequence;
+            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+            if (xs.Contains(dsSchema.TargetNamespace)) {
+                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                try {
+                    global::System.Xml.Schema.XmlSchema schema = null;
+                    dsSchema.Write(s1);
+                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                        s2.SetLength(0);
+                        schema.Write(s2);
+                        if ((s1.Length == s2.Length)) {
+                            s1.Position = 0;
+                            s2.Position = 0;
+                            for (; ((s1.Position != s1.Length) 
+                                        && (s1.ReadByte() == s2.ReadByte())); ) {
+                                ;
+                            }
+                            if ((s1.Position == s1.Length)) {
+                                return type;
+                            }
+                        }
+                    }
+                }
+                finally {
+                    if ((s1 != null)) {
+                        s1.Close();
+                    }
+                    if ((s2 != null)) {
+                        s2.Close();
+                    }
+                }
+            }
+            xs.Add(dsSchema);
+            return type;
+        }
+        
+        public delegate void PatientApptsRowChangeEventHandler(object sender, PatientApptsRowChangeEvent e);
+        
+        public delegate void BSDXResourceRowChangeEventHandler(object sender, BSDXResourceRowChangeEvent e);
+        
+        /// <summary>
+        ///Represents the strongly named DataTable class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        [global::System.Serializable()]
+        [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
+        public partial class PatientApptsDataTable : global::System.Data.TypedTableBase<PatientApptsRow> {
+            
+            private global::System.Data.DataColumn columnName;
+            
+            private global::System.Data.DataColumn columnDOB;
+            
+            private global::System.Data.DataColumn columnSex;
+            
+            private global::System.Data.DataColumn columnHRN;
+            
+            private global::System.Data.DataColumn columnApptDate;
+            
+            private global::System.Data.DataColumn columnClinic;
+            
+            private global::System.Data.DataColumn columnTypeStatus;
+            
+            private global::System.Data.DataColumn columnRESOURCEID;
+            
+            private global::System.Data.DataColumn columnAPPT_MADE_BY;
+            
+            private global::System.Data.DataColumn columnDATE_APPT_MADE;
+            
+            private global::System.Data.DataColumn columnNOTE;
+            
+            private global::System.Data.DataColumn columnSTREET;
+            
+            private global::System.Data.DataColumn columnCITY;
+            
+            private global::System.Data.DataColumn columnSTATE;
+            
+            private global::System.Data.DataColumn columnZIP;
+            
+            private global::System.Data.DataColumn columnHOMEPHONE;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsDataTable() {
+                this.TableName = "PatientAppts";
+                this.BeginInit();
+                this.InitClass();
+                this.EndInit();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal PatientApptsDataTable(global::System.Data.DataTable table) {
+                this.TableName = table.TableName;
+                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
+                    this.CaseSensitive = table.CaseSensitive;
+                }
+                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
+                    this.Locale = table.Locale;
+                }
+                if ((table.Namespace != table.DataSet.Namespace)) {
+                    this.Namespace = table.Namespace;
+                }
+                this.Prefix = table.Prefix;
+                this.MinimumCapacity = table.MinimumCapacity;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected PatientApptsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                    base(info, context) {
+                this.InitVars();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn NameColumn {
+                get {
+                    return this.columnName;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn DOBColumn {
+                get {
+                    return this.columnDOB;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn SexColumn {
+                get {
+                    return this.columnSex;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn HRNColumn {
+                get {
+                    return this.columnHRN;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn ApptDateColumn {
+                get {
+                    return this.columnApptDate;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn ClinicColumn {
+                get {
+                    return this.columnClinic;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn TypeStatusColumn {
+                get {
+                    return this.columnTypeStatus;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn RESOURCEIDColumn {
+                get {
+                    return this.columnRESOURCEID;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn APPT_MADE_BYColumn {
+                get {
+                    return this.columnAPPT_MADE_BY;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn DATE_APPT_MADEColumn {
+                get {
+                    return this.columnDATE_APPT_MADE;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn NOTEColumn {
+                get {
+                    return this.columnNOTE;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn STREETColumn {
+                get {
+                    return this.columnSTREET;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn CITYColumn {
+                get {
+                    return this.columnCITY;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn STATEColumn {
+                get {
+                    return this.columnSTATE;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn ZIPColumn {
+                get {
+                    return this.columnZIP;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn HOMEPHONEColumn {
+                get {
+                    return this.columnHOMEPHONE;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            [global::System.ComponentModel.Browsable(false)]
+            public int Count {
+                get {
+                    return this.Rows.Count;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRow this[int index] {
+                get {
+                    return ((PatientApptsRow)(this.Rows[index]));
+                }
+            }
+            
+            public event PatientApptsRowChangeEventHandler PatientApptsRowChanging;
+            
+            public event PatientApptsRowChangeEventHandler PatientApptsRowChanged;
+            
+            public event PatientApptsRowChangeEventHandler PatientApptsRowDeleting;
+            
+            public event PatientApptsRowChangeEventHandler PatientApptsRowDeleted;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void AddPatientApptsRow(PatientApptsRow row) {
+                this.Rows.Add(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRow AddPatientApptsRow(
+                        string Name, 
+                        System.DateTime DOB, 
+                        string Sex, 
+                        string HRN, 
+                        System.DateTime ApptDate, 
+                        string Clinic, 
+                        string TypeStatus, 
+                        BSDXResourceRow parentBSDXResourceRowByFK_BSDXResource_PatientAppts, 
+                        string APPT_MADE_BY, 
+                        System.DateTime DATE_APPT_MADE, 
+                        string NOTE, 
+                        string STREET, 
+                        string CITY, 
+                        string STATE, 
+                        string ZIP, 
+                        string HOMEPHONE) {
+                PatientApptsRow rowPatientApptsRow = ((PatientApptsRow)(this.NewRow()));
+                object[] columnValuesArray = new object[] {
+                        Name,
+                        DOB,
+                        Sex,
+                        HRN,
+                        ApptDate,
+                        Clinic,
+                        TypeStatus,
+                        null,
+                        APPT_MADE_BY,
+                        DATE_APPT_MADE,
+                        NOTE,
+                        STREET,
+                        CITY,
+                        STATE,
+                        ZIP,
+                        HOMEPHONE};
+                if ((parentBSDXResourceRowByFK_BSDXResource_PatientAppts != null)) {
+                    columnValuesArray[7] = parentBSDXResourceRowByFK_BSDXResource_PatientAppts[0];
+                }
+                rowPatientApptsRow.ItemArray = columnValuesArray;
+                this.Rows.Add(rowPatientApptsRow);
+                return rowPatientApptsRow;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public override global::System.Data.DataTable Clone() {
+                PatientApptsDataTable cln = ((PatientApptsDataTable)(base.Clone()));
+                cln.InitVars();
+                return cln;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataTable CreateInstance() {
+                return new PatientApptsDataTable();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal void InitVars() {
+                this.columnName = base.Columns["Name"];
+                this.columnDOB = base.Columns["DOB"];
+                this.columnSex = base.Columns["Sex"];
+                this.columnHRN = base.Columns["HRN"];
+                this.columnApptDate = base.Columns["ApptDate"];
+                this.columnClinic = base.Columns["Clinic"];
+                this.columnTypeStatus = base.Columns["TypeStatus"];
+                this.columnRESOURCEID = base.Columns["RESOURCEID"];
+                this.columnAPPT_MADE_BY = base.Columns["APPT_MADE_BY"];
+                this.columnDATE_APPT_MADE = base.Columns["DATE_APPT_MADE"];
+                this.columnNOTE = base.Columns["NOTE"];
+                this.columnSTREET = base.Columns["STREET"];
+                this.columnCITY = base.Columns["CITY"];
+                this.columnSTATE = base.Columns["STATE"];
+                this.columnZIP = base.Columns["ZIP"];
+                this.columnHOMEPHONE = base.Columns["HOMEPHONE"];
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private void InitClass() {
+                this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnName);
+                this.columnDOB = new global::System.Data.DataColumn("DOB", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnDOB);
+                this.columnSex = new global::System.Data.DataColumn("Sex", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnSex);
+                this.columnHRN = new global::System.Data.DataColumn("HRN", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnHRN);
+                this.columnApptDate = new global::System.Data.DataColumn("ApptDate", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnApptDate);
+                this.columnClinic = new global::System.Data.DataColumn("Clinic", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnClinic);
+                this.columnTypeStatus = new global::System.Data.DataColumn("TypeStatus", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnTypeStatus);
+                this.columnRESOURCEID = new global::System.Data.DataColumn("RESOURCEID", typeof(int), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnRESOURCEID);
+                this.columnAPPT_MADE_BY = new global::System.Data.DataColumn("APPT_MADE_BY", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnAPPT_MADE_BY);
+                this.columnDATE_APPT_MADE = new global::System.Data.DataColumn("DATE_APPT_MADE", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnDATE_APPT_MADE);
+                this.columnNOTE = new global::System.Data.DataColumn("NOTE", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnNOTE);
+                this.columnSTREET = new global::System.Data.DataColumn("STREET", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnSTREET);
+                this.columnCITY = new global::System.Data.DataColumn("CITY", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnCITY);
+                this.columnSTATE = new global::System.Data.DataColumn("STATE", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnSTATE);
+                this.columnZIP = new global::System.Data.DataColumn("ZIP", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnZIP);
+                this.columnHOMEPHONE = new global::System.Data.DataColumn("HOMEPHONE", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnHOMEPHONE);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRow NewPatientApptsRow() {
+                return ((PatientApptsRow)(this.NewRow()));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
+                return new PatientApptsRow(builder);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Type GetRowType() {
+                return typeof(PatientApptsRow);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanged(e);
+                if ((this.PatientApptsRowChanged != null)) {
+                    this.PatientApptsRowChanged(this, new PatientApptsRowChangeEvent(((PatientApptsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanging(e);
+                if ((this.PatientApptsRowChanging != null)) {
+                    this.PatientApptsRowChanging(this, new PatientApptsRowChangeEvent(((PatientApptsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleted(e);
+                if ((this.PatientApptsRowDeleted != null)) {
+                    this.PatientApptsRowDeleted(this, new PatientApptsRowChangeEvent(((PatientApptsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleting(e);
+                if ((this.PatientApptsRowDeleting != null)) {
+                    this.PatientApptsRowDeleting(this, new PatientApptsRowChangeEvent(((PatientApptsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void RemovePatientApptsRow(PatientApptsRow row) {
+                this.Rows.Remove(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+                global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+                global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+                dsPatientApptDisplay2 ds = new dsPatientApptDisplay2();
+                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
+                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
+                any1.MinOccurs = new decimal(0);
+                any1.MaxOccurs = decimal.MaxValue;
+                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any1);
+                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
+                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
+                any2.MinOccurs = new decimal(1);
+                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any2);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute1.Name = "namespace";
+                attribute1.FixedValue = ds.Namespace;
+                type.Attributes.Add(attribute1);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute2.Name = "tableTypeName";
+                attribute2.FixedValue = "PatientApptsDataTable";
+                type.Attributes.Add(attribute2);
+                type.Particle = sequence;
+                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+                if (xs.Contains(dsSchema.TargetNamespace)) {
+                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                    try {
+                        global::System.Xml.Schema.XmlSchema schema = null;
+                        dsSchema.Write(s1);
+                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                            s2.SetLength(0);
+                            schema.Write(s2);
+                            if ((s1.Length == s2.Length)) {
+                                s1.Position = 0;
+                                s2.Position = 0;
+                                for (; ((s1.Position != s1.Length) 
+                                            && (s1.ReadByte() == s2.ReadByte())); ) {
+                                    ;
+                                }
+                                if ((s1.Position == s1.Length)) {
+                                    return type;
+                                }
+                            }
+                        }
+                    }
+                    finally {
+                        if ((s1 != null)) {
+                            s1.Close();
+                        }
+                        if ((s2 != null)) {
+                            s2.Close();
+                        }
+                    }
+                }
+                xs.Add(dsSchema);
+                return type;
+            }
+        }
+        
+        /// <summary>
+        ///Represents the strongly named DataTable class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        [global::System.Serializable()]
+        [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
+        public partial class BSDXResourceDataTable : global::System.Data.TypedTableBase<BSDXResourceRow> {
+            
+            private global::System.Data.DataColumn columnRESOURCEID;
+            
+            private global::System.Data.DataColumn columnRESOURCE_NAME;
+            
+            private global::System.Data.DataColumn columnLETTER_TEXT;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceDataTable() {
+                this.TableName = "BSDXResource";
+                this.BeginInit();
+                this.InitClass();
+                this.EndInit();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal BSDXResourceDataTable(global::System.Data.DataTable table) {
+                this.TableName = table.TableName;
+                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
+                    this.CaseSensitive = table.CaseSensitive;
+                }
+                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
+                    this.Locale = table.Locale;
+                }
+                if ((table.Namespace != table.DataSet.Namespace)) {
+                    this.Namespace = table.Namespace;
+                }
+                this.Prefix = table.Prefix;
+                this.MinimumCapacity = table.MinimumCapacity;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected BSDXResourceDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                    base(info, context) {
+                this.InitVars();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn RESOURCEIDColumn {
+                get {
+                    return this.columnRESOURCEID;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn RESOURCE_NAMEColumn {
+                get {
+                    return this.columnRESOURCE_NAME;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn LETTER_TEXTColumn {
+                get {
+                    return this.columnLETTER_TEXT;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            [global::System.ComponentModel.Browsable(false)]
+            public int Count {
+                get {
+                    return this.Rows.Count;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRow this[int index] {
+                get {
+                    return ((BSDXResourceRow)(this.Rows[index]));
+                }
+            }
+            
+            public event BSDXResourceRowChangeEventHandler BSDXResourceRowChanging;
+            
+            public event BSDXResourceRowChangeEventHandler BSDXResourceRowChanged;
+            
+            public event BSDXResourceRowChangeEventHandler BSDXResourceRowDeleting;
+            
+            public event BSDXResourceRowChangeEventHandler BSDXResourceRowDeleted;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void AddBSDXResourceRow(BSDXResourceRow row) {
+                this.Rows.Add(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRow AddBSDXResourceRow(int RESOURCEID, string RESOURCE_NAME, string LETTER_TEXT) {
+                BSDXResourceRow rowBSDXResourceRow = ((BSDXResourceRow)(this.NewRow()));
+                object[] columnValuesArray = new object[] {
+                        RESOURCEID,
+                        RESOURCE_NAME,
+                        LETTER_TEXT};
+                rowBSDXResourceRow.ItemArray = columnValuesArray;
+                this.Rows.Add(rowBSDXResourceRow);
+                return rowBSDXResourceRow;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public override global::System.Data.DataTable Clone() {
+                BSDXResourceDataTable cln = ((BSDXResourceDataTable)(base.Clone()));
+                cln.InitVars();
+                return cln;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataTable CreateInstance() {
+                return new BSDXResourceDataTable();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal void InitVars() {
+                this.columnRESOURCEID = base.Columns["RESOURCEID"];
+                this.columnRESOURCE_NAME = base.Columns["RESOURCE_NAME"];
+                this.columnLETTER_TEXT = base.Columns["LETTER_TEXT"];
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private void InitClass() {
+                this.columnRESOURCEID = new global::System.Data.DataColumn("RESOURCEID", typeof(int), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnRESOURCEID);
+                this.columnRESOURCE_NAME = new global::System.Data.DataColumn("RESOURCE_NAME", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnRESOURCE_NAME);
+                this.columnLETTER_TEXT = new global::System.Data.DataColumn("LETTER_TEXT", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnLETTER_TEXT);
+                this.Constraints.Add(new global::System.Data.UniqueConstraint("kBSDXResourceID", new global::System.Data.DataColumn[] {
+                                this.columnRESOURCEID}, false));
+                this.columnRESOURCEID.AllowDBNull = false;
+                this.columnRESOURCEID.Unique = true;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRow NewBSDXResourceRow() {
+                return ((BSDXResourceRow)(this.NewRow()));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
+                return new BSDXResourceRow(builder);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Type GetRowType() {
+                return typeof(BSDXResourceRow);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanged(e);
+                if ((this.BSDXResourceRowChanged != null)) {
+                    this.BSDXResourceRowChanged(this, new BSDXResourceRowChangeEvent(((BSDXResourceRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanging(e);
+                if ((this.BSDXResourceRowChanging != null)) {
+                    this.BSDXResourceRowChanging(this, new BSDXResourceRowChangeEvent(((BSDXResourceRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleted(e);
+                if ((this.BSDXResourceRowDeleted != null)) {
+                    this.BSDXResourceRowDeleted(this, new BSDXResourceRowChangeEvent(((BSDXResourceRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleting(e);
+                if ((this.BSDXResourceRowDeleting != null)) {
+                    this.BSDXResourceRowDeleting(this, new BSDXResourceRowChangeEvent(((BSDXResourceRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void RemoveBSDXResourceRow(BSDXResourceRow row) {
+                this.Rows.Remove(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+                global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+                global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+                dsPatientApptDisplay2 ds = new dsPatientApptDisplay2();
+                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
+                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
+                any1.MinOccurs = new decimal(0);
+                any1.MaxOccurs = decimal.MaxValue;
+                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any1);
+                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
+                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
+                any2.MinOccurs = new decimal(1);
+                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any2);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute1.Name = "namespace";
+                attribute1.FixedValue = ds.Namespace;
+                type.Attributes.Add(attribute1);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute2.Name = "tableTypeName";
+                attribute2.FixedValue = "BSDXResourceDataTable";
+                type.Attributes.Add(attribute2);
+                type.Particle = sequence;
+                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+                if (xs.Contains(dsSchema.TargetNamespace)) {
+                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                    try {
+                        global::System.Xml.Schema.XmlSchema schema = null;
+                        dsSchema.Write(s1);
+                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                            s2.SetLength(0);
+                            schema.Write(s2);
+                            if ((s1.Length == s2.Length)) {
+                                s1.Position = 0;
+                                s2.Position = 0;
+                                for (; ((s1.Position != s1.Length) 
+                                            && (s1.ReadByte() == s2.ReadByte())); ) {
+                                    ;
+                                }
+                                if ((s1.Position == s1.Length)) {
+                                    return type;
+                                }
+                            }
+                        }
+                    }
+                    finally {
+                        if ((s1 != null)) {
+                            s1.Close();
+                        }
+                        if ((s2 != null)) {
+                            s2.Close();
+                        }
+                    }
+                }
+                xs.Add(dsSchema);
+                return type;
+            }
+        }
+        
+        /// <summary>
+        ///Represents strongly named DataRow class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public partial class PatientApptsRow : global::System.Data.DataRow {
+            
+            private PatientApptsDataTable tablePatientAppts;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal PatientApptsRow(global::System.Data.DataRowBuilder rb) : 
+                    base(rb) {
+                this.tablePatientAppts = ((PatientApptsDataTable)(this.Table));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Name {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.NameColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Name\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.NameColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.DateTime DOB {
+                get {
+                    try {
+                        return ((global::System.DateTime)(this[this.tablePatientAppts.DOBColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'DOB\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.DOBColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Sex {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.SexColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Sex\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.SexColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string HRN {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.HRNColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'HRN\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.HRNColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.DateTime ApptDate {
+                get {
+                    try {
+                        return ((global::System.DateTime)(this[this.tablePatientAppts.ApptDateColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'ApptDate\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.ApptDateColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Clinic {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.ClinicColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Clinic\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.ClinicColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string TypeStatus {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.TypeStatusColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'TypeStatus\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.TypeStatusColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public int RESOURCEID {
+                get {
+                    try {
+                        return ((int)(this[this.tablePatientAppts.RESOURCEIDColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'RESOURCEID\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.RESOURCEIDColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string APPT_MADE_BY {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.APPT_MADE_BYColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'APPT_MADE_BY\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.APPT_MADE_BYColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.DateTime DATE_APPT_MADE {
+                get {
+                    try {
+                        return ((global::System.DateTime)(this[this.tablePatientAppts.DATE_APPT_MADEColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'DATE_APPT_MADE\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.DATE_APPT_MADEColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string NOTE {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.NOTEColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'NOTE\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.NOTEColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string STREET {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.STREETColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'STREET\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.STREETColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string CITY {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.CITYColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'CITY\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.CITYColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string STATE {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.STATEColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'STATE\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.STATEColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string ZIP {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.ZIPColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'ZIP\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.ZIPColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string HOMEPHONE {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.HOMEPHONEColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'HOMEPHONE\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.HOMEPHONEColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRow BSDXResourceRow {
+                get {
+                    return ((BSDXResourceRow)(this.GetParentRow(this.Table.ParentRelations["FK_BSDXResource_PatientAppts"])));
+                }
+                set {
+                    this.SetParentRow(value, this.Table.ParentRelations["FK_BSDXResource_PatientAppts"]);
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsNameNull() {
+                return this.IsNull(this.tablePatientAppts.NameColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetNameNull() {
+                this[this.tablePatientAppts.NameColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsDOBNull() {
+                return this.IsNull(this.tablePatientAppts.DOBColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetDOBNull() {
+                this[this.tablePatientAppts.DOBColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsSexNull() {
+                return this.IsNull(this.tablePatientAppts.SexColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetSexNull() {
+                this[this.tablePatientAppts.SexColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsHRNNull() {
+                return this.IsNull(this.tablePatientAppts.HRNColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetHRNNull() {
+                this[this.tablePatientAppts.HRNColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsApptDateNull() {
+                return this.IsNull(this.tablePatientAppts.ApptDateColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetApptDateNull() {
+                this[this.tablePatientAppts.ApptDateColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsClinicNull() {
+                return this.IsNull(this.tablePatientAppts.ClinicColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetClinicNull() {
+                this[this.tablePatientAppts.ClinicColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsTypeStatusNull() {
+                return this.IsNull(this.tablePatientAppts.TypeStatusColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetTypeStatusNull() {
+                this[this.tablePatientAppts.TypeStatusColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsRESOURCEIDNull() {
+                return this.IsNull(this.tablePatientAppts.RESOURCEIDColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetRESOURCEIDNull() {
+                this[this.tablePatientAppts.RESOURCEIDColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsAPPT_MADE_BYNull() {
+                return this.IsNull(this.tablePatientAppts.APPT_MADE_BYColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetAPPT_MADE_BYNull() {
+                this[this.tablePatientAppts.APPT_MADE_BYColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsDATE_APPT_MADENull() {
+                return this.IsNull(this.tablePatientAppts.DATE_APPT_MADEColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetDATE_APPT_MADENull() {
+                this[this.tablePatientAppts.DATE_APPT_MADEColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsNOTENull() {
+                return this.IsNull(this.tablePatientAppts.NOTEColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetNOTENull() {
+                this[this.tablePatientAppts.NOTEColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsSTREETNull() {
+                return this.IsNull(this.tablePatientAppts.STREETColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetSTREETNull() {
+                this[this.tablePatientAppts.STREETColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsCITYNull() {
+                return this.IsNull(this.tablePatientAppts.CITYColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetCITYNull() {
+                this[this.tablePatientAppts.CITYColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsSTATENull() {
+                return this.IsNull(this.tablePatientAppts.STATEColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetSTATENull() {
+                this[this.tablePatientAppts.STATEColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsZIPNull() {
+                return this.IsNull(this.tablePatientAppts.ZIPColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetZIPNull() {
+                this[this.tablePatientAppts.ZIPColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsHOMEPHONENull() {
+                return this.IsNull(this.tablePatientAppts.HOMEPHONEColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetHOMEPHONENull() {
+                this[this.tablePatientAppts.HOMEPHONEColumn] = global::System.Convert.DBNull;
+            }
+        }
+        
+        /// <summary>
+        ///Represents strongly named DataRow class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public partial class BSDXResourceRow : global::System.Data.DataRow {
+            
+            private BSDXResourceDataTable tableBSDXResource;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal BSDXResourceRow(global::System.Data.DataRowBuilder rb) : 
+                    base(rb) {
+                this.tableBSDXResource = ((BSDXResourceDataTable)(this.Table));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public int RESOURCEID {
+                get {
+                    return ((int)(this[this.tableBSDXResource.RESOURCEIDColumn]));
+                }
+                set {
+                    this[this.tableBSDXResource.RESOURCEIDColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string RESOURCE_NAME {
+                get {
+                    try {
+                        return ((string)(this[this.tableBSDXResource.RESOURCE_NAMEColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'RESOURCE_NAME\' in table \'BSDXResource\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tableBSDXResource.RESOURCE_NAMEColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string LETTER_TEXT {
+                get {
+                    try {
+                        return ((string)(this[this.tableBSDXResource.LETTER_TEXTColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'LETTER_TEXT\' in table \'BSDXResource\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tableBSDXResource.LETTER_TEXTColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsRESOURCE_NAMENull() {
+                return this.IsNull(this.tableBSDXResource.RESOURCE_NAMEColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetRESOURCE_NAMENull() {
+                this[this.tableBSDXResource.RESOURCE_NAMEColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsLETTER_TEXTNull() {
+                return this.IsNull(this.tableBSDXResource.LETTER_TEXTColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetLETTER_TEXTNull() {
+                this[this.tableBSDXResource.LETTER_TEXTColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRow[] GetPatientApptsRows() {
+                if ((this.Table.ChildRelations["FK_BSDXResource_PatientAppts"] == null)) {
+                    return new PatientApptsRow[0];
+                }
+                else {
+                    return ((PatientApptsRow[])(base.GetChildRows(this.Table.ChildRelations["FK_BSDXResource_PatientAppts"])));
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Row event argument class
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public class PatientApptsRowChangeEvent : global::System.EventArgs {
+            
+            private PatientApptsRow eventRow;
+            
+            private global::System.Data.DataRowAction eventAction;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRowChangeEvent(PatientApptsRow row, global::System.Data.DataRowAction action) {
+                this.eventRow = row;
+                this.eventAction = action;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRow Row {
+                get {
+                    return this.eventRow;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataRowAction Action {
+                get {
+                    return this.eventAction;
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Row event argument class
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public class BSDXResourceRowChangeEvent : global::System.EventArgs {
+            
+            private BSDXResourceRow eventRow;
+            
+            private global::System.Data.DataRowAction eventAction;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRowChangeEvent(BSDXResourceRow row, global::System.Data.DataRowAction action) {
+                this.eventRow = row;
+                this.eventAction = action;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRow Row {
+                get {
+                    return this.eventRow;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataRowAction Action {
+                get {
+                    return this.eventAction;
+                }
+            }
+        }
+    }
+}
+
+#pragma warning restore 1591
Index: Scheduling/branches/GUI1.2/dsPatientApptDisplay2.xsd
===================================================================
--- Scheduling/branches/GUI1.2/dsPatientApptDisplay2.xsd	(revision 855)
+++ Scheduling/branches/GUI1.2/dsPatientApptDisplay2.xsd	(revision 855)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema id="dsPatientApptDisplay2" targetNamespace="http://tempuri.org/dsPatientApptDisplay2.xsd" xmlns:mstns="http://tempuri.org/dsPatientApptDisplay2.xsd" xmlns="http://tempuri.org/dsPatientApptDisplay2.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
+  <xs:annotation>
+    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
+      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
+        <Connections />
+        <Tables />
+        <Sources />
+      </DataSource>
+    </xs:appinfo>
+  </xs:annotation>
+  <xs:element name="dsPatientApptDisplay2" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="dsPatientApptDisplay2" msprop:Generator_DataSetName="dsPatientApptDisplay2">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element name="PatientAppts" msprop:Generator_UserTableName="PatientAppts" msprop:Generator_RowDeletedName="PatientApptsRowDeleted" msprop:Generator_TableClassName="PatientApptsDataTable" msprop:Generator_RowChangedName="PatientApptsRowChanged" msprop:Generator_RowClassName="PatientApptsRow" msprop:Generator_RowChangingName="PatientApptsRowChanging" msprop:Generator_RowEvArgName="PatientApptsRowChangeEvent" msprop:Generator_RowEvHandlerName="PatientApptsRowChangeEventHandler" msprop:Generator_TablePropName="PatientAppts" msprop:Generator_TableVarName="tablePatientAppts" msprop:Generator_RowDeletingName="PatientApptsRowDeleting">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="DOB" msprop:Generator_UserColumnName="DOB" msprop:Generator_ColumnPropNameInRow="DOB" msprop:Generator_ColumnVarNameInTable="columnDOB" msprop:Generator_ColumnPropNameInTable="DOBColumn" type="xs:date" minOccurs="0" />
+              <xs:element name="Sex" msprop:Generator_UserColumnName="Sex" msprop:Generator_ColumnPropNameInRow="Sex" msprop:Generator_ColumnVarNameInTable="columnSex" msprop:Generator_ColumnPropNameInTable="SexColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="HRN" msprop:Generator_UserColumnName="HRN" msprop:Generator_ColumnPropNameInRow="HRN" msprop:Generator_ColumnVarNameInTable="columnHRN" msprop:Generator_ColumnPropNameInTable="HRNColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="ApptDate" msprop:Generator_UserColumnName="ApptDate" msprop:Generator_ColumnPropNameInRow="ApptDate" msprop:Generator_ColumnVarNameInTable="columnApptDate" msprop:Generator_ColumnPropNameInTable="ApptDateColumn" type="xs:date" minOccurs="0" />
+              <xs:element name="Clinic" msprop:Generator_UserColumnName="Clinic" msprop:Generator_ColumnPropNameInRow="Clinic" msprop:Generator_ColumnVarNameInTable="columnClinic" msprop:Generator_ColumnPropNameInTable="ClinicColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="TypeStatus" msprop:Generator_UserColumnName="TypeStatus" msprop:Generator_ColumnPropNameInRow="TypeStatus" msprop:Generator_ColumnVarNameInTable="columnTypeStatus" msprop:Generator_ColumnPropNameInTable="TypeStatusColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="RESOURCEID" msprop:Generator_UserColumnName="RESOURCEID" msprop:Generator_ColumnPropNameInRow="RESOURCEID" msprop:Generator_ColumnVarNameInTable="columnRESOURCEID" msprop:Generator_ColumnPropNameInTable="RESOURCEIDColumn" type="xs:int" minOccurs="0" />
+              <xs:element name="APPT_MADE_BY" msprop:Generator_UserColumnName="APPT_MADE_BY" msprop:Generator_ColumnPropNameInRow="APPT_MADE_BY" msprop:Generator_ColumnVarNameInTable="columnAPPT_MADE_BY" msprop:Generator_ColumnPropNameInTable="APPT_MADE_BYColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="DATE_APPT_MADE" msprop:Generator_UserColumnName="DATE_APPT_MADE" msprop:Generator_ColumnPropNameInRow="DATE_APPT_MADE" msprop:Generator_ColumnVarNameInTable="columnDATE_APPT_MADE" msprop:Generator_ColumnPropNameInTable="DATE_APPT_MADEColumn" type="xs:date" minOccurs="0" />
+              <xs:element name="NOTE" msprop:Generator_UserColumnName="NOTE" msprop:Generator_ColumnPropNameInRow="NOTE" msprop:Generator_ColumnVarNameInTable="columnNOTE" msprop:Generator_ColumnPropNameInTable="NOTEColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="STREET" msprop:Generator_UserColumnName="STREET" msprop:Generator_ColumnPropNameInRow="STREET" msprop:Generator_ColumnVarNameInTable="columnSTREET" msprop:Generator_ColumnPropNameInTable="STREETColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="CITY" msprop:Generator_UserColumnName="CITY" msprop:Generator_ColumnPropNameInRow="CITY" msprop:Generator_ColumnVarNameInTable="columnCITY" msprop:Generator_ColumnPropNameInTable="CITYColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="STATE" msprop:Generator_UserColumnName="STATE" msprop:Generator_ColumnPropNameInRow="STATE" msprop:Generator_ColumnVarNameInTable="columnSTATE" msprop:Generator_ColumnPropNameInTable="STATEColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="ZIP" msprop:Generator_UserColumnName="ZIP" msprop:Generator_ColumnPropNameInRow="ZIP" msprop:Generator_ColumnVarNameInTable="columnZIP" msprop:Generator_ColumnPropNameInTable="ZIPColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="HOMEPHONE" msprop:Generator_UserColumnName="HOMEPHONE" msprop:Generator_ColumnPropNameInRow="HOMEPHONE" msprop:Generator_ColumnVarNameInTable="columnHOMEPHONE" msprop:Generator_ColumnPropNameInTable="HOMEPHONEColumn" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="BSDXResource" msprop:Generator_UserTableName="BSDXResource" msprop:Generator_RowDeletedName="BSDXResourceRowDeleted" msprop:Generator_TableClassName="BSDXResourceDataTable" msprop:Generator_RowChangedName="BSDXResourceRowChanged" msprop:Generator_RowClassName="BSDXResourceRow" msprop:Generator_RowChangingName="BSDXResourceRowChanging" msprop:Generator_RowEvArgName="BSDXResourceRowChangeEvent" msprop:Generator_RowEvHandlerName="BSDXResourceRowChangeEventHandler" msprop:Generator_TablePropName="BSDXResource" msprop:Generator_TableVarName="tableBSDXResource" msprop:Generator_RowDeletingName="BSDXResourceRowDeleting">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="RESOURCEID" msprop:Generator_UserColumnName="RESOURCEID" msprop:Generator_ColumnPropNameInRow="RESOURCEID" msprop:Generator_ColumnVarNameInTable="columnRESOURCEID" msprop:Generator_ColumnPropNameInTable="RESOURCEIDColumn" type="xs:int" />
+              <xs:element name="RESOURCE_NAME" msprop:Generator_UserColumnName="RESOURCE_NAME" msprop:Generator_ColumnPropNameInRow="RESOURCE_NAME" msprop:Generator_ColumnVarNameInTable="columnRESOURCE_NAME" msprop:Generator_ColumnPropNameInTable="RESOURCE_NAMEColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="LETTER_TEXT" msprop:Generator_UserColumnName="LETTER_TEXT" msprop:Generator_ColumnPropNameInRow="LETTER_TEXT" msprop:Generator_ColumnVarNameInTable="columnLETTER_TEXT" msprop:Generator_ColumnPropNameInTable="LETTER_TEXTColumn" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+    <xs:unique name="kBSDXResourceID">
+      <xs:selector xpath=".//mstns:BSDXResource" />
+      <xs:field xpath="mstns:RESOURCEID" />
+    </xs:unique>
+    <xs:keyref name="FK_BSDXResource_PatientAppts" refer="kBSDXResourceID" msprop:rel_Generator_UserRelationName="FK_BSDXResource_PatientAppts" msprop:rel_Generator_RelationVarName="relationFK_BSDXResource_PatientAppts" msprop:rel_Generator_UserChildTable="PatientAppts" msprop:rel_Generator_UserParentTable="BSDXResource" msprop:rel_Generator_ParentPropName="BSDXResourceRow" msprop:rel_Generator_ChildPropName="GetPatientApptsRows">
+      <xs:selector xpath=".//mstns:PatientAppts" />
+      <xs:field xpath="mstns:RESOURCEID" />
+    </xs:keyref>
+  </xs:element>
+</xs:schema>
Index: Scheduling/branches/GUI1.2/dsPatientApptDisplay2.xsx
===================================================================
--- Scheduling/branches/GUI1.2/dsPatientApptDisplay2.xsx	(revision 855)
+++ Scheduling/branches/GUI1.2/dsPatientApptDisplay2.xsx	(revision 855)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.-->
+<XSDDesignerLayout layoutVersion="2" viewPortLeft="0" viewPortTop="0" zoom="100">
+    <PatientAppts_XmlElement left="1693" top="635" width="6403" height="5503" selected="0" zOrder="1" index="0" expanded="1" />
+    <BSDXResource_XmlElement left="11218" top="1403" width="7514" height="3810" selected="0" zOrder="2" index="1" expanded="1" />
+    <BSDXResourcePatientAppts_XmlKeyref left="9314" top="3135" width="503" height="503" selected="0" zOrder="4" />
+</XSDDesignerLayout>
Index: Scheduling/branches/GUI1.2/dsRebookAppts.Designer.cs
===================================================================
--- Scheduling/branches/GUI1.2/dsRebookAppts.Designer.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/dsRebookAppts.Designer.cs	(revision 855)
@@ -0,0 +1,1684 @@
+﻿//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.3603
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+#pragma warning disable 1591
+
+namespace IndianHealthService.ClinicalScheduling {
+    
+    
+    /// <summary>
+    ///Represents a strongly typed in-memory cache of data.
+    ///</summary>
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+    [global::System.Serializable()]
+    [global::System.ComponentModel.DesignerCategoryAttribute("code")]
+    [global::System.ComponentModel.ToolboxItem(true)]
+    [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
+    [global::System.Xml.Serialization.XmlRootAttribute("dsRebookAppts")]
+    [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
+    public partial class dsRebookAppts : global::System.Data.DataSet {
+        
+        private PatientApptsDataTable tablePatientAppts;
+        
+        private BSDXResourceDataTable tableBSDXResource;
+        
+        private global::System.Data.DataRelation relationFK_BSDXResource_PatientAppts;
+        
+        private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public dsRebookAppts() {
+            this.BeginInit();
+            this.InitClass();
+            global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
+            base.Tables.CollectionChanged += schemaChangedHandler;
+            base.Relations.CollectionChanged += schemaChangedHandler;
+            this.EndInit();
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected dsRebookAppts(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                base(info, context, false) {
+            if ((this.IsBinarySerialized(info, context) == true)) {
+                this.InitVars(false);
+                global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
+                this.Tables.CollectionChanged += schemaChangedHandler1;
+                this.Relations.CollectionChanged += schemaChangedHandler1;
+                return;
+            }
+            string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
+            if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
+                global::System.Data.DataSet ds = new global::System.Data.DataSet();
+                ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
+                if ((ds.Tables["PatientAppts"] != null)) {
+                    base.Tables.Add(new PatientApptsDataTable(ds.Tables["PatientAppts"]));
+                }
+                if ((ds.Tables["BSDXResource"] != null)) {
+                    base.Tables.Add(new BSDXResourceDataTable(ds.Tables["BSDXResource"]));
+                }
+                this.DataSetName = ds.DataSetName;
+                this.Prefix = ds.Prefix;
+                this.Namespace = ds.Namespace;
+                this.Locale = ds.Locale;
+                this.CaseSensitive = ds.CaseSensitive;
+                this.EnforceConstraints = ds.EnforceConstraints;
+                this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
+                this.InitVars();
+            }
+            else {
+                this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema)));
+            }
+            this.GetSerializationData(info, context);
+            global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
+            base.Tables.CollectionChanged += schemaChangedHandler;
+            this.Relations.CollectionChanged += schemaChangedHandler;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
+        public PatientApptsDataTable PatientAppts {
+            get {
+                return this.tablePatientAppts;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.Browsable(false)]
+        [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)]
+        public BSDXResourceDataTable BSDXResource {
+            get {
+                return this.tableBSDXResource;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.BrowsableAttribute(true)]
+        [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)]
+        public override global::System.Data.SchemaSerializationMode SchemaSerializationMode {
+            get {
+                return this._schemaSerializationMode;
+            }
+            set {
+                this._schemaSerializationMode = value;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+        public new global::System.Data.DataTableCollection Tables {
+            get {
+                return base.Tables;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)]
+        public new global::System.Data.DataRelationCollection Relations {
+            get {
+                return base.Relations;
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override void InitializeDerivedDataSet() {
+            this.BeginInit();
+            this.InitClass();
+            this.EndInit();
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public override global::System.Data.DataSet Clone() {
+            dsRebookAppts cln = ((dsRebookAppts)(base.Clone()));
+            cln.InitVars();
+            cln.SchemaSerializationMode = this.SchemaSerializationMode;
+            return cln;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override bool ShouldSerializeTables() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override bool ShouldSerializeRelations() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) {
+            if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) {
+                this.Reset();
+                global::System.Data.DataSet ds = new global::System.Data.DataSet();
+                ds.ReadXml(reader);
+                if ((ds.Tables["PatientAppts"] != null)) {
+                    base.Tables.Add(new PatientApptsDataTable(ds.Tables["PatientAppts"]));
+                }
+                if ((ds.Tables["BSDXResource"] != null)) {
+                    base.Tables.Add(new BSDXResourceDataTable(ds.Tables["BSDXResource"]));
+                }
+                this.DataSetName = ds.DataSetName;
+                this.Prefix = ds.Prefix;
+                this.Namespace = ds.Namespace;
+                this.Locale = ds.Locale;
+                this.CaseSensitive = ds.CaseSensitive;
+                this.EnforceConstraints = ds.EnforceConstraints;
+                this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add);
+                this.InitVars();
+            }
+            else {
+                this.ReadXml(reader);
+                this.InitVars();
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() {
+            global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream();
+            this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null));
+            stream.Position = 0;
+            return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal void InitVars() {
+            this.InitVars(true);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        internal void InitVars(bool initTable) {
+            this.tablePatientAppts = ((PatientApptsDataTable)(base.Tables["PatientAppts"]));
+            if ((initTable == true)) {
+                if ((this.tablePatientAppts != null)) {
+                    this.tablePatientAppts.InitVars();
+                }
+            }
+            this.tableBSDXResource = ((BSDXResourceDataTable)(base.Tables["BSDXResource"]));
+            if ((initTable == true)) {
+                if ((this.tableBSDXResource != null)) {
+                    this.tableBSDXResource.InitVars();
+                }
+            }
+            this.relationFK_BSDXResource_PatientAppts = this.Relations["FK_BSDXResource_PatientAppts"];
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void InitClass() {
+            this.DataSetName = "dsRebookAppts";
+            this.Prefix = "";
+            this.Namespace = "http://tempuri.org/dsRebookAppts.xsd";
+            this.EnforceConstraints = true;
+            this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
+            this.tablePatientAppts = new PatientApptsDataTable();
+            base.Tables.Add(this.tablePatientAppts);
+            this.tableBSDXResource = new BSDXResourceDataTable();
+            base.Tables.Add(this.tableBSDXResource);
+            global::System.Data.ForeignKeyConstraint fkc;
+            fkc = new global::System.Data.ForeignKeyConstraint("FK_BSDXResource_PatientAppts", new global::System.Data.DataColumn[] {
+                        this.tableBSDXResource.RESOURCEIDColumn}, new global::System.Data.DataColumn[] {
+                        this.tablePatientAppts.RESOURCEIDColumn});
+            this.tablePatientAppts.Constraints.Add(fkc);
+            fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None;
+            fkc.DeleteRule = global::System.Data.Rule.Cascade;
+            fkc.UpdateRule = global::System.Data.Rule.Cascade;
+            this.relationFK_BSDXResource_PatientAppts = new global::System.Data.DataRelation("FK_BSDXResource_PatientAppts", new global::System.Data.DataColumn[] {
+                        this.tableBSDXResource.RESOURCEIDColumn}, new global::System.Data.DataColumn[] {
+                        this.tablePatientAppts.RESOURCEIDColumn}, false);
+            this.Relations.Add(this.relationFK_BSDXResource_PatientAppts);
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private bool ShouldSerializePatientAppts() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private bool ShouldSerializeBSDXResource() {
+            return false;
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) {
+            if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) {
+                this.InitVars();
+            }
+        }
+        
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+            dsRebookAppts ds = new dsRebookAppts();
+            global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+            global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+            global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
+            any.Namespace = ds.Namespace;
+            sequence.Items.Add(any);
+            type.Particle = sequence;
+            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+            if (xs.Contains(dsSchema.TargetNamespace)) {
+                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                try {
+                    global::System.Xml.Schema.XmlSchema schema = null;
+                    dsSchema.Write(s1);
+                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                        s2.SetLength(0);
+                        schema.Write(s2);
+                        if ((s1.Length == s2.Length)) {
+                            s1.Position = 0;
+                            s2.Position = 0;
+                            for (; ((s1.Position != s1.Length) 
+                                        && (s1.ReadByte() == s2.ReadByte())); ) {
+                                ;
+                            }
+                            if ((s1.Position == s1.Length)) {
+                                return type;
+                            }
+                        }
+                    }
+                }
+                finally {
+                    if ((s1 != null)) {
+                        s1.Close();
+                    }
+                    if ((s2 != null)) {
+                        s2.Close();
+                    }
+                }
+            }
+            xs.Add(dsSchema);
+            return type;
+        }
+        
+        public delegate void PatientApptsRowChangeEventHandler(object sender, PatientApptsRowChangeEvent e);
+        
+        public delegate void BSDXResourceRowChangeEventHandler(object sender, BSDXResourceRowChangeEvent e);
+        
+        /// <summary>
+        ///Represents the strongly named DataTable class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        [global::System.Serializable()]
+        [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
+        public partial class PatientApptsDataTable : global::System.Data.TypedTableBase<PatientApptsRow> {
+            
+            private global::System.Data.DataColumn columnName;
+            
+            private global::System.Data.DataColumn columnDOB;
+            
+            private global::System.Data.DataColumn columnSex;
+            
+            private global::System.Data.DataColumn columnHRN;
+            
+            private global::System.Data.DataColumn columnNewApptDate;
+            
+            private global::System.Data.DataColumn columnClinic;
+            
+            private global::System.Data.DataColumn columnTypeStatus;
+            
+            private global::System.Data.DataColumn columnRESOURCEID;
+            
+            private global::System.Data.DataColumn columnAPPT_MADE_BY;
+            
+            private global::System.Data.DataColumn columnDATE_APPT_MADE;
+            
+            private global::System.Data.DataColumn columnNOTE;
+            
+            private global::System.Data.DataColumn columnSTREET;
+            
+            private global::System.Data.DataColumn columnCITY;
+            
+            private global::System.Data.DataColumn columnSTATE;
+            
+            private global::System.Data.DataColumn columnZIP;
+            
+            private global::System.Data.DataColumn columnHOMEPHONE;
+            
+            private global::System.Data.DataColumn columnOldApptDate;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsDataTable() {
+                this.TableName = "PatientAppts";
+                this.BeginInit();
+                this.InitClass();
+                this.EndInit();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal PatientApptsDataTable(global::System.Data.DataTable table) {
+                this.TableName = table.TableName;
+                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
+                    this.CaseSensitive = table.CaseSensitive;
+                }
+                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
+                    this.Locale = table.Locale;
+                }
+                if ((table.Namespace != table.DataSet.Namespace)) {
+                    this.Namespace = table.Namespace;
+                }
+                this.Prefix = table.Prefix;
+                this.MinimumCapacity = table.MinimumCapacity;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected PatientApptsDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                    base(info, context) {
+                this.InitVars();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn NameColumn {
+                get {
+                    return this.columnName;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn DOBColumn {
+                get {
+                    return this.columnDOB;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn SexColumn {
+                get {
+                    return this.columnSex;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn HRNColumn {
+                get {
+                    return this.columnHRN;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn NewApptDateColumn {
+                get {
+                    return this.columnNewApptDate;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn ClinicColumn {
+                get {
+                    return this.columnClinic;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn TypeStatusColumn {
+                get {
+                    return this.columnTypeStatus;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn RESOURCEIDColumn {
+                get {
+                    return this.columnRESOURCEID;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn APPT_MADE_BYColumn {
+                get {
+                    return this.columnAPPT_MADE_BY;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn DATE_APPT_MADEColumn {
+                get {
+                    return this.columnDATE_APPT_MADE;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn NOTEColumn {
+                get {
+                    return this.columnNOTE;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn STREETColumn {
+                get {
+                    return this.columnSTREET;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn CITYColumn {
+                get {
+                    return this.columnCITY;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn STATEColumn {
+                get {
+                    return this.columnSTATE;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn ZIPColumn {
+                get {
+                    return this.columnZIP;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn HOMEPHONEColumn {
+                get {
+                    return this.columnHOMEPHONE;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn OldApptDateColumn {
+                get {
+                    return this.columnOldApptDate;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            [global::System.ComponentModel.Browsable(false)]
+            public int Count {
+                get {
+                    return this.Rows.Count;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRow this[int index] {
+                get {
+                    return ((PatientApptsRow)(this.Rows[index]));
+                }
+            }
+            
+            public event PatientApptsRowChangeEventHandler PatientApptsRowChanging;
+            
+            public event PatientApptsRowChangeEventHandler PatientApptsRowChanged;
+            
+            public event PatientApptsRowChangeEventHandler PatientApptsRowDeleting;
+            
+            public event PatientApptsRowChangeEventHandler PatientApptsRowDeleted;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void AddPatientApptsRow(PatientApptsRow row) {
+                this.Rows.Add(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRow AddPatientApptsRow(
+                        string Name, 
+                        System.DateTime DOB, 
+                        string Sex, 
+                        string HRN, 
+                        System.DateTime NewApptDate, 
+                        string Clinic, 
+                        string TypeStatus, 
+                        BSDXResourceRow parentBSDXResourceRowByFK_BSDXResource_PatientAppts, 
+                        string APPT_MADE_BY, 
+                        System.DateTime DATE_APPT_MADE, 
+                        string NOTE, 
+                        string STREET, 
+                        string CITY, 
+                        string STATE, 
+                        string ZIP, 
+                        string HOMEPHONE, 
+                        System.DateTime OldApptDate) {
+                PatientApptsRow rowPatientApptsRow = ((PatientApptsRow)(this.NewRow()));
+                object[] columnValuesArray = new object[] {
+                        Name,
+                        DOB,
+                        Sex,
+                        HRN,
+                        NewApptDate,
+                        Clinic,
+                        TypeStatus,
+                        null,
+                        APPT_MADE_BY,
+                        DATE_APPT_MADE,
+                        NOTE,
+                        STREET,
+                        CITY,
+                        STATE,
+                        ZIP,
+                        HOMEPHONE,
+                        OldApptDate};
+                if ((parentBSDXResourceRowByFK_BSDXResource_PatientAppts != null)) {
+                    columnValuesArray[7] = parentBSDXResourceRowByFK_BSDXResource_PatientAppts[0];
+                }
+                rowPatientApptsRow.ItemArray = columnValuesArray;
+                this.Rows.Add(rowPatientApptsRow);
+                return rowPatientApptsRow;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public override global::System.Data.DataTable Clone() {
+                PatientApptsDataTable cln = ((PatientApptsDataTable)(base.Clone()));
+                cln.InitVars();
+                return cln;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataTable CreateInstance() {
+                return new PatientApptsDataTable();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal void InitVars() {
+                this.columnName = base.Columns["Name"];
+                this.columnDOB = base.Columns["DOB"];
+                this.columnSex = base.Columns["Sex"];
+                this.columnHRN = base.Columns["HRN"];
+                this.columnNewApptDate = base.Columns["NewApptDate"];
+                this.columnClinic = base.Columns["Clinic"];
+                this.columnTypeStatus = base.Columns["TypeStatus"];
+                this.columnRESOURCEID = base.Columns["RESOURCEID"];
+                this.columnAPPT_MADE_BY = base.Columns["APPT_MADE_BY"];
+                this.columnDATE_APPT_MADE = base.Columns["DATE_APPT_MADE"];
+                this.columnNOTE = base.Columns["NOTE"];
+                this.columnSTREET = base.Columns["STREET"];
+                this.columnCITY = base.Columns["CITY"];
+                this.columnSTATE = base.Columns["STATE"];
+                this.columnZIP = base.Columns["ZIP"];
+                this.columnHOMEPHONE = base.Columns["HOMEPHONE"];
+                this.columnOldApptDate = base.Columns["OldApptDate"];
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private void InitClass() {
+                this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnName);
+                this.columnDOB = new global::System.Data.DataColumn("DOB", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnDOB);
+                this.columnSex = new global::System.Data.DataColumn("Sex", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnSex);
+                this.columnHRN = new global::System.Data.DataColumn("HRN", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnHRN);
+                this.columnNewApptDate = new global::System.Data.DataColumn("NewApptDate", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnNewApptDate);
+                this.columnClinic = new global::System.Data.DataColumn("Clinic", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnClinic);
+                this.columnTypeStatus = new global::System.Data.DataColumn("TypeStatus", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnTypeStatus);
+                this.columnRESOURCEID = new global::System.Data.DataColumn("RESOURCEID", typeof(int), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnRESOURCEID);
+                this.columnAPPT_MADE_BY = new global::System.Data.DataColumn("APPT_MADE_BY", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnAPPT_MADE_BY);
+                this.columnDATE_APPT_MADE = new global::System.Data.DataColumn("DATE_APPT_MADE", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnDATE_APPT_MADE);
+                this.columnNOTE = new global::System.Data.DataColumn("NOTE", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnNOTE);
+                this.columnSTREET = new global::System.Data.DataColumn("STREET", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnSTREET);
+                this.columnCITY = new global::System.Data.DataColumn("CITY", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnCITY);
+                this.columnSTATE = new global::System.Data.DataColumn("STATE", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnSTATE);
+                this.columnZIP = new global::System.Data.DataColumn("ZIP", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnZIP);
+                this.columnHOMEPHONE = new global::System.Data.DataColumn("HOMEPHONE", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnHOMEPHONE);
+                this.columnOldApptDate = new global::System.Data.DataColumn("OldApptDate", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnOldApptDate);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRow NewPatientApptsRow() {
+                return ((PatientApptsRow)(this.NewRow()));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
+                return new PatientApptsRow(builder);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Type GetRowType() {
+                return typeof(PatientApptsRow);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanged(e);
+                if ((this.PatientApptsRowChanged != null)) {
+                    this.PatientApptsRowChanged(this, new PatientApptsRowChangeEvent(((PatientApptsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanging(e);
+                if ((this.PatientApptsRowChanging != null)) {
+                    this.PatientApptsRowChanging(this, new PatientApptsRowChangeEvent(((PatientApptsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleted(e);
+                if ((this.PatientApptsRowDeleted != null)) {
+                    this.PatientApptsRowDeleted(this, new PatientApptsRowChangeEvent(((PatientApptsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleting(e);
+                if ((this.PatientApptsRowDeleting != null)) {
+                    this.PatientApptsRowDeleting(this, new PatientApptsRowChangeEvent(((PatientApptsRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void RemovePatientApptsRow(PatientApptsRow row) {
+                this.Rows.Remove(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+                global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+                global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+                dsRebookAppts ds = new dsRebookAppts();
+                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
+                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
+                any1.MinOccurs = new decimal(0);
+                any1.MaxOccurs = decimal.MaxValue;
+                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any1);
+                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
+                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
+                any2.MinOccurs = new decimal(1);
+                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any2);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute1.Name = "namespace";
+                attribute1.FixedValue = ds.Namespace;
+                type.Attributes.Add(attribute1);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute2.Name = "tableTypeName";
+                attribute2.FixedValue = "PatientApptsDataTable";
+                type.Attributes.Add(attribute2);
+                type.Particle = sequence;
+                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+                if (xs.Contains(dsSchema.TargetNamespace)) {
+                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                    try {
+                        global::System.Xml.Schema.XmlSchema schema = null;
+                        dsSchema.Write(s1);
+                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                            s2.SetLength(0);
+                            schema.Write(s2);
+                            if ((s1.Length == s2.Length)) {
+                                s1.Position = 0;
+                                s2.Position = 0;
+                                for (; ((s1.Position != s1.Length) 
+                                            && (s1.ReadByte() == s2.ReadByte())); ) {
+                                    ;
+                                }
+                                if ((s1.Position == s1.Length)) {
+                                    return type;
+                                }
+                            }
+                        }
+                    }
+                    finally {
+                        if ((s1 != null)) {
+                            s1.Close();
+                        }
+                        if ((s2 != null)) {
+                            s2.Close();
+                        }
+                    }
+                }
+                xs.Add(dsSchema);
+                return type;
+            }
+        }
+        
+        /// <summary>
+        ///Represents the strongly named DataTable class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        [global::System.Serializable()]
+        [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
+        public partial class BSDXResourceDataTable : global::System.Data.TypedTableBase<BSDXResourceRow> {
+            
+            private global::System.Data.DataColumn columnRESOURCEID;
+            
+            private global::System.Data.DataColumn columnRESOURCE_NAME;
+            
+            private global::System.Data.DataColumn columnLETTER_TEXT;
+            
+            private global::System.Data.DataColumn columnNO_SHOW_LETTER;
+            
+            private global::System.Data.DataColumn columnCLINIC_CANCELLATION_LETTER;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceDataTable() {
+                this.TableName = "BSDXResource";
+                this.BeginInit();
+                this.InitClass();
+                this.EndInit();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal BSDXResourceDataTable(global::System.Data.DataTable table) {
+                this.TableName = table.TableName;
+                if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
+                    this.CaseSensitive = table.CaseSensitive;
+                }
+                if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
+                    this.Locale = table.Locale;
+                }
+                if ((table.Namespace != table.DataSet.Namespace)) {
+                    this.Namespace = table.Namespace;
+                }
+                this.Prefix = table.Prefix;
+                this.MinimumCapacity = table.MinimumCapacity;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected BSDXResourceDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : 
+                    base(info, context) {
+                this.InitVars();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn RESOURCEIDColumn {
+                get {
+                    return this.columnRESOURCEID;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn RESOURCE_NAMEColumn {
+                get {
+                    return this.columnRESOURCE_NAME;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn LETTER_TEXTColumn {
+                get {
+                    return this.columnLETTER_TEXT;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn NO_SHOW_LETTERColumn {
+                get {
+                    return this.columnNO_SHOW_LETTER;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataColumn CLINIC_CANCELLATION_LETTERColumn {
+                get {
+                    return this.columnCLINIC_CANCELLATION_LETTER;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            [global::System.ComponentModel.Browsable(false)]
+            public int Count {
+                get {
+                    return this.Rows.Count;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRow this[int index] {
+                get {
+                    return ((BSDXResourceRow)(this.Rows[index]));
+                }
+            }
+            
+            public event BSDXResourceRowChangeEventHandler BSDXResourceRowChanging;
+            
+            public event BSDXResourceRowChangeEventHandler BSDXResourceRowChanged;
+            
+            public event BSDXResourceRowChangeEventHandler BSDXResourceRowDeleting;
+            
+            public event BSDXResourceRowChangeEventHandler BSDXResourceRowDeleted;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void AddBSDXResourceRow(BSDXResourceRow row) {
+                this.Rows.Add(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRow AddBSDXResourceRow(int RESOURCEID, string RESOURCE_NAME, string LETTER_TEXT, string NO_SHOW_LETTER, string CLINIC_CANCELLATION_LETTER) {
+                BSDXResourceRow rowBSDXResourceRow = ((BSDXResourceRow)(this.NewRow()));
+                object[] columnValuesArray = new object[] {
+                        RESOURCEID,
+                        RESOURCE_NAME,
+                        LETTER_TEXT,
+                        NO_SHOW_LETTER,
+                        CLINIC_CANCELLATION_LETTER};
+                rowBSDXResourceRow.ItemArray = columnValuesArray;
+                this.Rows.Add(rowBSDXResourceRow);
+                return rowBSDXResourceRow;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public override global::System.Data.DataTable Clone() {
+                BSDXResourceDataTable cln = ((BSDXResourceDataTable)(base.Clone()));
+                cln.InitVars();
+                return cln;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataTable CreateInstance() {
+                return new BSDXResourceDataTable();
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal void InitVars() {
+                this.columnRESOURCEID = base.Columns["RESOURCEID"];
+                this.columnRESOURCE_NAME = base.Columns["RESOURCE_NAME"];
+                this.columnLETTER_TEXT = base.Columns["LETTER_TEXT"];
+                this.columnNO_SHOW_LETTER = base.Columns["NO_SHOW_LETTER"];
+                this.columnCLINIC_CANCELLATION_LETTER = base.Columns["CLINIC_CANCELLATION_LETTER"];
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            private void InitClass() {
+                this.columnRESOURCEID = new global::System.Data.DataColumn("RESOURCEID", typeof(int), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnRESOURCEID);
+                this.columnRESOURCE_NAME = new global::System.Data.DataColumn("RESOURCE_NAME", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnRESOURCE_NAME);
+                this.columnLETTER_TEXT = new global::System.Data.DataColumn("LETTER_TEXT", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnLETTER_TEXT);
+                this.columnNO_SHOW_LETTER = new global::System.Data.DataColumn("NO_SHOW_LETTER", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnNO_SHOW_LETTER);
+                this.columnCLINIC_CANCELLATION_LETTER = new global::System.Data.DataColumn("CLINIC_CANCELLATION_LETTER", typeof(string), null, global::System.Data.MappingType.Element);
+                base.Columns.Add(this.columnCLINIC_CANCELLATION_LETTER);
+                this.Constraints.Add(new global::System.Data.UniqueConstraint("kBSDXResourceID", new global::System.Data.DataColumn[] {
+                                this.columnRESOURCEID}, false));
+                this.columnRESOURCEID.AllowDBNull = false;
+                this.columnRESOURCEID.Unique = true;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRow NewBSDXResourceRow() {
+                return ((BSDXResourceRow)(this.NewRow()));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) {
+                return new BSDXResourceRow(builder);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override global::System.Type GetRowType() {
+                return typeof(BSDXResourceRow);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanged(e);
+                if ((this.BSDXResourceRowChanged != null)) {
+                    this.BSDXResourceRowChanged(this, new BSDXResourceRowChangeEvent(((BSDXResourceRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowChanging(e);
+                if ((this.BSDXResourceRowChanging != null)) {
+                    this.BSDXResourceRowChanging(this, new BSDXResourceRowChangeEvent(((BSDXResourceRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleted(e);
+                if ((this.BSDXResourceRowDeleted != null)) {
+                    this.BSDXResourceRowDeleted(this, new BSDXResourceRowChangeEvent(((BSDXResourceRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) {
+                base.OnRowDeleting(e);
+                if ((this.BSDXResourceRowDeleting != null)) {
+                    this.BSDXResourceRowDeleting(this, new BSDXResourceRowChangeEvent(((BSDXResourceRow)(e.Row)), e.Action));
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void RemoveBSDXResourceRow(BSDXResourceRow row) {
+                this.Rows.Remove(row);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
+                global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
+                global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
+                dsRebookAppts ds = new dsRebookAppts();
+                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
+                any1.Namespace = "http://www.w3.org/2001/XMLSchema";
+                any1.MinOccurs = new decimal(0);
+                any1.MaxOccurs = decimal.MaxValue;
+                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any1);
+                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
+                any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
+                any2.MinOccurs = new decimal(1);
+                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
+                sequence.Items.Add(any2);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute1.Name = "namespace";
+                attribute1.FixedValue = ds.Namespace;
+                type.Attributes.Add(attribute1);
+                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
+                attribute2.Name = "tableTypeName";
+                attribute2.FixedValue = "BSDXResourceDataTable";
+                type.Attributes.Add(attribute2);
+                type.Particle = sequence;
+                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
+                if (xs.Contains(dsSchema.TargetNamespace)) {
+                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
+                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
+                    try {
+                        global::System.Xml.Schema.XmlSchema schema = null;
+                        dsSchema.Write(s1);
+                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
+                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
+                            s2.SetLength(0);
+                            schema.Write(s2);
+                            if ((s1.Length == s2.Length)) {
+                                s1.Position = 0;
+                                s2.Position = 0;
+                                for (; ((s1.Position != s1.Length) 
+                                            && (s1.ReadByte() == s2.ReadByte())); ) {
+                                    ;
+                                }
+                                if ((s1.Position == s1.Length)) {
+                                    return type;
+                                }
+                            }
+                        }
+                    }
+                    finally {
+                        if ((s1 != null)) {
+                            s1.Close();
+                        }
+                        if ((s2 != null)) {
+                            s2.Close();
+                        }
+                    }
+                }
+                xs.Add(dsSchema);
+                return type;
+            }
+        }
+        
+        /// <summary>
+        ///Represents strongly named DataRow class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public partial class PatientApptsRow : global::System.Data.DataRow {
+            
+            private PatientApptsDataTable tablePatientAppts;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal PatientApptsRow(global::System.Data.DataRowBuilder rb) : 
+                    base(rb) {
+                this.tablePatientAppts = ((PatientApptsDataTable)(this.Table));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Name {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.NameColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Name\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.NameColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.DateTime DOB {
+                get {
+                    try {
+                        return ((global::System.DateTime)(this[this.tablePatientAppts.DOBColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'DOB\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.DOBColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Sex {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.SexColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Sex\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.SexColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string HRN {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.HRNColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'HRN\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.HRNColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.DateTime NewApptDate {
+                get {
+                    try {
+                        return ((global::System.DateTime)(this[this.tablePatientAppts.NewApptDateColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'NewApptDate\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.NewApptDateColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string Clinic {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.ClinicColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'Clinic\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.ClinicColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string TypeStatus {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.TypeStatusColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'TypeStatus\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.TypeStatusColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public int RESOURCEID {
+                get {
+                    try {
+                        return ((int)(this[this.tablePatientAppts.RESOURCEIDColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'RESOURCEID\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.RESOURCEIDColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string APPT_MADE_BY {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.APPT_MADE_BYColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'APPT_MADE_BY\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.APPT_MADE_BYColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.DateTime DATE_APPT_MADE {
+                get {
+                    try {
+                        return ((global::System.DateTime)(this[this.tablePatientAppts.DATE_APPT_MADEColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'DATE_APPT_MADE\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.DATE_APPT_MADEColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string NOTE {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.NOTEColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'NOTE\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.NOTEColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string STREET {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.STREETColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'STREET\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.STREETColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string CITY {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.CITYColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'CITY\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.CITYColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string STATE {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.STATEColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'STATE\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.STATEColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string ZIP {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.ZIPColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'ZIP\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.ZIPColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string HOMEPHONE {
+                get {
+                    try {
+                        return ((string)(this[this.tablePatientAppts.HOMEPHONEColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'HOMEPHONE\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.HOMEPHONEColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public System.DateTime OldApptDate {
+                get {
+                    try {
+                        return ((global::System.DateTime)(this[this.tablePatientAppts.OldApptDateColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'OldApptDate\' in table \'PatientAppts\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tablePatientAppts.OldApptDateColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRow BSDXResourceRow {
+                get {
+                    return ((BSDXResourceRow)(this.GetParentRow(this.Table.ParentRelations["FK_BSDXResource_PatientAppts"])));
+                }
+                set {
+                    this.SetParentRow(value, this.Table.ParentRelations["FK_BSDXResource_PatientAppts"]);
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsNameNull() {
+                return this.IsNull(this.tablePatientAppts.NameColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetNameNull() {
+                this[this.tablePatientAppts.NameColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsDOBNull() {
+                return this.IsNull(this.tablePatientAppts.DOBColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetDOBNull() {
+                this[this.tablePatientAppts.DOBColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsSexNull() {
+                return this.IsNull(this.tablePatientAppts.SexColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetSexNull() {
+                this[this.tablePatientAppts.SexColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsHRNNull() {
+                return this.IsNull(this.tablePatientAppts.HRNColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetHRNNull() {
+                this[this.tablePatientAppts.HRNColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsNewApptDateNull() {
+                return this.IsNull(this.tablePatientAppts.NewApptDateColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetNewApptDateNull() {
+                this[this.tablePatientAppts.NewApptDateColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsClinicNull() {
+                return this.IsNull(this.tablePatientAppts.ClinicColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetClinicNull() {
+                this[this.tablePatientAppts.ClinicColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsTypeStatusNull() {
+                return this.IsNull(this.tablePatientAppts.TypeStatusColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetTypeStatusNull() {
+                this[this.tablePatientAppts.TypeStatusColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsRESOURCEIDNull() {
+                return this.IsNull(this.tablePatientAppts.RESOURCEIDColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetRESOURCEIDNull() {
+                this[this.tablePatientAppts.RESOURCEIDColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsAPPT_MADE_BYNull() {
+                return this.IsNull(this.tablePatientAppts.APPT_MADE_BYColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetAPPT_MADE_BYNull() {
+                this[this.tablePatientAppts.APPT_MADE_BYColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsDATE_APPT_MADENull() {
+                return this.IsNull(this.tablePatientAppts.DATE_APPT_MADEColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetDATE_APPT_MADENull() {
+                this[this.tablePatientAppts.DATE_APPT_MADEColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsNOTENull() {
+                return this.IsNull(this.tablePatientAppts.NOTEColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetNOTENull() {
+                this[this.tablePatientAppts.NOTEColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsSTREETNull() {
+                return this.IsNull(this.tablePatientAppts.STREETColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetSTREETNull() {
+                this[this.tablePatientAppts.STREETColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsCITYNull() {
+                return this.IsNull(this.tablePatientAppts.CITYColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetCITYNull() {
+                this[this.tablePatientAppts.CITYColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsSTATENull() {
+                return this.IsNull(this.tablePatientAppts.STATEColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetSTATENull() {
+                this[this.tablePatientAppts.STATEColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsZIPNull() {
+                return this.IsNull(this.tablePatientAppts.ZIPColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetZIPNull() {
+                this[this.tablePatientAppts.ZIPColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsHOMEPHONENull() {
+                return this.IsNull(this.tablePatientAppts.HOMEPHONEColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetHOMEPHONENull() {
+                this[this.tablePatientAppts.HOMEPHONEColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsOldApptDateNull() {
+                return this.IsNull(this.tablePatientAppts.OldApptDateColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetOldApptDateNull() {
+                this[this.tablePatientAppts.OldApptDateColumn] = global::System.Convert.DBNull;
+            }
+        }
+        
+        /// <summary>
+        ///Represents strongly named DataRow class.
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public partial class BSDXResourceRow : global::System.Data.DataRow {
+            
+            private BSDXResourceDataTable tableBSDXResource;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            internal BSDXResourceRow(global::System.Data.DataRowBuilder rb) : 
+                    base(rb) {
+                this.tableBSDXResource = ((BSDXResourceDataTable)(this.Table));
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public int RESOURCEID {
+                get {
+                    return ((int)(this[this.tableBSDXResource.RESOURCEIDColumn]));
+                }
+                set {
+                    this[this.tableBSDXResource.RESOURCEIDColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string RESOURCE_NAME {
+                get {
+                    try {
+                        return ((string)(this[this.tableBSDXResource.RESOURCE_NAMEColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'RESOURCE_NAME\' in table \'BSDXResource\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tableBSDXResource.RESOURCE_NAMEColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string LETTER_TEXT {
+                get {
+                    try {
+                        return ((string)(this[this.tableBSDXResource.LETTER_TEXTColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'LETTER_TEXT\' in table \'BSDXResource\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tableBSDXResource.LETTER_TEXTColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string NO_SHOW_LETTER {
+                get {
+                    try {
+                        return ((string)(this[this.tableBSDXResource.NO_SHOW_LETTERColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'NO_SHOW_LETTER\' in table \'BSDXResource\' is DBNull.", e);
+                    }
+                }
+                set {
+                    this[this.tableBSDXResource.NO_SHOW_LETTERColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public string CLINIC_CANCELLATION_LETTER {
+                get {
+                    try {
+                        return ((string)(this[this.tableBSDXResource.CLINIC_CANCELLATION_LETTERColumn]));
+                    }
+                    catch (global::System.InvalidCastException e) {
+                        throw new global::System.Data.StrongTypingException("The value for column \'CLINIC_CANCELLATION_LETTER\' in table \'BSDXResource\' is DBNu" +
+                                "ll.", e);
+                    }
+                }
+                set {
+                    this[this.tableBSDXResource.CLINIC_CANCELLATION_LETTERColumn] = value;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsRESOURCE_NAMENull() {
+                return this.IsNull(this.tableBSDXResource.RESOURCE_NAMEColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetRESOURCE_NAMENull() {
+                this[this.tableBSDXResource.RESOURCE_NAMEColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsLETTER_TEXTNull() {
+                return this.IsNull(this.tableBSDXResource.LETTER_TEXTColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetLETTER_TEXTNull() {
+                this[this.tableBSDXResource.LETTER_TEXTColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsNO_SHOW_LETTERNull() {
+                return this.IsNull(this.tableBSDXResource.NO_SHOW_LETTERColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetNO_SHOW_LETTERNull() {
+                this[this.tableBSDXResource.NO_SHOW_LETTERColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public bool IsCLINIC_CANCELLATION_LETTERNull() {
+                return this.IsNull(this.tableBSDXResource.CLINIC_CANCELLATION_LETTERColumn);
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public void SetCLINIC_CANCELLATION_LETTERNull() {
+                this[this.tableBSDXResource.CLINIC_CANCELLATION_LETTERColumn] = global::System.Convert.DBNull;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRow[] GetPatientApptsRows() {
+                if ((this.Table.ChildRelations["FK_BSDXResource_PatientAppts"] == null)) {
+                    return new PatientApptsRow[0];
+                }
+                else {
+                    return ((PatientApptsRow[])(base.GetChildRows(this.Table.ChildRelations["FK_BSDXResource_PatientAppts"])));
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Row event argument class
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public class PatientApptsRowChangeEvent : global::System.EventArgs {
+            
+            private PatientApptsRow eventRow;
+            
+            private global::System.Data.DataRowAction eventAction;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRowChangeEvent(PatientApptsRow row, global::System.Data.DataRowAction action) {
+                this.eventRow = row;
+                this.eventAction = action;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public PatientApptsRow Row {
+                get {
+                    return this.eventRow;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataRowAction Action {
+                get {
+                    return this.eventAction;
+                }
+            }
+        }
+        
+        /// <summary>
+        ///Row event argument class
+        ///</summary>
+        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
+        public class BSDXResourceRowChangeEvent : global::System.EventArgs {
+            
+            private BSDXResourceRow eventRow;
+            
+            private global::System.Data.DataRowAction eventAction;
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRowChangeEvent(BSDXResourceRow row, global::System.Data.DataRowAction action) {
+                this.eventRow = row;
+                this.eventAction = action;
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public BSDXResourceRow Row {
+                get {
+                    return this.eventRow;
+                }
+            }
+            
+            [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+            public global::System.Data.DataRowAction Action {
+                get {
+                    return this.eventAction;
+                }
+            }
+        }
+    }
+}
+
+#pragma warning restore 1591
Index: Scheduling/branches/GUI1.2/dsRebookAppts.cs
===================================================================
--- Scheduling/branches/GUI1.2/dsRebookAppts.cs	(revision 855)
+++ Scheduling/branches/GUI1.2/dsRebookAppts.cs	(revision 855)
@@ -0,0 +1,9 @@
+﻿namespace IndianHealthService.ClinicalScheduling {
+    
+    
+    public partial class dsRebookAppts {
+        partial class BSDXResourceDataTable
+        {
+        }
+    }
+}
Index: Scheduling/branches/GUI1.2/dsRebookAppts.xsd
===================================================================
--- Scheduling/branches/GUI1.2/dsRebookAppts.xsd	(revision 855)
+++ Scheduling/branches/GUI1.2/dsRebookAppts.xsd	(revision 855)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema id="dsRebookAppts" targetNamespace="http://tempuri.org/dsRebookAppts.xsd" xmlns:mstns="http://tempuri.org/dsRebookAppts.xsd" xmlns="http://tempuri.org/dsRebookAppts.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
+  <xs:annotation>
+    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
+      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
+        <Connections />
+        <Tables />
+        <Sources />
+      </DataSource>
+    </xs:appinfo>
+  </xs:annotation>
+  <xs:element name="dsRebookAppts" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="dsRebookAppts" msprop:Generator_DataSetName="dsRebookAppts">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element name="PatientAppts" msprop:Generator_UserTableName="PatientAppts" msprop:Generator_RowDeletedName="PatientApptsRowDeleted" msprop:Generator_TableClassName="PatientApptsDataTable" msprop:Generator_RowChangedName="PatientApptsRowChanged" msprop:Generator_RowClassName="PatientApptsRow" msprop:Generator_RowChangingName="PatientApptsRowChanging" msprop:Generator_RowEvArgName="PatientApptsRowChangeEvent" msprop:Generator_RowEvHandlerName="PatientApptsRowChangeEventHandler" msprop:Generator_TablePropName="PatientAppts" msprop:Generator_TableVarName="tablePatientAppts" msprop:Generator_RowDeletingName="PatientApptsRowDeleting">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="DOB" msprop:Generator_UserColumnName="DOB" msprop:Generator_ColumnPropNameInRow="DOB" msprop:Generator_ColumnVarNameInTable="columnDOB" msprop:Generator_ColumnPropNameInTable="DOBColumn" type="xs:date" minOccurs="0" />
+              <xs:element name="Sex" msprop:Generator_UserColumnName="Sex" msprop:Generator_ColumnPropNameInRow="Sex" msprop:Generator_ColumnVarNameInTable="columnSex" msprop:Generator_ColumnPropNameInTable="SexColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="HRN" msprop:Generator_UserColumnName="HRN" msprop:Generator_ColumnPropNameInRow="HRN" msprop:Generator_ColumnVarNameInTable="columnHRN" msprop:Generator_ColumnPropNameInTable="HRNColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="NewApptDate" msprop:Generator_UserColumnName="NewApptDate" msprop:Generator_ColumnPropNameInRow="NewApptDate" msprop:Generator_ColumnVarNameInTable="columnNewApptDate" msprop:Generator_ColumnPropNameInTable="NewApptDateColumn" type="xs:date" minOccurs="0" />
+              <xs:element name="Clinic" msprop:Generator_UserColumnName="Clinic" msprop:Generator_ColumnPropNameInRow="Clinic" msprop:Generator_ColumnVarNameInTable="columnClinic" msprop:Generator_ColumnPropNameInTable="ClinicColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="TypeStatus" msprop:Generator_UserColumnName="TypeStatus" msprop:Generator_ColumnPropNameInRow="TypeStatus" msprop:Generator_ColumnVarNameInTable="columnTypeStatus" msprop:Generator_ColumnPropNameInTable="TypeStatusColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="RESOURCEID" msprop:Generator_UserColumnName="RESOURCEID" msprop:Generator_ColumnPropNameInRow="RESOURCEID" msprop:Generator_ColumnVarNameInTable="columnRESOURCEID" msprop:Generator_ColumnPropNameInTable="RESOURCEIDColumn" type="xs:int" minOccurs="0" />
+              <xs:element name="APPT_MADE_BY" msprop:Generator_UserColumnName="APPT_MADE_BY" msprop:Generator_ColumnPropNameInRow="APPT_MADE_BY" msprop:Generator_ColumnVarNameInTable="columnAPPT_MADE_BY" msprop:Generator_ColumnPropNameInTable="APPT_MADE_BYColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="DATE_APPT_MADE" msprop:Generator_UserColumnName="DATE_APPT_MADE" msprop:Generator_ColumnPropNameInRow="DATE_APPT_MADE" msprop:Generator_ColumnVarNameInTable="columnDATE_APPT_MADE" msprop:Generator_ColumnPropNameInTable="DATE_APPT_MADEColumn" type="xs:date" minOccurs="0" />
+              <xs:element name="NOTE" msprop:Generator_UserColumnName="NOTE" msprop:Generator_ColumnPropNameInRow="NOTE" msprop:Generator_ColumnVarNameInTable="columnNOTE" msprop:Generator_ColumnPropNameInTable="NOTEColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="STREET" msprop:Generator_UserColumnName="STREET" msprop:Generator_ColumnPropNameInRow="STREET" msprop:Generator_ColumnVarNameInTable="columnSTREET" msprop:Generator_ColumnPropNameInTable="STREETColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="CITY" msprop:Generator_UserColumnName="CITY" msprop:Generator_ColumnPropNameInRow="CITY" msprop:Generator_ColumnVarNameInTable="columnCITY" msprop:Generator_ColumnPropNameInTable="CITYColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="STATE" msprop:Generator_UserColumnName="STATE" msprop:Generator_ColumnPropNameInRow="STATE" msprop:Generator_ColumnVarNameInTable="columnSTATE" msprop:Generator_ColumnPropNameInTable="STATEColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="ZIP" msprop:Generator_UserColumnName="ZIP" msprop:Generator_ColumnPropNameInRow="ZIP" msprop:Generator_ColumnVarNameInTable="columnZIP" msprop:Generator_ColumnPropNameInTable="ZIPColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="HOMEPHONE" msprop:Generator_UserColumnName="HOMEPHONE" msprop:Generator_ColumnPropNameInRow="HOMEPHONE" msprop:Generator_ColumnVarNameInTable="columnHOMEPHONE" msprop:Generator_ColumnPropNameInTable="HOMEPHONEColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="OldApptDate" msprop:Generator_UserColumnName="OldApptDate" msprop:Generator_ColumnPropNameInRow="OldApptDate" msprop:Generator_ColumnVarNameInTable="columnOldApptDate" msprop:Generator_ColumnPropNameInTable="OldApptDateColumn" type="xs:date" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="BSDXResource" msprop:Generator_UserTableName="BSDXResource" msprop:Generator_RowDeletedName="BSDXResourceRowDeleted" msprop:Generator_TableClassName="BSDXResourceDataTable" msprop:Generator_RowChangedName="BSDXResourceRowChanged" msprop:Generator_RowClassName="BSDXResourceRow" msprop:Generator_RowChangingName="BSDXResourceRowChanging" msprop:Generator_RowEvArgName="BSDXResourceRowChangeEvent" msprop:Generator_RowEvHandlerName="BSDXResourceRowChangeEventHandler" msprop:Generator_TablePropName="BSDXResource" msprop:Generator_TableVarName="tableBSDXResource" msprop:Generator_RowDeletingName="BSDXResourceRowDeleting">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element name="RESOURCEID" msprop:Generator_UserColumnName="RESOURCEID" msprop:Generator_ColumnPropNameInRow="RESOURCEID" msprop:Generator_ColumnVarNameInTable="columnRESOURCEID" msprop:Generator_ColumnPropNameInTable="RESOURCEIDColumn" type="xs:int" />
+              <xs:element name="RESOURCE_NAME" msprop:Generator_UserColumnName="RESOURCE_NAME" msprop:Generator_ColumnPropNameInRow="RESOURCE_NAME" msprop:Generator_ColumnVarNameInTable="columnRESOURCE_NAME" msprop:Generator_ColumnPropNameInTable="RESOURCE_NAMEColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="LETTER_TEXT" msprop:Generator_UserColumnName="LETTER_TEXT" msprop:Generator_ColumnPropNameInRow="LETTER_TEXT" msprop:Generator_ColumnVarNameInTable="columnLETTER_TEXT" msprop:Generator_ColumnPropNameInTable="LETTER_TEXTColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="NO_SHOW_LETTER" msprop:Generator_UserColumnName="NO_SHOW_LETTER" msprop:Generator_ColumnPropNameInRow="NO_SHOW_LETTER" msprop:Generator_ColumnVarNameInTable="columnNO_SHOW_LETTER" msprop:Generator_ColumnPropNameInTable="NO_SHOW_LETTERColumn" type="xs:string" minOccurs="0" />
+              <xs:element name="CLINIC_CANCELLATION_LETTER" msprop:Generator_UserColumnName="CLINIC_CANCELLATION_LETTER" msprop:Generator_ColumnPropNameInRow="CLINIC_CANCELLATION_LETTER" msprop:Generator_ColumnVarNameInTable="columnCLINIC_CANCELLATION_LETTER" msprop:Generator_ColumnPropNameInTable="CLINIC_CANCELLATION_LETTERColumn" type="xs:string" minOccurs="0" />
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:choice>
+    </xs:complexType>
+    <xs:unique name="kBSDXResourceID">
+      <xs:selector xpath=".//mstns:BSDXResource" />
+      <xs:field xpath="mstns:RESOURCEID" />
+    </xs:unique>
+    <xs:keyref name="FK_BSDXResource_PatientAppts" refer="kBSDXResourceID" msprop:rel_Generator_UserRelationName="FK_BSDXResource_PatientAppts" msprop:rel_Generator_RelationVarName="relationFK_BSDXResource_PatientAppts" msprop:rel_Generator_UserChildTable="PatientAppts" msprop:rel_Generator_UserParentTable="BSDXResource" msprop:rel_Generator_ParentPropName="BSDXResourceRow" msprop:rel_Generator_ChildPropName="GetPatientApptsRows">
+      <xs:selector xpath=".//mstns:PatientAppts" />
+      <xs:field xpath="mstns:RESOURCEID" />
+    </xs:keyref>
+  </xs:element>
+</xs:schema>
Index: Scheduling/branches/GUI1.2/dsRebookAppts.xsx
===================================================================
--- Scheduling/branches/GUI1.2/dsRebookAppts.xsx	(revision 855)
+++ Scheduling/branches/GUI1.2/dsRebookAppts.xsx	(revision 855)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.-->
+<XSDDesignerLayout layoutVersion="2" viewPortLeft="0" viewPortTop="0" zoom="100">
+    <PatientAppts_XmlElement left="450" top="424" width="5821" height="9313" selected="0" zOrder="1" index="0" expanded="1" />
+    <BSDXResource_XmlElement left="9155" top="1561" width="5291" height="3810" selected="0" zOrder="2" index="1" expanded="1" />
+    <BSDXResourcePatientAppts_XmlKeyref left="6786" top="4766" width="503" height="503" selected="0" zOrder="4" />
+</XSDDesignerLayout>
Index: Scheduling/branches/GUI1.2/mssccprj.scc
===================================================================
--- Scheduling/branches/GUI1.2/mssccprj.scc	(revision 855)
+++ Scheduling/branches/GUI1.2/mssccprj.scc	(revision 855)
@@ -0,0 +1,5 @@
+SCC = This is a Source Code Control file
+
+[ClinicalScheduling.csproj]
+SCC_Aux_Path="\\Npatucdev\VSS_IHSClinicalScheduling"
+SCC_Project_Name="$/IHSClinicalScheduling.root/IHSClinicalScheduling/Documents and Settings/Horace/My Documents/Visual Studio 2005/Projects/ClinicalScheduling20/ClinicalScheduling", WFAAAAAA
