source: Scheduling/branches/BMX4Support/DManagement.cs@ 1189

Last change on this file since 1189 was 1075, checked in by Sam Habiel, 14 years ago

CalendarGrid: Handling for mouse scroll wheel added.
CGAppointments: Now supports Deep Cloning with Clone().
Updated Exes

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