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

Last change on this file since 1310 was 1124, checked in by Sam Habiel, 14 years ago

Updated Release exes.
CGDocument: Appointment Creation Code now reuses appt object passed in rather than creating a new one.
CGView:
ctxPrintScheduleT3 added. Print schedule in 3 days. For weekday after weekend.
Scaling of grid now restricted. You can't scale down from the original TimeScale, but you can scale up.
DCheckIn: Remove unused variables.
DResource: Remove unused variables.

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