Changeset 1124 for Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
- Timestamp:
- Mar 30, 2011, 4:19:15 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/CGDocument.cs
r1123 r1124 337 337 try 338 338 { 339 //Create new Document340 339 this.SelectedDate = dDate.Date; 341 340 … … 361 360 //If this document already has a view, the use it 362 361 //SAM: Why do this again??? 362 //SAM: I think it's not needed; b/c 363 363 Hashtable h = CGDocumentManager.Current.Views; 364 364 CGDocument d; … … 952 952 public int CreateAppointment(CGAppointment rApptInfo, bool bWalkin) 953 953 { 954 string sStart; 955 string sEnd; 956 string sPatID; 957 string sResource; 958 string sNote; 959 string sLen; 954 // i18n code -- Use culture neutral FMDates 955 string sStart = FMDateTime.Create(rApptInfo.StartTime).FMDateString; 956 string sEnd = FMDateTime.Create(rApptInfo.EndTime).FMDateString; 957 958 TimeSpan sp = rApptInfo.EndTime - rApptInfo.StartTime; 959 string sLen = sp.TotalMinutes.ToString(); 960 string sPatID = rApptInfo.PatientID.ToString(); 961 string sNote = rApptInfo.Note; 962 string sResource = rApptInfo.Resource; 963 960 964 string sApptID; 961 965 962 //sStart = rApptInfo.StartTime.ToString("M-d-yyyy@HH:mm");963 //sEnd = rApptInfo.EndTime.ToString("M-d-yyyy@HH:mm");964 965 // i18n code -- Use culture neutral FMDates966 sStart = FMDateTime.Create(rApptInfo.StartTime).FMDateString;967 sEnd = FMDateTime.Create(rApptInfo.EndTime).FMDateString;968 969 TimeSpan sp = rApptInfo.EndTime - rApptInfo.StartTime;970 sLen = sp.TotalMinutes.ToString();971 sPatID = rApptInfo.PatientID.ToString();972 sNote = rApptInfo.Note;973 sResource = rApptInfo.Resource;974 966 if (bWalkin == true) 975 967 { … … 980 972 sApptID = rApptInfo.AccessTypeID.ToString(); 981 973 } 982 983 CGAppointment aCopy = new CGAppointment();984 aCopy.CreateAppointment(rApptInfo.StartTime, rApptInfo.EndTime, sNote, 0, sResource);985 aCopy.PatientID = rApptInfo.PatientID;986 aCopy.PatientName = rApptInfo.PatientName;987 aCopy.HealthRecordNumber = rApptInfo.HealthRecordNumber;988 aCopy.AccessTypeID = rApptInfo.AccessTypeID;989 aCopy.WalkIn = bWalkin ? true : false;990 974 991 975 string sSql = "BSDX ADD NEW APPOINTMENT^" + sStart + "^" + sEnd + "^" + sPatID + "^" + sResource + "^" + sLen + "^" + sNote + "^" + sApptID; 992 976 System.Data.DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "NewAppointment"); 993 int nApptID;994 977 995 978 Debug.Assert(dtAppt.Rows.Count == 1); 996 979 DataRow r = dtAppt.Rows[0]; 997 nApptID = Convert.ToInt32(r["APPOINTMENTID"]);980 int nApptID = Convert.ToInt32(r["APPOINTMENTID"]); 998 981 string sErrorID; 999 982 sErrorID = r["ERRORID"].ToString(); … … 1002 985 throw new Exception(sErrorID); 1003 986 } 1004 aCopy.AppointmentKey = nApptID; 1005 this.m_appointments.AddAppointment(aCopy); 1006 1007 //TODO: Improve 1008 //Yucky hack for now... haven't investigated why we need to create a new CGAppointment beyond 1009 //the one that we pass. 987 988 //next line is probably done elsewhere 989 rApptInfo.WalkIn = bWalkin ? true : false; 1010 990 rApptInfo.AppointmentKey = nApptID; 991 992 this.m_appointments.AddAppointment(rApptInfo); 1011 993 1012 994 //Have make appointment from CGView responsible for requesting an update for the avialability.
Note:
See TracChangeset
for help on using the changeset viewer.