- Timestamp:
- Jul 11, 2010, 10:09:11 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/cs/bsdx0200GUISourceCode/DPatientLetter.cs
r848 r850 8 8 { 9 9 /// <summary> 10 /// Summary description for DPatientLetter.10 /// Handles Printing of letters (Reminder, Rebook, Cancellation) and a Report. Contains a Print Preview dialog. 11 11 /// </summary> 12 12 public class DPatientLetter : System.Windows.Forms.PrintPreviewDialog … … 18 18 private System.Drawing.Printing.PrintDocument printAppts; 19 19 private System.Drawing.Printing.PrintDocument printReminderLetters; 20 private System.Drawing.Printing.PrintDocument printCancelLetters; 21 private System.Drawing.Printing.PrintDocument printRebookLetters; 20 22 21 23 #region Fields … … 28 30 int _pageNumber = 0; 29 31 30 // datasetto load the results of queries into and set to print routines32 //typed datasets to load the results of queries into and set to print routines 31 33 dsPatientApptDisplay2 _dsApptDisplay; 32 private PrintDocument printCancelLetters;33 private PrintDocument printRebookLetters;34 34 dsRebookAppts _dsRebookAppts; 35 35 36 #endregion Fields 37 38 #region Windows Form Designer generated code 39 /// <summary> 40 /// Required method for Designer support - do not modify 41 /// the contents of this method with the code editor. 42 /// </summary> 43 private void InitializeComponent() 44 { 45 this.printAppts = new System.Drawing.Printing.PrintDocument(); 46 this.printReminderLetters = new System.Drawing.Printing.PrintDocument(); 47 this.printCancelLetters = new System.Drawing.Printing.PrintDocument(); 48 this.printRebookLetters = new System.Drawing.Printing.PrintDocument(); 49 this.SuspendLayout(); 50 // 51 // printAppts 52 // 53 this.printAppts.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printAppts_PrintPage); 54 // 55 // printReminderLetters 56 // 57 this.printReminderLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printReminderLetters_PrintPage); 58 // 59 // printCancelLetters 60 // 61 this.printCancelLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printCancelLetters_PrintPage); 62 // 63 // printRebookLetters 64 // 65 this.printRebookLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printRebookLetters_PrintPage); 66 // 67 // DPatientLetter 68 // 69 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); 70 this.ClientSize = new System.Drawing.Size(648, 398); 71 this.Name = "DPatientLetter"; 72 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 73 this.Text = "Patient Letter"; 74 this.ResumeLayout(false); 75 76 } 77 #endregion 78 36 79 37 80 /// <summary> … … 83 126 /// <param name="dtBegin">Beginning Date</param> 84 127 /// <param name="dtEnd">End Date</param> 85 /// working on moving this over...86 128 public void InitializeFormRebookLetters(CGDocumentManager docManager, 87 129 string sClinicList, … … 96 138 } 97 139 98 string sBegin = dtBegin.ToString("M/d/yyyy@HH:mm");99 string sEnd = dtEnd.ToString("M/d/yyyy@HH:mm");100 101 140 //Call RPC to get list of appt ids that have been rebooked for these clinics on these dates 102 string sSql1 = "BSDX REBOOK CLINIC LIST^" + sClinicList + "^" + sBegin + "^" + sEnd;103 string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;141 DataTable PatientAppts = docManager.DAL.GetRebookedAppointments(sClinicList, dtBegin, dtEnd); 142 DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList); 104 143 105 144 _dsRebookAppts = new dsRebookAppts(); 106 _dsRebookAppts.PatientAppts.Merge( docManager.RPMSDataTable(sSql1, "PatientAppts"));107 _dsRebookAppts.BSDXResource.Merge( docManager.RPMSDataTable(sSql2, "Resources"));145 _dsRebookAppts.PatientAppts.Merge(PatientAppts); 146 _dsRebookAppts.BSDXResource.Merge(Resources); 108 147 109 148 } … … 134 173 } 135 174 136 string sSql1 = "BSDX REBOOK LIST^" + sApptIDList;137 string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList;175 DataTable PatientAppts = docManager.DAL.GetRebookedAppointments(sApptIDList); 176 DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList); 138 177 139 178 _dsRebookAppts = new dsRebookAppts(); 140 _dsRebookAppts.PatientAppts.Merge(docManager.RPMSDataTable(sSql1, "PatientAppts")); 141 _dsRebookAppts.BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources")); 142 143 179 _dsRebookAppts.PatientAppts.Merge(PatientAppts); 180 _dsRebookAppts.BSDXResource.Merge(Resources); 144 181 } 145 182 catch (Exception ex) … … 169 206 throw new Exception("At least one clinic must be selected."); 170 207 } 171 172 string sBegin = dtBegin.ToString("M/d/yyyy@HH:mm"); 173 string sEnd = dtEnd.ToString("M/d/yyyy@HH:mm"); 174 175 //Call RPC to get list of appt ids that have been cancelled for these clinics on these dates 176 string sSql1 = "BSDX CANCEL CLINIC LIST^" + sClinicList + "^" + sBegin + "^" + sEnd; 177 string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList; 178 208 209 DataTable PatientAppts = docManager.DAL.GetCancelledAppointments(sClinicList, dtBegin, dtEnd); 210 DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList); 211 179 212 _dsRebookAppts = new dsRebookAppts(); 180 _dsRebookAppts.PatientAppts.Merge( docManager.RPMSDataTable(sSql1, "PatientAppts"));181 _dsRebookAppts.BSDXResource.Merge( docManager.RPMSDataTable(sSql2, "Resources"));182 213 _dsRebookAppts.PatientAppts.Merge(PatientAppts); 214 _dsRebookAppts.BSDXResource.Merge(Resources); 215 183 216 PrintPreviewControl.Document = printCancelLetters; 184 217 … … 208 241 } 209 242 243 // Global variables to use in printing routine down below 210 244 _dtBegin = dtBegin; 211 245 _dtEnd = dtEnd; 212 string sBegin = dtBegin.ToShortDateString(); 213 string sEnd = dtEnd.ToShortDateString(); 214 this.Text = "Clinic Schedules"; 215 216 string sSql = "BSDX CLINIC LETTERS^" + sClinicList + "^" + sBegin + "^" + sEnd; 217 string sSql2 = "BSDX RESOURCE LETTERS^" + sClinicList; 218 246 247 this.Text = "Reminder Letters"; 248 249 // Get Data 250 DataTable PatientAppts = docManager.DAL.GetClinicSchedules(sClinicList, dtBegin, dtEnd); 251 DataTable Resources = docManager.DAL.GetResourceLetters(sClinicList); 252 253 // Merge tables into typed dataset 219 254 _dsApptDisplay = new dsPatientApptDisplay2(); 220 _dsApptDisplay. BSDXResource.Merge(docManager.RPMSDataTable(sSql2, "Resources"));221 _dsApptDisplay. PatientAppts.Merge(docManager.RPMSDataTable(sSql, "PatientAppts"));255 _dsApptDisplay.PatientAppts.Merge(PatientAppts); 256 _dsApptDisplay.BSDXResource.Merge(Resources); 222 257 223 258 this.PrintPreviewControl.Document = printReminderLetters; … … 260 295 } 261 296 262 #region Windows Form Designer generated code263 /// <summary>264 /// Required method for Designer support - do not modify265 /// the contents of this method with the code editor.266 /// </summary>267 private void InitializeComponent()268 {269 this.printAppts = new System.Drawing.Printing.PrintDocument();270 this.printReminderLetters = new System.Drawing.Printing.PrintDocument();271 this.printCancelLetters = new System.Drawing.Printing.PrintDocument();272 this.printRebookLetters = new System.Drawing.Printing.PrintDocument();273 this.SuspendLayout();274 //275 // printAppts276 //277 this.printAppts.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printAppts_PrintPage);278 //279 // printReminderLetters280 //281 this.printReminderLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printReminderLetters_PrintPage);282 //283 // printCancelLetters284 //285 this.printCancelLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printCancelLetters_PrintPage);286 //287 // printRebookLetters288 //289 this.printRebookLetters.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.printRebookLetters_PrintPage);290 //291 // DPatientLetter292 //293 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);294 this.ClientSize = new System.Drawing.Size(648, 398);295 this.Name = "DPatientLetter";296 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;297 this.Text = "Patient Letter";298 this.ResumeLayout(false);299 300 }301 #endregion302 297 303 298 private void printAppts_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
Note:
See TracChangeset
for help on using the changeset viewer.