source: Scheduling/trunk/cs/bsdx0200GUISourceCode/DAccessBlock.cs@ 855

Last change on this file since 855 was 853, checked in by Sam Habiel, 14 years ago
File size: 16.5 KB
Line 
1namespace IndianHealthService.ClinicalScheduling
2{
3 using System;
4 using System.ComponentModel;
5 using System.Data;
6 using System.Drawing;
7 using System.Windows.Forms;
8 using System.Xml;
9 /// <summary>
10 /// This class was regenerated from Calendargrid.dll using Reflector.exe
11 /// by Sam Habiel for WorldVista. The original source code is lost.
12 /// </summary>
13 public class DAccessBlock : Form
14 {
15 private ComboBox cboAccessTypeFilter;
16 private Button cmdCancel;
17 private Button cmdOK;
18 private Container components;
19 private Label label1;
20 private Label label15;
21 private Label label2;
22 private Label label3;
23 private Label label4;
24 private Label label6;
25 private Label label7;
26 private Label lblClinic;
27 private Label lblEndTime;
28 private Label lblStartTime;
29 private ListBox lstAccessTypes;
30 private DataSet m_dsGlobal;
31 private DataTable m_dtTypes;
32 private DataView m_dvTypes;
33 private CGAppointment m_pAppt;
34 private NumericUpDown nudSlots;
35 private Panel panel1;
36 private Panel panel2;
37 private TextBox txtNote;
38
39 public DAccessBlock()
40 {
41 this.InitializeComponent();
42 }
43
44 private void cboAccessTypeFilter_SelectionChangeCommitted(object sender, EventArgs e)
45 {
46 if (this.cboAccessTypeFilter.Text == "<Show All Access Types>")
47 {
48 this.LoadListBox("ALL");
49 }
50 else
51 {
52 this.LoadListBox("SELECTED");
53 }
54 }
55
56 private void cmdOK_Click(object sender, EventArgs e)
57 {
58 this.UpdateDialogData(false);
59 }
60
61 protected override void Dispose(bool disposing)
62 {
63 if (disposing && (this.components != null))
64 {
65 this.components.Dispose();
66 }
67 base.Dispose(disposing);
68 }
69
70 private void InitializeComponent()
71 {
72 this.panel1 = new Panel();
73 this.cmdCancel = new Button();
74 this.cmdOK = new Button();
75 this.panel2 = new Panel();
76 this.label4 = new Label();
77 this.cboAccessTypeFilter = new ComboBox();
78 this.lstAccessTypes = new ListBox();
79 this.nudSlots = new NumericUpDown();
80 this.label6 = new Label();
81 this.lblEndTime = new Label();
82 this.label7 = new Label();
83 this.label2 = new Label();
84 this.lblClinic = new Label();
85 this.label15 = new Label();
86 this.txtNote = new TextBox();
87 this.label1 = new Label();
88 this.lblStartTime = new Label();
89 this.label3 = new Label();
90 this.panel1.SuspendLayout();
91 this.panel2.SuspendLayout();
92 this.nudSlots.BeginInit();
93 base.SuspendLayout();
94 this.panel1.Controls.Add(this.cmdCancel);
95 this.panel1.Controls.Add(this.cmdOK);
96 this.panel1.Dock = DockStyle.Bottom;
97 this.panel1.Location = new Point(0, 0x14e);
98 this.panel1.Name = "panel1";
99 this.panel1.Size = new Size(0x192, 40);
100 this.panel1.TabIndex = 2;
101 this.cmdCancel.Location = new Point(0x120, 8);
102 this.cmdCancel.Name = "cmdCancel";
103 this.cmdCancel.Size = new Size(0x40, 0x18);
104 this.cmdCancel.TabIndex = 1;
105 this.cmdCancel.Text = "Cancel";
106
107 this.cmdOK.Location = new Point(0xd0, 8);
108 this.cmdOK.Name = "cmdOK";
109 this.cmdOK.Size = new Size(0x40, 0x18);
110 this.cmdOK.TabIndex = 0;
111 this.cmdOK.Text = "OK";
112 this.cmdOK.Click += new EventHandler(this.cmdOK_Click);
113 this.panel2.Controls.Add(this.label4);
114 this.panel2.Controls.Add(this.cboAccessTypeFilter);
115 this.panel2.Controls.Add(this.lstAccessTypes);
116 this.panel2.Controls.Add(this.nudSlots);
117 this.panel2.Controls.Add(this.label6);
118 this.panel2.Controls.Add(this.lblEndTime);
119 this.panel2.Controls.Add(this.label7);
120 this.panel2.Controls.Add(this.label2);
121 this.panel2.Controls.Add(this.lblClinic);
122 this.panel2.Controls.Add(this.label15);
123 this.panel2.Controls.Add(this.txtNote);
124 this.panel2.Controls.Add(this.label1);
125 this.panel2.Controls.Add(this.lblStartTime);
126 this.panel2.Controls.Add(this.label3);
127 this.panel2.Dock = DockStyle.Fill;
128 this.panel2.Location = new Point(0, 0);
129 this.panel2.Name = "panel2";
130 this.panel2.Size = new Size(0x192, 0x14e);
131 this.panel2.TabIndex = 3;
132 this.label4.Location = new Point(8, 0x88);
133 this.label4.Name = "label4";
134 this.label4.Size = new Size(80, 0x10);
135 this.label4.TabIndex = 0x29;
136 this.label4.Text = "Access Group:";
137 this.label4.TextAlign = ContentAlignment.MiddleRight;
138 this.cboAccessTypeFilter.DropDownStyle = ComboBoxStyle.DropDownList;
139 this.cboAccessTypeFilter.Location = new Point(0x58, 0x88);
140 this.cboAccessTypeFilter.Name = "cboAccessTypeFilter";
141 this.cboAccessTypeFilter.Size = new Size(0x128, 0x15);
142 this.cboAccessTypeFilter.TabIndex = 40;
143 this.cboAccessTypeFilter.SelectionChangeCommitted += new EventHandler(this.cboAccessTypeFilter_SelectionChangeCommitted);
144 this.lstAccessTypes.Location = new Point(0x58, 0xb0);
145 this.lstAccessTypes.Name = "lstAccessTypes";
146 this.lstAccessTypes.Size = new Size(0x128, 0x52);
147 this.lstAccessTypes.TabIndex = 0x26;
148 this.nudSlots.Location = new Point(0x58, 0x38);
149 int[] bits = new int[4];
150 bits[0] = 0x3e6;
151 this.nudSlots.Maximum = new decimal(bits);
152 this.nudSlots.Name = "nudSlots";
153 this.nudSlots.Size = new Size(40, 20);
154 this.nudSlots.TabIndex = 0x25;
155 int[] numArray2 = new int[4];
156 numArray2[0] = 1;
157 this.nudSlots.Value = new decimal(numArray2);
158 this.label6.Location = new Point(40, 0x38);
159 this.label6.Name = "label6";
160 this.label6.Size = new Size(40, 0x10);
161 this.label6.TabIndex = 0x24;
162 this.label6.Text = "Slots:";
163 this.label6.TextAlign = ContentAlignment.MiddleRight;
164 this.lblEndTime.BorderStyle = BorderStyle.Fixed3D;
165 this.lblEndTime.Location = new Point(0x110, 8);
166 this.lblEndTime.Name = "lblEndTime";
167 this.lblEndTime.Size = new Size(0x70, 0x10);
168 this.lblEndTime.TabIndex = 0x22;
169 this.label7.Location = new Point(0xd0, 8);
170 this.label7.Name = "label7";
171 this.label7.Size = new Size(0x40, 0x10);
172 this.label7.TabIndex = 0x21;
173 this.label7.Text = "End Time:";
174 this.label7.TextAlign = ContentAlignment.MiddleRight;
175 this.label2.Location = new Point(0x10, 0xb0);
176 this.label2.Name = "label2";
177 this.label2.Size = new Size(0x48, 0x10);
178 this.label2.TabIndex = 0x1d;
179 this.label2.Text = "Access Type:";
180 this.label2.TextAlign = ContentAlignment.MiddleRight;
181 this.lblClinic.BorderStyle = BorderStyle.Fixed3D;
182 this.lblClinic.Location = new Point(0x58, 0x20);
183 this.lblClinic.Name = "lblClinic";
184 this.lblClinic.Size = new Size(0x128, 0x10);
185 this.lblClinic.TabIndex = 0x1b;
186 this.label15.Location = new Point(40, 0x20);
187 this.label15.Name = "label15";
188 this.label15.Size = new Size(40, 0x10);
189 this.label15.TabIndex = 0x1a;
190 this.label15.Text = "Clinic:";
191 this.label15.TextAlign = ContentAlignment.MiddleRight;
192 this.txtNote.AcceptsReturn = true;
193 this.txtNote.Location = new Point(0x58, 80);
194 this.txtNote.Multiline = true;
195 this.txtNote.Name = "txtNote";
196 this.txtNote.Size = new Size(0x128, 0x30);
197 this.txtNote.TabIndex = 0x19;
198 this.label1.Location = new Point(0x18, 0x58);
199 this.label1.Name = "label1";
200 this.label1.Size = new Size(0x38, 0x10);
201 this.label1.TabIndex = 0x18;
202 this.label1.Text = "Note:";
203 this.label1.TextAlign = ContentAlignment.MiddleRight;
204 this.lblStartTime.BorderStyle = BorderStyle.Fixed3D;
205 this.lblStartTime.Location = new Point(0x58, 8);
206 this.lblStartTime.Name = "lblStartTime";
207 this.lblStartTime.Size = new Size(120, 0x10);
208 this.lblStartTime.TabIndex = 0x16;
209 this.label3.Location = new Point(0x18, 8);
210 this.label3.Name = "label3";
211 this.label3.Size = new Size(0x40, 0x10);
212 this.label3.TabIndex = 20;
213 this.label3.Text = "Start Time:";
214 this.label3.TextAlign = ContentAlignment.MiddleRight;
215 base.AcceptButton = this.cmdOK;
216 this.AutoScaleBaseSize = new Size(5, 13);
217 base.CancelButton = this.cmdCancel;
218 base.ClientSize = new Size(0x192, 0x176);
219 base.Controls.Add(this.panel2);
220 base.Controls.Add(this.panel1);
221 base.FormBorderStyle = FormBorderStyle.FixedDialog;
222 base.Name = "DAccessBlock";
223 base.StartPosition = FormStartPosition.CenterParent;
224 this.Text = "Access Block";
225 this.panel1.ResumeLayout(false);
226 this.panel2.ResumeLayout(false);
227 this.panel2.PerformLayout();
228 this.nudSlots.EndInit();
229 base.ResumeLayout(false);
230 }
231
232 public void InitializePage(CGAppointment pAppt, DataSet dsGlobal)
233 {
234 this.m_pAppt = new CGAppointment();
235 this.m_pAppt.StartTime = pAppt.StartTime;
236 this.m_pAppt.EndTime = pAppt.EndTime;
237 this.m_pAppt.Resource = pAppt.Resource;
238 this.m_pAppt.Note = pAppt.Note;
239 this.m_pAppt.Slots = pAppt.Slots;
240 this.m_pAppt.AccessTypeID = pAppt.AccessTypeID;
241 this.m_pAppt.AccessTypeName = pAppt.AccessTypeName;
242 this.m_dsGlobal = dsGlobal;
243 this.LoadListBox("ALL");
244 DataTable table = dsGlobal.Tables["AccessGroup"];
245 DataSet set = new DataSet("dsTemp");
246 set.Tables.Add(table.Copy());
247 DataTable table2 = set.Tables["AccessGroup"];
248 DataView view = new DataView(table2);
249 view.AddNew()["ACCESS_GROUP"] = "<Show All Access Types>";
250 view.Sort = "ACCESS_GROUP ASC";
251 this.cboAccessTypeFilter.DataSource = view;
252 this.cboAccessTypeFilter.DisplayMember = "ACCESS_GROUP";
253 this.cboAccessTypeFilter.SelectedIndex = this.cboAccessTypeFilter.Items.Count - 1;
254 this.cmdCancel.DialogResult = DialogResult.Cancel;
255 this.cmdOK.DialogResult = DialogResult.OK;
256 this.UpdateDialogData(true);
257 }
258
259 public void InitializePage(DateTime dStart, DateTime dEnd, string sClinic, string sNote, DataSet dsGlobal)
260 {
261 this.m_pAppt = new CGAppointment();
262 this.m_pAppt.StartTime = dStart;
263 this.m_pAppt.EndTime = dEnd;
264 this.m_pAppt.Resource = sClinic;
265 this.m_pAppt.Note = sNote;
266 this.m_pAppt.Slots = 1;
267 this.m_dsGlobal = dsGlobal;
268 this.LoadListBox("ALL");
269 DataTable table = dsGlobal.Tables["AccessGroup"];
270 DataSet set = new DataSet("dsTemp");
271 set.Tables.Add(table.Copy());
272 DataTable table2 = set.Tables["AccessGroup"];
273 DataView view = new DataView(table2);
274 view.AddNew()["ACCESS_GROUP"] = "<Show All Access Types>";
275 view.Sort = "ACCESS_GROUP ASC";
276 this.cboAccessTypeFilter.DataSource = view;
277 this.cboAccessTypeFilter.DisplayMember = "ACCESS_GROUP";
278 this.cboAccessTypeFilter.SelectedIndex = this.cboAccessTypeFilter.Items.Count - 1;
279 this.m_pAppt.AccessTypeID = 0;
280 this.cmdCancel.DialogResult = DialogResult.Cancel;
281 this.cmdOK.DialogResult = DialogResult.OK;
282 this.UpdateDialogData(true);
283 }
284
285 public void LoadListBox(string sGroup)
286 {
287 string str = "";
288 if (sGroup == "ALL")
289 {
290 this.m_dtTypes = this.m_dsGlobal.Tables["AccessTypes"];
291 this.m_dvTypes = new DataView(this.m_dtTypes);
292 str = "INACTIVE <> 'YES'";
293 this.m_dvTypes.RowFilter = str;
294 this.lstAccessTypes.DataSource = this.m_dvTypes;
295 this.lstAccessTypes.DisplayMember = "ACCESS_TYPE_NAME";
296 this.lstAccessTypes.ValueMember = "BMXIEN";
297 }
298 else
299 {
300 this.m_dtTypes = this.m_dsGlobal.Tables["AccessGroupType"];
301 this.m_dvTypes = new DataView(this.m_dtTypes);
302 str = "ACCESS_GROUP = '" + this.cboAccessTypeFilter.Text + "'";
303 this.m_dvTypes.RowFilter = str;
304 this.lstAccessTypes.DataSource = this.m_dvTypes;
305 this.lstAccessTypes.DisplayMember = "ACCESS_TYPE";
306 this.lstAccessTypes.ValueMember = "ACCESS_TYPE_ID";
307 }
308 }
309
310 private void UpdateDialogData(bool b)
311 {
312 if (b)
313 {
314 this.lblClinic.Text = this.m_pAppt.Resource;
315 this.lblEndTime.Text = this.m_pAppt.EndTime.ToShortDateString() + " " + this.m_pAppt.EndTime.ToShortTimeString();
316 this.lblStartTime.Text = this.m_pAppt.StartTime.ToShortDateString() + " " + this.m_pAppt.StartTime.ToShortTimeString();
317 this.txtNote.Text = this.m_pAppt.Note;
318 this.nudSlots.Value = this.m_pAppt.Slots;
319 if (this.m_pAppt.AccessTypeID != 0)
320 {
321 this.lstAccessTypes.SelectedValue = this.m_pAppt.AccessTypeID;
322 }
323 }
324 else
325 {
326 this.m_pAppt.Note = this.txtNote.Text;
327 int selectedIndex = this.lstAccessTypes.SelectedIndex;
328 string str = this.lstAccessTypes.SelectedValue.ToString();
329 str = (str == "") ? "-1" : str;
330 int num = Convert.ToInt16(str);
331 this.m_pAppt.AccessTypeID = num;
332 this.m_pAppt.Slots = Convert.ToInt16(this.nudSlots.Value);
333 }
334 }
335
336 public int AccessTypeID
337 {
338 get
339 {
340 return this.m_pAppt.AccessTypeID;
341 }
342 set
343 {
344 this.m_pAppt.AccessTypeID = value;
345 }
346 }
347
348 public CGAppointment Appointment
349 {
350 get
351 {
352 return this.m_pAppt;
353 }
354 set
355 {
356 this.m_pAppt = value;
357 }
358 }
359
360 public DateTime EndTime
361 {
362 get
363 {
364 return this.m_pAppt.EndTime;
365 }
366 set
367 {
368 this.m_pAppt.EndTime = value;
369 }
370 }
371
372 public string Note
373 {
374 get
375 {
376 return this.m_pAppt.Note;
377 }
378 set
379 {
380 this.m_pAppt.Note = value;
381 }
382 }
383
384 public string Resource
385 {
386 get
387 {
388 return this.m_pAppt.Resource;
389 }
390 set
391 {
392 this.m_pAppt.Resource = value;
393 }
394 }
395
396 public int Slots
397 {
398 get
399 {
400 return this.m_pAppt.Slots;
401 }
402 set
403 {
404 this.m_pAppt.Slots = value;
405 }
406 }
407
408 public DateTime StartTime
409 {
410 get
411 {
412 return this.m_pAppt.StartTime;
413 }
414 set
415 {
416 this.m_pAppt.StartTime = value;
417 }
418 }
419 }
420}
421
Note: See TracBrowser for help on using the repository browser.