Changeset 1095 for Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
- Timestamp:
- Feb 21, 2011, 9:21:24 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
r1084 r1095 173 173 /// <summary> 174 174 /// Update schedule based on info in RPMS 175 /// <returns>Clears and repopluates m_appointments</returns> 175 176 /// </summary> 176 177 private bool RefreshDaysSchedule() … … 200 201 m_dLastRefresh = DateTime.Now; 201 202 203 //Clear appointments associated with this document 202 204 this.m_appointments.ClearAllAppointments(); 203 205 … … 205 207 rAppointmentSchedule = CGSchedLib.CreateAppointmentSchedule(m_DocManager, m_sResourcesArray, this.m_dStartDate, this.m_dEndDate); 206 208 207 // Datatable dumper into Debug Log (nice to know that this exists) 208 CGSchedLib.OutputArray(rAppointmentSchedule, "rAppointmentSchedule"); 209 210 209 // loop through datatable: Create CGAppointment and add to CGAppointments 211 210 foreach (DataRow r in rAppointmentSchedule.Rows) 212 211 { … … 422 421 try 423 422 { 424 if (this.m_DocManager.ConnectInfo.Connected == false)425 {426 m_DocManager.ConnectInfo.LoadConnectInfo();427 }428 429 423 ArrayList saryApptTypes = new ArrayList(); 430 int nApptTypeID = 0; 431 424 432 425 //Refresh Availability schedules 433 426 DataTable rAvailabilitySchedule; 434 427 rAvailabilitySchedule = CGSchedLib.CreateAvailabilitySchedule(m_DocManager, m_sResourcesArray, this.m_dStartDate, this.m_dEndDate, saryApptTypes,/**/ m_ScheduleType, "0"); 435 CGSchedLib.OutputArray(rAvailabilitySchedule, "rAvailabilitySchedule"); 436 428 429 ////NEW 430 //NOTE: This lock makes sure that availabilities aren't queried for slots when the array is an intermediate 431 //state. The other place that has this lock is SlotsAvailable function. 432 lock (this.m_pAvArray) 433 { 434 m_pAvArray.Clear(); 435 foreach (DataRow rTemp in rAvailabilitySchedule.Rows) 436 { 437 DateTime dStart = (DateTime)rTemp["START_TIME"]; 438 DateTime dEnd = (DateTime)rTemp["END_TIME"]; 439 440 //TODO: Fix this slots datatype problem 441 string sSlots = rTemp["SLOTS"].ToString(); 442 int nSlots = Convert.ToInt16(sSlots); 443 444 string sResourceList = rTemp["RESOURCE"].ToString(); 445 string sAccessRuleList = rTemp["ACCESS_TYPE"].ToString(); 446 string sNote = rTemp["NOTE"].ToString(); 447 448 int nApptTypeID; 449 450 if ((nSlots < -1000) || (sAccessRuleList == "")) 451 { 452 nApptTypeID = 0; 453 } 454 else 455 { 456 nApptTypeID = Int32.Parse(rTemp["ACCESS_TYPE"].ToString()); 457 } 458 459 AddAvailability(dStart, dEnd, nApptTypeID, nSlots, sResourceList, sAccessRuleList, sNote); 460 } 461 } 462 return true; 463 464 /* NOT USED 437 465 //Refresh Type Schedule 438 466 string sResourceName = ""; … … 442 470 sResourceName = m_sResourcesArray[j].ToString(); 443 471 DataTable dtTemp = CGSchedLib.CreateAssignedTypeSchedule(m_DocManager, sResourceName, this.m_dStartDate, this.m_dEndDate, m_ScheduleType); 444 CGSchedLib.OutputArray(dtTemp, "dtTemp"); 472 445 473 if (j == 0) 446 474 { … … 452 480 } 453 481 } 454 CGSchedLib.OutputArray(rTypeSchedule, "rTypeSchedule");455 482 456 483 DateTime dStart; … … 523 550 524 551 525 AddAvailability(dStart, dEnd, nApptTypeID, nSlots, false, sResourceList, sAccessRuleList, sNote);552 //AddAvailability(dStart, dEnd, nApptTypeID, nSlots, sResourceList, sAccessRuleList, sNote); 526 553 }//end foreach datarow rTemp 527 554 }//end lock 528 555 return true; 556 */ 529 557 } 530 558 catch (Exception ex) … … 552 580 /// <param name="sNote"></param> 553 581 /// <returns></returns> 554 public int AddAvailability(DateTime StartTime, DateTime EndTime, int nType, int nSlots, bool UpdateView,string sResourceList, string sAccessRuleList, string sNote)582 public int AddAvailability(DateTime StartTime, DateTime EndTime, int nType, int nSlots, string sResourceList, string sAccessRuleList, string sNote) 555 583 { 556 584 //adds it to the object array … … 588 616 int nIndex = 0; 589 617 nIndex = m_pAvArray.Add(pNewAv); 590 if (UpdateView == true) 591 { 592 this.UpdateAllViews(); 593 } 618 594 619 return nIndex; 595 620 }
Note:
See TracChangeset
for help on using the changeset viewer.