source: Scheduling/trunk/cs/bsdx0200GUISourceCode/DManagement.cs@ 1731

Last change on this file since 1731 was 1731, checked in by Faisal Sami, 8 years ago

BSDX Scheduling changes for version 2.0.1.

File size: 102.1 KB
Line 
1using System;
2using System.Drawing;
3using System.Collections;
4using System.ComponentModel;
5using System.Windows.Forms;
6using System.Data;
7using IndianHealthService.BMXNet;
8using System.Diagnostics;
9using System.Threading;
10
11namespace IndianHealthService.ClinicalScheduling
12{
13 /// <summary>
14 /// Summary description for DManagement.
15 /// </summary>
16 public class DManagement : System.Windows.Forms.Form
17 {
18
19 private System.ComponentModel.Container components = null;
20 private System.Windows.Forms.TabPage tpResources;
21 private System.Windows.Forms.TabPage tpAccessTypes;
22 private System.Windows.Forms.GroupBox grpDescription;
23 private System.Windows.Forms.Label lblDescription;
24 private System.Windows.Forms.Panel pnlPageBottom;
25 private System.Windows.Forms.TabControl tabMain;
26 private System.Windows.Forms.Panel pnlAddEdit;
27 private System.Windows.Forms.Button cmdAddResource;
28 private System.Windows.Forms.Button cmdChangeResource;
29 private System.Windows.Forms.Panel pnlDescription;
30 private System.Windows.Forms.Panel pnlResources;
31 private System.Windows.Forms.DataGrid grdResources;
32 private System.Windows.Forms.Panel pnlAddEditAT;
33 private System.Windows.Forms.Button cmdChangeAT;
34 private System.Windows.Forms.Button cmdAddAT;
35 private System.Windows.Forms.Panel pnlDescriptionAT;
36 private System.Windows.Forms.GroupBox grpDescriptionAT;
37 private System.Windows.Forms.Label label1;
38 private System.Windows.Forms.TabPage tpAccessGroups;
39 private System.Windows.Forms.Button cmdClose;
40 private System.Windows.Forms.TabPage tpResourceGroups;
41 private System.Windows.Forms.Panel pnlAddEditResourceGroups;
42 private System.Windows.Forms.Panel pnlDescriptionResourceGroup;
43 private System.Windows.Forms.GroupBox grpDescriptionResourceGroup;
44 private System.Windows.Forms.Label lblDescriptionResourceGroup;
45 private System.Windows.Forms.Panel pnlAddEditAccessGroup;
46 private System.Windows.Forms.Button cmdRemoveAccessGroup;
47 private System.Windows.Forms.Button cmdAddAccessGroup;
48 private System.Windows.Forms.Panel pnlDescriptionAccessGroups;
49 private System.Windows.Forms.GroupBox grpDescriptionAccessGroups;
50 private System.Windows.Forms.Label lblDescriptionAccessGroups;
51 private System.Windows.Forms.DataGrid grdAccessGroups;
52 private System.Windows.Forms.Button cmdRemoveUser;
53 private System.Windows.Forms.DataGrid grdResourceGroup;
54 private System.Windows.Forms.Button cmdRemoveResourceGroup;
55 private System.Windows.Forms.Button cmdAddResourceGroup;
56 private System.Windows.Forms.Button cmdChangeResourceGroup;
57 private System.Windows.Forms.Button cmdChangeAccessGroup;
58 private System.Windows.Forms.TabPage tpTransferAppts;
59 private System.Windows.Forms.Panel pnlCmdXfer;
60 private System.Windows.Forms.Panel pnlDescriptionXfer;
61 private System.Windows.Forms.Label lblDescriptionXfer;
62 private System.Windows.Forms.GroupBox grpDescriptionXfer;
63 private System.Windows.Forms.DataGrid grdAccessTypes;
64
65 #region Fields
66 private DataTable m_dtResources;
67 private DataView m_dvResources;
68 private DataTable m_dtHospLoc;
69 private DataView m_dvHospLoc;
70 private DataTable m_dtResourceGroup;
71 private DataView m_dvResourceGroup;
72 private DataTable m_dtAccessTypes;
73 private DataView m_dvAccessTypes;
74 private DataTable m_dtAccessGroup;
75 private DataView m_dvAccessGroup;
76 private DataTable m_dtAccessGroupType;
77 private DataView m_dvAccessGroupType;
78 private int m_nATRow;
79 private int m_nResourceRow;
80 private int m_nResourceGroupRow;
81 private int m_nAccessGroupRow;
82 private int m_nResourceID;
83 private int m_nResourceGroupID;
84 private int m_nAccessGroupID;
85 private DataSet m_dsGlobal;
86 private CGDocumentManager m_DocManager;
87 private bool m_bEditUsers;
88 private string m_sMember;
89 private string m_sGroupMember;
90 private string m_sAccessGroupMember;
91 private bool m_bEditGroupItems;
92 private bool m_bEditAccessGroupItems;
93 private string m_sResourceGroupName;
94 private string m_sAccessGroupName;
95 private DataTable m_dtWSGrid;
96 private System.Windows.Forms.Button cmdCopyAppts;
97 private System.Windows.Forms.ComboBox cboRPMSClinic;
98 private System.Windows.Forms.Label label2;
99 private System.Windows.Forms.Label label3;
100 private System.Windows.Forms.DateTimePicker dtpBegin;
101 private System.Windows.Forms.Label label4;
102 private System.Windows.Forms.Label label5;
103 private System.Windows.Forms.DateTimePicker dtpEnd;
104 private System.Windows.Forms.ComboBox cboBSDXClinic;
105 private System.Windows.Forms.TabPage tpWorkStations;
106 private System.Windows.Forms.Panel panel1;
107 private System.Windows.Forms.Button cmdWorkStationsMessage;
108 private System.Windows.Forms.Button cmdWorkStationsShutdown;
109 private System.Windows.Forms.Button cmdWorkStationsRefresh;
110 private System.Windows.Forms.Panel pnlWorkstations;
111 private System.Windows.Forms.GroupBox groupBox1;
112 private System.Windows.Forms.Label lblWorkstations;
113 private System.Windows.Forms.DataGrid grdWorkStations;
114 private TabPage tpConfiguration;
115 private CheckBox chkEventPolling;
116 private Label lblEventPollInterval;
117 private NumericUpDown nudEventPolling;
118 private System.Windows.Forms.TextBox txtSendMessage;
119
120 #endregion Fields
121
122 #region Initialization
123
124 public DManagement()
125 {
126 InitializeComponent();
127
128 m_nATRow = -1;
129 m_nResourceRow = -1;
130 m_nResourceGroupRow = -1;
131 m_nAccessGroupRow = -1;
132 m_nResourceID = 0;
133 m_sMember = "Resource";
134 m_sGroupMember = "Group";
135 m_sAccessGroupMember = "Group";
136
137 }
138
139 public void InitializeDialog(CGDocumentManager docManager)
140 {
141 //System.IntPtr pHandle = this.Handle;
142 //this.m_sMgrHandle = pHandle.ToString()
143 this.m_DocManager = docManager;
144 this.m_dsGlobal = m_DocManager.GlobalDataSet;
145
146 m_DocManager.RemoteSession.EventServices.RpmsEvent += MgrEventHandler;
147 m_DocManager.RemoteSession.EventServices.Subscribe("BSDX WORKSTATION REPORT");
148 m_dtWSGrid = new DataTable("WSGrid");
149 m_dtWSGrid.Columns.Add("UserName", typeof(System.String));
150 m_dtWSGrid.Columns.Add("Handle", typeof(System.String));
151 m_dtWSGrid.Columns.Add("Version", typeof(System.String));
152 m_dtWSGrid.Columns.Add("Views", typeof(System.String));
153
154 this.grdWorkStations.DataSource = m_dtWSGrid;
155
156 //Resources
157 m_dtResources = m_dsGlobal.Tables["Resources"];
158 m_dvResources = new DataView(m_dtResources);
159 m_dvResources.Sort = "RESOURCE_NAME ASC";
160 this.grdResources.DataSource = m_dvResources;
161
162 //Reload ResourceUser table with all users
163 m_dsGlobal.Tables["ResourceUser"].Clear();
164 m_DocManager.LoadResourceUserTable(true);
165
166 //Create DataGridTableStyle for ResourceUser table
167 DataGridTableStyle tsRU = new DataGridTableStyle();
168 tsRU.MappingName = "ResourceUser";
169 tsRU.ReadOnly = true;
170 // Add RESOURCEID column style.
171 DataGridColumnStyle colRUID = new DataGridTextBoxColumn();
172 colRUID.MappingName = "RESOURCEID";
173 colRUID.HeaderText = "Resource ID";
174 colRUID.Width = 0;
175 tsRU.GridColumnStyles.Add(colRUID);
176 // Add RESOURCEUSER_ID column style.
177 DataGridColumnStyle colRUserID = new DataGridTextBoxColumn();
178 colRUserID.MappingName = "RESOURCEUSER_ID";
179 colRUserID.HeaderText = "ResourceUser ID";
180 colRUserID.Width = 15;
181 tsRU.GridColumnStyles.Add(colRUserID);
182 // Add USERNAME column style.
183 DataGridColumnStyle colRUName = new DataGridTextBoxColumn();
184 colRUName.MappingName = "USERNAME";
185 colRUName.HeaderText = "Resource User Name";
186 colRUName.Width = 250;
187 tsRU.GridColumnStyles.Add(colRUName);
188
189 grdResources.TableStyles.Add(tsRU);
190
191 //Create DataGridTableStyle for Resources table
192 DataGridTableStyle tsResource = new DataGridTableStyle();
193 tsResource.MappingName = "Resources";
194 tsResource.ReadOnly = true;
195
196 // Add RESOURCEID column style.
197 DataGridColumnStyle colResID = new DataGridTextBoxColumn();
198 colResID.MappingName = "RESOURCEID";
199 colResID.HeaderText = "Resource ID";
200 colResID.Width = 0;
201 tsResource.GridColumnStyles.Add(colResID);
202
203 // Add RESOURCE_NAME column style.
204 DataGridColumnStyle colResName = new DataGridTextBoxColumn();
205 colResName.MappingName = "RESOURCE_NAME";
206 colResName.HeaderText = "Resource Name";
207 colResName.Width = 250;
208 tsResource.GridColumnStyles.Add(colResName);
209 grdResources.TableStyles.Add(tsResource);
210
211 //ResourceGroup
212 m_dtResourceGroup = m_dsGlobal.Tables["ResourceGroup"];
213 m_dvResourceGroup = new DataView(m_dtResourceGroup);
214 m_dvResourceGroup.Sort = "RESOURCE_GROUP ASC";
215 this.grdResourceGroup.DataSource = m_dvResourceGroup;
216
217 //Create DataGridTableStyle for ResourceGroup table
218 DataGridTableStyle tsResourceGroup = new DataGridTableStyle();
219 tsResourceGroup.MappingName = "ResourceGroup";
220 tsResourceGroup.ReadOnly = true;
221 // Add RESOURCE_GROUPID column style.
222 DataGridColumnStyle colResGroupID = new DataGridTextBoxColumn();
223 colResGroupID.MappingName = "RESOURCE_GROUPID";
224 colResGroupID.HeaderText = "GroupID";
225 colResGroupID.Width = 50;
226 tsResourceGroup.GridColumnStyles.Add(colResGroupID);
227 // Add RESOURCE_GROUP column style.
228 DataGridColumnStyle colResGroup = new DataGridTextBoxColumn();
229 colResGroup.MappingName = "RESOURCE_GROUP";
230 colResGroup.HeaderText = "Group";
231 colResGroup.Width = 250;
232 tsResourceGroup.GridColumnStyles.Add(colResGroup);
233 grdResourceGroup.TableStyles.Add(tsResourceGroup);
234
235 //Create DataGridTableStyle for GroupResources table
236 DataGridTableStyle tsGroupResources = new DataGridTableStyle();
237 tsGroupResources.MappingName = "GroupResources";
238 tsGroupResources.ReadOnly = true;
239 // Add RESOURCE_GROUPID column style.
240 DataGridColumnStyle colResGroupID2 = new DataGridTextBoxColumn();
241 colResGroupID2.MappingName = "RESOURCE_GROUPID";
242 colResGroupID2.HeaderText = "Resource GroupID";
243 colResGroupID2.Width = 50;
244 tsGroupResources.GridColumnStyles.Add(colResGroupID2);
245 // Add RESOURCE_NAME column style.
246 DataGridColumnStyle colGroupRes = new DataGridTextBoxColumn();
247 colGroupRes.MappingName = "RESOURCE_NAME";
248 colGroupRes.HeaderText = "Resource Name";
249 colGroupRes.Width = 250;
250 tsGroupResources.GridColumnStyles.Add(colGroupRes);
251
252
253 // Add RESOURCE_GROUP_ITEMID column style.
254 DataGridColumnStyle colResGroupItemID = new DataGridTextBoxColumn();
255 colResGroupItemID.MappingName = "RESOURCE_GROUP_ITEMID";
256 colResGroupItemID.HeaderText = "Resource ItemID";
257 colResGroupItemID.Width = 50;
258 tsGroupResources.GridColumnStyles.Add(colResGroupItemID);
259 grdResourceGroup.TableStyles.Add(tsGroupResources);
260
261
262 //Access Types
263 m_dtAccessTypes = m_dsGlobal.Tables["AccessTypes"];
264 m_dvAccessTypes = new DataView(m_dtAccessTypes);
265 m_dvAccessTypes.Sort = "ACCESS_TYPE_NAME ASC";
266 this.grdAccessTypes.DataSource = m_dvAccessTypes;
267
268 // Create DataGridTableStyle for AccessTypes table
269 DataGridTableStyle tsAT = new DataGridTableStyle();
270 tsAT.MappingName = "AccessTypes";
271 tsAT.ReadOnly = true;
272
273 // Add ACCESS_TYPE_NAME column style.
274 DataGridColumnStyle colATName = new DataGridTextBoxColumn();
275 colATName.MappingName = "ACCESS_TYPE_NAME";
276 colATName.HeaderText = "Access Type";
277 colATName.Width = 250;
278 tsAT.GridColumnStyles.Add(colATName);
279
280 // Add INACTIVE column style.
281 DataGridColumnStyle colATInactive = new DataGridTextBoxColumn();
282 colATInactive.MappingName = "INACTIVE";
283 colATInactive.HeaderText = "Inactive?";
284 colATInactive.Width = 100;
285 tsAT.GridColumnStyles.Add(colATInactive);
286
287 grdAccessTypes.TableStyles.Add(tsAT);
288
289
290 //Access Groups
291 m_dtAccessGroup = m_dsGlobal.Tables["AccessGroup"];
292 m_dvAccessGroup = new DataView(m_dtAccessGroup);
293 m_dvAccessGroup.Sort = "ACCESS_GROUP ASC";
294 this.grdAccessGroups.DataSource = m_dvAccessGroup;
295
296 // Create DataGridTableStyle for AccessGroup table
297 DataGridTableStyle tsAG = new DataGridTableStyle();
298 tsAG.MappingName = "AccessGroup";
299 tsAG.ReadOnly = true;
300
301 // Add BMXIEN column style.
302 DataGridColumnStyle colAGID = new DataGridTextBoxColumn();
303 colAGID.MappingName = "BMXIEN";
304 colAGID.HeaderText = "Access Group ID";
305 colAGID.Width = 50;
306 tsAG.GridColumnStyles.Add(colAGID);
307
308 // Add ACCESS_GROUP column style.
309 DataGridColumnStyle colAGNAME = new DataGridTextBoxColumn();
310 colAGNAME.MappingName = "ACCESS_GROUP";
311 colAGNAME.HeaderText = "Access Group";
312 colAGNAME.Width = 150;
313 tsAG.GridColumnStyles.Add(colAGNAME);
314
315 grdAccessGroups.TableStyles.Add(tsAG);
316
317 //Access Group Types
318 m_dtAccessGroupType = m_dsGlobal.Tables["AccessGroupType"];
319 m_dvAccessGroupType = new DataView(m_dtAccessGroupType);
320
321 // Create DataGridTableStyle for AccessGroupType table
322 DataGridTableStyle tsAGTP = new DataGridTableStyle();
323 tsAGTP.MappingName = "AccessGroupType";
324 tsAGTP.ReadOnly = true;
325
326 // 0 Add ACCESS_GROUP_TYPEID column style.
327 DataGridColumnStyle colAGTPID = new DataGridTextBoxColumn();
328 colAGTPID.MappingName = "ACCESS_GROUP_TYPEID";
329 colAGTPID.HeaderText = "Access Group Type ID";
330 colAGTPID.Width = 0;
331 tsAGTP.GridColumnStyles.Add(colAGTPID);
332
333 // 1 Add ACCESS_GROUP_ID column style.
334 DataGridColumnStyle colAGTPGroupID = new DataGridTextBoxColumn();
335 colAGTPGroupID.MappingName = "ACCESS_GROUP_ID";
336 colAGTPGroupID.HeaderText = "Access Group ID";
337 colAGTPGroupID.Width = 0;
338 tsAGTP.GridColumnStyles.Add(colAGTPGroupID);
339
340 // 2 Add ACCESS_GROUP column style.
341 DataGridColumnStyle colAGTPGroup = new DataGridTextBoxColumn();
342 colAGTPGroup.MappingName = "ACCESS_GROUP";
343 colAGTPGroup.HeaderText = "Access Group";
344 colAGTPGroup.Width = 0;
345 tsAGTP.GridColumnStyles.Add(colAGTPGroup);
346
347 // 3 Add ACCESS_TYPE_ID column style.
348 DataGridColumnStyle colAGTPTypeID = new DataGridTextBoxColumn();
349 colAGTPTypeID.MappingName = "ACCESS_TYPE_ID";
350 colAGTPTypeID.HeaderText = "Access TypeID";
351 colAGTPTypeID.Width = 0;
352 tsAGTP.GridColumnStyles.Add(colAGTPTypeID);
353
354 // 4 Add ACCESS_TYPE column style.
355 DataGridColumnStyle colAGTPType = new DataGridTextBoxColumn();
356 colAGTPType.MappingName = "ACCESS_TYPE";
357 colAGTPType.HeaderText = "Access Type";
358 colAGTPType.Width = 150;
359 tsAGTP.GridColumnStyles.Add(colAGTPType);
360
361 grdAccessGroups.TableStyles.Add(tsAGTP);
362
363
364 //Find out if there are any grdResources rows and
365 //enable command buttons accordingly
366 int nRows = this.grdResources.VisibleRowCount;
367 if (nRows == 0)
368 {
369 this.cmdChangeResource.Enabled = false;
370 this.cmdRemoveUser.Enabled = false;
371 }
372 else
373 {
374 grdResources.CurrentCell = new DataGridCell(0, 0);
375 this.cmdChangeResource.Enabled = true;
376 this.cmdRemoveUser.Enabled = true;
377
378 }
379
380 //Copy Appointments TabPage
381 m_dtHospLoc = m_dsGlobal.Tables["HospitalLocation"];
382 m_dvHospLoc = new DataView(m_dtHospLoc);
383 m_dvHospLoc.Sort = "HOSPITAL_LOCATION ASC";
384 cboRPMSClinic.DataSource = m_dvHospLoc;
385 cboRPMSClinic.DisplayMember = "HOSPITAL_LOCATION";
386 cboRPMSClinic.ValueMember = "HOSPITAL_LOCATION_ID";
387 cboBSDXClinic.DataSource = m_dvResources;
388 cboBSDXClinic.DisplayMember = "RESOURCE_NAME";
389 cboBSDXClinic.ValueMember = "RESOURCEID";
390
391 string result = docManager.RemoteSession.TransmitRPC("VEFA GET BMX POLL INTERVAL", "");
392 if (result.Split('^')[0] == "1")
393 {
394 chkEventPolling.Checked = true;
395 nudEventPolling.Enabled = true;
396 nudEventPolling.Value = Convert.ToInt32(result.Split('^')[1]);
397 }
398 }
399
400 private void DManagement_Load(object sender, System.EventArgs e)
401 {
402 this.cmdChangeResource.Enabled = false;
403 this.cmdRemoveUser.Enabled = false;
404 //Select the grid's zeroeth row
405 if (m_dvResources.Count > 0)
406 {
407 this.grdResources.CurrentCell = new DataGridCell(0,0);
408 this.grdResources.Select(0);
409 this.m_nResourceRow=0;
410 Object dgItem = grdResources[0,0];
411 this.m_nResourceID = Convert.ToInt16(dgItem);
412 this.cmdChangeResource.Enabled = true;
413 this.cmdRemoveUser.Enabled = true;
414 }
415
416 this.cmdChangeResourceGroup.Enabled = false;
417 this.cmdRemoveResourceGroup.Enabled = false;
418 if (this.m_dvResourceGroup.Count > 0)
419 {
420 this.m_nResourceGroupRow = 0;
421 this.cmdChangeResourceGroup.Enabled = true;
422 this.cmdRemoveResourceGroup.Enabled = true;
423 }
424
425 this.cmdChangeAccessGroup.Enabled = false;
426 this.cmdRemoveAccessGroup.Enabled = false;
427 if (this.m_dvAccessGroup.Count > 0)
428 {
429 this.m_nAccessGroupRow = 0;
430 this.cmdChangeAccessGroup.Enabled = true;
431 this.cmdRemoveAccessGroup.Enabled = true;
432 }
433
434 this.cmdChangeAT.Enabled = false;
435 if (this.m_dvAccessTypes.Count > 0)
436 {
437 this.m_nATRow = 0;
438 this.cmdChangeAT.Enabled = true;
439 }
440 }
441
442 protected override void Dispose( bool disposing )
443 {
444 if( disposing )
445 {
446 if(components != null)
447 {
448 components.Dispose();
449 }
450 }
451 base.Dispose( disposing );
452 }
453
454 #endregion Initialization
455
456 #region Windows Form Designer generated code
457 /// <summary>
458 /// Required method for Designer support - do not modify
459 /// the contents of this method with the code editor.
460 /// </summary>
461 private void InitializeComponent()
462 {
463 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DManagement));
464 this.pnlPageBottom = new System.Windows.Forms.Panel();
465 this.cmdClose = new System.Windows.Forms.Button();
466 this.tabMain = new System.Windows.Forms.TabControl();
467 this.tpResources = new System.Windows.Forms.TabPage();
468 this.pnlResources = new System.Windows.Forms.Panel();
469 this.grdResources = new System.Windows.Forms.DataGrid();
470 this.pnlDescription = new System.Windows.Forms.Panel();
471 this.grpDescription = new System.Windows.Forms.GroupBox();
472 this.lblDescription = new System.Windows.Forms.Label();
473 this.pnlAddEdit = new System.Windows.Forms.Panel();
474 this.cmdRemoveUser = new System.Windows.Forms.Button();
475 this.cmdChangeResource = new System.Windows.Forms.Button();
476 this.cmdAddResource = new System.Windows.Forms.Button();
477 this.tpResourceGroups = new System.Windows.Forms.TabPage();
478 this.grdResourceGroup = new System.Windows.Forms.DataGrid();
479 this.pnlDescriptionResourceGroup = new System.Windows.Forms.Panel();
480 this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
481 this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
482 this.pnlAddEditResourceGroups = new System.Windows.Forms.Panel();
483 this.cmdChangeResourceGroup = new System.Windows.Forms.Button();
484 this.cmdRemoveResourceGroup = new System.Windows.Forms.Button();
485 this.cmdAddResourceGroup = new System.Windows.Forms.Button();
486 this.tpAccessTypes = new System.Windows.Forms.TabPage();
487 this.grdAccessTypes = new System.Windows.Forms.DataGrid();
488 this.pnlDescriptionAT = new System.Windows.Forms.Panel();
489 this.grpDescriptionAT = new System.Windows.Forms.GroupBox();
490 this.label1 = new System.Windows.Forms.Label();
491 this.pnlAddEditAT = new System.Windows.Forms.Panel();
492 this.cmdChangeAT = new System.Windows.Forms.Button();
493 this.cmdAddAT = new System.Windows.Forms.Button();
494 this.tpAccessGroups = new System.Windows.Forms.TabPage();
495 this.grdAccessGroups = new System.Windows.Forms.DataGrid();
496 this.pnlDescriptionAccessGroups = new System.Windows.Forms.Panel();
497 this.grpDescriptionAccessGroups = new System.Windows.Forms.GroupBox();
498 this.lblDescriptionAccessGroups = new System.Windows.Forms.Label();
499 this.pnlAddEditAccessGroup = new System.Windows.Forms.Panel();
500 this.cmdChangeAccessGroup = new System.Windows.Forms.Button();
501 this.cmdRemoveAccessGroup = new System.Windows.Forms.Button();
502 this.cmdAddAccessGroup = new System.Windows.Forms.Button();
503 this.tpTransferAppts = new System.Windows.Forms.TabPage();
504 this.label5 = new System.Windows.Forms.Label();
505 this.dtpEnd = new System.Windows.Forms.DateTimePicker();
506 this.label4 = new System.Windows.Forms.Label();
507 this.dtpBegin = new System.Windows.Forms.DateTimePicker();
508 this.label3 = new System.Windows.Forms.Label();
509 this.cboBSDXClinic = new System.Windows.Forms.ComboBox();
510 this.label2 = new System.Windows.Forms.Label();
511 this.cboRPMSClinic = new System.Windows.Forms.ComboBox();
512 this.pnlDescriptionXfer = new System.Windows.Forms.Panel();
513 this.grpDescriptionXfer = new System.Windows.Forms.GroupBox();
514 this.lblDescriptionXfer = new System.Windows.Forms.Label();
515 this.pnlCmdXfer = new System.Windows.Forms.Panel();
516 this.cmdCopyAppts = new System.Windows.Forms.Button();
517 this.tpWorkStations = new System.Windows.Forms.TabPage();
518 this.grdWorkStations = new System.Windows.Forms.DataGrid();
519 this.pnlWorkstations = new System.Windows.Forms.Panel();
520 this.groupBox1 = new System.Windows.Forms.GroupBox();
521 this.lblWorkstations = new System.Windows.Forms.Label();
522 this.panel1 = new System.Windows.Forms.Panel();
523 this.txtSendMessage = new System.Windows.Forms.TextBox();
524 this.cmdWorkStationsMessage = new System.Windows.Forms.Button();
525 this.cmdWorkStationsShutdown = new System.Windows.Forms.Button();
526 this.cmdWorkStationsRefresh = new System.Windows.Forms.Button();
527 this.tpConfiguration = new System.Windows.Forms.TabPage();
528 this.nudEventPolling = new System.Windows.Forms.NumericUpDown();
529 this.lblEventPollInterval = new System.Windows.Forms.Label();
530 this.chkEventPolling = new System.Windows.Forms.CheckBox();
531 this.pnlPageBottom.SuspendLayout();
532 this.tabMain.SuspendLayout();
533 this.tpResources.SuspendLayout();
534 this.pnlResources.SuspendLayout();
535 ((System.ComponentModel.ISupportInitialize)(this.grdResources)).BeginInit();
536 this.pnlDescription.SuspendLayout();
537 this.grpDescription.SuspendLayout();
538 this.pnlAddEdit.SuspendLayout();
539 this.tpResourceGroups.SuspendLayout();
540 ((System.ComponentModel.ISupportInitialize)(this.grdResourceGroup)).BeginInit();
541 this.pnlDescriptionResourceGroup.SuspendLayout();
542 this.grpDescriptionResourceGroup.SuspendLayout();
543 this.pnlAddEditResourceGroups.SuspendLayout();
544 this.tpAccessTypes.SuspendLayout();
545 ((System.ComponentModel.ISupportInitialize)(this.grdAccessTypes)).BeginInit();
546 this.pnlDescriptionAT.SuspendLayout();
547 this.grpDescriptionAT.SuspendLayout();
548 this.pnlAddEditAT.SuspendLayout();
549 this.tpAccessGroups.SuspendLayout();
550 ((System.ComponentModel.ISupportInitialize)(this.grdAccessGroups)).BeginInit();
551 this.pnlDescriptionAccessGroups.SuspendLayout();
552 this.grpDescriptionAccessGroups.SuspendLayout();
553 this.pnlAddEditAccessGroup.SuspendLayout();
554 this.tpTransferAppts.SuspendLayout();
555 this.pnlDescriptionXfer.SuspendLayout();
556 this.grpDescriptionXfer.SuspendLayout();
557 this.pnlCmdXfer.SuspendLayout();
558 this.tpWorkStations.SuspendLayout();
559 ((System.ComponentModel.ISupportInitialize)(this.grdWorkStations)).BeginInit();
560 this.pnlWorkstations.SuspendLayout();
561 this.groupBox1.SuspendLayout();
562 this.panel1.SuspendLayout();
563 this.tpConfiguration.SuspendLayout();
564 ((System.ComponentModel.ISupportInitialize)(this.nudEventPolling)).BeginInit();
565 this.SuspendLayout();
566 //
567 // pnlPageBottom
568 //
569 this.pnlPageBottom.Controls.Add(this.cmdClose);
570 this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
571 this.pnlPageBottom.Location = new System.Drawing.Point(0, 454);
572 this.pnlPageBottom.Name = "pnlPageBottom";
573 this.pnlPageBottom.Size = new System.Drawing.Size(704, 40);
574 this.pnlPageBottom.TabIndex = 3;
575 //
576 // cmdClose
577 //
578 this.cmdClose.DialogResult = System.Windows.Forms.DialogResult.OK;
579 this.cmdClose.Location = new System.Drawing.Point(600, 8);
580 this.cmdClose.Name = "cmdClose";
581 this.cmdClose.Size = new System.Drawing.Size(96, 24);
582 this.cmdClose.TabIndex = 0;
583 this.cmdClose.Text = "Close";
584 //
585 // tabMain
586 //
587 this.tabMain.Controls.Add(this.tpResources);
588 this.tabMain.Controls.Add(this.tpResourceGroups);
589 this.tabMain.Controls.Add(this.tpAccessTypes);
590 this.tabMain.Controls.Add(this.tpAccessGroups);
591 this.tabMain.Controls.Add(this.tpTransferAppts);
592 this.tabMain.Controls.Add(this.tpWorkStations);
593 this.tabMain.Controls.Add(this.tpConfiguration);
594 this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill;
595 this.tabMain.Location = new System.Drawing.Point(0, 0);
596 this.tabMain.Name = "tabMain";
597 this.tabMain.SelectedIndex = 0;
598 this.tabMain.Size = new System.Drawing.Size(704, 454);
599 this.tabMain.TabIndex = 4;
600 this.tabMain.Click += new System.EventHandler(this.tabMain_Click);
601 //
602 // tpResources
603 //
604 this.tpResources.Controls.Add(this.pnlResources);
605 this.tpResources.Controls.Add(this.pnlDescription);
606 this.tpResources.Controls.Add(this.pnlAddEdit);
607 this.tpResources.Location = new System.Drawing.Point(4, 22);
608 this.tpResources.Name = "tpResources";
609 this.tpResources.Size = new System.Drawing.Size(696, 428);
610 this.tpResources.TabIndex = 0;
611 this.tpResources.Text = "Resources and Users";
612 //
613 // pnlResources
614 //
615 this.pnlResources.Controls.Add(this.grdResources);
616 this.pnlResources.Dock = System.Windows.Forms.DockStyle.Fill;
617 this.pnlResources.Location = new System.Drawing.Point(0, 0);
618 this.pnlResources.Name = "pnlResources";
619 this.pnlResources.Size = new System.Drawing.Size(696, 316);
620 this.pnlResources.TabIndex = 2;
621 //
622 // grdResources
623 //
624 this.grdResources.DataMember = "";
625 this.grdResources.Dock = System.Windows.Forms.DockStyle.Fill;
626 this.grdResources.HeaderForeColor = System.Drawing.SystemColors.ControlText;
627 this.grdResources.Location = new System.Drawing.Point(0, 0);
628 this.grdResources.Name = "grdResources";
629 this.grdResources.ReadOnly = true;
630 this.grdResources.Size = new System.Drawing.Size(696, 316);
631 this.grdResources.TabIndex = 0;
632 this.grdResources.CurrentCellChanged += new System.EventHandler(this.grdResources_CurrentCellChanged);
633 this.grdResources.Navigate += new System.Windows.Forms.NavigateEventHandler(this.grdResources_Navigate);
634 //
635 // pnlDescription
636 //
637 this.pnlDescription.Controls.Add(this.grpDescription);
638 this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
639 this.pnlDescription.Location = new System.Drawing.Point(0, 316);
640 this.pnlDescription.Name = "pnlDescription";
641 this.pnlDescription.Size = new System.Drawing.Size(696, 72);
642 this.pnlDescription.TabIndex = 1;
643 //
644 // grpDescription
645 //
646 this.grpDescription.Controls.Add(this.lblDescription);
647 this.grpDescription.Dock = System.Windows.Forms.DockStyle.Fill;
648 this.grpDescription.Location = new System.Drawing.Point(0, 0);
649 this.grpDescription.Name = "grpDescription";
650 this.grpDescription.Size = new System.Drawing.Size(696, 72);
651 this.grpDescription.TabIndex = 0;
652 this.grpDescription.TabStop = false;
653 this.grpDescription.Text = "Description";
654 //
655 // lblDescription
656 //
657 this.lblDescription.Dock = System.Windows.Forms.DockStyle.Fill;
658 this.lblDescription.Location = new System.Drawing.Point(3, 16);
659 this.lblDescription.Name = "lblDescription";
660 this.lblDescription.Size = new System.Drawing.Size(690, 53);
661 this.lblDescription.TabIndex = 0;
662 this.lblDescription.Text = resources.GetString("lblDescription.Text");
663 //
664 // pnlAddEdit
665 //
666 this.pnlAddEdit.Controls.Add(this.cmdRemoveUser);
667 this.pnlAddEdit.Controls.Add(this.cmdChangeResource);
668 this.pnlAddEdit.Controls.Add(this.cmdAddResource);
669 this.pnlAddEdit.Dock = System.Windows.Forms.DockStyle.Bottom;
670 this.pnlAddEdit.Location = new System.Drawing.Point(0, 388);
671 this.pnlAddEdit.Name = "pnlAddEdit";
672 this.pnlAddEdit.Size = new System.Drawing.Size(696, 40);
673 this.pnlAddEdit.TabIndex = 0;
674 //
675 // cmdRemoveUser
676 //
677 this.cmdRemoveUser.Location = new System.Drawing.Point(304, 8);
678 this.cmdRemoveUser.Name = "cmdRemoveUser";
679 this.cmdRemoveUser.Size = new System.Drawing.Size(128, 24);
680 this.cmdRemoveUser.TabIndex = 3;
681 this.cmdRemoveUser.Text = "&Remove User";
682 this.cmdRemoveUser.Visible = false;
683 this.cmdRemoveUser.Click += new System.EventHandler(this.cmdRemoveUser_Click);
684 //
685 // cmdChangeResource
686 //
687 this.cmdChangeResource.Enabled = false;
688 this.cmdChangeResource.Location = new System.Drawing.Point(160, 8);
689 this.cmdChangeResource.Name = "cmdChangeResource";
690 this.cmdChangeResource.Size = new System.Drawing.Size(128, 24);
691 this.cmdChangeResource.TabIndex = 1;
692 this.cmdChangeResource.Text = "&Change...";
693 this.cmdChangeResource.Click += new System.EventHandler(this.cmdChangeResource_Click);
694 //
695 // cmdAddResource
696 //
697 this.cmdAddResource.Location = new System.Drawing.Point(16, 8);
698 this.cmdAddResource.Name = "cmdAddResource";
699 this.cmdAddResource.Size = new System.Drawing.Size(128, 24);
700 this.cmdAddResource.TabIndex = 0;
701 this.cmdAddResource.Text = "&Add...";
702 this.cmdAddResource.Click += new System.EventHandler(this.cmdAddResource_Click);
703 //
704 // tpResourceGroups
705 //
706 this.tpResourceGroups.Controls.Add(this.grdResourceGroup);
707 this.tpResourceGroups.Controls.Add(this.pnlDescriptionResourceGroup);
708 this.tpResourceGroups.Controls.Add(this.pnlAddEditResourceGroups);
709 this.tpResourceGroups.Location = new System.Drawing.Point(4, 22);
710 this.tpResourceGroups.Name = "tpResourceGroups";
711 this.tpResourceGroups.Size = new System.Drawing.Size(696, 428);
712 this.tpResourceGroups.TabIndex = 4;
713 this.tpResourceGroups.Text = "Resource Groups";
714 //
715 // grdResourceGroup
716 //
717 this.grdResourceGroup.AccessibleName = "DataGrid";
718 this.grdResourceGroup.AccessibleRole = System.Windows.Forms.AccessibleRole.Table;
719 this.grdResourceGroup.DataMember = "";
720 this.grdResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
721 this.grdResourceGroup.HeaderForeColor = System.Drawing.SystemColors.ControlText;
722 this.grdResourceGroup.Location = new System.Drawing.Point(0, 0);
723 this.grdResourceGroup.Name = "grdResourceGroup";
724 this.grdResourceGroup.ReadOnly = true;
725 this.grdResourceGroup.Size = new System.Drawing.Size(696, 316);
726 this.grdResourceGroup.TabIndex = 4;
727 this.grdResourceGroup.CurrentCellChanged += new System.EventHandler(this.grdResourceGroup_CurrentCellChanged);
728 this.grdResourceGroup.Navigate += new System.Windows.Forms.NavigateEventHandler(this.grdResourceGroup_Navigate);
729 //
730 // pnlDescriptionResourceGroup
731 //
732 this.pnlDescriptionResourceGroup.Controls.Add(this.grpDescriptionResourceGroup);
733 this.pnlDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Bottom;
734 this.pnlDescriptionResourceGroup.Location = new System.Drawing.Point(0, 316);
735 this.pnlDescriptionResourceGroup.Name = "pnlDescriptionResourceGroup";
736 this.pnlDescriptionResourceGroup.Size = new System.Drawing.Size(696, 72);
737 this.pnlDescriptionResourceGroup.TabIndex = 3;
738 //
739 // grpDescriptionResourceGroup
740 //
741 this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
742 this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
743 this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
744 this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
745 this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(696, 72);
746 this.grpDescriptionResourceGroup.TabIndex = 0;
747 this.grpDescriptionResourceGroup.TabStop = false;
748 this.grpDescriptionResourceGroup.Text = "Description";
749 //
750 // lblDescriptionResourceGroup
751 //
752 this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
753 this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
754 this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
755 this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(690, 53);
756 this.lblDescriptionResourceGroup.TabIndex = 0;
757 this.lblDescriptionResourceGroup.Text = resources.GetString("lblDescriptionResourceGroup.Text");
758 //
759 // pnlAddEditResourceGroups
760 //
761 this.pnlAddEditResourceGroups.Controls.Add(this.cmdChangeResourceGroup);
762 this.pnlAddEditResourceGroups.Controls.Add(this.cmdRemoveResourceGroup);
763 this.pnlAddEditResourceGroups.Controls.Add(this.cmdAddResourceGroup);
764 this.pnlAddEditResourceGroups.Dock = System.Windows.Forms.DockStyle.Bottom;
765 this.pnlAddEditResourceGroups.Location = new System.Drawing.Point(0, 388);
766 this.pnlAddEditResourceGroups.Name = "pnlAddEditResourceGroups";
767 this.pnlAddEditResourceGroups.Size = new System.Drawing.Size(696, 40);
768 this.pnlAddEditResourceGroups.TabIndex = 2;
769 //
770 // cmdChangeResourceGroup
771 //
772 this.cmdChangeResourceGroup.Enabled = false;
773 this.cmdChangeResourceGroup.Location = new System.Drawing.Point(160, 8);
774 this.cmdChangeResourceGroup.Name = "cmdChangeResourceGroup";
775 this.cmdChangeResourceGroup.Size = new System.Drawing.Size(128, 24);
776 this.cmdChangeResourceGroup.TabIndex = 2;
777 this.cmdChangeResourceGroup.Text = "&Change Group";
778 this.cmdChangeResourceGroup.Click += new System.EventHandler(this.cmdChangeResourceGroup_Click);
779 //
780 // cmdRemoveResourceGroup
781 //
782 this.cmdRemoveResourceGroup.Enabled = false;
783 this.cmdRemoveResourceGroup.Location = new System.Drawing.Point(304, 8);
784 this.cmdRemoveResourceGroup.Name = "cmdRemoveResourceGroup";
785 this.cmdRemoveResourceGroup.Size = new System.Drawing.Size(128, 24);
786 this.cmdRemoveResourceGroup.TabIndex = 1;
787 this.cmdRemoveResourceGroup.Text = "&Remove Group";
788 this.cmdRemoveResourceGroup.Click += new System.EventHandler(this.cmdRemoveResourceGroup_Click);
789 //
790 // cmdAddResourceGroup
791 //
792 this.cmdAddResourceGroup.Location = new System.Drawing.Point(16, 8);
793 this.cmdAddResourceGroup.Name = "cmdAddResourceGroup";
794 this.cmdAddResourceGroup.Size = new System.Drawing.Size(128, 24);
795 this.cmdAddResourceGroup.TabIndex = 0;
796 this.cmdAddResourceGroup.Text = "&Add Group";
797 this.cmdAddResourceGroup.Click += new System.EventHandler(this.cmdAddResourceGroup_Click);
798 //
799 // tpAccessTypes
800 //
801 this.tpAccessTypes.Controls.Add(this.grdAccessTypes);
802 this.tpAccessTypes.Controls.Add(this.pnlDescriptionAT);
803 this.tpAccessTypes.Controls.Add(this.pnlAddEditAT);
804 this.tpAccessTypes.Location = new System.Drawing.Point(4, 22);
805 this.tpAccessTypes.Name = "tpAccessTypes";
806 this.tpAccessTypes.Size = new System.Drawing.Size(696, 428);
807 this.tpAccessTypes.TabIndex = 2;
808 this.tpAccessTypes.Text = "Access Types";
809 //
810 // grdAccessTypes
811 //
812 this.grdAccessTypes.DataMember = "";
813 this.grdAccessTypes.Dock = System.Windows.Forms.DockStyle.Fill;
814 this.grdAccessTypes.HeaderForeColor = System.Drawing.SystemColors.ControlText;
815 this.grdAccessTypes.Location = new System.Drawing.Point(0, 0);
816 this.grdAccessTypes.Name = "grdAccessTypes";
817 this.grdAccessTypes.ReadOnly = true;
818 this.grdAccessTypes.RowHeadersVisible = false;
819 this.grdAccessTypes.Size = new System.Drawing.Size(696, 316);
820 this.grdAccessTypes.TabIndex = 3;
821 this.grdAccessTypes.CurrentCellChanged += new System.EventHandler(this.grdAccessTypes_CurrentCellChanged);
822 //
823 // pnlDescriptionAT
824 //
825 this.pnlDescriptionAT.Controls.Add(this.grpDescriptionAT);
826 this.pnlDescriptionAT.Dock = System.Windows.Forms.DockStyle.Bottom;
827 this.pnlDescriptionAT.Location = new System.Drawing.Point(0, 316);
828 this.pnlDescriptionAT.Name = "pnlDescriptionAT";
829 this.pnlDescriptionAT.Size = new System.Drawing.Size(696, 72);
830 this.pnlDescriptionAT.TabIndex = 2;
831 //
832 // grpDescriptionAT
833 //
834 this.grpDescriptionAT.Controls.Add(this.label1);
835 this.grpDescriptionAT.Dock = System.Windows.Forms.DockStyle.Fill;
836 this.grpDescriptionAT.Location = new System.Drawing.Point(0, 0);
837 this.grpDescriptionAT.Name = "grpDescriptionAT";
838 this.grpDescriptionAT.Size = new System.Drawing.Size(696, 72);
839 this.grpDescriptionAT.TabIndex = 0;
840 this.grpDescriptionAT.TabStop = false;
841 this.grpDescriptionAT.Text = "Description";
842 //
843 // label1
844 //
845 this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
846 this.label1.Location = new System.Drawing.Point(3, 16);
847 this.label1.Name = "label1";
848 this.label1.Size = new System.Drawing.Size(690, 53);
849 this.label1.TabIndex = 1;
850 this.label1.Text = " Use the Access Types panel to define the kinds of access available for schedulin" +
851 "g at this facility. Common types of access include Walkin, Scheduled, Same Day," +
852 " and Dental Expanded Functions.";
853 //
854 // pnlAddEditAT
855 //
856 this.pnlAddEditAT.Controls.Add(this.cmdChangeAT);
857 this.pnlAddEditAT.Controls.Add(this.cmdAddAT);
858 this.pnlAddEditAT.Dock = System.Windows.Forms.DockStyle.Bottom;
859 this.pnlAddEditAT.Location = new System.Drawing.Point(0, 388);
860 this.pnlAddEditAT.Name = "pnlAddEditAT";
861 this.pnlAddEditAT.Size = new System.Drawing.Size(696, 40);
862 this.pnlAddEditAT.TabIndex = 1;
863 //
864 // cmdChangeAT
865 //
866 this.cmdChangeAT.Location = new System.Drawing.Point(160, 8);
867 this.cmdChangeAT.Name = "cmdChangeAT";
868 this.cmdChangeAT.Size = new System.Drawing.Size(128, 24);
869 this.cmdChangeAT.TabIndex = 1;
870 this.cmdChangeAT.Text = "&Change Access Type";
871 this.cmdChangeAT.Click += new System.EventHandler(this.cmdChangeAT_Click);
872 //
873 // cmdAddAT
874 //
875 this.cmdAddAT.Location = new System.Drawing.Point(16, 8);
876 this.cmdAddAT.Name = "cmdAddAT";
877 this.cmdAddAT.Size = new System.Drawing.Size(128, 24);
878 this.cmdAddAT.TabIndex = 0;
879 this.cmdAddAT.Text = "&Add Access Type";
880 this.cmdAddAT.Click += new System.EventHandler(this.cmdAddAT_Click);
881 //
882 // tpAccessGroups
883 //
884 this.tpAccessGroups.Controls.Add(this.grdAccessGroups);
885 this.tpAccessGroups.Controls.Add(this.pnlDescriptionAccessGroups);
886 this.tpAccessGroups.Controls.Add(this.pnlAddEditAccessGroup);
887 this.tpAccessGroups.Location = new System.Drawing.Point(4, 22);
888 this.tpAccessGroups.Name = "tpAccessGroups";
889 this.tpAccessGroups.Size = new System.Drawing.Size(696, 428);
890 this.tpAccessGroups.TabIndex = 1;
891 this.tpAccessGroups.Text = "Access Groups";
892 //
893 // grdAccessGroups
894 //
895 this.grdAccessGroups.AccessibleName = "DataGrid";
896 this.grdAccessGroups.AccessibleRole = System.Windows.Forms.AccessibleRole.Table;
897 this.grdAccessGroups.DataMember = "";
898 this.grdAccessGroups.Dock = System.Windows.Forms.DockStyle.Fill;
899 this.grdAccessGroups.HeaderForeColor = System.Drawing.SystemColors.ControlText;
900 this.grdAccessGroups.Location = new System.Drawing.Point(0, 0);
901 this.grdAccessGroups.Name = "grdAccessGroups";
902 this.grdAccessGroups.ReadOnly = true;
903 this.grdAccessGroups.Size = new System.Drawing.Size(696, 316);
904 this.grdAccessGroups.TabIndex = 5;
905 this.grdAccessGroups.CurrentCellChanged += new System.EventHandler(this.grdAccessGroups_CurrentCellChanged);
906 this.grdAccessGroups.Navigate += new System.Windows.Forms.NavigateEventHandler(this.grdAccessGroups_Navigate);
907 //
908 // pnlDescriptionAccessGroups
909 //
910 this.pnlDescriptionAccessGroups.Controls.Add(this.grpDescriptionAccessGroups);
911 this.pnlDescriptionAccessGroups.Dock = System.Windows.Forms.DockStyle.Bottom;
912 this.pnlDescriptionAccessGroups.Location = new System.Drawing.Point(0, 316);
913 this.pnlDescriptionAccessGroups.Name = "pnlDescriptionAccessGroups";
914 this.pnlDescriptionAccessGroups.Size = new System.Drawing.Size(696, 72);
915 this.pnlDescriptionAccessGroups.TabIndex = 4;
916 //
917 // grpDescriptionAccessGroups
918 //
919 this.grpDescriptionAccessGroups.Controls.Add(this.lblDescriptionAccessGroups);
920 this.grpDescriptionAccessGroups.Dock = System.Windows.Forms.DockStyle.Fill;
921 this.grpDescriptionAccessGroups.Location = new System.Drawing.Point(0, 0);
922 this.grpDescriptionAccessGroups.Name = "grpDescriptionAccessGroups";
923 this.grpDescriptionAccessGroups.Size = new System.Drawing.Size(696, 72);
924 this.grpDescriptionAccessGroups.TabIndex = 0;
925 this.grpDescriptionAccessGroups.TabStop = false;
926 this.grpDescriptionAccessGroups.Text = "Description";
927 //
928 // lblDescriptionAccessGroups
929 //
930 this.lblDescriptionAccessGroups.Dock = System.Windows.Forms.DockStyle.Fill;
931 this.lblDescriptionAccessGroups.Location = new System.Drawing.Point(3, 16);
932 this.lblDescriptionAccessGroups.Name = "lblDescriptionAccessGroups";
933 this.lblDescriptionAccessGroups.Size = new System.Drawing.Size(690, 53);
934 this.lblDescriptionAccessGroups.TabIndex = 0;
935 this.lblDescriptionAccessGroups.Text = resources.GetString("lblDescriptionAccessGroups.Text");
936 //
937 // pnlAddEditAccessGroup
938 //
939 this.pnlAddEditAccessGroup.Controls.Add(this.cmdChangeAccessGroup);
940 this.pnlAddEditAccessGroup.Controls.Add(this.cmdRemoveAccessGroup);
941 this.pnlAddEditAccessGroup.Controls.Add(this.cmdAddAccessGroup);
942 this.pnlAddEditAccessGroup.Dock = System.Windows.Forms.DockStyle.Bottom;
943 this.pnlAddEditAccessGroup.Location = new System.Drawing.Point(0, 388);
944 this.pnlAddEditAccessGroup.Name = "pnlAddEditAccessGroup";
945 this.pnlAddEditAccessGroup.Size = new System.Drawing.Size(696, 40);
946 this.pnlAddEditAccessGroup.TabIndex = 3;
947 //
948 // cmdChangeAccessGroup
949 //
950 this.cmdChangeAccessGroup.Enabled = false;
951 this.cmdChangeAccessGroup.Location = new System.Drawing.Point(160, 8);
952 this.cmdChangeAccessGroup.Name = "cmdChangeAccessGroup";
953 this.cmdChangeAccessGroup.Size = new System.Drawing.Size(128, 24);
954 this.cmdChangeAccessGroup.TabIndex = 3;
955 this.cmdChangeAccessGroup.Text = "&Change Group";
956 this.cmdChangeAccessGroup.Click += new System.EventHandler(this.cmdChangeAccessGroup_Click);
957 //
958 // cmdRemoveAccessGroup
959 //
960 this.cmdRemoveAccessGroup.Enabled = false;
961 this.cmdRemoveAccessGroup.Location = new System.Drawing.Point(304, 8);
962 this.cmdRemoveAccessGroup.Name = "cmdRemoveAccessGroup";
963 this.cmdRemoveAccessGroup.Size = new System.Drawing.Size(128, 24);
964 this.cmdRemoveAccessGroup.TabIndex = 1;
965 this.cmdRemoveAccessGroup.Text = "&Remove Group";
966 this.cmdRemoveAccessGroup.Click += new System.EventHandler(this.cmdRemoveAccessGroup_Click);
967 //
968 // cmdAddAccessGroup
969 //
970 this.cmdAddAccessGroup.Location = new System.Drawing.Point(16, 8);
971 this.cmdAddAccessGroup.Name = "cmdAddAccessGroup";
972 this.cmdAddAccessGroup.Size = new System.Drawing.Size(128, 24);
973 this.cmdAddAccessGroup.TabIndex = 0;
974 this.cmdAddAccessGroup.Text = "&Add Group";
975 this.cmdAddAccessGroup.Click += new System.EventHandler(this.cmdAddAccessGroup_Click);
976 //
977 // tpTransferAppts
978 //
979 this.tpTransferAppts.Controls.Add(this.label5);
980 this.tpTransferAppts.Controls.Add(this.dtpEnd);
981 this.tpTransferAppts.Controls.Add(this.label4);
982 this.tpTransferAppts.Controls.Add(this.dtpBegin);
983 this.tpTransferAppts.Controls.Add(this.label3);
984 this.tpTransferAppts.Controls.Add(this.cboBSDXClinic);
985 this.tpTransferAppts.Controls.Add(this.label2);
986 this.tpTransferAppts.Controls.Add(this.cboRPMSClinic);
987 this.tpTransferAppts.Controls.Add(this.pnlDescriptionXfer);
988 this.tpTransferAppts.Controls.Add(this.pnlCmdXfer);
989 this.tpTransferAppts.Location = new System.Drawing.Point(4, 22);
990 this.tpTransferAppts.Name = "tpTransferAppts";
991 this.tpTransferAppts.Size = new System.Drawing.Size(696, 428);
992 this.tpTransferAppts.TabIndex = 5;
993 this.tpTransferAppts.Text = "Copy Appointments";
994 //
995 // label5
996 //
997 this.label5.Location = new System.Drawing.Point(8, 128);
998 this.label5.Name = "label5";
999 this.label5.Size = new System.Drawing.Size(144, 18);
1000 this.label5.TabIndex = 10;
1001 this.label5.Text = "End with appointments on:";
1002 //
1003 // dtpEnd
1004 //
1005 this.dtpEnd.Location = new System.Drawing.Point(152, 128);
1006 this.dtpEnd.Name = "dtpEnd";
1007 this.dtpEnd.Size = new System.Drawing.Size(232, 20);
1008 this.dtpEnd.TabIndex = 9;
1009 //
1010 // label4
1011 //
1012 this.label4.Location = new System.Drawing.Point(8, 94);
1013 this.label4.Name = "label4";
1014 this.label4.Size = new System.Drawing.Size(144, 18);
1015 this.label4.TabIndex = 8;
1016 this.label4.Text = "Start with appointments on:";
1017 //
1018 // dtpBegin
1019 //
1020 this.dtpBegin.Location = new System.Drawing.Point(152, 93);
1021 this.dtpBegin.Name = "dtpBegin";
1022 this.dtpBegin.Size = new System.Drawing.Size(232, 20);
1023 this.dtpBegin.TabIndex = 7;
1024 //
1025 // label3
1026 //
1027 this.label3.Location = new System.Drawing.Point(8, 46);
1028 this.label3.Name = "label3";
1029 this.label3.Size = new System.Drawing.Size(136, 24);
1030 this.label3.TabIndex = 6;
1031 this.label3.Text = "Copy To Windows Scheduling Resource:";
1032 //
1033 // cboBSDXClinic
1034 //
1035 this.cboBSDXClinic.Location = new System.Drawing.Point(152, 48);
1036 this.cboBSDXClinic.Name = "cboBSDXClinic";
1037 this.cboBSDXClinic.Size = new System.Drawing.Size(232, 21);
1038 this.cboBSDXClinic.TabIndex = 5;
1039 this.cboBSDXClinic.Text = "cboBSDXClinic";
1040 //
1041 // label2
1042 //
1043 this.label2.Location = new System.Drawing.Point(8, 18);
1044 this.label2.Name = "label2";
1045 this.label2.Size = new System.Drawing.Size(136, 16);
1046 this.label2.TabIndex = 4;
1047 this.label2.Text = "Copy From VistA Clinic:";
1048 //
1049 // cboRPMSClinic
1050 //
1051 this.cboRPMSClinic.Location = new System.Drawing.Point(152, 16);
1052 this.cboRPMSClinic.Name = "cboRPMSClinic";
1053 this.cboRPMSClinic.Size = new System.Drawing.Size(232, 21);
1054 this.cboRPMSClinic.TabIndex = 3;
1055 this.cboRPMSClinic.Text = "cboRPMSClinic";
1056 //
1057 // pnlDescriptionXfer
1058 //
1059 this.pnlDescriptionXfer.Controls.Add(this.grpDescriptionXfer);
1060 this.pnlDescriptionXfer.Dock = System.Windows.Forms.DockStyle.Bottom;
1061 this.pnlDescriptionXfer.Location = new System.Drawing.Point(0, 316);
1062 this.pnlDescriptionXfer.Name = "pnlDescriptionXfer";
1063 this.pnlDescriptionXfer.Size = new System.Drawing.Size(696, 72);
1064 this.pnlDescriptionXfer.TabIndex = 2;
1065 //
1066 // grpDescriptionXfer
1067 //
1068 this.grpDescriptionXfer.Controls.Add(this.lblDescriptionXfer);
1069 this.grpDescriptionXfer.Dock = System.Windows.Forms.DockStyle.Fill;
1070 this.grpDescriptionXfer.Location = new System.Drawing.Point(0, 0);
1071 this.grpDescriptionXfer.Name = "grpDescriptionXfer";
1072 this.grpDescriptionXfer.Size = new System.Drawing.Size(696, 72);
1073 this.grpDescriptionXfer.TabIndex = 0;
1074 this.grpDescriptionXfer.TabStop = false;
1075 this.grpDescriptionXfer.Text = "Description";
1076 //
1077 // lblDescriptionXfer
1078 //
1079 this.lblDescriptionXfer.Dock = System.Windows.Forms.DockStyle.Fill;
1080 this.lblDescriptionXfer.Location = new System.Drawing.Point(3, 16);
1081 this.lblDescriptionXfer.Name = "lblDescriptionXfer";
1082 this.lblDescriptionXfer.Size = new System.Drawing.Size(690, 53);
1083 this.lblDescriptionXfer.TabIndex = 0;
1084 this.lblDescriptionXfer.Text = resources.GetString("lblDescriptionXfer.Text");
1085 //
1086 // pnlCmdXfer
1087 //
1088 this.pnlCmdXfer.Controls.Add(this.cmdCopyAppts);
1089 this.pnlCmdXfer.Dock = System.Windows.Forms.DockStyle.Bottom;
1090 this.pnlCmdXfer.Location = new System.Drawing.Point(0, 388);
1091 this.pnlCmdXfer.Name = "pnlCmdXfer";
1092 this.pnlCmdXfer.Size = new System.Drawing.Size(696, 40);
1093 this.pnlCmdXfer.TabIndex = 1;
1094 //
1095 // cmdCopyAppts
1096 //
1097 this.cmdCopyAppts.Location = new System.Drawing.Point(16, 8);
1098 this.cmdCopyAppts.Name = "cmdCopyAppts";
1099 this.cmdCopyAppts.Size = new System.Drawing.Size(128, 24);
1100 this.cmdCopyAppts.TabIndex = 0;
1101 this.cmdCopyAppts.Text = "&Copy Appointments";
1102 this.cmdCopyAppts.Click += new System.EventHandler(this.cmdCopyAppts_Click);
1103 //
1104 // tpWorkStations
1105 //
1106 this.tpWorkStations.Controls.Add(this.grdWorkStations);
1107 this.tpWorkStations.Controls.Add(this.pnlWorkstations);
1108 this.tpWorkStations.Controls.Add(this.panel1);
1109 this.tpWorkStations.Location = new System.Drawing.Point(4, 22);
1110 this.tpWorkStations.Name = "tpWorkStations";
1111 this.tpWorkStations.Size = new System.Drawing.Size(696, 428);
1112 this.tpWorkStations.TabIndex = 6;
1113 this.tpWorkStations.Text = "WorkStations";
1114 //
1115 // grdWorkStations
1116 //
1117 this.grdWorkStations.AccessibleName = "DataGrid";
1118 this.grdWorkStations.AccessibleRole = System.Windows.Forms.AccessibleRole.Table;
1119 this.grdWorkStations.DataMember = "";
1120 this.grdWorkStations.Dock = System.Windows.Forms.DockStyle.Fill;
1121 this.grdWorkStations.HeaderForeColor = System.Drawing.SystemColors.ControlText;
1122 this.grdWorkStations.Location = new System.Drawing.Point(0, 0);
1123 this.grdWorkStations.Name = "grdWorkStations";
1124 this.grdWorkStations.ReadOnly = true;
1125 this.grdWorkStations.Size = new System.Drawing.Size(696, 316);
1126 this.grdWorkStations.TabIndex = 6;
1127 //
1128 // pnlWorkstations
1129 //
1130 this.pnlWorkstations.Controls.Add(this.groupBox1);
1131 this.pnlWorkstations.Dock = System.Windows.Forms.DockStyle.Bottom;
1132 this.pnlWorkstations.Location = new System.Drawing.Point(0, 316);
1133 this.pnlWorkstations.Name = "pnlWorkstations";
1134 this.pnlWorkstations.Size = new System.Drawing.Size(696, 72);
1135 this.pnlWorkstations.TabIndex = 5;
1136 //
1137 // groupBox1
1138 //
1139 this.groupBox1.Controls.Add(this.lblWorkstations);
1140 this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;
1141 this.groupBox1.Location = new System.Drawing.Point(0, 0);
1142 this.groupBox1.Name = "groupBox1";
1143 this.groupBox1.Size = new System.Drawing.Size(696, 72);
1144 this.groupBox1.TabIndex = 0;
1145 this.groupBox1.TabStop = false;
1146 this.groupBox1.Text = "Description";
1147 //
1148 // lblWorkstations
1149 //
1150 this.lblWorkstations.Dock = System.Windows.Forms.DockStyle.Fill;
1151 this.lblWorkstations.Location = new System.Drawing.Point(3, 16);
1152 this.lblWorkstations.Name = "lblWorkstations";
1153 this.lblWorkstations.Size = new System.Drawing.Size(690, 53);
1154 this.lblWorkstations.TabIndex = 0;
1155 this.lblWorkstations.Text = resources.GetString("lblWorkstations.Text");
1156 //
1157 // panel1
1158 //
1159 this.panel1.Controls.Add(this.txtSendMessage);
1160 this.panel1.Controls.Add(this.cmdWorkStationsMessage);
1161 this.panel1.Controls.Add(this.cmdWorkStationsShutdown);
1162 this.panel1.Controls.Add(this.cmdWorkStationsRefresh);
1163 this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
1164 this.panel1.Location = new System.Drawing.Point(0, 388);
1165 this.panel1.Name = "panel1";
1166 this.panel1.Size = new System.Drawing.Size(696, 40);
1167 this.panel1.TabIndex = 4;
1168 //
1169 // txtSendMessage
1170 //
1171 this.txtSendMessage.Location = new System.Drawing.Point(440, 8);
1172 this.txtSendMessage.Name = "txtSendMessage";
1173 this.txtSendMessage.Size = new System.Drawing.Size(248, 20);
1174 this.txtSendMessage.TabIndex = 4;
1175 //
1176 // cmdWorkStationsMessage
1177 //
1178 this.cmdWorkStationsMessage.Location = new System.Drawing.Point(160, 8);
1179 this.cmdWorkStationsMessage.Name = "cmdWorkStationsMessage";
1180 this.cmdWorkStationsMessage.Size = new System.Drawing.Size(128, 24);
1181 this.cmdWorkStationsMessage.TabIndex = 3;
1182 this.cmdWorkStationsMessage.Text = "Send &Message";
1183 this.cmdWorkStationsMessage.Click += new System.EventHandler(this.cmdWorkStationsMessage_Click);
1184 //
1185 // cmdWorkStationsShutdown
1186 //
1187 this.cmdWorkStationsShutdown.Location = new System.Drawing.Point(304, 8);
1188 this.cmdWorkStationsShutdown.Name = "cmdWorkStationsShutdown";
1189 this.cmdWorkStationsShutdown.Size = new System.Drawing.Size(128, 24);
1190 this.cmdWorkStationsShutdown.TabIndex = 1;
1191 this.cmdWorkStationsShutdown.Text = "&Stop Workstations";
1192 this.cmdWorkStationsShutdown.Click += new System.EventHandler(this.cmdWorkStationsShutdown_Click);
1193 //
1194 // cmdWorkStationsRefresh
1195 //
1196 this.cmdWorkStationsRefresh.Location = new System.Drawing.Point(16, 8);
1197 this.cmdWorkStationsRefresh.Name = "cmdWorkStationsRefresh";
1198 this.cmdWorkStationsRefresh.Size = new System.Drawing.Size(128, 24);
1199 this.cmdWorkStationsRefresh.TabIndex = 0;
1200 this.cmdWorkStationsRefresh.Text = "&Refresh";
1201 this.cmdWorkStationsRefresh.Click += new System.EventHandler(this.cmdWorkStationsRefresh_Click);
1202 //
1203 // tpConfiguration
1204 //
1205 this.tpConfiguration.BackColor = System.Drawing.SystemColors.Control;
1206 this.tpConfiguration.Controls.Add(this.nudEventPolling);
1207 this.tpConfiguration.Controls.Add(this.lblEventPollInterval);
1208 this.tpConfiguration.Controls.Add(this.chkEventPolling);
1209 this.tpConfiguration.Location = new System.Drawing.Point(4, 22);
1210 this.tpConfiguration.Name = "tpConfiguration";
1211 this.tpConfiguration.Padding = new System.Windows.Forms.Padding(3);
1212 this.tpConfiguration.Size = new System.Drawing.Size(696, 428);
1213 this.tpConfiguration.TabIndex = 7;
1214 this.tpConfiguration.Text = "Configuration";
1215 //
1216 // nudEventPolling
1217 //
1218 this.nudEventPolling.Enabled = false;
1219 this.nudEventPolling.Location = new System.Drawing.Point(374, 24);
1220 this.nudEventPolling.Maximum = new decimal(new int[] {
1221 9999999,
1222 0,
1223 0,
1224 0});
1225 this.nudEventPolling.Minimum = new decimal(new int[] {
1226 5,
1227 0,
1228 0,
1229 0});
1230 this.nudEventPolling.Name = "nudEventPolling";
1231 this.nudEventPolling.Size = new System.Drawing.Size(74, 20);
1232 this.nudEventPolling.TabIndex = 11;
1233 this.nudEventPolling.Value = new decimal(new int[] {
1234 5,
1235 0,
1236 0,
1237 0});
1238 this.nudEventPolling.ValueChanged += new System.EventHandler(this.nudEventPolling_ValueChanged);
1239 //
1240 // lblEventPollInterval
1241 //
1242 this.lblEventPollInterval.AutoSize = true;
1243 this.lblEventPollInterval.Location = new System.Drawing.Point(185, 26);
1244 this.lblEventPollInterval.Name = "lblEventPollInterval";
1245 this.lblEventPollInterval.Size = new System.Drawing.Size(167, 13);
1246 this.lblEventPollInterval.TabIndex = 9;
1247 this.lblEventPollInterval.Text = "Event Polling Interval (in seconds)";
1248 //
1249 // chkEventPolling
1250 //
1251 this.chkEventPolling.AutoSize = true;
1252 this.chkEventPolling.Location = new System.Drawing.Point(33, 25);
1253 this.chkEventPolling.Name = "chkEventPolling";
1254 this.chkEventPolling.Size = new System.Drawing.Size(130, 17);
1255 this.chkEventPolling.TabIndex = 7;
1256 this.chkEventPolling.Text = "Event Polling Enabled";
1257 this.chkEventPolling.UseVisualStyleBackColor = true;
1258 this.chkEventPolling.CheckedChanged += new System.EventHandler(this.chkEventPolling_CheckedChanged);
1259 //
1260 // DManagement
1261 //
1262 this.AcceptButton = this.cmdClose;
1263 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
1264 this.ClientSize = new System.Drawing.Size(704, 494);
1265 this.Controls.Add(this.tabMain);
1266 this.Controls.Add(this.pnlPageBottom);
1267 this.Name = "DManagement";
1268 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
1269 this.Text = "Scheduling Management";
1270 this.Closing += new System.ComponentModel.CancelEventHandler(this.DManagement_Closing);
1271 this.Load += new System.EventHandler(this.DManagement_Load);
1272 this.pnlPageBottom.ResumeLayout(false);
1273 this.tabMain.ResumeLayout(false);
1274 this.tpResources.ResumeLayout(false);
1275 this.pnlResources.ResumeLayout(false);
1276 ((System.ComponentModel.ISupportInitialize)(this.grdResources)).EndInit();
1277 this.pnlDescription.ResumeLayout(false);
1278 this.grpDescription.ResumeLayout(false);
1279 this.pnlAddEdit.ResumeLayout(false);
1280 this.tpResourceGroups.ResumeLayout(false);
1281 ((System.ComponentModel.ISupportInitialize)(this.grdResourceGroup)).EndInit();
1282 this.pnlDescriptionResourceGroup.ResumeLayout(false);
1283 this.grpDescriptionResourceGroup.ResumeLayout(false);
1284 this.pnlAddEditResourceGroups.ResumeLayout(false);
1285 this.tpAccessTypes.ResumeLayout(false);
1286 ((System.ComponentModel.ISupportInitialize)(this.grdAccessTypes)).EndInit();
1287 this.pnlDescriptionAT.ResumeLayout(false);
1288 this.grpDescriptionAT.ResumeLayout(false);
1289 this.pnlAddEditAT.ResumeLayout(false);
1290 this.tpAccessGroups.ResumeLayout(false);
1291 ((System.ComponentModel.ISupportInitialize)(this.grdAccessGroups)).EndInit();
1292 this.pnlDescriptionAccessGroups.ResumeLayout(false);
1293 this.grpDescriptionAccessGroups.ResumeLayout(false);
1294 this.pnlAddEditAccessGroup.ResumeLayout(false);
1295 this.tpTransferAppts.ResumeLayout(false);
1296 this.pnlDescriptionXfer.ResumeLayout(false);
1297 this.grpDescriptionXfer.ResumeLayout(false);
1298 this.pnlCmdXfer.ResumeLayout(false);
1299 this.tpWorkStations.ResumeLayout(false);
1300 ((System.ComponentModel.ISupportInitialize)(this.grdWorkStations)).EndInit();
1301 this.pnlWorkstations.ResumeLayout(false);
1302 this.groupBox1.ResumeLayout(false);
1303 this.panel1.ResumeLayout(false);
1304 this.panel1.PerformLayout();
1305 this.tpConfiguration.ResumeLayout(false);
1306 this.tpConfiguration.PerformLayout();
1307 ((System.ComponentModel.ISupportInitialize)(this.nudEventPolling)).EndInit();
1308 this.ResumeLayout(false);
1309
1310 }
1311 #endregion
1312
1313 #region TabMain
1314 private void tabMain_Click(object sender, System.EventArgs e)
1315 {
1316 TabPage tp = tabMain.SelectedTab;
1317 if (tp.Text == "Resource Groups")
1318 {
1319 //20041109 Added below
1320 InitResourceGroupsPage();
1321 }
1322 //20041109 Added below
1323 if (tp.Text == "Access Groups")
1324 {
1325 InitAccessGroupsPage();
1326 }
1327
1328 }
1329 #endregion TabMain
1330
1331 #region Resources
1332
1333 private void cmdAddResource_Click(object sender, System.EventArgs e)
1334 {
1335 try
1336 {
1337 if (m_bEditUsers == true)
1338 {
1339 AddResourceUser();
1340 return;
1341 }
1342
1343 DResource dRes = new DResource();
1344 dRes.InitializePage(-1, this.m_dsGlobal);
1345 if (dRes.ShowDialog(this) == DialogResult.Cancel)
1346 {
1347 return;
1348 }
1349
1350 //Call RPMS to add new resource
1351 bool bInactive = dRes.Inactive;
1352 string sInactive = (bInactive == true)?"YES":"NO";
1353 string sResourceName = dRes.ResourceName;
1354 int nHospLocID = dRes.HospitalLocationID;
1355 string sHospLocID = nHospLocID.ToString();
1356 int nResourceID = dRes.ResourceID;
1357 string sResourceID = nResourceID.ToString();
1358
1359 int nTimeScale = dRes.TimeScale;
1360 string sTimeScale = nTimeScale.ToString();
1361 string sLetterText = dRes.LetterText;
1362
1363 string sNoShowLetter = dRes.NoShowLetterText;
1364 string sCancellationLetter = dRes.CancellationLetterText;
1365
1366 string sSql = "BSDX ADD/EDIT RESOURCE^" + sResourceID + "|" + sResourceName + "|" + sInactive + "|" + sHospLocID + "|" + sTimeScale + "|" + sLetterText + "|" + sNoShowLetter + "|" + sCancellationLetter;
1367 DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "Resource");
1368
1369 Debug.Assert(dtRes.Rows.Count == 1);
1370 if (dtRes.Rows.Count != 1)
1371 {
1372 throw new Exception("DManagement:cmdAddResource_Click: Unable to add new Resource.");
1373 }
1374 DataRow dr = dtRes.Rows[0];
1375 int nErrorID = (int) dr["RESOURCEID"];
1376 if (nErrorID == 0)
1377 {
1378 throw new Exception((string) dr["ERRORTEXT"]);
1379 }
1380 m_dsGlobal.Tables["GroupResources"].Clear();
1381 m_dsGlobal.Tables["ResourceUser"].Clear();
1382 m_dsGlobal.Tables["Resources"].Clear();
1383 m_DocManager.LoadBSDXResourcesTable();
1384
1385 m_DocManager.LoadGroupResourcesTable();
1386
1387 m_DocManager.LoadResourceUserTable();
1388
1389 m_DocManager.UpdateViews();
1390 }
1391 catch (Exception ex)
1392 {
1393 MessageBox.Show(ex.Message);
1394 }
1395 }
1396
1397 private void cmdChangeResource_Click(object sender, System.EventArgs e)
1398 {
1399 try
1400 {
1401 if (m_bEditUsers == true)
1402 {
1403 ChangeResourceUser();
1404 return;
1405 }
1406
1407 Object oSelectedResourceID = grdResources[grdResources.CurrentRowIndex, 0];
1408 int nSelectedResourceID = Convert.ToInt16(oSelectedResourceID);
1409
1410 DResource dRes = new DResource();
1411 dRes.InitializePage(nSelectedResourceID, this.m_dsGlobal);
1412
1413 if (dRes.ShowDialog(this) == DialogResult.Cancel)
1414 {
1415 return;
1416 }
1417
1418 //Call RPMS to change data for resource
1419 bool bInactive = dRes.Inactive;
1420 string sInactive = (bInactive == true)?"YES":"NO";
1421 string sResourceName = dRes.ResourceName;
1422 int nHospLocID = dRes.HospitalLocationID;
1423 string sHospLocID = nHospLocID.ToString();
1424 int nResourceID = dRes.ResourceID;
1425 string sResourceID = nResourceID.ToString();
1426
1427 int nTimeScale = dRes.TimeScale;
1428 string sTimeScale = nTimeScale.ToString();
1429 string sLetterText = dRes.LetterText;
1430
1431 string sNoShowLetter = dRes.NoShowLetterText;
1432 string sCancellationLetter = dRes.CancellationLetterText;
1433
1434 //Replace all crlfs with "@~" character combination
1435 //sLetterText = sLetterText.Replace("\r\n","@~");
1436
1437 string sSql = "BSDX ADD/EDIT RESOURCE^" + sResourceID + "|" + sResourceName + "|" + sInactive + "|" + sHospLocID + "|" + sTimeScale + "|" + sLetterText + "|" + sNoShowLetter + "|" + sCancellationLetter;
1438 DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "Resource");
1439
1440 if (dtRes.Rows.Count != 1)
1441 {
1442 Exception ex = new Exception("Unable to update Resource file");
1443 throw ex;
1444 }
1445 DataRow rw = dtRes.Rows[0];
1446 string sError = rw["ERRORTEXT"].ToString();
1447 if (sError != "")
1448 {
1449 Exception ex = new Exception(sError);
1450 throw ex;
1451 }
1452
1453 m_dsGlobal.Tables["ResourceUser"].Clear();
1454
1455 m_dsGlobal.Tables["Resources"].Clear();
1456 m_DocManager.LoadBSDXResourcesTable();
1457 m_DocManager.LoadResourceUserTable();
1458
1459 m_dsGlobal.Tables["GroupResources"].Clear();
1460 m_DocManager.LoadGroupResourcesTable();
1461
1462 m_DocManager.UpdateViews();
1463 }
1464 catch (Exception ex)
1465 {
1466 MessageBox.Show(ex.Message);
1467 }
1468 }
1469
1470 private void grdResources_CurrentCellChanged(object sender, System.EventArgs e)
1471 {
1472 DataGridCell dgCell;
1473 dgCell = this.grdResources.CurrentCell;
1474 m_nResourceRow = dgCell.RowNumber;
1475 this.grdResources.Select(m_nResourceRow);
1476 if (m_sMember == "Resource")
1477 {
1478 Object dgItem = grdResources[dgCell.RowNumber, 0];
1479 this.m_nResourceID = Convert.ToInt16(dgItem);
1480 Debug.Write("m_nResourceID changed to " + m_nResourceID.ToString() + "\n");
1481 }
1482 this.cmdChangeResource.Enabled = true;
1483 }
1484 private void grdResources_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
1485 {
1486 m_sMember = grdResources.DataMember.ToString();
1487 if (m_sMember == "")
1488 m_sMember = "Resource";
1489
1490 if (m_sMember == "ResourceUser")
1491 {
1492 m_bEditUsers = true;
1493 this.cmdAddResource.Text = "Add User...";
1494 this.cmdChangeResource.Text = "Change User...";
1495 this.cmdRemoveUser.Visible = true;
1496 this.lblDescription.Text = "Define the users who can create appointments and establish availability for a particular resource. Users must first be given basic access to the VistA Scheduling package using standard VistA menu and key management before they can be selected here and assigned to a resource. Click the left-pointing arrow near the upper right of the window to go back to the list of resources.";
1497 int nRows = this.grdResources.VisibleRowCount;
1498 if (nRows == 0)
1499 {
1500 this.cmdChangeResource.Enabled = false;
1501 this.cmdRemoveUser.Enabled = false;
1502 }
1503 else
1504 {
1505 grdResources.CurrentCell = new DataGridCell(0, 0);
1506 this.cmdChangeResource.Enabled = true;
1507 this.cmdRemoveUser.Enabled = true;
1508 }
1509 }
1510 else
1511 {
1512 m_bEditUsers = false;
1513 this.cmdAddResource.Text = "Add ...";
1514 this.cmdChangeResource.Text = "Change...";
1515 this.cmdRemoveUser.Visible = false;
1516 this.lblDescription.Text="Use the resources panel to define the set of clinical entities available for scheduling at this facility. Resources may include care providers (for example, dentists and physicians) or other kinds of scheduled services, facilities or equipment. Click the small + sign next to the resource name to manage the users who can schedule this resource.";
1517 this.cmdChangeResource.Enabled = true;
1518 }
1519 }
1520
1521 #endregion Resources
1522
1523 #region ResourceUser
1524
1525 private void AddResourceUser()
1526 {
1527 DResourceUser dRes = new DResourceUser();
1528
1529 //Find out if there are any rows here
1530 int nRows = this.grdResources.VisibleRowCount;
1531 if (nRows == 0)
1532 {
1533 this.cmdChangeResource.Enabled = false;
1534 this.cmdRemoveUser.Enabled = false;
1535 }
1536
1537 dRes.InitializePage(-1, this.m_dsGlobal);
1538 if (dRes.ShowDialog(this) == DialogResult.Cancel)
1539 {
1540 return;
1541 }
1542 //Call RPMS to add new Resource User
1543 int nUserID = dRes.UserID;
1544 string sUserID = nUserID.ToString();
1545 bool bOverbook = dRes.Overbook;
1546 string sOverbook = (bOverbook == true)?"YES":"NO";
1547 bool bModifySchedule = dRes.ModifySchedule;
1548 string sModifySchedule = (bModifySchedule == true)?"YES":"NO";
1549 bool bAppointments = dRes.Appoinmtments;
1550 string sAppointments = (bAppointments == true)?"YES":"NO";
1551
1552 string sSql = "BSDX ADD/EDIT RESOURCEUSER^" + "0" + "|" + sOverbook + "|" + sModifySchedule + "|" + m_nResourceID + "|" + sUserID + "|" + sAppointments;
1553 DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResourceUser");
1554
1555 m_dsGlobal.Tables["ResourceUser"].Clear();
1556 m_DocManager.LoadResourceUserTable(true);
1557
1558 m_DocManager.UpdateViews();
1559 }
1560
1561
1562 private void ChangeResourceUser()
1563 {
1564 Object oSelectedResourceUserID = grdResources[grdResources.CurrentCell.RowNumber, 1];
1565 int nSelectedResourceUserID = Convert.ToInt16(oSelectedResourceUserID);
1566 DResourceUser dRes = new DResourceUser();
1567 dRes.InitializePage(nSelectedResourceUserID, this.m_dsGlobal);
1568 if (dRes.ShowDialog(this) != DialogResult.OK)
1569 {
1570 return;
1571 }
1572 //Call RPMS to change Resource User
1573 int nUserID = dRes.UserID;
1574 string sUserID = nUserID.ToString();
1575 bool bOverbook = dRes.Overbook;
1576 string sOverbook = (bOverbook == true)?"YES":"NO";
1577 bool bModifySchedule = dRes.ModifySchedule;
1578 string sModifySchedule = (bModifySchedule == true)?"YES":"NO";
1579 bool bAppointments = dRes.Appoinmtments;
1580 string sAppointments = (bAppointments == true)?"YES":"NO";
1581
1582 string sSql = "BSDX ADD/EDIT RESOURCEUSER^" + nSelectedResourceUserID.ToString() + "|" + sOverbook + "|" + sModifySchedule + "|" + m_nResourceID + "|" + sUserID + "|" + sAppointments ;
1583 DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResourceUser");
1584
1585 m_dsGlobal.Tables["ResourceUser"].Clear();
1586 m_DocManager.LoadResourceUserTable(true);
1587
1588 m_DocManager.UpdateViews();
1589 }
1590
1591
1592 private void cmdRemoveUser_Click(object sender, System.EventArgs e)
1593 {
1594 Object oSelectedResourceUserID = grdResources[grdResources.CurrentCell.RowNumber, 1];
1595 int nSelectedResourceUserID = Convert.ToInt16(oSelectedResourceUserID);
1596
1597 string sSql = "BSDX DELETE RESOURCEUSER^" + nSelectedResourceUserID.ToString();
1598 DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResUsr");
1599
1600 m_dsGlobal.Tables["ResourceUser"].Clear();
1601 m_DocManager.LoadResourceUserTable(true);
1602
1603 m_DocManager.UpdateViews();
1604 int nRows = this.grdResources.VisibleRowCount;
1605 if (nRows == 0)
1606 {
1607 this.cmdChangeResource.Enabled = false;
1608 this.cmdRemoveUser.Enabled = false;
1609 }
1610 else
1611 {
1612 grdResources.Select(0);
1613 this.cmdChangeResource.Enabled = true;
1614 this.cmdRemoveUser.Enabled = true;
1615 }
1616 }
1617
1618 #endregion ResourceUser
1619
1620 #region ResourceGroups
1621
1622 //20041109 Added below
1623 private void InitResourceGroupsPage()
1624 {
1625 this.cmdChangeResourceGroup.Enabled = false;
1626 this.cmdRemoveResourceGroup.Enabled = false;
1627 if (this.m_dvResourceGroup.Count > 0)
1628 {
1629 this.m_nResourceGroupRow = 0;
1630
1631 this.grdResourceGroup.CurrentCell = new DataGridCell(0,0);
1632 this.grdResourceGroup.Select(0);
1633 this.m_nResourceGroupRow = 0;
1634 object dgItem = this.grdResourceGroup[0,0];
1635 this.m_nResourceGroupID = Convert.ToInt16(dgItem);
1636 dgItem = grdResourceGroup[0,1];
1637 this.m_sResourceGroupName = dgItem.ToString();
1638
1639 this.cmdChangeResourceGroup.Enabled = true;
1640 this.cmdRemoveResourceGroup.Enabled = true;
1641 }
1642 }
1643
1644 private void cmdAddResourceGroup_Click(object sender, System.EventArgs e)
1645 {
1646 try
1647 {
1648 if (m_bEditGroupItems == true)
1649 {
1650 AddResourceGroupItem();
1651 return;
1652 }
1653
1654 DResourceGroup dRes = new DResourceGroup();
1655 dRes.InitializePage(-1, this.m_dsGlobal);
1656 if (dRes.ShowDialog(this) == DialogResult.Cancel)
1657 {
1658 return;
1659 }
1660
1661 //Call RPMS to add new resource
1662
1663 string sResGroupName = dRes.ResourceGroupName;
1664
1665 string sSql = "BSDX ADD/EDIT RESOURCE GROUP^0|" + sResGroupName;
1666 DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "ResourceGroup");
1667
1668 Debug.Assert(dtRes.Rows.Count == 1);
1669 if (dtRes.Rows.Count != 1)
1670 {
1671 throw new Exception("DManagement:cmdAddResource_Click: Unable to add new Resource Group.");
1672 }
1673 DataRow dr = dtRes.Rows[0];
1674 int nErrorID = (int) dr["RESOURCEGROUPID"];
1675 if (nErrorID == 0)
1676 {
1677 throw new Exception((string) dr["ERRORTEXT"]);
1678 }
1679
1680 m_dsGlobal.Tables["GroupResources"].Clear();
1681 m_DocManager.LoadGroupResourcesTable();
1682 m_DocManager.LoadResourceGroupTable();
1683
1684 m_DocManager.UpdateViews();
1685
1686 //20041109 Added below
1687 InitResourceGroupsPage();
1688 }
1689 catch (Exception ex)
1690 {
1691 MessageBox.Show(ex.Message);
1692 }
1693 }
1694
1695 private void grdResourceGroup_CurrentCellChanged(object sender, System.EventArgs e)
1696 {
1697 DataGridCell dgCell;
1698 dgCell = grdResourceGroup.CurrentCell;
1699 m_nResourceGroupRow = dgCell.RowNumber;
1700 grdResourceGroup.Select(m_nResourceGroupRow);
1701 if (m_sGroupMember == "Group")
1702 {
1703 Object dgItem = grdResourceGroup[dgCell.RowNumber, 1];
1704 m_sResourceGroupName = dgItem.ToString();
1705 dgItem = grdResourceGroup[dgCell.RowNumber, 0];
1706 m_nResourceGroupID = Convert.ToInt16(dgItem);
1707 Debug.Write("m_nResourceGroupID changed to " + m_nResourceGroupID.ToString() + "\n");
1708 }
1709 this.cmdRemoveResourceGroup.Enabled = true;
1710 this.cmdChangeResourceGroup.Enabled = true;
1711 }
1712
1713
1714 private void grdResourceGroup_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
1715 {
1716 m_sGroupMember = grdResourceGroup.DataMember.ToString();
1717 if (m_sGroupMember == "")
1718 m_sGroupMember = "Group";
1719
1720 if (m_sGroupMember == "GroupResource")
1721 {
1722 m_bEditGroupItems = true;
1723 cmdAddResourceGroup.Text = "Add Resource";
1724 this.cmdRemoveResourceGroup.Text = "Remove Resource";
1725 this.cmdChangeResourceGroup.Visible = false;
1726 this.cmdRemoveResourceGroup.Visible = true;
1727 this.lblDescriptionResourceGroup.Text = "Define the Resource which will be a part of this group. Click the left-pointing arrow near the upper right of the window to go back to the list of Resource Groups.";
1728 int nRows = this.grdResourceGroup.VisibleRowCount;
1729 if (nRows == 0)
1730 {
1731 this.cmdRemoveResourceGroup.Enabled = false;
1732 this.cmdChangeResourceGroup.Visible = false;
1733 }
1734 else
1735 {
1736 grdResourceGroup.CurrentCell = new DataGridCell(0, 0);
1737 this.cmdChangeResourceGroup.Visible = false;
1738 this.cmdRemoveResourceGroup.Enabled = true;
1739 }
1740 }
1741 else
1742 {
1743 m_bEditGroupItems = false;
1744 this.cmdAddResourceGroup.Text = "&Add Group";
1745 this.cmdRemoveResourceGroup.Text = "&Remove Group";
1746 this.cmdChangeResourceGroup.Visible = true;
1747 this.lblDescriptionResourceGroup.Text="Use this panel to organize Resources into useful groups. Resource Groups may include departments, clinics or any other collection of resources. Resource groups will be visible to all scheduling users.";
1748 }
1749 }
1750
1751 private void cmdRemoveResourceGroup_Click(object sender, System.EventArgs e)
1752 {
1753 if (m_bEditGroupItems == true)
1754 {
1755 RemoveResourceGroupItem();
1756 return;
1757 }
1758
1759 string sSql = "BSDX DELETE RESOURCE GROUP^" + m_sResourceGroupName;
1760 DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResGrp");
1761
1762 m_dsGlobal.Tables["GroupResources"].Clear();
1763 m_DocManager.LoadGroupResourcesTable();
1764 m_DocManager.LoadResourceGroupTable();
1765
1766 DataTable dt = m_dsGlobal.Tables["ResourceGroup"];
1767 DataRow dr = dt.Rows.Find(m_sResourceGroupName);
1768 dr.Delete();
1769 dr.AcceptChanges();
1770
1771 m_DocManager.UpdateViews();
1772
1773 //20041109 Added below
1774 InitResourceGroupsPage();
1775
1776 //20041109 Removed below
1777// int nRows = this.grdResourceGroup.VisibleRowCount;
1778// if (nRows == 0)
1779// {
1780// this.cmdRemoveResourceGroup.Enabled = false;
1781// }
1782// else
1783// {
1784// grdResourceGroup.Select(0);
1785// this.cmdRemoveResourceGroup.Enabled = true;
1786// }
1787
1788 }
1789
1790 private void AddResourceGroupItem()
1791 {
1792 DResourceGroupItem dRes = new DResourceGroupItem();
1793 dRes.InitializePage(-1, this.m_dsGlobal);
1794 if (dRes.ShowDialog(this) == DialogResult.Cancel)
1795 {
1796 return;
1797 }
1798
1799 //Call RPMS to add new resource
1800
1801 int nResID = dRes.ResourceID;
1802
1803 string sSql = "BSDX ADD RES GROUP ITEM^" + m_nResourceGroupID.ToString() + "^" + nResID.ToString();
1804 DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "ResourceGroupItem");
1805
1806 this.cmdRemoveResourceGroup.Enabled = true;
1807
1808 m_dsGlobal.Tables["GroupResources"].Clear();
1809 m_DocManager.LoadGroupResourcesTable();
1810
1811 m_DocManager.UpdateViews();
1812
1813 }
1814
1815 private void RemoveResourceGroupItem()
1816 {
1817 Object oSelectedResourceName = this.grdResourceGroup[grdResourceGroup.CurrentCell.RowNumber, 1];
1818 string sSelectedResourceName = oSelectedResourceName.ToString();
1819
1820 Object oSelectedResourceGroupID = this.grdResourceGroup[grdResourceGroup.CurrentCell.RowNumber, 0];
1821 int nSelectedResourceGroupID = Convert.ToInt16(oSelectedResourceGroupID);
1822
1823 Object oSelectedResourceItemID = this.grdResourceGroup[grdResourceGroup.CurrentCell.RowNumber, 2];
1824 int nSelectedResourceItemID = Convert.ToInt16(oSelectedResourceItemID);
1825
1826 string sSql = "BSDX DELETE RES GROUP ITEM^" + nSelectedResourceGroupID.ToString() + "^" + nSelectedResourceItemID.ToString();
1827 DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResGrpItem");
1828
1829 m_dsGlobal.Tables["GroupResources"].Clear();
1830 m_DocManager.LoadGroupResourcesTable();
1831
1832 m_DocManager.UpdateViews();
1833 int nRows = this.grdResourceGroup.VisibleRowCount;
1834 if (nRows == 0)
1835 {
1836 this.cmdRemoveResourceGroup.Enabled = false;
1837 }
1838 else
1839 {
1840 grdResourceGroup.Select(0);
1841 this.cmdRemoveResourceGroup.Enabled = true;
1842 }
1843 }
1844
1845 private void cmdChangeResourceGroup_Click(object sender, System.EventArgs e)
1846 {
1847 try
1848 {
1849 int nRows = this.grdResourceGroup.VisibleRowCount;
1850 if (nRows == 0)
1851 {
1852 Debug.Assert(false, "This code shouldn't execute.");
1853 m_sResourceGroupName = "";
1854 this.cmdChangeResource.Enabled = false;
1855 this.cmdRemoveResourceGroup.Enabled = false;
1856 return;
1857 }
1858 else
1859 {
1860 DataGridCell dgCell;
1861 dgCell = grdResourceGroup.CurrentCell;
1862 Object dgItem = grdResourceGroup[dgCell.RowNumber, 1];
1863 m_sResourceGroupName = dgItem.ToString();
1864 this.cmdChangeResource.Enabled = true;
1865 this.cmdRemoveResourceGroup.Enabled = true;
1866 }
1867
1868 DataTable dt = m_dsGlobal.Tables["ResourceGroup"];
1869 DataRow dr = dt.Rows.Find(m_sResourceGroupName);
1870 int nRGID = Convert.ToInt16(dr["RESOURCE_GROUPID"]);
1871
1872 DResourceGroup dRes = new DResourceGroup();
1873 dRes.ResourceGroupName = m_sResourceGroupName;
1874 dRes.InitializePage(nRGID, this.m_dsGlobal);
1875 if (dRes.ShowDialog(this) == DialogResult.Cancel)
1876 {
1877 return;
1878 }
1879
1880 //Call RPMS to change resource group
1881
1882 string sResGroupName = dRes.ResourceGroupName;
1883
1884 string sSql = "BSDX ADD/EDIT RESOURCE GROUP^" + nRGID.ToString() + "|" + sResGroupName;
1885 DataTable dtRes = m_DocManager.RPMSDataTable(sSql, "TempResGrp");
1886
1887 Debug.Assert(dtRes.Rows.Count == 1);
1888 if (dtRes.Rows.Count != 1)
1889 {
1890 throw new Exception("DManagement:cmdAddResource_Click: Unable to edit Resource Group.");
1891 }
1892 dr = dtRes.Rows[0];
1893 int nErrorID = (int) dr["RESOURCEGROUPID"];
1894 if (nErrorID == 0)
1895 {
1896 throw new Exception((string) dr["ERRORTEXT"]);
1897 }
1898
1899 m_sResourceGroupName = sResGroupName;
1900 m_dsGlobal.Tables["GroupResources"].Clear(); //must be cleared first as it has a relationship to ResourceGroup
1901 m_dsGlobal.Tables["ResourceGroup"].Clear();
1902 m_DocManager.LoadResourceGroupTable();
1903 m_DocManager.LoadGroupResourcesTable();
1904
1905
1906 dr.Delete();
1907 dr.AcceptChanges();
1908
1909 m_DocManager.UpdateViews();
1910 }
1911 catch (Exception ex)
1912 {
1913 MessageBox.Show(ex.Message);
1914 }
1915 }
1916
1917 #endregion ResourceGroups
1918
1919 #region AccessTypes
1920
1921 private void grdAccessTypes_CurrentCellChanged(object sender, System.EventArgs e)
1922 {
1923 DataGridCell myCell;
1924 myCell = this.grdAccessTypes.CurrentCell;
1925 m_nATRow = myCell.RowNumber;
1926 grdAccessTypes.Select(m_nATRow);
1927 this.cmdChangeAT.Enabled = true;
1928 }
1929
1930 private void cmdChangeAT_Click(object sender, System.EventArgs e)
1931 {
1932 try
1933 {
1934 DAccessType dAT = new DAccessType();
1935 dAT.InitializePage(m_nATRow, this.m_dsGlobal);
1936
1937 if (dAT.ShowDialog(this) == DialogResult.Cancel)
1938 {
1939 return;
1940 }
1941 //Call RPMS to change data for access type
1942 bool bInactive = dAT.Inactive;
1943 string sInactive = (bInactive == true)?"YES":"NO";
1944 string sAccessTypeName = dAT.AccessTypeName;
1945 string sColor = dAT.DisplayColor;
1946 string sRed = dAT.Red.ToString();
1947 string sBlue = dAT.Blue.ToString();
1948 string sGreen = dAT.Green.ToString();
1949 string sIEN = dAT.AccessIEN;
1950
1951
1952 string sSql = "BSDX ADD/EDIT ACCESS TYPE^" + sIEN + "|" + sAccessTypeName + "|" + sInactive + "|" + sColor + "|" + sRed + "|" + sGreen + "|" + sBlue;
1953 DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AccessType");
1954
1955 Debug.Assert(dtAppt.Rows.Count == 1);
1956 if (dtAppt.Rows.Count != 1)
1957 {
1958 throw new Exception("DManagement:cmdChangeAT_Click: Unable to add new Access Type.");
1959 }
1960 DataRow dr = dtAppt.Rows[0];
1961 int nErrorID = (int) dr["ACCESSTYPEID"];
1962 if (nErrorID == 0)
1963 {
1964 throw new Exception((string) dr["ERRORTEXT"]);
1965 }
1966
1967 RefreshAccessTypesTables();
1968 }
1969 catch (Exception ex)
1970 {
1971 MessageBox.Show(ex.Message);
1972 }
1973 }
1974
1975 private void RefreshAccessTypesTables()
1976 {
1977 m_dsGlobal.Tables["AccessTypes"].Clear();
1978 m_dsGlobal.Tables["AccessGroupType"].Clear();
1979 //PORT TODO: This may fail.
1980 DataTable dt1 = m_DocManager.DAL.GetAccessTypes(m_dsGlobal, "AccessTypes");
1981 //m_dsGlobal.Tables["AccessTypes"].Merge(dt1); //smh -commented out for BMX4
1982 //m_dsGlobal.Tables.Add(dt1); //smh -commented out for BMX4
1983 //Fix Groups
1984 //m_DocManager.LoadAccessTypesTable();
1985 m_DocManager.LoadAccessGroupTypesTable();
1986 m_DocManager.UpdateViews();
1987 }
1988
1989 private void cmdAddAT_Click(object sender, System.EventArgs e)
1990 {
1991 try
1992 {
1993 DAccessType dAT = new DAccessType();
1994 dAT.InitializePage(-1, this.m_dsGlobal);
1995 if (dAT.ShowDialog(this) == DialogResult.Cancel)
1996 {
1997 return;
1998 }
1999
2000 //Call RPMS to add new access type
2001 bool bInactive = dAT.Inactive;
2002 string sInactive = (bInactive == true)?"YES":"NO";
2003 string sAccessTypeName = dAT.AccessTypeName;
2004 string sColor = dAT.DisplayColor;
2005 string sRed = dAT.Red.ToString();
2006 string sBlue = dAT.Blue.ToString();
2007 string sGreen = dAT.Green.ToString();
2008
2009 string sSql = "BSDX ADD/EDIT ACCESS TYPE^0|" + sAccessTypeName + "|" + sInactive + "|" + sColor + "|" + sRed + "|" + sGreen + "|" + sBlue;
2010 DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AccessType");
2011
2012 Debug.Assert(dtAppt.Rows.Count == 1);
2013 if (dtAppt.Rows.Count != 1)
2014 {
2015 throw new Exception("DManagement:cmdAddAT_Click: Unable to add new Resource.");
2016 }
2017 DataRow dr = dtAppt.Rows[0];
2018 int nErrorID = (int) dr["ACCESSTYPEID"];
2019 if (nErrorID == 0)
2020 {
2021 throw new Exception((string) dr["ERRORTEXT"]);
2022 }
2023
2024 RefreshAccessTypesTables();
2025
2026 }
2027 catch (Exception ex)
2028 {
2029 MessageBox.Show(ex.Message);
2030 }
2031 }
2032
2033 #endregion AccessTypes
2034
2035 #region AccessGroups
2036
2037 private void InitAccessGroupsPage()
2038 {
2039 this.cmdChangeAccessGroup.Enabled = false;
2040 this.cmdRemoveAccessGroup.Enabled = false;
2041 if (this.m_dvAccessGroup.Count > 0)
2042 {
2043 this.m_nAccessGroupRow = 0;
2044
2045 this.grdAccessGroups.CurrentCell = new DataGridCell(0,0);
2046 this.grdAccessGroups.Select(0);
2047 this.m_nAccessGroupRow = 0;
2048 object dgItem = this.grdAccessGroups[0,0];
2049 this.m_nAccessGroupID = Convert.ToInt16(dgItem);
2050 dgItem = grdAccessGroups[0,1];
2051 this.m_sAccessGroupName = dgItem.ToString();
2052 this.cmdChangeAccessGroup.Enabled = true;
2053 this.cmdRemoveAccessGroup.Enabled = true;
2054 }
2055 }
2056
2057 private void grdAccessGroups_CurrentCellChanged(object sender, System.EventArgs e)
2058 {
2059 DataGridCell dgCell;
2060 dgCell = grdAccessGroups.CurrentCell;
2061 m_nAccessGroupRow = dgCell.RowNumber;
2062 grdAccessGroups.Select(m_nAccessGroupRow);
2063 if (m_sAccessGroupMember == "Group")
2064 {
2065 Object dgItem = grdAccessGroups[dgCell.RowNumber, 0];
2066 m_sAccessGroupName = dgItem.ToString();
2067 dgItem = grdAccessGroups[dgCell.RowNumber, 0];
2068 m_nAccessGroupID = Convert.ToInt16(dgItem);
2069 Debug.Write("m_nAccessGroupID changed to " + m_nAccessGroupID.ToString() + "\n");
2070 dgItem = grdAccessGroups[dgCell.RowNumber, 1];
2071 m_sAccessGroupName = dgItem.ToString();
2072 Debug.Write("m_sAccessGroupName changed to " + m_sAccessGroupName + "\n");
2073 }
2074 cmdRemoveAccessGroup.Enabled = true;
2075 cmdChangeAccessGroup.Enabled = true;
2076 }
2077
2078 private void grdAccessGroups_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
2079 {
2080 m_sAccessGroupMember = grdAccessGroups.DataMember.ToString();
2081 if (m_sAccessGroupMember == "")
2082 {
2083 m_sAccessGroupMember = "Group";
2084 }
2085
2086 if (m_sAccessGroupMember == "AccessGroupType")
2087 {
2088 m_bEditAccessGroupItems = true;
2089 this.cmdAddAccessGroup.Text = "&Add Type";
2090 this.cmdRemoveAccessGroup.Text = "&Remove Type";
2091 cmdChangeAccessGroup.Visible = false;
2092 this.lblDescriptionAccessGroups.Text = "Define the Access Type which will be a part of this group. Click the left-pointing arrow near the upper right of the window to go back to the list of Access Groups.";
2093 int nRows = this.grdAccessGroups.VisibleRowCount;
2094 if (nRows == 0)
2095 {
2096 this.cmdRemoveAccessGroup.Enabled = false;
2097 cmdChangeAccessGroup.Visible = false;
2098 }
2099 else
2100 {
2101 grdAccessGroups.CurrentCell = new DataGridCell(0, 0);
2102 cmdChangeAccessGroup.Visible = false;
2103 this.cmdRemoveAccessGroup.Enabled = true;
2104 }
2105 }
2106 else
2107 {
2108 m_bEditAccessGroupItems = false;
2109 this.cmdAddAccessGroup.Text = "&Add Group";
2110 this.cmdRemoveAccessGroup.Text = "&Remove Group";
2111 cmdChangeAccessGroup.Visible = true;
2112 this.lblDescriptionAccessGroups.Text="Use this panel to organize Access Types into convenient groups. Access Groups are useful when selecting the Access Type (Walk-in, Same-Day, etc) to use when setting up the schedule for a resource. Access Type Groups will be visible to all scheduling users.";
2113 }
2114 }
2115
2116 private void cmdAddAccessGroup_Click(object sender, System.EventArgs e)
2117 {
2118 try
2119 {
2120 if (m_bEditAccessGroupItems == true)
2121 {
2122 AddAccessGroupItem();
2123 return;
2124 }
2125
2126 DAccessGroup dRes = new DAccessGroup();
2127 dRes.InitializePage(-1, this.m_dsGlobal);
2128 if (dRes.ShowDialog(this) == DialogResult.Cancel)
2129 {
2130 return;
2131 }
2132
2133 //Call RPMS to add new Acccess Group
2134 string sAccessGroupName = dRes.AccessGroupName;
2135 string sSql = "BSDX ADD/EDIT ACCESS GROUP^0|" + sAccessGroupName;
2136 DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AccessGroup");
2137
2138 Debug.Assert(dtAppt.Rows.Count == 1);
2139 if (dtAppt.Rows.Count != 1)
2140 {
2141 throw new Exception("DManagement:cmdAddAccessGroup_Click: Unable to add new Resource.");
2142 }
2143 DataRow dr = dtAppt.Rows[0];
2144 int nErrorID = (int) dr["ACCESSGROUPID"];
2145 if (nErrorID == 0)
2146 {
2147 throw new Exception((string) dr["ERRORTEXT"]);
2148 }
2149
2150 m_dsGlobal.Tables["AccessGroupType"].Clear();
2151 m_dsGlobal.Tables["AccessGroup"].Clear();
2152 m_DocManager.LoadAccessGroupsTable();
2153 m_DocManager.LoadAccessGroupTypesTable();
2154
2155 m_DocManager.UpdateViews();
2156
2157 //20041109 Added
2158 InitAccessGroupsPage();
2159 }
2160 catch (Exception ex)
2161 {
2162 MessageBox.Show(ex.Message);
2163 }
2164
2165 }
2166
2167 private void cmdRemoveAccessGroup_Click(object sender, System.EventArgs e)
2168 {
2169 if (m_bEditAccessGroupItems == true)
2170 {
2171 RemoveAccessGroupItem();
2172 return;
2173 }
2174
2175 string sSql = "BSDX DELETE ACCESS GROUP^" + this.m_nAccessGroupID;
2176 DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AccessGroup");
2177
2178 m_dsGlobal.Tables["AccessGroupType"].Clear();
2179 m_dsGlobal.Tables["AccessGroup"].Clear();
2180 m_DocManager.LoadAccessGroupsTable();
2181 m_DocManager.LoadAccessGroupTypesTable();
2182 m_DocManager.UpdateViews();
2183
2184 //20041109 Added
2185 InitAccessGroupsPage();
2186 }
2187
2188 private void cmdChangeAccessGroup_Click(object sender, System.EventArgs e)
2189 {
2190 try
2191 {
2192 int nRows = this.grdAccessGroups.VisibleRowCount;
2193 int nAccessGroupID;
2194 if (nRows == 0)
2195 {
2196 Debug.Assert(false, "This code shouldn't execute.");
2197 return;
2198 }
2199 else
2200 {
2201 DataGridCell dgCell;
2202 dgCell = grdAccessGroups.CurrentCell;
2203 Object dgItem = grdAccessGroups[dgCell.RowNumber, 1];
2204 m_sAccessGroupName = dgItem.ToString();
2205 dgItem = grdAccessGroups[dgCell.RowNumber, 0];
2206 nAccessGroupID = Convert.ToInt16(dgItem);
2207 }
2208
2209 DAccessGroup dRes = new DAccessGroup();
2210 dRes.AccessGroupName = m_sAccessGroupName;
2211 dRes.InitializePage(nAccessGroupID, this.m_dsGlobal);
2212 if (dRes.ShowDialog(this) == DialogResult.Cancel)
2213 {
2214 return;
2215 }
2216
2217 //Call RPMS to change resource group
2218
2219 string sAccessGroupName = dRes.AccessGroupName;
2220
2221 string sSql = "BSDX ADD/EDIT ACCESS GROUP^" + nAccessGroupID.ToString() + "|" + sAccessGroupName;
2222 DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "TempAccGrp");
2223
2224 Debug.Assert(dtAppt.Rows.Count == 1);
2225 if (dtAppt.Rows.Count != 1)
2226 {
2227 throw new Exception("DManagement:cmdChangeAccessGroup_Click: Unable to add new Resource.");
2228 }
2229 DataRow dr = dtAppt.Rows[0];
2230 int nErrorID = (int) dr["ACCESSGROUPID"];
2231 if (nErrorID == 0)
2232 {
2233 throw new Exception((string) dr["ERRORTEXT"]);
2234 }
2235
2236 m_sAccessGroupName = sAccessGroupName;
2237 m_dsGlobal.Tables["AccessGroupType"].Clear();
2238 m_dsGlobal.Tables["AccessGroup"].Clear();
2239 m_DocManager.LoadAccessGroupsTable();
2240 m_DocManager.LoadAccessGroupTypesTable();
2241
2242 m_DocManager.UpdateViews();
2243 }
2244 catch (Exception ex)
2245 {
2246 MessageBox.Show(ex.Message);
2247 }
2248 }
2249
2250 private void AddAccessGroupItem()
2251 {
2252 try
2253 {
2254 DAccessGroupItem dRes = new DAccessGroupItem();
2255 dRes.InitializePage(-1, this.m_dsGlobal);
2256 if (dRes.ShowDialog(this) == DialogResult.Cancel)
2257 {
2258 return;
2259 }
2260
2261 //Call RPMS to add new AccessGroupItem
2262
2263 int nAccessTypeID = dRes.AccessTypeID;
2264
2265 string sSql = "BSDX ADD ACCESS GROUP ITEM^" + m_nAccessGroupID.ToString() + "^" + nAccessTypeID.ToString();
2266 DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "AccessGroupItem");
2267
2268 Debug.Assert(dtAppt.Rows.Count == 1);
2269 if (dtAppt.Rows.Count != 1)
2270 {
2271 throw new Exception("DManagement:AddAccessGroupItem: Unable to add new Access Group Item.");
2272 }
2273 DataRow dr = dtAppt.Rows[0];
2274 int nErrorID = (int) dr["ACCESSGROUPTYPEID"];
2275 if (nErrorID == 0)
2276 {
2277 throw new Exception((string) dr["ERRORTEXT"]);
2278 }
2279
2280
2281 this.cmdRemoveAccessGroup.Enabled = true;
2282
2283 RefreshAccessTypesTables();
2284
2285 }
2286 catch (Exception ex)
2287 {
2288 MessageBox.Show(ex.Message);
2289 }
2290 }
2291
2292 private void RemoveAccessGroupItem()
2293 {
2294 try
2295 {
2296 Object oSelectedAccessGroupID = this.grdAccessGroups[grdAccessGroups.CurrentCell.RowNumber, 1];
2297 int nSelectedAccessGroupID = Convert.ToInt16(oSelectedAccessGroupID);
2298
2299 Object oSelectedAccessGroupItemID = this.grdAccessGroups[grdAccessGroups.CurrentCell.RowNumber, 3];
2300 int nSelectedAccessGroupItemID = Convert.ToInt16(oSelectedAccessGroupItemID);
2301
2302 string sSql = "BSDX DELETE ACCESS GROUP ITEM^" + nSelectedAccessGroupID.ToString() + "^" + nSelectedAccessGroupItemID.ToString();
2303 DataTable dtAppt = m_DocManager.RPMSDataTable(sSql, "TempAccGrpItem");
2304
2305 Debug.Assert(dtAppt.Rows.Count == 1);
2306 if (dtAppt.Rows.Count != 1)
2307 {
2308 throw new Exception("DManagement:RemoveAccessGroupItem: Unable to add new Access Group Item.");
2309 }
2310 DataRow dr = dtAppt.Rows[0];
2311 int nErrorID = (int) dr["ACCESSGROUPTYPEID"];
2312 if (nErrorID == 0)
2313 {
2314 throw new Exception((string) dr["ERRORTEXT"]);
2315 }
2316
2317 m_dsGlobal.Tables["AccessGroupType"].Clear();
2318 m_DocManager.LoadAccessGroupTypesTable();
2319
2320 m_DocManager.UpdateViews();
2321 int nRows = this.grdAccessGroups.VisibleRowCount;
2322 if (nRows == 0)
2323 {
2324 this.cmdRemoveAccessGroup.Enabled = false;
2325 }
2326 else
2327 {
2328 grdResourceGroup.Select(0);
2329 this.cmdRemoveAccessGroup.Enabled = true;
2330 }
2331 }
2332 catch (Exception ex)
2333 {
2334 MessageBox.Show(ex.Message);
2335 }
2336 }
2337
2338 #endregion AccessGroups
2339
2340 #region TransferAppts
2341
2342 private void cmdCopyAppts_Click(object sender, System.EventArgs e)
2343 {
2344 try
2345 {
2346 //Show a modeless progress dialog
2347 int nHospLocationID = Convert.ToInt32(this.cboRPMSClinic.SelectedValue);
2348 int nResourceID = Convert.ToInt32(this.cboBSDXClinic.SelectedValue);
2349
2350 ThreadApptCopy tac = new ThreadApptCopy(this.dtpBegin.Value, this.dtpEnd.Value,
2351 nHospLocationID.ToString(), cboRPMSClinic.Text,
2352 nResourceID.ToString(), cboBSDXClinic.Text,
2353 this.m_DocManager);
2354
2355 Thread threadApptCopy = new Thread(new System.Threading.ThreadStart(tac.ThreadApptCopyProc));
2356 //threadApptCopy.ApartmentState = ApartmentState.STA;
2357 threadApptCopy.SetApartmentState(ApartmentState.STA);
2358 threadApptCopy.Start();
2359
2360 }
2361 catch(Exception ex)
2362 {
2363 MessageBox.Show(this,ex.Message,"Clinical Scheduling");
2364 }
2365
2366 }
2367
2368
2369 public class ThreadApptCopy
2370 {
2371 private DateTime m_dtBegin;
2372 private DateTime m_dtEnd;
2373 private string m_HospLocationID;
2374 private string m_HospLocationName;
2375 private string m_ResourceID;
2376 private string m_ResourceName;
2377 private CGDocumentManager m_DocManager;
2378
2379 public ThreadApptCopy(DateTime dtBegin, DateTime EndDate,
2380 string HospLocationID, string HospLocationName,
2381 string ResourceID, string ResourceName,
2382 CGDocumentManager DocManager)
2383 {
2384 m_dtBegin = dtBegin;
2385 m_dtEnd = EndDate;
2386 m_HospLocationID = HospLocationID;
2387 m_HospLocationName = HospLocationName;
2388 m_ResourceID = ResourceID;
2389 m_ResourceName = ResourceName;
2390 m_DocManager = DocManager;
2391 }
2392
2393 public void ThreadApptCopyProc()
2394 {
2395 DCopyAppts dCopy = new DCopyAppts();
2396 dCopy.InitializePage(m_dtBegin, m_dtEnd,
2397 m_HospLocationID, m_HospLocationName,
2398 m_ResourceID, m_ResourceName,
2399 m_DocManager);
2400 dCopy.ShowDialog();
2401 }
2402 }
2403
2404 #endregion TransferAppts
2405
2406 #region Workstations
2407 private void cmdWorkStationsRefresh_Click(object sender, System.EventArgs e)
2408 {
2409 this.m_dtWSGrid.Clear();
2410 this.m_DocManager.RemoteSession.EventServices.TriggerEvent("BSDX CALL WORKSTATIONS", "A", true);
2411 }
2412
2413 delegate void UpdateWorkstationGridDelegate(string sParam);
2414
2415 private void MgrEventHandler(Object obj, RemoteEventArgs e)
2416 {
2417 try
2418 {
2419 if (e.EventType == "BSDX WORKSTATION REPORT")
2420 {
2421 Debug.Write("DManagement Got Workstation Report\n");
2422 UpdateWorkstationGridDelegate uWSGd = new UpdateWorkstationGridDelegate(UpdateWorkstationGrid);
2423 if (this.InvokeRequired == true) //ensures that handle is created
2424 {
2425 this.Invoke(uWSGd, new object[] { e.Details });
2426 }
2427 else
2428 {
2429 UpdateWorkstationGrid(e.Details);
2430 }
2431 }
2432 }
2433 catch (Exception ex)
2434 {
2435 Debug.Write("MgrEventHandler exception: " + ex.Message + "\n");
2436 }
2437 }
2438
2439 private void UpdateWorkstationGrid(string sParam)
2440 {
2441 string sDelim = "~";
2442 DataRow dr = this.m_dtWSGrid.NewRow();
2443 dr["UserName"] = M.Piece(sParam,sDelim,1);
2444 dr["Handle"] = M.Piece(sParam,sDelim,2);
2445 dr["Version"] = M.Piece(sParam,sDelim,3);
2446 dr["Views"] = M.Piece(sParam,sDelim,4);
2447 m_dtWSGrid.Rows.Add(dr);
2448 }
2449
2450 private void DManagement_Closing(object sender, System.ComponentModel.CancelEventArgs e)
2451 {
2452 CGDocumentManager.Current.RemoteSession.EventServices.Unsubscribe("BSDX WORKSTATION REPORT");
2453 }
2454
2455 private void cmdWorkStationsMessage_Click(object sender, System.EventArgs e)
2456 {
2457 string sMessage;
2458 dInputText dlg = new dInputText();
2459 dlg.DialogTitle = "Clinical Scheduling - Send Message to Scheduling Clients.";
2460
2461 if (dlg.ShowDialog(this) != DialogResult.OK)
2462 return;
2463
2464 sMessage = dlg.TextValue;
2465
2466 if (sMessage == "")
2467 return;
2468
2469 this.m_DocManager.RemoteSession.EventServices.TriggerEvent("BSDX ADMIN MESSAGE", sMessage, false);
2470 }
2471
2472 private void cmdWorkStationsShutdown_Click(object sender, System.EventArgs e)
2473 {
2474 if (MessageBox.Show("Are you sure you want to shut down all Clincal Scheduling clients?" ,"Clinical Scheduling Client Shutdown", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
2475 {
2476 return;
2477 }
2478 this.m_DocManager.RemoteSession.EventServices.TriggerEvent("BSDX ADMIN SHUTDOWN", txtSendMessage.Text, false);
2479 }
2480 #endregion Workstations
2481
2482 private void chkEventPolling_CheckedChanged(object sender, EventArgs e)
2483 {
2484 if (chkEventPolling.Checked)
2485 {
2486 nudEventPolling.Enabled = true;
2487 int interval = Convert.ToInt32(nudEventPolling.Value);
2488 string result = this.m_DocManager.RemoteSession.TransmitRPC("VEFA SET BMX POLL INTERVAL", interval.ToString());
2489 this.m_DocManager.RemoteSession.EventServices.EventPollingInterval = (interval * 1000);
2490 this.m_DocManager.RemoteSession.EventServices.IsEventPollingEnabled = true;
2491 }
2492 else
2493 {
2494 nudEventPolling.Enabled = false;
2495 string result = this.m_DocManager.RemoteSession.TransmitRPC("VEFA SET BMX POLL INTERVAL", "0");
2496 this.m_DocManager.RemoteSession.EventServices.EventPollingInterval = 5000;
2497 this.m_DocManager.RemoteSession.EventServices.IsEventPollingEnabled = false;
2498 }
2499 }
2500
2501 private void nudEventPolling_ValueChanged(object sender, EventArgs e)
2502 {
2503 string result = this.m_DocManager.RemoteSession.TransmitRPC("VEFA SET BMX POLL INTERVAL", nudEventPolling.Value.ToString());
2504 this.m_DocManager.RemoteSession.EventServices.IsEventPollingEnabled = false;
2505 this.m_DocManager.RemoteSession.EventServices.EventPollingInterval = (Convert.ToInt32(nudEventPolling.Value) * 1000);
2506 this.m_DocManager.RemoteSession.EventServices.IsEventPollingEnabled = true;
2507 }
2508 }
2509}
Note: See TracBrowser for help on using the repository browser.