source: Scheduling/trunk/cs/bsdx0200GUISourceCode/DResource.cs@ 794

Last change on this file since 794 was 627, checked in by Sam Habiel, 15 years ago

Removed user-interface references to RPMS.

File size: 29.6 KB
Line 
1using System;
2using System.Drawing;
3using System.Collections;
4using System.ComponentModel;
5using System.Windows.Forms;
6using System.Data;
7//using System.Data.OleDb;
8using IndianHealthService.BMXNet;
9using System.Diagnostics;
10
11namespace IndianHealthService.ClinicalScheduling
12{
13 /// <summary>
14 /// Summary description for DResource.
15 /// </summary>
16 public class DResource : System.Windows.Forms.Form
17 {
18 private System.Windows.Forms.Button cmdCancel;
19 private System.Windows.Forms.Button cmdOK;
20 private System.Windows.Forms.Panel pnlDescription;
21 private System.Windows.Forms.GroupBox grpDescription;
22 private System.Windows.Forms.Label lblDescription;
23 private System.Windows.Forms.CheckBox chkInactivate;
24 private System.Windows.Forms.GroupBox grpRPMSClinicLink;
25 private System.Windows.Forms.Label lblReactivateDate;
26 private System.Windows.Forms.Label label10;
27 private System.Windows.Forms.Label lblInactivateDate;
28 private System.Windows.Forms.Label label8;
29 private System.Windows.Forms.Label lblClinicCode;
30 private System.Windows.Forms.Label label6;
31 private System.Windows.Forms.Label lblProvider;
32 private System.Windows.Forms.Label label7;
33 private System.Windows.Forms.Label lblVisitServiceCategory;
34 private System.Windows.Forms.Label label3;
35 private System.Windows.Forms.Label lblCreateVisit;
36 private System.Windows.Forms.Label label2;
37 private System.Windows.Forms.Label label4;
38 private System.Windows.Forms.ComboBox cboRPMSClinic;
39 private System.Windows.Forms.Label label1;
40 private System.Windows.Forms.TextBox txtResourceName;
41 private System.Windows.Forms.TabControl tabResources;
42 private System.Windows.Forms.TabPage tpRPMSLink;
43 private System.Windows.Forms.ComboBox cboTimeInterval;
44 private System.Windows.Forms.Label label5;
45 private System.Windows.Forms.TabPage tpLetter;
46 private System.Windows.Forms.TextBox txtLetter;
47 private System.Windows.Forms.Label label9;
48 private System.Windows.Forms.Label label11;
49 private System.Windows.Forms.Panel pnlOkCancel;
50 private System.Windows.Forms.TabPage tpRebookLetter;
51 private System.Windows.Forms.TabPage tpCancellationLetter;
52 private System.Windows.Forms.Label label12;
53 private System.Windows.Forms.Label label13;
54 private System.Windows.Forms.TextBox txtRebookLetter;
55 private System.Windows.Forms.TextBox txtCancellationLetter;
56 /// <summary>
57 /// Required designer variable.
58 /// </summary>
59 private System.ComponentModel.Container components = null;
60
61 public DResource()
62 {
63 InitializeComponent();
64 }
65
66 #region Windows Form Designer generated code
67 /// <summary>
68 /// Required method for Designer support - do not modify
69 /// the contents of this method with the code editor.
70 /// </summary>
71 private void InitializeComponent()
72 {
73 this.pnlOkCancel = new System.Windows.Forms.Panel();
74 this.cmdCancel = new System.Windows.Forms.Button();
75 this.cmdOK = new System.Windows.Forms.Button();
76 this.pnlDescription = new System.Windows.Forms.Panel();
77 this.grpDescription = new System.Windows.Forms.GroupBox();
78 this.lblDescription = new System.Windows.Forms.Label();
79 this.tabResources = new System.Windows.Forms.TabControl();
80 this.tpRPMSLink = new System.Windows.Forms.TabPage();
81 this.label11 = new System.Windows.Forms.Label();
82 this.label5 = new System.Windows.Forms.Label();
83 this.cboTimeInterval = new System.Windows.Forms.ComboBox();
84 this.chkInactivate = new System.Windows.Forms.CheckBox();
85 this.grpRPMSClinicLink = new System.Windows.Forms.GroupBox();
86 this.lblReactivateDate = new System.Windows.Forms.Label();
87 this.label10 = new System.Windows.Forms.Label();
88 this.lblInactivateDate = new System.Windows.Forms.Label();
89 this.label8 = new System.Windows.Forms.Label();
90 this.lblClinicCode = new System.Windows.Forms.Label();
91 this.label6 = new System.Windows.Forms.Label();
92 this.lblProvider = new System.Windows.Forms.Label();
93 this.label7 = new System.Windows.Forms.Label();
94 this.lblVisitServiceCategory = new System.Windows.Forms.Label();
95 this.label3 = new System.Windows.Forms.Label();
96 this.lblCreateVisit = new System.Windows.Forms.Label();
97 this.label2 = new System.Windows.Forms.Label();
98 this.label4 = new System.Windows.Forms.Label();
99 this.cboRPMSClinic = new System.Windows.Forms.ComboBox();
100 this.label1 = new System.Windows.Forms.Label();
101 this.txtResourceName = new System.Windows.Forms.TextBox();
102 this.tpLetter = new System.Windows.Forms.TabPage();
103 this.label9 = new System.Windows.Forms.Label();
104 this.txtLetter = new System.Windows.Forms.TextBox();
105 this.tpRebookLetter = new System.Windows.Forms.TabPage();
106 this.label12 = new System.Windows.Forms.Label();
107 this.txtRebookLetter = new System.Windows.Forms.TextBox();
108 this.tpCancellationLetter = new System.Windows.Forms.TabPage();
109 this.label13 = new System.Windows.Forms.Label();
110 this.txtCancellationLetter = new System.Windows.Forms.TextBox();
111 this.pnlOkCancel.SuspendLayout();
112 this.pnlDescription.SuspendLayout();
113 this.grpDescription.SuspendLayout();
114 this.tabResources.SuspendLayout();
115 this.tpRPMSLink.SuspendLayout();
116 this.grpRPMSClinicLink.SuspendLayout();
117 this.tpLetter.SuspendLayout();
118 this.tpRebookLetter.SuspendLayout();
119 this.tpCancellationLetter.SuspendLayout();
120 this.SuspendLayout();
121 //
122 // pnlOkCancel
123 //
124 this.pnlOkCancel.Controls.Add(this.cmdCancel);
125 this.pnlOkCancel.Controls.Add(this.cmdOK);
126 this.pnlOkCancel.Dock = System.Windows.Forms.DockStyle.Bottom;
127 this.pnlOkCancel.Location = new System.Drawing.Point(0, 424);
128 this.pnlOkCancel.Name = "pnlOkCancel";
129 this.pnlOkCancel.Size = new System.Drawing.Size(498, 40);
130 this.pnlOkCancel.TabIndex = 3;
131 //
132 // cmdCancel
133 //
134 this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
135 this.cmdCancel.Location = new System.Drawing.Point(416, 8);
136 this.cmdCancel.Name = "cmdCancel";
137 this.cmdCancel.Size = new System.Drawing.Size(64, 24);
138 this.cmdCancel.TabIndex = 25;
139 this.cmdCancel.Text = "Cancel";
140 //
141 // cmdOK
142 //
143 this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
144 this.cmdOK.Location = new System.Drawing.Point(336, 8);
145 this.cmdOK.Name = "cmdOK";
146 this.cmdOK.Size = new System.Drawing.Size(64, 24);
147 this.cmdOK.TabIndex = 20;
148 this.cmdOK.Text = "OK";
149 this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
150 //
151 // pnlDescription
152 //
153 this.pnlDescription.Controls.Add(this.grpDescription);
154 this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
155 this.pnlDescription.Location = new System.Drawing.Point(0, 344);
156 this.pnlDescription.Name = "pnlDescription";
157 this.pnlDescription.Size = new System.Drawing.Size(498, 80);
158 this.pnlDescription.TabIndex = 46;
159 //
160 // grpDescription
161 //
162 this.grpDescription.Controls.Add(this.lblDescription);
163 this.grpDescription.Dock = System.Windows.Forms.DockStyle.Fill;
164 this.grpDescription.Location = new System.Drawing.Point(0, 0);
165 this.grpDescription.Name = "grpDescription";
166 this.grpDescription.Size = new System.Drawing.Size(498, 80);
167 this.grpDescription.TabIndex = 0;
168 this.grpDescription.TabStop = false;
169 this.grpDescription.Text = "Description";
170 //
171 // lblDescription
172 //
173 this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
174 this.lblDescription.Location = new System.Drawing.Point(3, 16);
175 this.lblDescription.Name = "lblDescription";
176 this.lblDescription.Size = new System.Drawing.Size(492, 61);
177 this.lblDescription.TabIndex = 1;
178 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.";
179 //
180 // tabResources
181 //
182 this.tabResources.Controls.Add(this.tpRPMSLink);
183 this.tabResources.Controls.Add(this.tpLetter);
184 this.tabResources.Controls.Add(this.tpRebookLetter);
185 this.tabResources.Controls.Add(this.tpCancellationLetter);
186 this.tabResources.Dock = System.Windows.Forms.DockStyle.Fill;
187 this.tabResources.Location = new System.Drawing.Point(0, 0);
188 this.tabResources.Name = "tabResources";
189 this.tabResources.SelectedIndex = 0;
190 this.tabResources.Size = new System.Drawing.Size(498, 344);
191 this.tabResources.TabIndex = 10;
192 this.tabResources.SelectedIndexChanged += new System.EventHandler(this.tabResources_SelectedIndexChanged);
193 //
194 // tpRPMSLink
195 //
196 this.tpRPMSLink.Controls.Add(this.label11);
197 this.tpRPMSLink.Controls.Add(this.label5);
198 this.tpRPMSLink.Controls.Add(this.cboTimeInterval);
199 this.tpRPMSLink.Controls.Add(this.chkInactivate);
200 this.tpRPMSLink.Controls.Add(this.grpRPMSClinicLink);
201 this.tpRPMSLink.Controls.Add(this.label1);
202 this.tpRPMSLink.Controls.Add(this.txtResourceName);
203 this.tpRPMSLink.Location = new System.Drawing.Point(4, 22);
204 this.tpRPMSLink.Name = "tpRPMSLink";
205 this.tpRPMSLink.Size = new System.Drawing.Size(490, 318);
206 this.tpRPMSLink.TabIndex = 0;
207 this.tpRPMSLink.Text = "Resource Link";
208 //
209 // label11
210 //
211 this.label11.Location = new System.Drawing.Point(328, 40);
212 this.label11.Name = "label11";
213 this.label11.Size = new System.Drawing.Size(80, 16);
214 this.label11.TabIndex = 52;
215 this.label11.Text = "minutes.";
216 //
217 // label5
218 //
219 this.label5.Location = new System.Drawing.Point(192, 40);
220 this.label5.Name = "label5";
221 this.label5.Size = new System.Drawing.Size(64, 16);
222 this.label5.TabIndex = 51;
223 this.label5.Text = "Time Scale:";
224 //
225 // cboTimeInterval
226 //
227 this.cboTimeInterval.Items.AddRange(new object[] {
228 "5",
229 "10",
230 "15",
231 "20",
232 "30",
233 "60"});
234 this.cboTimeInterval.Location = new System.Drawing.Point(256, 38);
235 this.cboTimeInterval.MaxDropDownItems = 6;
236 this.cboTimeInterval.Name = "cboTimeInterval";
237 this.cboTimeInterval.Size = new System.Drawing.Size(64, 21);
238 this.cboTimeInterval.TabIndex = 10;
239 //
240 // chkInactivate
241 //
242 this.chkInactivate.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
243 this.chkInactivate.Location = new System.Drawing.Point(80, 40);
244 this.chkInactivate.Name = "chkInactivate";
245 this.chkInactivate.Size = new System.Drawing.Size(72, 16);
246 this.chkInactivate.TabIndex = 5;
247 this.chkInactivate.Text = "Inactive:";
248 //
249 // grpRPMSClinicLink
250 //
251 this.grpRPMSClinicLink.Controls.Add(this.lblReactivateDate);
252 this.grpRPMSClinicLink.Controls.Add(this.label10);
253 this.grpRPMSClinicLink.Controls.Add(this.lblInactivateDate);
254 this.grpRPMSClinicLink.Controls.Add(this.label8);
255 this.grpRPMSClinicLink.Controls.Add(this.lblClinicCode);
256 this.grpRPMSClinicLink.Controls.Add(this.label6);
257 this.grpRPMSClinicLink.Controls.Add(this.lblProvider);
258 this.grpRPMSClinicLink.Controls.Add(this.label7);
259 this.grpRPMSClinicLink.Controls.Add(this.lblVisitServiceCategory);
260 this.grpRPMSClinicLink.Controls.Add(this.label3);
261 this.grpRPMSClinicLink.Controls.Add(this.lblCreateVisit);
262 this.grpRPMSClinicLink.Controls.Add(this.label2);
263 this.grpRPMSClinicLink.Controls.Add(this.label4);
264 this.grpRPMSClinicLink.Controls.Add(this.cboRPMSClinic);
265 this.grpRPMSClinicLink.Location = new System.Drawing.Point(32, 88);
266 this.grpRPMSClinicLink.Name = "grpRPMSClinicLink";
267 this.grpRPMSClinicLink.Size = new System.Drawing.Size(384, 208);
268 this.grpRPMSClinicLink.TabIndex = 48;
269 this.grpRPMSClinicLink.TabStop = false;
270 this.grpRPMSClinicLink.Text = "VistA Clinic Link";
271 //
272 // lblReactivateDate
273 //
274 this.lblReactivateDate.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
275 this.lblReactivateDate.Location = new System.Drawing.Point(176, 168);
276 this.lblReactivateDate.Name = "lblReactivateDate";
277 this.lblReactivateDate.Size = new System.Drawing.Size(176, 16);
278 this.lblReactivateDate.TabIndex = 57;
279 //
280 // label10
281 //
282 this.label10.Location = new System.Drawing.Point(56, 168);
283 this.label10.Name = "label10";
284 this.label10.Size = new System.Drawing.Size(112, 16);
285 this.label10.TabIndex = 56;
286 this.label10.Text = "Reactivate Date:";
287 this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
288 //
289 // lblInactivateDate
290 //
291 this.lblInactivateDate.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
292 this.lblInactivateDate.Location = new System.Drawing.Point(176, 144);
293 this.lblInactivateDate.Name = "lblInactivateDate";
294 this.lblInactivateDate.Size = new System.Drawing.Size(176, 16);
295 this.lblInactivateDate.TabIndex = 55;
296 //
297 // label8
298 //
299 this.label8.Location = new System.Drawing.Point(48, 144);
300 this.label8.Name = "label8";
301 this.label8.Size = new System.Drawing.Size(120, 16);
302 this.label8.TabIndex = 54;
303 this.label8.Text = "Inactivate Date:";
304 this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
305 //
306 // lblClinicCode
307 //
308 this.lblClinicCode.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
309 this.lblClinicCode.Location = new System.Drawing.Point(176, 120);
310 this.lblClinicCode.Name = "lblClinicCode";
311 this.lblClinicCode.Size = new System.Drawing.Size(176, 16);
312 this.lblClinicCode.TabIndex = 53;
313 //
314 // label6
315 //
316 this.label6.Location = new System.Drawing.Point(96, 120);
317 this.label6.Name = "label6";
318 this.label6.Size = new System.Drawing.Size(72, 16);
319 this.label6.TabIndex = 52;
320 this.label6.Text = "Clinic Code:";
321 this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
322 //
323 // lblProvider
324 //
325 this.lblProvider.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
326 this.lblProvider.Location = new System.Drawing.Point(176, 96);
327 this.lblProvider.Name = "lblProvider";
328 this.lblProvider.Size = new System.Drawing.Size(176, 16);
329 this.lblProvider.TabIndex = 51;
330 //
331 // label7
332 //
333 this.label7.Location = new System.Drawing.Point(104, 96);
334 this.label7.Name = "label7";
335 this.label7.Size = new System.Drawing.Size(64, 16);
336 this.label7.TabIndex = 50;
337 this.label7.Text = "Provider:";
338 this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
339 //
340 // lblVisitServiceCategory
341 //
342 this.lblVisitServiceCategory.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
343 this.lblVisitServiceCategory.Location = new System.Drawing.Point(176, 72);
344 this.lblVisitServiceCategory.Name = "lblVisitServiceCategory";
345 this.lblVisitServiceCategory.Size = new System.Drawing.Size(176, 16);
346 this.lblVisitServiceCategory.TabIndex = 49;
347 //
348 // label3
349 //
350 this.label3.Location = new System.Drawing.Point(48, 72);
351 this.label3.Name = "label3";
352 this.label3.Size = new System.Drawing.Size(120, 16);
353 this.label3.TabIndex = 48;
354 this.label3.Text = "Visit Sevice Category:";
355 this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
356 //
357 // lblCreateVisit
358 //
359 this.lblCreateVisit.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
360 this.lblCreateVisit.Location = new System.Drawing.Point(176, 48);
361 this.lblCreateVisit.Name = "lblCreateVisit";
362 this.lblCreateVisit.Size = new System.Drawing.Size(40, 16);
363 this.lblCreateVisit.TabIndex = 47;
364 //
365 // label2
366 //
367 this.label2.Location = new System.Drawing.Point(32, 48);
368 this.label2.Name = "label2";
369 this.label2.Size = new System.Drawing.Size(136, 16);
370 this.label2.TabIndex = 46;
371 this.label2.Text = "Create Visit at Check-In?";
372 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
373 //
374 // label4
375 //
376 this.label4.Location = new System.Drawing.Point(32, 18);
377 this.label4.Name = "label4";
378 this.label4.Size = new System.Drawing.Size(72, 16);
379 this.label4.TabIndex = 45;
380 this.label4.Text = "VistA Clinic:";
381 this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
382 //
383 // cboRPMSClinic
384 //
385 this.cboRPMSClinic.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
386 this.cboRPMSClinic.Location = new System.Drawing.Point(112, 16);
387 this.cboRPMSClinic.Name = "cboRPMSClinic";
388 this.cboRPMSClinic.Size = new System.Drawing.Size(256, 21);
389 this.cboRPMSClinic.TabIndex = 15;
390 //
391 // label1
392 //
393 this.label1.Location = new System.Drawing.Point(36, 11);
394 this.label1.Name = "label1";
395 this.label1.Size = new System.Drawing.Size(96, 16);
396 this.label1.TabIndex = 47;
397 this.label1.Text = "Resource Name:";
398 this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
399 //
400 // txtResourceName
401 //
402 this.txtResourceName.Location = new System.Drawing.Point(140, 11);
403 this.txtResourceName.MaxLength = 30;
404 this.txtResourceName.Name = "txtResourceName";
405 this.txtResourceName.Size = new System.Drawing.Size(256, 20);
406 this.txtResourceName.TabIndex = 0;
407 this.txtResourceName.Text = "";
408 //
409 // tpLetter
410 //
411 this.tpLetter.Controls.Add(this.label9);
412 this.tpLetter.Controls.Add(this.txtLetter);
413 this.tpLetter.Location = new System.Drawing.Point(4, 22);
414 this.tpLetter.Name = "tpLetter";
415 this.tpLetter.Size = new System.Drawing.Size(490, 318);
416 this.tpLetter.TabIndex = 1;
417 this.tpLetter.Text = "Reminder Letter";
418 //
419 // label9
420 //
421 this.label9.Location = new System.Drawing.Point(32, 24);
422 this.label9.Name = "label9";
423 this.label9.Size = new System.Drawing.Size(416, 32);
424 this.label9.TabIndex = 1;
425 this.label9.Text = "Enter the text which will appear on reminder letters sent to patients with appoin" +
426 "tments in this clinic. Use CTRL+Enter to start a new line.";
427 //
428 // txtLetter
429 //
430 this.txtLetter.Location = new System.Drawing.Point(32, 72);
431 this.txtLetter.Multiline = true;
432 this.txtLetter.Name = "txtLetter";
433 this.txtLetter.Size = new System.Drawing.Size(416, 216);
434 this.txtLetter.TabIndex = 20;
435 this.txtLetter.Text = "Dear Patient,\r\n\r\nThis letter is to remind you that you have the appointments list" +
436 "ed below.\r\n\r\nPlease contact us at 555-1234 if you are unable to keep this appoin" +
437 "tment.\r\n\r\nThank you,\r\n\r\nThe Clinic";
438 //
439 // tpRebookLetter
440 //
441 this.tpRebookLetter.Controls.Add(this.label12);
442 this.tpRebookLetter.Controls.Add(this.txtRebookLetter);
443 this.tpRebookLetter.Location = new System.Drawing.Point(4, 22);
444 this.tpRebookLetter.Name = "tpRebookLetter";
445 this.tpRebookLetter.Size = new System.Drawing.Size(490, 318);
446 this.tpRebookLetter.TabIndex = 2;
447 this.tpRebookLetter.Text = "Rebook Letter";
448 //
449 // label12
450 //
451 this.label12.Location = new System.Drawing.Point(37, 27);
452 this.label12.Name = "label12";
453 this.label12.Size = new System.Drawing.Size(416, 32);
454 this.label12.TabIndex = 21;
455 this.label12.Text = "Enter the text which will appear on rebook letters sent to patients with appointm" +
456 "ents in this clinic. Use CTRL+Enter to start a new line.";
457 //
458 // txtRebookLetter
459 //
460 this.txtRebookLetter.Location = new System.Drawing.Point(37, 75);
461 this.txtRebookLetter.Multiline = true;
462 this.txtRebookLetter.Name = "txtRebookLetter";
463 this.txtRebookLetter.Size = new System.Drawing.Size(416, 216);
464 this.txtRebookLetter.TabIndex = 22;
465 this.txtRebookLetter.Text = "Dear Patient,\r\n\r\nThis letter is to inform you that we have changed the appointmen" +
466 "ts listed below.\r\n\r\nPlease contact us at 555-1234 if you are unable to keep your" +
467 " appointment.\r\n\r\nThank you,\r\n\r\nThe Clinic";
468 //
469 // tpCancellationLetter
470 //
471 this.tpCancellationLetter.Controls.Add(this.label13);
472 this.tpCancellationLetter.Controls.Add(this.txtCancellationLetter);
473 this.tpCancellationLetter.Location = new System.Drawing.Point(4, 22);
474 this.tpCancellationLetter.Name = "tpCancellationLetter";
475 this.tpCancellationLetter.Size = new System.Drawing.Size(490, 318);
476 this.tpCancellationLetter.TabIndex = 3;
477 this.tpCancellationLetter.Text = "Cancellation Letter";
478 //
479 // label13
480 //
481 this.label13.Location = new System.Drawing.Point(37, 27);
482 this.label13.Name = "label13";
483 this.label13.Size = new System.Drawing.Size(416, 32);
484 this.label13.TabIndex = 21;
485 this.label13.Text = "Enter the text which will appear on cancellation letters sent to patients with ap" +
486 "pointments in this clinic. Use CTRL+Enter to start a new line.";
487 //
488 // txtCancellationLetter
489 //
490 this.txtCancellationLetter.Location = new System.Drawing.Point(37, 75);
491 this.txtCancellationLetter.Multiline = true;
492 this.txtCancellationLetter.Name = "txtCancellationLetter";
493 this.txtCancellationLetter.Size = new System.Drawing.Size(416, 216);
494 this.txtCancellationLetter.TabIndex = 22;
495 this.txtCancellationLetter.Text = "Dear Patient,\r\n\r\nThis letter is to inform you that the appointments listed below " +
496 "have been cancelled.\r\n\r\nPlease contact us at 555-1234 if you have questions abou" +
497 "t your appointments.\r\n\r\nThank you,\r\n\r\nThe Clinic";
498 //
499 // DResource
500 //
501 this.AcceptButton = this.cmdOK;
502 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
503 this.CancelButton = this.cmdCancel;
504 this.ClientSize = new System.Drawing.Size(498, 464);
505 this.Controls.Add(this.tabResources);
506 this.Controls.Add(this.pnlDescription);
507 this.Controls.Add(this.pnlOkCancel);
508 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
509 this.Name = "DResource";
510 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
511 this.Text = "Manage Resource";
512 this.Activated += new System.EventHandler(this.DResource_Activated);
513 this.pnlOkCancel.ResumeLayout(false);
514 this.pnlDescription.ResumeLayout(false);
515 this.grpDescription.ResumeLayout(false);
516 this.tabResources.ResumeLayout(false);
517 this.tpRPMSLink.ResumeLayout(false);
518 this.grpRPMSClinicLink.ResumeLayout(false);
519 this.tpLetter.ResumeLayout(false);
520 this.tpRebookLetter.ResumeLayout(false);
521 this.tpCancellationLetter.ResumeLayout(false);
522 this.ResumeLayout(false);
523
524 }
525 #endregion
526
527 #region Fields
528
529 private DataTable m_dtResources;
530 private CGResource m_pResource;
531 private DataView m_dvHospLoc;
532 private DataView m_dvClinicParams;
533
534 #endregion Fields
535
536 #region Methods
537
538 public void InitializePage(int nSelectedResourceID, DataSet dsGlobal)
539 {
540
541 m_dtResources = dsGlobal.Tables["Resources"];
542
543 //Datasource the HOSPITAL LOCATION combo box
544 DataTable dtHospLoc = dsGlobal.Tables["HospitalLocation"];
545 m_dvHospLoc = new DataView(dtHospLoc);
546 m_dvHospLoc.Sort = "HOSPITAL_LOCATION_ID ASC";
547 int nFind = m_dvHospLoc.Find((int) 0);
548 if (nFind < 0)
549 {
550 DataRowView drv = m_dvHospLoc.AddNew();
551 drv.BeginEdit();
552 drv["HOSPITAL_LOCATION"]="<None>";
553 drv["HOSPITAL_LOCATION_ID"]=0;
554 drv.EndEdit();
555 }
556
557 DataTable dtClinicParams = dsGlobal.Tables["ClinicSetupParameters"];
558 m_dvClinicParams = new DataView(dtClinicParams);
559// m_dvClinicParams.Sort = "HOSPITAL_LOCATION_ID ASC";
560 m_dvClinicParams.Sort = "HOSPITAL_LOCATION ASC";
561 string sFind = "<None>";
562// nFind = m_dvClinicParams.Find((int) 0);
563 nFind = m_dvClinicParams.Find((string) sFind);
564
565 if (nFind < 0)
566 {
567 DataRowView drv = m_dvClinicParams.AddNew();
568 drv.BeginEdit();
569 drv["HOSPITAL_LOCATION"]="<None>";
570 drv["HOSPITAL_LOCATION_ID"]="0";
571 drv["CREATE_VISIT"]="";
572 drv["VISIT_SERVICE_CATEGORY"]="";
573 drv.EndEdit();
574 }
575
576//smh cboRPMSClinic.DataSource = m_dvClinicParams;
577 cboRPMSClinic.DataSource = m_dvHospLoc;
578 cboRPMSClinic.DisplayMember = "HOSPITAL_LOCATION";
579 cboRPMSClinic.ValueMember = "HOSPITAL_LOCATION_ID";
580// cboRPMSClinic.SelectedItem = nFind;
581 cboRPMSClinic.SelectedIndex = nFind;
582
583 //Set databindings of the label boxes
584
585//smh lblCreateVisit.DataBindings.Add("Text", m_dvClinicParams, "CREATE_VISIT");
586//smh lblClinicCode.DataBindings.Add("Text", m_dvClinicParams, "CLINIC_STOP");
587 lblClinicCode.DataBindings.Add("Text", m_dvHospLoc, "STOP_CODE_NUMBER"); //smh
588//smh lblProvider.DataBindings.Add("Text", m_dvClinicParams, "PROVIDER");
589 lblProvider.DataBindings.Add("Text", m_dvHospLoc, "DEFAULT_PROVIDER"); //smh
590//smh lblInactivateDate.DataBindings.Add("Text", m_dvClinicParams, "INACTIVATE_DATE");
591 lblInactivateDate.DataBindings.Add("Text", m_dvHospLoc, "INACTIVATE_DATE"); //smh
592//smh lblReactivateDate.DataBindings.Add("Text", m_dvClinicParams, "REACTIVATE_DATE");
593 lblReactivateDate.DataBindings.Add("Text", m_dvHospLoc, "REACTIVATE_DATE"); //smh
594 //create new instance of Resource class
595 m_pResource = new CGResource();
596
597 if (nSelectedResourceID < 0) //then we're in ADD mode
598 {
599 this.Text = "Add New Scheduling Resource";
600 m_pResource.ResourceID = 0;
601 m_pResource.ResourceName = "";
602 m_pResource.Inactive = false;
603 m_pResource.HospitalLocationID = 0;
604 m_pResource.HospitalLocation = "";
605 m_pResource.TimeScale = 15;
606 }
607 else //we're in EDIT mode
608 {
609 this.Text = "Edit Scheduling Resource";
610// DataRow dr = m_dtResources.Rows[nSelectedResourceID];
611
612 DataRow dr = m_dtResources.Rows.Find(nSelectedResourceID);
613 //TODO: test dr for validity
614
615 string sID = dr["RESOURCEID"].ToString();
616 sID = (sID == "")?"0":sID;
617 m_pResource.ResourceID = Convert.ToInt16(sID);
618 m_pResource.ResourceName = dr["RESOURCE_NAME"].ToString();
619
620 string sInactive = dr["INACTIVE"].ToString();
621 m_pResource.Inactive = (sInactive == "1")?true:false;
622
623 sID = dr["HOSPITAL_LOCATION_ID"].ToString();
624 sID = (sID == "")?"0":sID;
625 m_pResource.HospitalLocationID = Convert.ToInt16(sID);
626
627 if (dr["TIMESCALE"].ToString() != "")
628 {
629 m_pResource.TimeScale = (int) dr["TIMESCALE"];
630 }
631 m_pResource.LetterText = dr["LETTER_TEXT"].ToString();
632 m_pResource.NoShowLetterText = dr["NO_SHOW_LETTER"].ToString();
633 m_pResource.CancellationLetterText = dr["CLINIC_CANCELLATION_LETTER"].ToString();
634
635 dr = dsGlobal.Tables["HospitalLocation"].Rows.Find(m_pResource.HospitalLocationID);
636 //TODO: test dr validity
637 m_pResource.HospitalLocation = dr["HOSPITAL_LOCATION"].ToString();
638
639
640 }
641 UpdateDialogData(true);
642 }
643
644 /// <summary>
645 /// If b is true, moves member vars into control data
646 /// otherwise, moves control data into member vars
647 /// </summary>
648 /// <param name="b"></param>
649 private void UpdateDialogData(bool b)
650 {
651 if (b == true)
652 {
653 txtResourceName.Text = m_pResource.ResourceName;
654 chkInactivate.Checked = m_pResource.Inactive;
655 cboRPMSClinic.SelectedValue = m_pResource.HospitalLocationID;
656 txtLetter.Text = m_pResource.LetterText;
657 txtRebookLetter.Text = m_pResource.NoShowLetterText;
658 txtCancellationLetter.Text = m_pResource.CancellationLetterText;
659 cboTimeInterval.Text = m_pResource.TimeScale.ToString();
660
661 }
662 else
663 {
664 m_pResource.ResourceName = this.txtResourceName.Text;
665 m_pResource.Inactive = this.chkInactivate.Checked;
666 m_pResource.HospitalLocationID = Convert.ToInt16(this.cboRPMSClinic.SelectedValue);
667 m_pResource.LetterText = txtLetter.Text;
668 m_pResource.CancellationLetterText = txtCancellationLetter.Text;
669 m_pResource.NoShowLetterText = txtRebookLetter.Text;
670 if (cboTimeInterval.Text != "")
671 m_pResource.TimeScale = Convert.ToInt16(cboTimeInterval.Text);
672
673 }
674 }
675
676 /// <summary>
677 /// Clean up any resources being used.
678 /// </summary>
679 protected override void Dispose( bool disposing )
680 {
681 if( disposing )
682 {
683 if(components != null)
684 {
685 components.Dispose();
686 }
687 }
688 base.Dispose( disposing );
689 }
690
691 private void cmdOK_Click(object sender, System.EventArgs e)
692 {
693 this.UpdateDialogData(false);
694 }
695
696 private void tabResources_SelectedIndexChanged(object sender, System.EventArgs e)
697 {
698 if (tabResources.SelectedIndex == 0)
699 {
700 txtResourceName.Focus();
701 }
702 else
703 {
704 txtLetter.Focus();
705 }
706 }
707
708 private void DResource_Activated(object sender, System.EventArgs e)
709 {
710 txtResourceName.Focus();
711 }
712
713 #endregion Methods
714
715 #region Properties
716 public bool Inactive
717 {
718 get
719 {
720 return m_pResource.Inactive;
721 }
722 set
723 {
724 m_pResource.Inactive = value;
725 }
726 }
727
728 public int HospitalLocationID
729 {
730 get
731 {
732 return m_pResource.HospitalLocationID;
733 }
734 set
735 {
736 m_pResource.HospitalLocationID = value;
737 }
738 }
739
740 public string ResourceName
741 {
742 get
743 {
744 return m_pResource.ResourceName;
745 }
746 set
747 {
748 m_pResource.ResourceName = value;
749 }
750 }
751
752 public string LetterText
753 {
754 get
755 {
756 return m_pResource.LetterText;
757 }
758 set
759 {
760 m_pResource.LetterText = value;
761 }
762 }
763
764 public string NoShowLetterText
765 {
766 get
767 {
768 return m_pResource.NoShowLetterText;
769 }
770 set
771 {
772 m_pResource.NoShowLetterText = value;
773 }
774 }
775
776 public string CancellationLetterText
777 {
778 get
779 {
780 return m_pResource.CancellationLetterText;
781 }
782 set
783 {
784 m_pResource.CancellationLetterText = value;
785 }
786 }
787
788 public int ResourceID
789 {
790 get
791 {
792 return m_pResource.ResourceID;
793 }
794 set
795 {
796 m_pResource.ResourceID = value;
797 }
798 }
799
800 public int TimeScale
801 {
802 get
803 {
804 return m_pResource.TimeScale;
805 }
806 set
807 {
808 m_pResource.TimeScale = value;
809 }
810 }
811
812 #endregion Properties
813
814
815 }
816}
Note: See TracBrowser for help on using the repository browser.