Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs	(revision 1083)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs	(revision 1084)
@@ -799,5 +799,7 @@
             sErrorID = r["ERRORID"].ToString();
             if ((sErrorID != "") || (nApptID < 1))
+            {
                 throw new Exception(sErrorID);
+            }
             aCopy.AppointmentKey = nApptID;
             this.m_appointments.AddAppointment(aCopy);
@@ -885,6 +887,8 @@
             {
                 this.m_appointments.RemoveAppointment(nApptID);
-                bool bRet = RefreshAvailabilitySchedule();
-                UpdateAllViews();
+                
+                // View responsible for deciding to redraw the grid; not the document now.
+                //bool bRet = RefreshAvailabilitySchedule();
+                //UpdateAllViews();
             }
             return "";
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs	(revision 1083)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/CGView.cs	(revision 1084)
@@ -617,5 +617,5 @@
             this.tvSchedules.Location = new System.Drawing.Point(0, 0);
             this.tvSchedules.Name = "tvSchedules";
-            this.tvSchedules.Size = new System.Drawing.Size(128, 290);
+            this.tvSchedules.Size = new System.Drawing.Size(128, 400);
             this.tvSchedules.Sorted = true;
             this.tvSchedules.TabIndex = 1;
@@ -664,5 +664,5 @@
             this.panelRight.Location = new System.Drawing.Point(941, 0);
             this.panelRight.Name = "panelRight";
-            this.panelRight.Size = new System.Drawing.Size(128, 290);
+            this.panelRight.Size = new System.Drawing.Size(128, 400);
             this.panelRight.TabIndex = 3;
             this.panelRight.Visible = false;
@@ -754,5 +754,4 @@
             this.lblResource.Size = new System.Drawing.Size(456, 19);
             this.lblResource.TabIndex = 2;
-            this.lblResource.Text = "lblResource";
             // 
             // panelCenter
@@ -762,5 +761,5 @@
             this.panelCenter.Location = new System.Drawing.Point(136, 24);
             this.panelCenter.Name = "panelCenter";
-            this.panelCenter.Size = new System.Drawing.Size(802, 242);
+            this.panelCenter.Size = new System.Drawing.Size(802, 352);
             this.panelCenter.TabIndex = 7;
             // 
@@ -848,5 +847,5 @@
             this.panelBottom.Controls.Add(this.statusBar1);
             this.panelBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.panelBottom.Location = new System.Drawing.Point(136, 266);
+            this.panelBottom.Location = new System.Drawing.Point(136, 376);
             this.panelBottom.Name = "panelBottom";
             this.panelBottom.Size = new System.Drawing.Size(802, 24);
@@ -866,5 +865,5 @@
             this.splitter1.Location = new System.Drawing.Point(128, 24);
             this.splitter1.Name = "splitter1";
-            this.splitter1.Size = new System.Drawing.Size(8, 266);
+            this.splitter1.Size = new System.Drawing.Size(8, 376);
             this.splitter1.TabIndex = 9;
             this.splitter1.TabStop = false;
@@ -875,5 +874,5 @@
             this.splitter2.Location = new System.Drawing.Point(938, 24);
             this.splitter2.Name = "splitter2";
-            this.splitter2.Size = new System.Drawing.Size(3, 266);
+            this.splitter2.Size = new System.Drawing.Size(3, 376);
             this.splitter2.TabIndex = 10;
             this.splitter2.TabStop = false;
@@ -903,5 +902,5 @@
             this.calendarGrid1.Resources = ((System.Collections.ArrayList)(resources.GetObject("calendarGrid1.Resources")));
             this.calendarGrid1.SelectedAppointment = 0;
-            this.calendarGrid1.Size = new System.Drawing.Size(802, 242);
+            this.calendarGrid1.Size = new System.Drawing.Size(802, 352);
             this.calendarGrid1.StartDate = new System.DateTime(2003, 1, 27, 0, 0, 0, 0);
             this.calendarGrid1.TabIndex = 0;
@@ -916,5 +915,5 @@
             // 
             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
-            this.ClientSize = new System.Drawing.Size(1069, 290);
+            this.ClientSize = new System.Drawing.Size(1069, 400);
             this.Controls.Add(this.panelCenter);
             this.Controls.Add(this.panelBottom);
