source: Scheduling/branches/GUI1.2/DAccessBlock.cs@ 1639

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

This update does the following:

File size: 16.4 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.DialogResult = DialogResult.Cancel;
102 this.cmdCancel.Location = new Point(0x120, 8);
103 this.cmdCancel.Name = "cmdCancel";
104 this.cmdCancel.Size = new Size(0x40, 0x18);
105 this.cmdCancel.TabIndex = 1;
106 this.cmdCancel.Text = "Cancel";
107 this.cmdOK.DialogResult = DialogResult.OK;
108 this.cmdOK.Location = new Point(0xd0, 8);
109 this.cmdOK.Name = "cmdOK";
110 this.cmdOK.Size = new Size(0x40, 0x18);
111 this.cmdOK.TabIndex = 0;
112 this.cmdOK.Text = "OK";
113 this.cmdOK.Click += new EventHandler(this.cmdOK_Click);
114 this.panel2.Controls.Add(this.label4);
115 this.panel2.Controls.Add(this.cboAccessTypeFilter);
116 this.panel2.Controls.Add(this.lstAccessTypes);
117 this.panel2.Controls.Add(this.nudSlots);
118 this.panel2.Controls.Add(this.label6);
119 this.panel2.Controls.Add(this.lblEndTime);
120 this.panel2.Controls.Add(this.label7);
121 this.panel2.Controls.Add(this.label2);
122 this.panel2.Controls.Add(this.lblClinic);
123 this.panel2.Controls.Add(this.label15);
124 this.panel2.Controls.Add(this.txtNote);
125 this.panel2.Controls.Add(this.label1);
126 this.panel2.Controls.Add(this.lblStartTime);
127 this.panel2.Controls.Add(this.label3);
128 this.panel2.Dock = DockStyle.Fill;
129 this.panel2.Location = new Point(0, 0);
130 this.panel2.Name = "panel2";
131 this.panel2.Size = new Size(0x192, 0x14e);
132 this.panel2.TabIndex = 3;
133 this.label4.Location = new Point(8, 0x88);
134 this.label4.Name = "label4";
135 this.label4.Size = new Size(80, 0x10);
136 this.label4.TabIndex = 0x29;
137 this.label4.Text = "Access Group:";
138 this.label4.TextAlign = ContentAlignment.MiddleRight;
139 this.cboAccessTypeFilter.DropDownStyle = ComboBoxStyle.DropDownList;
140 this.cboAccessTypeFilter.Location = new Point(0x58, 0x88);
141 this.cboAccessTypeFilter.Name = "cboAccessTypeFilter";
142 this.cboAccessTypeFilter.Size = new Size(0x128, 0x15);
143 this.cboAccessTypeFilter.TabIndex = 40;
144 this.cboAccessTypeFilter.SelectionChangeCommitted += new EventHandler(this.cboAccessTypeFilter_SelectionChangeCommitted);
145 this.lstAccessTypes.Location = new Point(0x58, 0xb0);
146 this.lstAccessTypes.Name = "lstAccessTypes";
147 this.lstAccessTypes.Size = new Size(0x128, 0x52);
148 this.lstAccessTypes.TabIndex = 0x26;
149 this.nudSlots.Location = new Point(0x58, 0x38);
150 int[] bits = new int[4];
151 bits[0] = 0x3e6;
152 this.nudSlots.Maximum = new decimal(bits);
153 this.nudSlots.Name = "nudSlots";
154 this.nudSlots.Size = new Size(40, 20);
155 this.nudSlots.TabIndex = 0x25;
156 int[] numArray2 = new int[4];
157 numArray2[0] = 1;
158 this.nudSlots.Value = new decimal(numArray2);
159 this.label6.Location = new Point(40, 0x38);
160 this.label6.Name = "label6";
161 this.label6.Size = new Size(40, 0x10);
162 this.label6.TabIndex = 0x24;
163 this.label6.Text = "Slots:";
164 this.label6.TextAlign = ContentAlignment.MiddleRight;
165 this.lblEndTime.BorderStyle = BorderStyle.Fixed3D;
166 this.lblEndTime.Location = new Point(0x110, 8);
167 this.lblEndTime.Name = "lblEndTime";
168 this.lblEndTime.Size = new Size(0x70, 0x10);
169 this.lblEndTime.TabIndex = 0x22;
170 this.label7.Location = new Point(0xd0, 8);
171 this.label7.Name = "label7";
172 this.label7.Size = new Size(0x40, 0x10);
173 this.label7.TabIndex = 0x21;
174 this.label7.Text = "End Time:";
175 this.label7.TextAlign = ContentAlignment.MiddleRight;
176 this.label2.Location = new Point(0x10, 0xb0);
177 this.label2.Name = "label2";
178 this.label2.Size = new Size(0x48, 0x10);
179 this.label2.TabIndex = 0x1d;
180 this.label2.Text = "Access Type:";
181 this.label2.TextAlign = ContentAlignment.MiddleRight;
182 this.lblClinic.BorderStyle = BorderStyle.Fixed3D;
183 this.lblClinic.Location = new Point(0x58, 0x20);
184 this.lblClinic.Name = "lblClinic";
185 this.lblClinic.Size = new Size(0x128, 0x10);
186 this.lblClinic.TabIndex = 0x1b;
187 this.label15.Location = new Point(40, 0x20);
188 this.label15.Name = "label15";
189 this.label15.Size = new Size(40, 0x10);
190 this.label15.TabIndex = 0x1a;
191 this.label15.Text = "Clinic:";
192 this.label15.TextAlign = ContentAlignment.MiddleRight;
193 this.txtNote.AcceptsReturn = true;
194 this.txtNote.Location = new Point(0x58, 80);
195 this.txtNote.Multiline = true;
196 this.txtNote.Name = "txtNote";
197 this.txtNote.Size = new Size(0x128, 0x30);
198 this.txtNote.TabIndex = 0x19;
199 this.label1.Location = new Point(0x18, 0x58);
200 this.label1.Name = "label1";
201 this.label1.Size = new Size(0x38, 0x10);
202 this.label1.TabIndex = 0x18;
203 this.label1.Text = "Note:";
204 this.label1.TextAlign = ContentAlignment.MiddleRight;
205 this.lblStartTime.BorderStyle = BorderStyle.Fixed3D;
206 this.lblStartTime.Location = new Point(0x58, 8);
207 this.lblStartTime.Name = "lblStartTime";
208 this.lblStartTime.Size = new Size(120, 0x10);
209 this.lblStartTime.TabIndex = 0x16;
210 this.label3.Location = new Point(0x18, 8);
211 this.label3.Name = "label3";
212 this.label3.Size = new Size(0x40, 0x10);
213 this.label3.TabIndex = 20;
214 this.label3.Text = "Start Time:";
215 this.label3.TextAlign = ContentAlignment.MiddleRight;
216 base.AcceptButton = this.cmdOK;
217 this.AutoScaleBaseSize = new Size(5, 13);
218 base.CancelButton = this.cmdCancel;
219 base.ClientSize = new Size(0x192, 0x176);
220 base.Controls.Add(this.panel2);
221 base.Controls.Add(this.panel1);
222 base.FormBorderStyle = FormBorderStyle.FixedDialog;
223 base.Name = "DAccessBlock";
224 base.StartPosition = FormStartPosition.CenterParent;
225 this.Text = "Access Block";
226 this.panel1.ResumeLayout(false);
227 this.panel2.ResumeLayout(false);
228 this.panel2.PerformLayout();
229 this.nudSlots.EndInit();
230 base.ResumeLayout(false);
231 }
232
233 public void InitializePage(CGAppointment pAppt, DataSet dsGlobal)
234 {
235 this.m_pAppt = new CGAppointment();
236 this.m_pAppt.StartTime = pAppt.StartTime;
237 this.m_pAppt.EndTime = pAppt.EndTime;
238 this.m_pAppt.Resource = pAppt.Resource;
239 this.m_pAppt.Note = pAppt.Note;
240 this.m_pAppt.Slots = pAppt.Slots;
241 this.m_pAppt.AccessTypeID = pAppt.AccessTypeID;
242 this.m_pAppt.AccessTypeName = pAppt.AccessTypeName;
243 this.m_dsGlobal = dsGlobal;
244 this.LoadListBox("ALL");
245 DataTable table = dsGlobal.Tables["AccessGroup"];
246 DataSet set = new DataSet("dsTemp");
247 set.Tables.Add(table.Copy());
248 DataTable table2 = set.Tables["AccessGroup"];
249 DataView view = new DataView(table2);
250 view.AddNew()["ACCESS_GROUP"] = "<Show All Access Types>";
251 view.Sort = "ACCESS_GROUP ASC";
252 this.cboAccessTypeFilter.DataSource = view;
253 this.cboAccessTypeFilter.DisplayMember = "ACCESS_GROUP";
254 this.cboAccessTypeFilter.SelectedIndex = this.cboAccessTypeFilter.Items.Count - 1;
255 this.UpdateDialogData(true);
256 }
257
258 public void InitializePage(DateTime dStart, DateTime dEnd, string sClinic, string sNote, DataSet dsGlobal)
259 {
260 this.m_pAppt = new CGAppointment();
261 this.m_pAppt.StartTime = dStart;
262 this.m_pAppt.EndTime = dEnd;
263 this.m_pAppt.Resource = sClinic;
264 this.m_pAppt.Note = sNote;
265 this.m_pAppt.Slots = 1;
266 this.m_dsGlobal = dsGlobal;
267 this.LoadListBox("ALL");
268 DataTable table = dsGlobal.Tables["AccessGroup"];
269 DataSet set = new DataSet("dsTemp");
270 set.Tables.Add(table.Copy());
271 DataTable table2 = set.Tables["AccessGroup"];
272 DataView view = new DataView(table2);
273 view.AddNew()["ACCESS_GROUP"] = "<Show All Access Types>";
274 view.Sort = "ACCESS_GROUP ASC";
275 this.cboAccessTypeFilter.DataSource = view;
276 this.cboAccessTypeFilter.DisplayMember = "ACCESS_GROUP";
277 this.cboAccessTypeFilter.SelectedIndex = this.cboAccessTypeFilter.Items.Count - 1;
278 this.m_pAppt.AccessTypeID = 0;
279 this.UpdateDialogData(true);
280 }
281
282 public void LoadListBox(string sGroup)
283 {
284 string str = "";
285 if (sGroup == "ALL")
286 {
287 this.m_dtTypes = this.m_dsGlobal.Tables["AccessTypes"];
288 this.m_dvTypes = new DataView(this.m_dtTypes);
289 str = "INACTIVE <> 'YES'";
290 this.m_dvTypes.RowFilter = str;
291 this.lstAccessTypes.DataSource = this.m_dvTypes;
292 this.lstAccessTypes.DisplayMember = "ACCESS_TYPE_NAME";
293 this.lstAccessTypes.ValueMember = "BMXIEN";
294 }
295 else
296 {
297 this.m_dtTypes = this.m_dsGlobal.Tables["AccessGroupType"];
298 this.m_dvTypes = new DataView(this.m_dtTypes);
299 str = "ACCESS_GROUP = '" + this.cboAccessTypeFilter.Text + "'";
300 this.m_dvTypes.RowFilter = str;
301 this.lstAccessTypes.DataSource = this.m_dvTypes;
302 this.lstAccessTypes.DisplayMember = "ACCESS_TYPE";
303 this.lstAccessTypes.ValueMember = "ACCESS_TYPE_ID";
304 }
305 }
306
307 private void UpdateDialogData(bool b)
308 {
309 if (b)
310 {
311 this.lblClinic.Text = this.m_pAppt.Resource;
312 this.lblEndTime.Text = this.m_pAppt.EndTime.ToShortDateString() + " " + this.m_pAppt.EndTime.ToShortTimeString();
313 this.lblStartTime.Text = this.m_pAppt.StartTime.ToShortDateString() + " " + this.m_pAppt.StartTime.ToShortTimeString();
314 this.txtNote.Text = this.m_pAppt.Note;
315 this.nudSlots.Value = this.m_pAppt.Slots;
316 if (this.m_pAppt.AccessTypeID != 0)
317 {
318 this.lstAccessTypes.SelectedValue = this.m_pAppt.AccessTypeID;
319 }
320 }
321 else
322 {
323 this.m_pAppt.Note = this.txtNote.Text;
324 int selectedIndex = this.lstAccessTypes.SelectedIndex;
325 string str = this.lstAccessTypes.SelectedValue.ToString();
326 str = (str == "") ? "-1" : str;
327 int num = Convert.ToInt16(str);
328 this.m_pAppt.AccessTypeID = num;
329 this.m_pAppt.Slots = Convert.ToInt16(this.nudSlots.Value);
330 }
331 }
332
333 public int AccessTypeID
334 {
335 get
336 {
337 return this.m_pAppt.AccessTypeID;
338 }
339 set
340 {
341 this.m_pAppt.AccessTypeID = value;
342 }
343 }
344
345 public CGAppointment Appointment
346 {
347 get
348 {
349 return this.m_pAppt;
350 }
351 set
352 {
353 this.m_pAppt = value;
354 }
355 }
356
357 public DateTime EndTime
358 {
359 get
360 {
361 return this.m_pAppt.EndTime;
362 }
363 set
364 {
365 this.m_pAppt.EndTime = value;
366 }
367 }
368
369 public string Note
370 {
371 get
372 {
373 return this.m_pAppt.Note;
374 }
375 set
376 {
377 this.m_pAppt.Note = value;
378 }
379 }
380
381 public string Resource
382 {
383 get
384 {
385 return this.m_pAppt.Resource;
386 }
387 set
388 {
389 this.m_pAppt.Resource = value;
390 }
391 }
392
393 public int Slots
394 {
395 get
396 {
397 return this.m_pAppt.Slots;
398 }
399 set
400 {
401 this.m_pAppt.Slots = value;
402 }
403 }
404
405 public DateTime StartTime
406 {
407 get
408 {
409 return this.m_pAppt.StartTime;
410 }
411 set
412 {
413 this.m_pAppt.StartTime = value;
414 }
415 }
416 }
417}
418
Note: See TracBrowser for help on using the repository browser.