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

Last change on this file since 1675 was 1513, checked in by Sam Habiel, 12 years ago

cmdChangeResourceGroup_Click changed so that it clears the in-memory resource groups before retrieving them again from the server. This prevents problems when renaming resource groups which when renamed will show up as a separate entry in the ResourceGroup table when repopulating that table from the server.
Fixes bug EHS#0000341.

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