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

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

Removed user-interface references to RPMS.

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