@@ -1838,5 +1837,5 @@
 		{
 			calendarGrid1.CGToolTip.Active = false;
-			CGAppointments	alRebookList = new CGAppointments();
+			CGAppointments alRebookList = new CGAppointments();
 
 			DCancelAppt dCancel = new DCancelAppt();
@@ -1902,5 +1901,10 @@
 				try
 				{
+                    this.UpdateArrays();
 					RaiseRPMSEvent("BSDX SCHEDULE" , m_Document.DocName);
+
+                    //Get the appointments and availabilities, async, from Server. Callback updates this thread's controls.
+                    OnUpdateScheduleDelegate ousd = new OnUpdateScheduleDelegate(OnUpdateSchedule);
+                    ousd.BeginInvoke(OnUpdateScheduleCallback, null);
 				}
 				catch (Exception ex)
@@ -2122,5 +2126,5 @@
 			try
 			{
-				CGAppointment appt = new CGAppointment();
+				
 			
 				//Get Time and Resource from Selected Cell
@@ -2196,4 +2200,5 @@
 				}
 
+                CGAppointment appt = new CGAppointment();
 				appt.PatientID = Convert.ToInt32(dPat.PatientIEN);
 				appt.PatientName = dPat.PatientName;
@@ -2324,4 +2329,7 @@
         private void OnUpdateScheduleCallback(IAsyncResult itfAR)
         {
+            // if the view meanwhile closed, just return
+            if (this == null) return;
+
             OnUpdateScheduleDelegate d = new OnUpdateScheduleDelegate(UpdateArrays);
             this.Invoke(d);
@@ -2710,4 +2718,9 @@
 		}
 
+        /// <summary>
+        /// Fired during drag and drop, on the drop action.
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
 		private void calendarGrid1_CGAppointmentChanged(object sender, IndianHealthService.ClinicalScheduling.CGAppointmentChangedArgs e)
 		{
@@ -2727,6 +2740,9 @@
                 }
 
+                //Can user edit destination resource?
 				if (EditAppointmentEnabled(e.Resource) == false)
 					return;
+                
+                //Can user edit original schedule?
 				if (EditAppointmentEnabled(e.Appointment.Resource) == false)
 					return;
@@ -2772,9 +2788,27 @@
 				}
 
-				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);
+                //Create a new appointment using old data for patient demographics and note and new data
+                //for StartTime, EndTime, Resource, AccessTypeID
+                CGAppointment appt = new CGAppointment();
+                appt.PatientID = e.Appointment.PatientID;
+                appt.PatientName = e.Appointment.PatientName;
+                appt.StartTime = e.StartTime;
+                appt.EndTime = e.EndTime;
+                appt.Resource = e.Resource;
+                appt.Note = e.Appointment.Note;
+                appt.HealthRecordNumber = e.Appointment.HealthRecordNumber;
+                appt.AccessTypeID = e.AccessTypeID;
+                this.Document.CreateAppointment(appt);
+
+                //CGAppointment a = new CGAppointment();
+                //a.StartTime = e.StartTime;
+                ////e.Appointment.StartTime = e.StartTime
+                //a.EndTime = e.EndTime;
+                ////e.Appointment.EndTime = e.EndTime;
+                //a.Resource = e.Resource;
+                ////e.Appointment.Resource = e.Resource;
+                //a.AccessTypeID = e.AccessTypeID;
+                ////e.Appointment.AccessTypeID = e.AccessTypeID;
+                //m_Document.CreateAppointment(a);
 			
 				
@@ -2790,10 +2824,10 @@
 			{
 				MessageBox.Show("Unable to change appointment  " +  ex.Message, "Clinical Scheduling");
-				this.m_DocManager.UpdateViews();
+				//this.m_DocManager.UpdateViews();
 				return;
 			}
 			finally
 			{
-
+                this.UpdateArrays();
             }
 			try
@@ -2802,5 +2836,7 @@
 				if (e.Resource != e.OldResource)
 					RaiseRPMSEvent("BSDX SCHEDULE", e.OldResource);
-				this.m_DocManager.UpdateViews(e.Resource, e.OldResource);
+				
+                //That will take too long. Don't do it. Try and see what happens when you come
+                //this.m_DocManager.UpdateViews(e.Resource, e.OldResource);
 			}
 			catch (Exception ex)
Index: Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.sln
===================================================================
--- Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.sln	(revision 1083)
+++ Scheduling/trunk/cs/bsdx0200GUISourceCode/ClinicalScheduling.sln	(revision 1084)
@@ -11,10 +11,10 @@
 	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 = Debug|Any CPU
-		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Release|Any CPU.Build.0 = Debug|Any CPU
-		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.ActiveCfg = Release|Any CPU
+		{8C05C4F7-FE81-479F-87A0-44E04C7F6E0F}.Debug|Any CPU.Build.0 = Release|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
+		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.ActiveCfg = Release|Any CPU
+		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Debug|Any CPU.Build.0 = Release|Any CPU
 		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{DE8E4CC9-4F3A-4E32-8DFE-EE5692E8FC45}.Release|Any CPU.Build.0 = Release|Any CPU
