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

Last change on this file since 933 was 899, checked in by Sam Habiel, 14 years ago
  1. Make combo boxes in DManagement searchable (in MS Lingo AutoComplete).
  2. Make sure that all DManagement lists and combo boxes are sorted.
File size: 33.3 KB
RevLine 
[614]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 {
[899]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);
[614]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 private DataView m_dvClinicParams;
535
536 #endregion Fields
537
538 #region Methods
539
540 public void InitializePage(int nSelectedResourceID, DataSet dsGlobal)
541 {
542 m_dtResources = dsGlobal.Tables["Resources"];
543
544 //Datasource the HOSPITAL LOCATION combo box
545 DataTable dtHospLoc = dsGlobal.Tables["HospitalLocation"];
546 m_dvHospLoc = new DataView(dtHospLoc);
[892]547 m_dvHospLoc.Sort = "HOSPITAL_LOCATION_ID ASC";
[614]548 int nFind = m_dvHospLoc.Find((int) 0);
549 if (nFind < 0)
550 {
551 DataRowView drv = m_dvHospLoc.AddNew();
552 drv.BeginEdit();
553 drv["HOSPITAL_LOCATION"]="<None>";
554 drv["HOSPITAL_LOCATION_ID"]=0;
555 drv.EndEdit();
556 }
[892]557 m_dvHospLoc.Sort = "HOSPITAL_LOCATION ASC";
[614]558
[802]559// DataTable dtClinicParams = dsGlobal.Tables["ClinicSetupParameters"];
560// m_dvClinicParams = new DataView(dtClinicParams);
[614]561// m_dvClinicParams.Sort = "HOSPITAL_LOCATION_ID ASC";
[802]562// m_dvClinicParams.Sort = "HOSPITAL_LOCATION ASC";
563// string sFind = "<None>";
[614]564// nFind = m_dvClinicParams.Find((int) 0);
[802]565/* nFind = m_dvClinicParams.Find((string) sFind);
[614]566
567 if (nFind < 0)
568 {
569 DataRowView drv = m_dvClinicParams.AddNew();
570 drv.BeginEdit();
571 drv["HOSPITAL_LOCATION"]="<None>";
572 drv["HOSPITAL_LOCATION_ID"]="0";
573 drv["CREATE_VISIT"]="";
574 drv["VISIT_SERVICE_CATEGORY"]="";
575 drv.EndEdit();
576 }
[802]577*/
[614]578//smh cboRPMSClinic.DataSource = m_dvClinicParams;
579 cboRPMSClinic.DataSource = m_dvHospLoc;
580 cboRPMSClinic.DisplayMember = "HOSPITAL_LOCATION";
581 cboRPMSClinic.ValueMember = "HOSPITAL_LOCATION_ID";
582// cboRPMSClinic.SelectedItem = nFind;
583 cboRPMSClinic.SelectedIndex = nFind;
584
585 //Set databindings of the label boxes
586
587//smh lblCreateVisit.DataBindings.Add("Text", m_dvClinicParams, "CREATE_VISIT");
588//smh lblClinicCode.DataBindings.Add("Text", m_dvClinicParams, "CLINIC_STOP");
589 lblClinicCode.DataBindings.Add("Text", m_dvHospLoc, "STOP_CODE_NUMBER"); //smh
590//smh lblProvider.DataBindings.Add("Text", m_dvClinicParams, "PROVIDER");
591 lblProvider.DataBindings.Add("Text", m_dvHospLoc, "DEFAULT_PROVIDER"); //smh
592//smh lblInactivateDate.DataBindings.Add("Text", m_dvClinicParams, "INACTIVATE_DATE");
593 lblInactivateDate.DataBindings.Add("Text", m_dvHospLoc, "INACTIVATE_DATE"); //smh
594//smh lblReactivateDate.DataBindings.Add("Text", m_dvClinicParams, "REACTIVATE_DATE");
595 lblReactivateDate.DataBindings.Add("Text", m_dvHospLoc, "REACTIVATE_DATE"); //smh
596 //create new instance of Resource class
597 m_pResource = new CGResource();
598
599 if (nSelectedResourceID < 0) //then we're in ADD mode
600 {
601 this.Text = "Add New Scheduling Resource";
602 m_pResource.ResourceID = 0;
603 m_pResource.ResourceName = "";
604 m_pResource.Inactive = false;
605 m_pResource.HospitalLocationID = 0;
606 m_pResource.HospitalLocation = "";
607 m_pResource.TimeScale = 15;
608 }
609 else //we're in EDIT mode
610 {
611 this.Text = "Edit Scheduling Resource";
612// DataRow dr = m_dtResources.Rows[nSelectedResourceID];
613
614 DataRow dr = m_dtResources.Rows.Find(nSelectedResourceID);
615 //TODO: test dr for validity
616
617 string sID = dr["RESOURCEID"].ToString();
618 sID = (sID == "")?"0":sID;
619 m_pResource.ResourceID = Convert.ToInt16(sID);
620 m_pResource.ResourceName = dr["RESOURCE_NAME"].ToString();
621
622 string sInactive = dr["INACTIVE"].ToString();
623 m_pResource.Inactive = (sInactive == "1")?true:false;
624
625 sID = dr["HOSPITAL_LOCATION_ID"].ToString();
626 sID = (sID == "")?"0":sID;
627 m_pResource.HospitalLocationID = Convert.ToInt16(sID);
628
629 if (dr["TIMESCALE"].ToString() != "")
630 {
631 m_pResource.TimeScale = (int) dr["TIMESCALE"];
632 }
633 m_pResource.LetterText = dr["LETTER_TEXT"].ToString();
634 m_pResource.NoShowLetterText = dr["NO_SHOW_LETTER"].ToString();
635 m_pResource.CancellationLetterText = dr["CLINIC_CANCELLATION_LETTER"].ToString();
636
637 dr = dsGlobal.Tables["HospitalLocation"].Rows.Find(m_pResource.HospitalLocationID);
638 //TODO: test dr validity
639 m_pResource.HospitalLocation = dr["HOSPITAL_LOCATION"].ToString();
640
641
642 }
643 UpdateDialogData(true);
644 }
645
646 /// <summary>
647 /// If b is true, moves member vars into control data
648 /// otherwise, moves control data into member vars
649 /// </summary>
650 /// <param name="b"></param>
651 private void UpdateDialogData(bool b)
652 {
653 if (b == true)
654 {
655 txtResourceName.Text = m_pResource.ResourceName;
656 chkInactivate.Checked = m_pResource.Inactive;
657 cboRPMSClinic.SelectedValue = m_pResource.HospitalLocationID;
658 txtLetter.Text = m_pResource.LetterText;
659 txtRebookLetter.Text = m_pResource.NoShowLetterText;
660 txtCancellationLetter.Text = m_pResource.CancellationLetterText;
661 cboTimeInterval.Text = m_pResource.TimeScale.ToString();
662
663 }
664 else
665 {
666 m_pResource.ResourceName = this.txtResourceName.Text;
667 m_pResource.Inactive = this.chkInactivate.Checked;
668 m_pResource.HospitalLocationID = Convert.ToInt16(this.cboRPMSClinic.SelectedValue);
669 m_pResource.LetterText = txtLetter.Text;
670 m_pResource.CancellationLetterText = txtCancellationLetter.Text;
671 m_pResource.NoShowLetterText = txtRebookLetter.Text;
672 if (cboTimeInterval.Text != "")
673 m_pResource.TimeScale = Convert.ToInt16(cboTimeInterval.Text);
674
675 }
676 }
677
678 /// <summary>
679 /// Clean up any resources being used.
680 /// </summary>
681 protected override void Dispose( bool disposing )
682 {
683 if( disposing )
684 {
685 if(components != null)
686 {
687 components.Dispose();
688 }
689 }
690 base.Dispose( disposing );
691 }
692
693 private void cmdOK_Click(object sender, System.EventArgs e)
694 {
695 this.UpdateDialogData(false);
696 }
697
698 private void tabResources_SelectedIndexChanged(object sender, System.EventArgs e)
699 {
700 if (tabResources.SelectedIndex == 0)
701 {
702 txtResourceName.Focus();
703 }
704 else
705 {
706 txtLetter.Focus();
707 }
708 }
709
710 private void DResource_Activated(object sender, System.EventArgs e)
711 {
712 txtResourceName.Focus();
713 }
714
715 #endregion Methods
716
717 #region Properties
718 public bool Inactive
719 {
720 get
721 {
722 return m_pResource.Inactive;
723 }
724 set
725 {
726 m_pResource.Inactive = value;
727 }
728 }
729
730 public int HospitalLocationID
731 {
732 get
733 {
734 return m_pResource.HospitalLocationID;
735 }
736 set
737 {
738 m_pResource.HospitalLocationID = value;
739 }
740 }
741
742 public string ResourceName
743 {
744 get
745 {
746 return m_pResource.ResourceName;
747 }
748 set
749 {
750 m_pResource.ResourceName = value;
751 }
752 }
753
754 public string LetterText
755 {
756 get
757 {
758 return m_pResource.LetterText;
759 }
760 set
761 {
762 m_pResource.LetterText = value;
763 }
764 }
765
766 public string NoShowLetterText
767 {
768 get
769 {
770 return m_pResource.NoShowLetterText;
771 }
772 set
773 {
774 m_pResource.NoShowLetterText = value;
775 }
776 }
777
778 public string CancellationLetterText
779 {
780 get
781 {
782 return m_pResource.CancellationLetterText;
783 }
784 set
785 {
786 m_pResource.CancellationLetterText = value;
787 }
788 }
789
790 public int ResourceID
791 {
792 get
793 {
794 return m_pResource.ResourceID;
795 }
796 set
797 {
798 m_pResource.ResourceID = value;
799 }
800 }
801
802 public int TimeScale
803 {
804 get
805 {
806 return m_pResource.TimeScale;
807 }
808 set
809 {
810 m_pResource.TimeScale = value;
811 }
812 }
813
814 #endregion Properties
815
816
817 }
818}
Note: See TracBrowser for help on using the repository browser.