source: BMXNET_RPMS_dotNET_UTILITIES-BMX/trunk/cs/bmx_0200scr/BMX2/BMXNetTest/frmBMXNetTest.cs@ 967

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

Support for other encodings besides ASCII. Constructors available in BMXNetLib and and BMXNetConnectInfo.
Comments in several files.

File size: 81.0 KB
Line 
1using System;
2using System.Drawing;
3using System.Collections;
4using System.ComponentModel;
5using System.Windows.Forms;
6using System.Data;
7using IndianHealthService.BMXNet;
8using System.Security.Principal;
9using System.Diagnostics;
10using System.Xml.Xsl;
11using System.Xml;
12
13namespace IndianHealthService.BMXNet
14{
15 /// <summary>
16 /// BMXNet demo form.
17 /// </summary>
18 public partial class frmBMXNetTest : System.Windows.Forms.Form
19 {
20 /// <summary>
21 /// Required designer variable.
22 /// </summary>
23 private System.ComponentModel.Container components = null;
24
25 public frmBMXNetTest()
26 {
27 InitializeComponent();
28 m_ci = new BMXNetConnectInfo();
29 }
30
31 /// <summary>
32 /// Clean up any resources being used.
33 /// </summary>
34 protected override void Dispose( bool disposing )
35 {
36 if( disposing )
37 {
38 if (m_ci != null)
39 m_ci.CloseConnection();
40 if (components != null)
41 {
42 components.Dispose();
43 }
44 }
45 base.Dispose( disposing );
46 }
47
48 #region Windows Form Designer generated code
49 /// <summary>
50 /// Required method for Designer support - do not modify
51 /// the contents of this method with the code editor.
52 /// </summary>
53 private void InitializeComponent()
54 {
55 this.mlTests = new System.Windows.Forms.TabControl();
56 this.tpaQuery = new System.Windows.Forms.TabPage();
57 this.panGrid = new System.Windows.Forms.Panel();
58 this.dataGrid2 = new System.Windows.Forms.DataGrid();
59 this.panQuery = new System.Windows.Forms.Panel();
60 this.cmdAddAll = new System.Windows.Forms.Button();
61 this.cmdXML = new System.Windows.Forms.Button();
62 this.cmdTest3 = new System.Windows.Forms.Button();
63 this.cmdTest4 = new System.Windows.Forms.Button();
64 this.cmdCancelChanges = new System.Windows.Forms.Button();
65 this.cmdAcceptChanges = new System.Windows.Forms.Button();
66 this.cmdExecuteQuery = new System.Windows.Forms.Button();
67 this.txtCommand = new System.Windows.Forms.TextBox();
68 this.tpaControls = new System.Windows.Forms.TabPage();
69 this.grpControls = new System.Windows.Forms.GroupBox();
70 this.label13 = new System.Windows.Forms.Label();
71 this.label9 = new System.Windows.Forms.Label();
72 this.lstCDSex = new System.Windows.Forms.ListBox();
73 this.dtpCDDOB = new System.Windows.Forms.DateTimePicker();
74 this.calCDDOB = new System.Windows.Forms.MonthCalendar();
75 this.cboCDSelect = new System.Windows.Forms.ComboBox();
76 this.label1 = new System.Windows.Forms.Label();
77 this.txtCDName = new System.Windows.Forms.TextBox();
78 this.lblCDIntro = new System.Windows.Forms.Label();
79 this.cmdCDLoad = new System.Windows.Forms.Button();
80 this.label2 = new System.Windows.Forms.Label();
81 this.txtCDSex = new System.Windows.Forms.TextBox();
82 this.label3 = new System.Windows.Forms.Label();
83 this.txtCDDOB = new System.Windows.Forms.TextBox();
84 this.txtCDSSN = new System.Windows.Forms.TextBox();
85 this.label8 = new System.Windows.Forms.Label();
86 this.label10 = new System.Windows.Forms.Label();
87 this.label11 = new System.Windows.Forms.Label();
88 this.label12 = new System.Windows.Forms.Label();
89 this.label4 = new System.Windows.Forms.Label();
90 this.tpaConnection = new System.Windows.Forms.TabPage();
91 this.cmdStopLogging = new System.Windows.Forms.Button();
92 this.cmdStartLogging = new System.Windows.Forms.Button();
93 this.cmdTestReceiveTimeout = new System.Windows.Forms.Button();
94 this.cmdTestSilent = new System.Windows.Forms.Button();
95 this.txtServer = new System.Windows.Forms.TextBox();
96 this.txtUser = new System.Windows.Forms.TextBox();
97 this.txtDivision = new System.Windows.Forms.TextBox();
98 this.cmdChangeDivision = new System.Windows.Forms.Button();
99 this.cmdChangeContext = new System.Windows.Forms.Button();
100 this.txtContext = new System.Windows.Forms.TextBox();
101 this.cmdChangeUser = new System.Windows.Forms.Button();
102 this.cmdChangeServer = new System.Windows.Forms.Button();
103 this.tpaOther = new System.Windows.Forms.TabPage();
104 this.label19 = new System.Windows.Forms.Label();
105 this.grdAsyncResult = new System.Windows.Forms.DataGrid();
106 this.label18 = new System.Windows.Forms.Label();
107 this.txtAsyncCommand = new System.Windows.Forms.TextBox();
108 this.cmdAsyncCall = new System.Windows.Forms.Button();
109 this.label17 = new System.Windows.Forms.Label();
110 this.txtEventMessages = new System.Windows.Forms.TextBox();
111 this.label16 = new System.Windows.Forms.Label();
112 this.chkEnableEvents = new System.Windows.Forms.CheckBox();
113 this.nudEventPollingInterval = new System.Windows.Forms.NumericUpDown();
114 this.chkEventRaiseBack = new System.Windows.Forms.CheckBox();
115 this.label15 = new System.Windows.Forms.Label();
116 this.txtEventParam = new System.Windows.Forms.TextBox();
117 this.label14 = new System.Windows.Forms.Label();
118 this.cmdUnregisterEvent = new System.Windows.Forms.Button();
119 this.txtUnregisterEvent = new System.Windows.Forms.TextBox();
120 this.cmdRaiseEvent = new System.Windows.Forms.Button();
121 this.txtRaiseEvent = new System.Windows.Forms.TextBox();
122 this.cmdRegisterEvent = new System.Windows.Forms.Button();
123 this.txtRegisterEvent = new System.Windows.Forms.TextBox();
124 this.grpPiece = new System.Windows.Forms.GroupBox();
125 this.txtDelim = new System.Windows.Forms.TextBox();
126 this.label7 = new System.Windows.Forms.Label();
127 this.label6 = new System.Windows.Forms.Label();
128 this.label5 = new System.Windows.Forms.Label();
129 this.txtEnd = new System.Windows.Forms.TextBox();
130 this.txtResult = new System.Windows.Forms.TextBox();
131 this.txtNumber = new System.Windows.Forms.TextBox();
132 this.txtInput = new System.Windows.Forms.TextBox();
133 this.cmdTestPiece = new System.Windows.Forms.Button();
134 this.cmdAcquireLock = new System.Windows.Forms.Button();
135 this.cmdReleaseLock = new System.Windows.Forms.Button();
136 this.cmdEventPollingInterval = new System.Windows.Forms.Button();
137 this.tabPage1 = new System.Windows.Forms.TabPage();
138 this.txtML = new System.Windows.Forms.TextBox();
139 this.lblML = new System.Windows.Forms.Label();
140 this.btnML = new System.Windows.Forms.Button();
141 this.mlTests.SuspendLayout();
142 this.tpaQuery.SuspendLayout();
143 this.panGrid.SuspendLayout();
144 ((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).BeginInit();
145 this.panQuery.SuspendLayout();
146 this.tpaControls.SuspendLayout();
147 this.grpControls.SuspendLayout();
148 this.tpaConnection.SuspendLayout();
149 this.tpaOther.SuspendLayout();
150 ((System.ComponentModel.ISupportInitialize)(this.grdAsyncResult)).BeginInit();
151 ((System.ComponentModel.ISupportInitialize)(this.nudEventPollingInterval)).BeginInit();
152 this.grpPiece.SuspendLayout();
153 this.tabPage1.SuspendLayout();
154 this.SuspendLayout();
155 //
156 // mlTests
157 //
158 this.mlTests.Controls.Add(this.tpaQuery);
159 this.mlTests.Controls.Add(this.tpaControls);
160 this.mlTests.Controls.Add(this.tpaConnection);
161 this.mlTests.Controls.Add(this.tpaOther);
162 this.mlTests.Controls.Add(this.tabPage1);
163 this.mlTests.Dock = System.Windows.Forms.DockStyle.Fill;
164 this.mlTests.Location = new System.Drawing.Point(0, 0);
165 this.mlTests.Name = "mlTests";
166 this.mlTests.SelectedIndex = 0;
167 this.mlTests.Size = new System.Drawing.Size(736, 566);
168 this.mlTests.TabIndex = 0;
169 //
170 // tpaQuery
171 //
172 this.tpaQuery.Controls.Add(this.panGrid);
173 this.tpaQuery.Controls.Add(this.panQuery);
174 this.tpaQuery.Location = new System.Drawing.Point(4, 22);
175 this.tpaQuery.Name = "tpaQuery";
176 this.tpaQuery.Size = new System.Drawing.Size(728, 540);
177 this.tpaQuery.TabIndex = 0;
178 this.tpaQuery.Text = "RPC and Query Testing";
179 //
180 // panGrid
181 //
182 this.panGrid.Controls.Add(this.dataGrid2);
183 this.panGrid.Dock = System.Windows.Forms.DockStyle.Fill;
184 this.panGrid.Location = new System.Drawing.Point(0, 216);
185 this.panGrid.Name = "panGrid";
186 this.panGrid.Size = new System.Drawing.Size(728, 324);
187 this.panGrid.TabIndex = 43;
188 //
189 // dataGrid2
190 //
191 this.dataGrid2.AccessibleName = "DataGrid";
192 this.dataGrid2.AccessibleRole = System.Windows.Forms.AccessibleRole.Table;
193 this.dataGrid2.DataMember = "";
194 this.dataGrid2.Dock = System.Windows.Forms.DockStyle.Fill;
195 this.dataGrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText;
196 this.dataGrid2.Location = new System.Drawing.Point(0, 0);
197 this.dataGrid2.Name = "dataGrid2";
198 this.dataGrid2.Size = new System.Drawing.Size(728, 324);
199 this.dataGrid2.TabIndex = 40;
200 this.dataGrid2.Navigate += new System.Windows.Forms.NavigateEventHandler(this.dataGrid2_Navigate);
201 //
202 // panQuery
203 //
204 this.panQuery.Controls.Add(this.cmdAddAll);
205 this.panQuery.Controls.Add(this.cmdXML);
206 this.panQuery.Controls.Add(this.cmdTest3);
207 this.panQuery.Controls.Add(this.cmdTest4);
208 this.panQuery.Controls.Add(this.cmdCancelChanges);
209 this.panQuery.Controls.Add(this.cmdAcceptChanges);
210 this.panQuery.Controls.Add(this.cmdExecuteQuery);
211 this.panQuery.Controls.Add(this.txtCommand);
212 this.panQuery.Dock = System.Windows.Forms.DockStyle.Top;
213 this.panQuery.Location = new System.Drawing.Point(0, 0);
214 this.panQuery.Name = "panQuery";
215 this.panQuery.Size = new System.Drawing.Size(728, 216);
216 this.panQuery.TabIndex = 42;
217 //
218 // cmdAddAll
219 //
220 this.cmdAddAll.Location = new System.Drawing.Point(344, 160);
221 this.cmdAddAll.Name = "cmdAddAll";
222 this.cmdAddAll.Size = new System.Drawing.Size(56, 32);
223 this.cmdAddAll.TabIndex = 78;
224 this.cmdAddAll.Text = "Add All";
225 this.cmdAddAll.Click += new System.EventHandler(this.cmdAddAll_Click);
226 //
227 // cmdXML
228 //
229 this.cmdXML.Location = new System.Drawing.Point(448, 160);
230 this.cmdXML.Name = "cmdXML";
231 this.cmdXML.Size = new System.Drawing.Size(56, 32);
232 this.cmdXML.TabIndex = 77;
233 this.cmdXML.Text = "XML";
234 this.cmdXML.Click += new System.EventHandler(this.cmdXML_Click);
235 //
236 // cmdTest3
237 //
238 this.cmdTest3.Location = new System.Drawing.Point(648, 160);
239 this.cmdTest3.Name = "cmdTest3";
240 this.cmdTest3.Size = new System.Drawing.Size(72, 32);
241 this.cmdTest3.TabIndex = 76;
242 this.cmdTest3.Text = "Low-Level TransmitRPC Demo";
243 this.cmdTest3.Click += new System.EventHandler(this.cmdTest3_Click);
244 //
245 // cmdTest4
246 //
247 this.cmdTest4.Location = new System.Drawing.Point(560, 160);
248 this.cmdTest4.Name = "cmdTest4";
249 this.cmdTest4.Size = new System.Drawing.Size(80, 32);
250 this.cmdTest4.TabIndex = 75;
251 this.cmdTest4.Text = "Table Relations Demo";
252 this.cmdTest4.Click += new System.EventHandler(this.cmdTest4_Click);
253 //
254 // cmdCancelChanges
255 //
256 this.cmdCancelChanges.Location = new System.Drawing.Point(232, 160);
257 this.cmdCancelChanges.Name = "cmdCancelChanges";
258 this.cmdCancelChanges.Size = new System.Drawing.Size(96, 32);
259 this.cmdCancelChanges.TabIndex = 74;
260 this.cmdCancelChanges.Text = "Cancel Changes";
261 this.cmdCancelChanges.Click += new System.EventHandler(this.cmdCancelChanges_Click);
262 //
263 // cmdAcceptChanges
264 //
265 this.cmdAcceptChanges.Location = new System.Drawing.Point(120, 160);
266 this.cmdAcceptChanges.Name = "cmdAcceptChanges";
267 this.cmdAcceptChanges.Size = new System.Drawing.Size(96, 32);
268 this.cmdAcceptChanges.TabIndex = 73;
269 this.cmdAcceptChanges.Text = "Accept Changes";
270 this.cmdAcceptChanges.Click += new System.EventHandler(this.cmdAcceptChanges_Click);
271 //
272 // cmdExecuteQuery
273 //
274 this.cmdExecuteQuery.Location = new System.Drawing.Point(16, 160);
275 this.cmdExecuteQuery.Name = "cmdExecuteQuery";
276 this.cmdExecuteQuery.Size = new System.Drawing.Size(96, 32);
277 this.cmdExecuteQuery.TabIndex = 71;
278 this.cmdExecuteQuery.Text = "Execute Query";
279 this.cmdExecuteQuery.Click += new System.EventHandler(this.cmdExecuteQuery_Click);
280 //
281 // txtCommand
282 //
283 this.txtCommand.Dock = System.Windows.Forms.DockStyle.Top;
284 this.txtCommand.Location = new System.Drawing.Point(0, 0);
285 this.txtCommand.Multiline = true;
286 this.txtCommand.Name = "txtCommand";
287 this.txtCommand.Size = new System.Drawing.Size(728, 152);
288 this.txtCommand.TabIndex = 72;
289 this.txtCommand.Text = "SELECT NAME, AGE, DOB FROM VA_PATIENT WHERE NAME LIKE \'END%\'";
290 //
291 // tpaControls
292 //
293 this.tpaControls.Controls.Add(this.grpControls);
294 this.tpaControls.Location = new System.Drawing.Point(4, 22);
295 this.tpaControls.Name = "tpaControls";
296 this.tpaControls.Size = new System.Drawing.Size(728, 540);
297 this.tpaControls.TabIndex = 3;
298 this.tpaControls.Text = "Controls Demo";
299 //
300 // grpControls
301 //
302 this.grpControls.Controls.Add(this.label13);
303 this.grpControls.Controls.Add(this.label9);
304 this.grpControls.Controls.Add(this.lstCDSex);
305 this.grpControls.Controls.Add(this.dtpCDDOB);
306 this.grpControls.Controls.Add(this.calCDDOB);
307 this.grpControls.Controls.Add(this.cboCDSelect);
308 this.grpControls.Controls.Add(this.label1);
309 this.grpControls.Controls.Add(this.txtCDName);
310 this.grpControls.Controls.Add(this.lblCDIntro);
311 this.grpControls.Controls.Add(this.cmdCDLoad);
312 this.grpControls.Controls.Add(this.label2);
313 this.grpControls.Controls.Add(this.txtCDSex);
314 this.grpControls.Controls.Add(this.label3);
315 this.grpControls.Controls.Add(this.txtCDDOB);
316 this.grpControls.Controls.Add(this.txtCDSSN);
317 this.grpControls.Controls.Add(this.label8);
318 this.grpControls.Controls.Add(this.label10);
319 this.grpControls.Controls.Add(this.label11);
320 this.grpControls.Controls.Add(this.label12);
321 this.grpControls.Controls.Add(this.label4);
322 this.grpControls.Location = new System.Drawing.Point(0, 8);
323 this.grpControls.Name = "grpControls";
324 this.grpControls.Size = new System.Drawing.Size(704, 520);
325 this.grpControls.TabIndex = 72;
326 this.grpControls.TabStop = false;
327 this.grpControls.Text = "Control demo";
328 //
329 // label13
330 //
331 this.label13.Location = new System.Drawing.Point(368, 128);
332 this.label13.Name = "label13";
333 this.label13.Size = new System.Drawing.Size(176, 24);
334 this.label13.TabIndex = 9;
335 this.label13.Text = "<-- Select a patient after loading the dataset";
336 //
337 // label9
338 //
339 this.label9.Location = new System.Drawing.Point(144, 80);
340 this.label9.Name = "label9";
341 this.label9.Size = new System.Drawing.Size(312, 24);
342 this.label9.TabIndex = 8;
343 this.label9.Text = "<---Press this button to load first 50 patients from VA Patient file into a datas" +
344 "et.";
345 //
346 // lstCDSex
347 //
348 this.lstCDSex.Items.AddRange(new object[] {
349 "MALE",
350 "FEMALE"});
351 this.lstCDSex.Location = new System.Drawing.Point(224, 264);
352 this.lstCDSex.Name = "lstCDSex";
353 this.lstCDSex.Size = new System.Drawing.Size(112, 17);
354 this.lstCDSex.TabIndex = 7;
355 //
356 // dtpCDDOB
357 //
358 this.dtpCDDOB.CustomFormat = "MMMM dd, yyyy";
359 this.dtpCDDOB.Location = new System.Drawing.Point(72, 392);
360 this.dtpCDDOB.Name = "dtpCDDOB";
361 this.dtpCDDOB.Size = new System.Drawing.Size(264, 20);
362 this.dtpCDDOB.TabIndex = 6;
363 //
364 // calCDDOB
365 //
366 this.calCDDOB.Location = new System.Drawing.Point(360, 344);
367 this.calCDDOB.Name = "calCDDOB";
368 this.calCDDOB.TabIndex = 5;
369 //
370 // cboCDSelect
371 //
372 this.cboCDSelect.Location = new System.Drawing.Point(96, 128);
373 this.cboCDSelect.Name = "cboCDSelect";
374 this.cboCDSelect.Size = new System.Drawing.Size(256, 21);
375 this.cboCDSelect.TabIndex = 4;
376 //
377 // label1
378 //
379 this.label1.Location = new System.Drawing.Point(16, 168);
380 this.label1.Name = "label1";
381 this.label1.Size = new System.Drawing.Size(40, 16);
382 this.label1.TabIndex = 3;
383 this.label1.Text = "Name:";
384 //
385 // txtCDName
386 //
387 this.txtCDName.Location = new System.Drawing.Point(72, 168);
388 this.txtCDName.Name = "txtCDName";
389 this.txtCDName.Size = new System.Drawing.Size(280, 20);
390 this.txtCDName.TabIndex = 2;
391 //
392 // lblCDIntro
393 //
394 this.lblCDIntro.Location = new System.Drawing.Point(24, 24);
395 this.lblCDIntro.Name = "lblCDIntro";
396 this.lblCDIntro.Size = new System.Drawing.Size(376, 32);
397 this.lblCDIntro.TabIndex = 1;
398 this.lblCDIntro.Text = "This panel demonstrates how to load data into various kinds of controls from a da" +
399 "taset.";
400 //
401 // cmdCDLoad
402 //
403 this.cmdCDLoad.Location = new System.Drawing.Point(32, 72);
404 this.cmdCDLoad.Name = "cmdCDLoad";
405 this.cmdCDLoad.Size = new System.Drawing.Size(96, 32);
406 this.cmdCDLoad.TabIndex = 0;
407 this.cmdCDLoad.Text = "Load Dataset";
408 this.cmdCDLoad.Click += new System.EventHandler(this.cmdCDLoad_Click);
409 //
410 // label2
411 //
412 this.label2.Location = new System.Drawing.Point(8, 128);
413 this.label2.Name = "label2";
414 this.label2.Size = new System.Drawing.Size(80, 16);
415 this.label2.TabIndex = 3;
416 this.label2.Text = "Select Patient:";
417 //
418 // txtCDSex
419 //
420 this.txtCDSex.Location = new System.Drawing.Point(72, 264);
421 this.txtCDSex.Name = "txtCDSex";
422 this.txtCDSex.Size = new System.Drawing.Size(72, 20);
423 this.txtCDSex.TabIndex = 2;
424 //
425 // label3
426 //
427 this.label3.Location = new System.Drawing.Point(72, 240);
428 this.label3.Name = "label3";
429 this.label3.Size = new System.Drawing.Size(128, 16);
430 this.label3.TabIndex = 3;
431 this.label3.Text = "Sex (Text Control):";
432 //
433 // txtCDDOB
434 //
435 this.txtCDDOB.Location = new System.Drawing.Point(72, 344);
436 this.txtCDDOB.Name = "txtCDDOB";
437 this.txtCDDOB.Size = new System.Drawing.Size(144, 20);
438 this.txtCDDOB.TabIndex = 2;
439 //
440 // txtCDSSN
441 //
442 this.txtCDSSN.Location = new System.Drawing.Point(72, 200);
443 this.txtCDSSN.Name = "txtCDSSN";
444 this.txtCDSSN.Size = new System.Drawing.Size(280, 20);
445 this.txtCDSSN.TabIndex = 2;
446 //
447 // label8
448 //
449 this.label8.Location = new System.Drawing.Point(16, 200);
450 this.label8.Name = "label8";
451 this.label8.Size = new System.Drawing.Size(40, 16);
452 this.label8.TabIndex = 3;
453 this.label8.Text = "SSN:";
454 //
455 // label10
456 //
457 this.label10.Location = new System.Drawing.Point(72, 368);
458 this.label10.Name = "label10";
459 this.label10.Size = new System.Drawing.Size(136, 16);
460 this.label10.TabIndex = 3;
461 this.label10.Text = "DOB (DateTime Picker):";
462 //
463 // label11
464 //
465 this.label11.Location = new System.Drawing.Point(72, 320);
466 this.label11.Name = "label11";
467 this.label11.Size = new System.Drawing.Size(128, 16);
468 this.label11.TabIndex = 3;
469 this.label11.Text = "DOB (Text Control):";
470 //
471 // label12
472 //
473 this.label12.Location = new System.Drawing.Point(360, 320);
474 this.label12.Name = "label12";
475 this.label12.Size = new System.Drawing.Size(200, 16);
476 this.label12.TabIndex = 3;
477 this.label12.Text = "DOB (Calendar Control):";
478 //
479 // label4
480 //
481 this.label4.Location = new System.Drawing.Point(224, 240);
482 this.label4.Name = "label4";
483 this.label4.Size = new System.Drawing.Size(128, 16);
484 this.label4.TabIndex = 3;
485 this.label4.Text = "Sex (ListBox Control):";
486 //
487 // tpaConnection
488 //
489 this.tpaConnection.Controls.Add(this.cmdStopLogging);
490 this.tpaConnection.Controls.Add(this.cmdStartLogging);
491 this.tpaConnection.Controls.Add(this.cmdTestReceiveTimeout);
492 this.tpaConnection.Controls.Add(this.cmdTestSilent);
493 this.tpaConnection.Controls.Add(this.txtServer);
494 this.tpaConnection.Controls.Add(this.txtUser);
495 this.tpaConnection.Controls.Add(this.txtDivision);
496 this.tpaConnection.Controls.Add(this.cmdChangeDivision);
497 this.tpaConnection.Controls.Add(this.cmdChangeContext);
498 this.tpaConnection.Controls.Add(this.txtContext);
499 this.tpaConnection.Controls.Add(this.cmdChangeUser);
500 this.tpaConnection.Controls.Add(this.cmdChangeServer);
501 this.tpaConnection.Location = new System.Drawing.Point(4, 22);
502 this.tpaConnection.Name = "tpaConnection";
503 this.tpaConnection.Size = new System.Drawing.Size(728, 540);
504 this.tpaConnection.TabIndex = 1;
505 this.tpaConnection.Text = "Connection";
506 //
507 // cmdStopLogging
508 //
509 this.cmdStopLogging.Location = new System.Drawing.Point(16, 393);
510 this.cmdStopLogging.Name = "cmdStopLogging";
511 this.cmdStopLogging.Size = new System.Drawing.Size(152, 28);
512 this.cmdStopLogging.TabIndex = 85;
513 this.cmdStopLogging.Text = "Stop Logging";
514 this.cmdStopLogging.UseVisualStyleBackColor = true;
515 this.cmdStopLogging.Click += new System.EventHandler(this.cmdStopLogging_Click);
516 //
517 // cmdStartLogging
518 //
519 this.cmdStartLogging.Location = new System.Drawing.Point(16, 346);
520 this.cmdStartLogging.Name = "cmdStartLogging";
521 this.cmdStartLogging.Size = new System.Drawing.Size(152, 28);
522 this.cmdStartLogging.TabIndex = 84;
523 this.cmdStartLogging.Text = "Start Logging";
524 this.cmdStartLogging.UseVisualStyleBackColor = true;
525 this.cmdStartLogging.Click += new System.EventHandler(this.cmdStartLogging_Click);
526 //
527 // cmdTestReceiveTimeout
528 //
529 this.cmdTestReceiveTimeout.Location = new System.Drawing.Point(16, 294);
530 this.cmdTestReceiveTimeout.Name = "cmdTestReceiveTimeout";
531 this.cmdTestReceiveTimeout.Size = new System.Drawing.Size(152, 28);
532 this.cmdTestReceiveTimeout.TabIndex = 83;
533 this.cmdTestReceiveTimeout.Text = "Test Receive Timeout";
534 this.cmdTestReceiveTimeout.UseVisualStyleBackColor = true;
535 this.cmdTestReceiveTimeout.Visible = false;
536 this.cmdTestReceiveTimeout.Click += new System.EventHandler(this.cmdTestReceiveTimeout_Click);
537 //
538 // cmdTestSilent
539 //
540 this.cmdTestSilent.Location = new System.Drawing.Point(16, 248);
541 this.cmdTestSilent.Name = "cmdTestSilent";
542 this.cmdTestSilent.Size = new System.Drawing.Size(152, 28);
543 this.cmdTestSilent.TabIndex = 82;
544 this.cmdTestSilent.Text = "Test Silent Login";
545 this.cmdTestSilent.UseVisualStyleBackColor = true;
546 this.cmdTestSilent.Visible = false;
547 this.cmdTestSilent.Click += new System.EventHandler(this.cmdTestSilent_Click);
548 //
549 // txtServer
550 //
551 this.txtServer.Location = new System.Drawing.Point(176, 24);
552 this.txtServer.Name = "txtServer";
553 this.txtServer.ReadOnly = true;
554 this.txtServer.Size = new System.Drawing.Size(200, 20);
555 this.txtServer.TabIndex = 81;
556 //
557 // txtUser
558 //
559 this.txtUser.Location = new System.Drawing.Point(176, 64);
560 this.txtUser.Name = "txtUser";
561 this.txtUser.ReadOnly = true;
562 this.txtUser.Size = new System.Drawing.Size(200, 20);
563 this.txtUser.TabIndex = 80;
564 //
565 // txtDivision
566 //
567 this.txtDivision.Location = new System.Drawing.Point(176, 104);
568 this.txtDivision.Name = "txtDivision";
569 this.txtDivision.Size = new System.Drawing.Size(200, 20);
570 this.txtDivision.TabIndex = 79;
571 //
572 // cmdChangeDivision
573 //
574 this.cmdChangeDivision.Location = new System.Drawing.Point(16, 96);
575 this.cmdChangeDivision.Name = "cmdChangeDivision";
576 this.cmdChangeDivision.Size = new System.Drawing.Size(152, 32);
577 this.cmdChangeDivision.TabIndex = 78;
578 this.cmdChangeDivision.Text = "Change Division";
579 this.cmdChangeDivision.Click += new System.EventHandler(this.cmdChangeDivision_Click);
580 //
581 // cmdChangeContext
582 //
583 this.cmdChangeContext.Location = new System.Drawing.Point(16, 136);
584 this.cmdChangeContext.Name = "cmdChangeContext";
585 this.cmdChangeContext.Size = new System.Drawing.Size(152, 32);
586 this.cmdChangeContext.TabIndex = 77;
587 this.cmdChangeContext.Text = "Change Application Context";
588 this.cmdChangeContext.Click += new System.EventHandler(this.cmdChangeContext_Click);
589 //
590 // txtContext
591 //
592 this.txtContext.Location = new System.Drawing.Point(176, 144);
593 this.txtContext.Name = "txtContext";
594 this.txtContext.Size = new System.Drawing.Size(200, 20);
595 this.txtContext.TabIndex = 76;
596 //
597 // cmdChangeUser
598 //
599 this.cmdChangeUser.Location = new System.Drawing.Point(16, 56);
600 this.cmdChangeUser.Name = "cmdChangeUser";
601 this.cmdChangeUser.Size = new System.Drawing.Size(152, 32);
602 this.cmdChangeUser.TabIndex = 74;
603 this.cmdChangeUser.Text = "Change RPMS User Login";
604 this.cmdChangeUser.Click += new System.EventHandler(this.cmdChangeUser_Click);
605 //
606 // cmdChangeServer
607 //
608 this.cmdChangeServer.Location = new System.Drawing.Point(16, 16);
609 this.cmdChangeServer.Name = "cmdChangeServer";
610 this.cmdChangeServer.Size = new System.Drawing.Size(152, 32);
611 this.cmdChangeServer.TabIndex = 73;
612 this.cmdChangeServer.Text = "Change RPMS Server";
613 this.cmdChangeServer.Click += new System.EventHandler(this.cmdChangeServer_Click);
614 //
615 // tpaOther
616 //
617 this.tpaOther.Controls.Add(this.label19);
618 this.tpaOther.Controls.Add(this.grdAsyncResult);
619 this.tpaOther.Controls.Add(this.label18);
620 this.tpaOther.Controls.Add(this.txtAsyncCommand);
621 this.tpaOther.Controls.Add(this.cmdAsyncCall);
622 this.tpaOther.Controls.Add(this.label17);
623 this.tpaOther.Controls.Add(this.txtEventMessages);
624 this.tpaOther.Controls.Add(this.label16);
625 this.tpaOther.Controls.Add(this.chkEnableEvents);
626 this.tpaOther.Controls.Add(this.nudEventPollingInterval);
627 this.tpaOther.Controls.Add(this.chkEventRaiseBack);
628 this.tpaOther.Controls.Add(this.label15);
629 this.tpaOther.Controls.Add(this.txtEventParam);
630 this.tpaOther.Controls.Add(this.label14);
631 this.tpaOther.Controls.Add(this.cmdUnregisterEvent);
632 this.tpaOther.Controls.Add(this.txtUnregisterEvent);
633 this.tpaOther.Controls.Add(this.cmdRaiseEvent);
634 this.tpaOther.Controls.Add(this.txtRaiseEvent);
635 this.tpaOther.Controls.Add(this.cmdRegisterEvent);
636 this.tpaOther.Controls.Add(this.txtRegisterEvent);
637 this.tpaOther.Controls.Add(this.grpPiece);
638 this.tpaOther.Controls.Add(this.cmdAcquireLock);
639 this.tpaOther.Controls.Add(this.cmdReleaseLock);
640 this.tpaOther.Controls.Add(this.cmdEventPollingInterval);
641 this.tpaOther.Location = new System.Drawing.Point(4, 22);
642 this.tpaOther.Name = "tpaOther";
643 this.tpaOther.Size = new System.Drawing.Size(728, 540);
644 this.tpaOther.TabIndex = 2;
645 this.tpaOther.Text = "Events";
646 //
647 // label19
648 //
649 this.label19.Location = new System.Drawing.Point(416, 176);
650 this.label19.Name = "label19";
651 this.label19.Size = new System.Drawing.Size(160, 16);
652 this.label19.TabIndex = 107;
653 this.label19.Text = "Asyncronous Result Set";
654 //
655 // grdAsyncResult
656 //
657 this.grdAsyncResult.DataMember = "";
658 this.grdAsyncResult.HeaderForeColor = System.Drawing.SystemColors.ControlText;
659 this.grdAsyncResult.Location = new System.Drawing.Point(416, 192);
660 this.grdAsyncResult.Name = "grdAsyncResult";
661 this.grdAsyncResult.Size = new System.Drawing.Size(296, 304);
662 this.grdAsyncResult.TabIndex = 106;
663 //
664 // label18
665 //
666 this.label18.Location = new System.Drawing.Point(416, 40);
667 this.label18.Name = "label18";
668 this.label18.Size = new System.Drawing.Size(160, 16);
669 this.label18.TabIndex = 105;
670 this.label18.Text = "Command String:";
671 //
672 // txtAsyncCommand
673 //
674 this.txtAsyncCommand.Location = new System.Drawing.Point(416, 56);
675 this.txtAsyncCommand.Multiline = true;
676 this.txtAsyncCommand.Name = "txtAsyncCommand";
677 this.txtAsyncCommand.Size = new System.Drawing.Size(288, 48);
678 this.txtAsyncCommand.TabIndex = 104;
679 this.txtAsyncCommand.Text = "BMX DEMO^W^15";
680 //
681 // cmdAsyncCall
682 //
683 this.cmdAsyncCall.Location = new System.Drawing.Point(416, 120);
684 this.cmdAsyncCall.Name = "cmdAsyncCall";
685 this.cmdAsyncCall.Size = new System.Drawing.Size(144, 32);
686 this.cmdAsyncCall.TabIndex = 103;
687 this.cmdAsyncCall.Text = "Make Asynchronous Call";
688 this.cmdAsyncCall.Click += new System.EventHandler(this.cmdAsyncCall_Click);
689 //
690 // label17
691 //
692 this.label17.Location = new System.Drawing.Point(24, 288);
693 this.label17.Name = "label17";
694 this.label17.Size = new System.Drawing.Size(160, 16);
695 this.label17.TabIndex = 102;
696 this.label17.Text = "Event Messages";
697 //
698 // txtEventMessages
699 //
700 this.txtEventMessages.Location = new System.Drawing.Point(24, 304);
701 this.txtEventMessages.Multiline = true;
702 this.txtEventMessages.Name = "txtEventMessages";
703 this.txtEventMessages.Size = new System.Drawing.Size(360, 40);
704 this.txtEventMessages.TabIndex = 101;
705 //
706 // label16
707 //
708 this.label16.Location = new System.Drawing.Point(272, 232);
709 this.label16.Name = "label16";
710 this.label16.Size = new System.Drawing.Size(96, 16);
711 this.label16.TabIndex = 100;
712 this.label16.Text = "(milliseconds)";
713 //
714 // chkEnableEvents
715 //
716 this.chkEnableEvents.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
717 this.chkEnableEvents.Location = new System.Drawing.Point(184, 16);
718 this.chkEnableEvents.Name = "chkEnableEvents";
719 this.chkEnableEvents.Size = new System.Drawing.Size(104, 16);
720 this.chkEnableEvents.TabIndex = 99;
721 this.chkEnableEvents.Text = "Enable Events";
722 this.chkEnableEvents.CheckedChanged += new System.EventHandler(this.chkEnableEvents_CheckedChanged);
723 //
724 // nudEventPollingInterval
725 //
726 this.nudEventPollingInterval.Increment = new decimal(new int[] {
727 500,
728 0,
729 0,
730 0});
731 this.nudEventPollingInterval.Location = new System.Drawing.Point(192, 232);
732 this.nudEventPollingInterval.Maximum = new decimal(new int[] {
733 10000,
734 0,
735 0,
736 0});
737 this.nudEventPollingInterval.Minimum = new decimal(new int[] {
738 1,
739 0,
740 0,
741 0});
742 this.nudEventPollingInterval.Name = "nudEventPollingInterval";
743 this.nudEventPollingInterval.Size = new System.Drawing.Size(64, 20);
744 this.nudEventPollingInterval.TabIndex = 98;
745 this.nudEventPollingInterval.Value = new decimal(new int[] {
746 3000,
747 0,
748 0,
749 0});
750 this.nudEventPollingInterval.ValueChanged += new System.EventHandler(this.nudEventPollingInterval_ValueChanged);
751 //
752 // chkEventRaiseBack
753 //
754 this.chkEventRaiseBack.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
755 this.chkEventRaiseBack.Checked = true;
756 this.chkEventRaiseBack.CheckState = System.Windows.Forms.CheckState.Checked;
757 this.chkEventRaiseBack.Location = new System.Drawing.Point(192, 160);
758 this.chkEventRaiseBack.Name = "chkEventRaiseBack";
759 this.chkEventRaiseBack.Size = new System.Drawing.Size(96, 16);
760 this.chkEventRaiseBack.TabIndex = 97;
761 this.chkEventRaiseBack.Text = "Raise Back";
762 //
763 // label15
764 //
765 this.label15.Location = new System.Drawing.Point(192, 128);
766 this.label15.Name = "label15";
767 this.label15.Size = new System.Drawing.Size(48, 16);
768 this.label15.TabIndex = 96;
769 this.label15.Text = "Param";
770 //
771 // txtEventParam
772 //
773 this.txtEventParam.Location = new System.Drawing.Point(240, 128);
774 this.txtEventParam.Name = "txtEventParam";
775 this.txtEventParam.Size = new System.Drawing.Size(144, 20);
776 this.txtEventParam.TabIndex = 95;
777 //
778 // label14
779 //
780 this.label14.Location = new System.Drawing.Point(192, 98);
781 this.label14.Name = "label14";
782 this.label14.Size = new System.Drawing.Size(48, 16);
783 this.label14.TabIndex = 94;
784 this.label14.Text = "Event";
785 //
786 // cmdUnregisterEvent
787 //
788 this.cmdUnregisterEvent.Location = new System.Drawing.Point(24, 184);
789 this.cmdUnregisterEvent.Name = "cmdUnregisterEvent";
790 this.cmdUnregisterEvent.Size = new System.Drawing.Size(152, 32);
791 this.cmdUnregisterEvent.TabIndex = 93;
792 this.cmdUnregisterEvent.Text = "UnSubscribe Event";
793 this.cmdUnregisterEvent.Click += new System.EventHandler(this.cmdUnregisterEvent_Click);
794 //
795 // txtUnregisterEvent
796 //
797 this.txtUnregisterEvent.Location = new System.Drawing.Point(184, 192);
798 this.txtUnregisterEvent.Name = "txtUnregisterEvent";
799 this.txtUnregisterEvent.Size = new System.Drawing.Size(200, 20);
800 this.txtUnregisterEvent.TabIndex = 92;
801 //
802 // cmdRaiseEvent
803 //
804 this.cmdRaiseEvent.Location = new System.Drawing.Point(24, 88);
805 this.cmdRaiseEvent.Name = "cmdRaiseEvent";
806 this.cmdRaiseEvent.Size = new System.Drawing.Size(152, 32);
807 this.cmdRaiseEvent.TabIndex = 91;
808 this.cmdRaiseEvent.Text = "Raise Event";
809 this.cmdRaiseEvent.Click += new System.EventHandler(this.cmdRaiseEvent_Click);
810 //
811 // txtRaiseEvent
812 //
813 this.txtRaiseEvent.Location = new System.Drawing.Point(240, 96);
814 this.txtRaiseEvent.Name = "txtRaiseEvent";
815 this.txtRaiseEvent.Size = new System.Drawing.Size(144, 20);
816 this.txtRaiseEvent.TabIndex = 90;
817 //
818 // cmdRegisterEvent
819 //
820 this.cmdRegisterEvent.Location = new System.Drawing.Point(24, 48);
821 this.cmdRegisterEvent.Name = "cmdRegisterEvent";
822 this.cmdRegisterEvent.Size = new System.Drawing.Size(152, 32);
823 this.cmdRegisterEvent.TabIndex = 89;
824 this.cmdRegisterEvent.Text = "Subscribe Event";
825 this.cmdRegisterEvent.Click += new System.EventHandler(this.cmdRegisterEvent_Click);
826 //
827 // txtRegisterEvent
828 //
829 this.txtRegisterEvent.Location = new System.Drawing.Point(184, 56);
830 this.txtRegisterEvent.Name = "txtRegisterEvent";
831 this.txtRegisterEvent.Size = new System.Drawing.Size(200, 20);
832 this.txtRegisterEvent.TabIndex = 88;
833 //
834 // grpPiece
835 //
836 this.grpPiece.Controls.Add(this.txtDelim);
837 this.grpPiece.Controls.Add(this.label7);
838 this.grpPiece.Controls.Add(this.label6);
839 this.grpPiece.Controls.Add(this.label5);
840 this.grpPiece.Controls.Add(this.txtEnd);
841 this.grpPiece.Controls.Add(this.txtResult);
842 this.grpPiece.Controls.Add(this.txtNumber);
843 this.grpPiece.Controls.Add(this.txtInput);
844 this.grpPiece.Controls.Add(this.cmdTestPiece);
845 this.grpPiece.Enabled = false;
846 this.grpPiece.Location = new System.Drawing.Point(24, 408);
847 this.grpPiece.Name = "grpPiece";
848 this.grpPiece.Size = new System.Drawing.Size(264, 120);
849 this.grpPiece.TabIndex = 71;
850 this.grpPiece.TabStop = false;
851 this.grpPiece.Text = "Piece Function Testing";
852 this.grpPiece.Visible = false;
853 //
854 // txtDelim
855 //
856 this.txtDelim.Location = new System.Drawing.Point(24, 56);
857 this.txtDelim.Name = "txtDelim";
858 this.txtDelim.Size = new System.Drawing.Size(16, 20);
859 this.txtDelim.TabIndex = 55;
860 this.txtDelim.Text = "^";
861 //
862 // label7
863 //
864 this.label7.Location = new System.Drawing.Point(96, 40);
865 this.label7.Name = "label7";
866 this.label7.Size = new System.Drawing.Size(48, 16);
867 this.label7.TabIndex = 54;
868 this.label7.Text = "End:";
869 this.label7.TextAlign = System.Drawing.ContentAlignment.TopRight;
870 //
871 // label6
872 //
873 this.label6.Location = new System.Drawing.Point(48, 40);
874 this.label6.Name = "label6";
875 this.label6.Size = new System.Drawing.Size(48, 16);
876 this.label6.TabIndex = 53;
877 this.label6.Text = "Start:";
878 this.label6.TextAlign = System.Drawing.ContentAlignment.TopRight;
879 //
880 // label5
881 //
882 this.label5.Location = new System.Drawing.Point(8, 40);
883 this.label5.Name = "label5";
884 this.label5.Size = new System.Drawing.Size(48, 16);
885 this.label5.TabIndex = 52;
886 this.label5.Text = "Delim:";
887 this.label5.TextAlign = System.Drawing.ContentAlignment.TopRight;
888 //
889 // txtEnd
890 //
891 this.txtEnd.Location = new System.Drawing.Point(112, 56);
892 this.txtEnd.Name = "txtEnd";
893 this.txtEnd.Size = new System.Drawing.Size(32, 20);
894 this.txtEnd.TabIndex = 45;
895 this.txtEnd.Text = "3";
896 //
897 // txtResult
898 //
899 this.txtResult.Location = new System.Drawing.Point(16, 88);
900 this.txtResult.Name = "txtResult";
901 this.txtResult.Size = new System.Drawing.Size(208, 20);
902 this.txtResult.TabIndex = 44;
903 //
904 // txtNumber
905 //
906 this.txtNumber.Location = new System.Drawing.Point(64, 56);
907 this.txtNumber.Name = "txtNumber";
908 this.txtNumber.Size = new System.Drawing.Size(32, 20);
909 this.txtNumber.TabIndex = 43;
910 this.txtNumber.Text = "2";
911 //
912 // txtInput
913 //
914 this.txtInput.Location = new System.Drawing.Point(16, 16);
915 this.txtInput.Name = "txtInput";
916 this.txtInput.Size = new System.Drawing.Size(200, 20);
917 this.txtInput.TabIndex = 42;
918 this.txtInput.Text = "1^2^3^4";
919 //
920 // cmdTestPiece
921 //
922 this.cmdTestPiece.Location = new System.Drawing.Point(152, 56);
923 this.cmdTestPiece.Name = "cmdTestPiece";
924 this.cmdTestPiece.Size = new System.Drawing.Size(72, 24);
925 this.cmdTestPiece.TabIndex = 41;
926 this.cmdTestPiece.Text = "Test Piece";
927 this.cmdTestPiece.Click += new System.EventHandler(this.cmdTestPiece_Click_1);
928 //
929 // cmdAcquireLock
930 //
931 this.cmdAcquireLock.Location = new System.Drawing.Point(24, 360);
932 this.cmdAcquireLock.Name = "cmdAcquireLock";
933 this.cmdAcquireLock.Size = new System.Drawing.Size(104, 32);
934 this.cmdAcquireLock.TabIndex = 89;
935 this.cmdAcquireLock.Text = "Acquire Lock";
936 this.cmdAcquireLock.Click += new System.EventHandler(this.cmdAcquireLock_Click);
937 //
938 // cmdReleaseLock
939 //
940 this.cmdReleaseLock.Location = new System.Drawing.Point(136, 360);
941 this.cmdReleaseLock.Name = "cmdReleaseLock";
942 this.cmdReleaseLock.Size = new System.Drawing.Size(88, 32);
943 this.cmdReleaseLock.TabIndex = 89;
944 this.cmdReleaseLock.Text = "Release Lock";
945 this.cmdReleaseLock.Click += new System.EventHandler(this.cmdReleaseLock_Click);
946 //
947 // cmdEventPollingInterval
948 //
949 this.cmdEventPollingInterval.Location = new System.Drawing.Point(24, 226);
950 this.cmdEventPollingInterval.Name = "cmdEventPollingInterval";
951 this.cmdEventPollingInterval.Size = new System.Drawing.Size(152, 32);
952 this.cmdEventPollingInterval.TabIndex = 93;
953 this.cmdEventPollingInterval.Text = "Event Polling Interval";
954 //
955 // tabPage1
956 //
957 this.tabPage1.Controls.Add(this.btnML);
958 this.tabPage1.Controls.Add(this.lblML);
959 this.tabPage1.Controls.Add(this.txtML);
960 this.tabPage1.Location = new System.Drawing.Point(4, 22);
961 this.tabPage1.Name = "tabPage1";
962 this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
963 this.tabPage1.Size = new System.Drawing.Size(728, 540);
964 this.tabPage1.TabIndex = 4;
965 this.tabPage1.Text = "Multi Lingual Tests";
966 this.tabPage1.UseVisualStyleBackColor = true;
967 //
968 // txtML
969 //
970 this.txtML.Location = new System.Drawing.Point(177, 66);
971 this.txtML.Name = "txtML";
972 this.txtML.Size = new System.Drawing.Size(100, 20);
973 this.txtML.TabIndex = 0;
974 //
975 // lblML
976 //
977 this.lblML.AutoSize = true;
978 this.lblML.Location = new System.Drawing.Point(51, 66);
979 this.lblML.Name = "lblML";
980 this.lblML.Size = new System.Drawing.Size(110, 13);
981 this.lblML.TabIndex = 1;
982 this.lblML.Text = "Type Something Here";
983 //
984 // btnML
985 //
986 this.btnML.Location = new System.Drawing.Point(132, 112);
987 this.btnML.Name = "btnML";
988 this.btnML.Size = new System.Drawing.Size(75, 23);
989 this.btnML.TabIndex = 2;
990 this.btnML.Text = "Store Data";
991 this.btnML.UseVisualStyleBackColor = true;
992 this.btnML.Click += new System.EventHandler(this.btnML_Click);
993 //
994 // frmBMXNetTest
995 //
996 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
997 this.ClientSize = new System.Drawing.Size(736, 566);
998 this.Controls.Add(this.mlTests);
999 this.Name = "frmBMXNetTest";
1000 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
1001 this.Text = "BMXNet Test Application";
1002 this.Load += new System.EventHandler(this.frmBMXNetTest_Load);
1003 this.mlTests.ResumeLayout(false);
1004 this.tpaQuery.ResumeLayout(false);
1005 this.panGrid.ResumeLayout(false);
1006 ((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).EndInit();
1007 this.panQuery.ResumeLayout(false);
1008 this.panQuery.PerformLayout();
1009 this.tpaControls.ResumeLayout(false);
1010 this.grpControls.ResumeLayout(false);
1011 this.grpControls.PerformLayout();
1012 this.tpaConnection.ResumeLayout(false);
1013 this.tpaConnection.PerformLayout();
1014 this.tpaOther.ResumeLayout(false);
1015 this.tpaOther.PerformLayout();
1016 ((System.ComponentModel.ISupportInitialize)(this.grdAsyncResult)).EndInit();
1017 ((System.ComponentModel.ISupportInitialize)(this.nudEventPollingInterval)).EndInit();
1018 this.grpPiece.ResumeLayout(false);
1019 this.grpPiece.PerformLayout();
1020 this.tabPage1.ResumeLayout(false);
1021 this.tabPage1.PerformLayout();
1022 this.ResumeLayout(false);
1023
1024 }
1025 #endregion
1026
1027 /// <summary>
1028 /// The main entry point for the application.
1029 /// </summary>
1030 [STAThread]
1031 static void Main()
1032 {
1033 try
1034 {
1035 Application.Run(new frmBMXNetTest());
1036 return;
1037 }
1038 catch (Exception ex)
1039 {
1040 MessageBox.Show("BMXNetTest Error: " + ex.Message, "BMXNetTest", MessageBoxButtons.OK, MessageBoxIcon.Error);
1041 return;
1042 }
1043
1044 }
1045
1046 private BMXNetConnectInfo m_ci;
1047 private System.Windows.Forms.TabControl mlTests;
1048 private System.Windows.Forms.DataGrid dataGrid2;
1049 private System.Windows.Forms.Button cmdCancelChanges;
1050 private System.Windows.Forms.TextBox txtCommand;
1051 private System.Windows.Forms.TextBox txtContext;
1052 private System.Windows.Forms.Button cmdChangeUser;
1053 private System.Windows.Forms.Button cmdChangeServer;
1054 private System.Windows.Forms.Button cmdChangeContext;
1055 private System.Windows.Forms.Button cmdChangeDivision;
1056 private System.Windows.Forms.TextBox txtDivision;
1057 private System.Windows.Forms.TextBox txtUser;
1058 private System.Windows.Forms.TextBox txtServer;
1059 private System.Windows.Forms.TabPage tpaQuery;
1060 private System.Windows.Forms.Panel panGrid;
1061 private System.Windows.Forms.Panel panQuery;
1062 private System.Windows.Forms.TabPage tpaConnection;
1063 private System.Windows.Forms.TabPage tpaOther;
1064 private System.Windows.Forms.GroupBox grpPiece;
1065 private System.Windows.Forms.TextBox txtDelim;
1066 private System.Windows.Forms.Label label7;
1067 private System.Windows.Forms.Label label6;
1068 private System.Windows.Forms.Label label5;
1069 private System.Windows.Forms.TextBox txtEnd;
1070 private System.Windows.Forms.TextBox txtResult;
1071 private System.Windows.Forms.TextBox txtNumber;
1072 private System.Windows.Forms.TextBox txtInput;
1073 private System.Windows.Forms.Button cmdTestPiece;
1074 private System.Windows.Forms.Button cmdTest4;
1075 private System.Windows.Forms.Button cmdTest3;
1076 private System.Windows.Forms.Button cmdExecuteQuery;
1077 private System.Windows.Forms.Button cmdAcceptChanges;
1078 private System.Windows.Forms.Button cmdXML;
1079 private System.Windows.Forms.GroupBox grpControls;
1080 private System.Windows.Forms.Button cmdCDLoad;
1081 private System.Windows.Forms.Label lblCDIntro;
1082 private System.Windows.Forms.Label label1;
1083 private System.Windows.Forms.TextBox txtCDName;
1084 private System.Windows.Forms.Label label2;
1085 private System.Windows.Forms.Label label3;
1086 private System.Windows.Forms.Label label8;
1087 private System.Windows.Forms.TextBox txtCDSex;
1088 private System.Windows.Forms.TextBox txtCDDOB;
1089 private System.Windows.Forms.TextBox txtCDSSN;
1090 private System.Windows.Forms.ComboBox cboCDSelect;
1091 private System.Windows.Forms.MonthCalendar calCDDOB;
1092 private System.Windows.Forms.TabPage tpaControls;
1093 private System.Windows.Forms.DateTimePicker dtpCDDOB;
1094 private System.Windows.Forms.Label label10;
1095 private System.Windows.Forms.Label label11;
1096 private System.Windows.Forms.Label label12;
1097 private System.Windows.Forms.ListBox lstCDSex;
1098 private System.Windows.Forms.Label label4;
1099 private System.Windows.Forms.Label label9;
1100 private System.Windows.Forms.Label label13;
1101 private System.Windows.Forms.Button cmdAddAll;
1102 private System.Windows.Forms.Button cmdUnregisterEvent;
1103 private System.Windows.Forms.TextBox txtUnregisterEvent;
1104 private System.Windows.Forms.Button cmdRaiseEvent;
1105 private System.Windows.Forms.TextBox txtRaiseEvent;
1106 private System.Windows.Forms.Button cmdRegisterEvent;
1107 private System.Windows.Forms.TextBox txtRegisterEvent;
1108 private System.Windows.Forms.Label label14;
1109 private System.Windows.Forms.Label label15;
1110 private System.Windows.Forms.TextBox txtEventParam;
1111 private System.Windows.Forms.CheckBox chkEventRaiseBack;
1112 private System.Windows.Forms.Button cmdAcquireLock;
1113 private System.Windows.Forms.Button cmdReleaseLock;
1114 private System.Windows.Forms.Button cmdEventPollingInterval;
1115 private System.Windows.Forms.NumericUpDown nudEventPollingInterval;
1116 private System.Windows.Forms.CheckBox chkEnableEvents;
1117 private System.Windows.Forms.Label label16;
1118 private System.Windows.Forms.TextBox txtEventMessages;
1119 private System.Windows.Forms.Label label17;
1120 private System.Windows.Forms.Button cmdAsyncCall;
1121 private System.Windows.Forms.TextBox txtAsyncCommand;
1122 private System.Windows.Forms.Label label18;
1123 private System.Windows.Forms.DataGrid grdAsyncResult;
1124 private System.Windows.Forms.Label label19;
1125 private Button cmdTestSilent;
1126 private Button cmdTestReceiveTimeout;
1127 private Button cmdStopLogging;
1128 private Button cmdStartLogging;
1129 private TabPage tabPage1;
1130 private Button btnML;
1131 private Label lblML;
1132 private TextBox txtML;
1133 BMXNetDataAdapter m_da = new BMXNetDataAdapter();
1134
1135
1136
1137 private void frmBMXNetTest_Load(object sender, System.EventArgs e)
1138 {
1139 //Basic steps to establish a BMXNet connection.
1140 //The first time a user connects, he will be prompted for
1141 //server info and passwords.
1142 //Subsequent connect requests will use cached information.
1143 //Note that LoadConnectInfo maintain's an internal copy
1144 //of a BMXNetLib object which is accessible from the
1145 //bmxNetLib property
1146 //
1147 //Use the ADO.NET provider methods or the BMXNetLib TransmitRPC
1148 //method to create a connection and exchange data.
1149 if (m_ci == null)
1150 m_ci = new BMXNetConnectInfo();
1151
1152 m_ci.EventPollingEnabled = false;
1153 m_ci.BMXNetEvent += new BMXNetConnectInfo.BMXNetEventDelegate(BMXNetEventHandler);
1154 try
1155 {
1156 //Use this overload to connect to the last M server
1157 //using Windows NT integrated security
1158 //m_ci.LoadConnectInfo();
1159
1160 //Use the following overload to force prompt for AV codes.
1161 //You can also use this overload if
1162 // you want to create your own dialog to collect
1163 // AV codes. You may then pass
1164 // the values you collected to LoadConnectInfo(access,verify)
1165 //
1166 m_ci.LoadConnectInfo("192.168.1.103",9260,"","");
1167
1168 m_ci.AppContext = "BMXRPC";
1169 txtContext.Text = m_ci.AppContext;
1170 this.txtServer.Text = m_ci.MServerAddress;
1171 this.txtUser.Text = m_ci.UserName;
1172 this.txtDivision.Text = m_ci.DivisionName;
1173
1174 }
1175 catch (Exception ex)
1176 {
1177 MessageBox.Show(ex.Message, "BMXNetTest");
1178 }
1179 txtCommand.Text = "BMX ADO SS^HW TEST^^~1~20~5";
1180 //txtCommand.Text = "SELECT NAME, AGE, DOB FROM PATIENT WHERE (NAME LIKE 'E%') AND (AGE BETWEEN 20 AND 60) MAXRECORDS:50";
1181// this.txtCommand.Text= "BMXGetFacRS^408";
1182// this.txtCommand.Text = "SELECT BMXIEN, NAME, AGE, DOB FROM VA_PATIENT WHERE (NAME LIKE 'E%') AND (AGE BETWEEN 20 AND 60) MAXRECORDS:50";
1183// txtCommand.Text = "BMX TEST^S|30";
1184// txtCommand.Text = "BMX ADO SS^IHS PATIENT^^~1~20~5";
1185// txtCommand.Text = "BMX ADO SS^17^^~4~4~5~~~~~18,SUB";
1186// //SIEN1,"","AA~3/21/1965~6/4/2004~5~~~~235|WT|C~11,.02"
1187// txtCommand.Text = "BMX ADO SS^23^^AA~3/21/1965~6/4/2004~5~~~~235|WT|C~11,.02";
1188// txtCommand.Text = "BMX ADO SS^17^^~4~9~~~~~~18,SUB";
1189// txtCommand.Text = "BMX ADO SS^11^^~1~5~~~~~~25,.001,.02IEN,AA~1/1/1960~6/30/2004~~~~~|C";
1190// txtCommand.Text = "BMX ADO SS^18^1,^~~~";
1191// txtCommand.Text = "BMX ADO SS^PATIENT DEMOGRAPHICS^^~1~5~";
1192// txtCommand.Text = @"BMX ADO SS^53^^~~~~~VMEAS~BMXADOFD~100002.1A||PU\60|WT\175|HT\70";
1193// txtCommand.Text = "BMX ADO SS^3^^~1658~1658^11,.05IEN,.001";
1194// BMX ADO SS^HW SD DEVICE1^^~~~
1195 }
1196
1197 private void cmdTestPiece_Click_1(object sender, System.EventArgs e)
1198 {
1199 //Demo of BMXNet Piece function. Note that only single-character
1200 //delimiters are supported.
1201 try
1202 {
1203 string sInput = txtInput.Text;
1204 string sDelim = txtDelim.Text;
1205 if (sDelim.Length > 1)
1206 throw new BMXNetException("BMXNet.Piece() supports only single-character delimiters.");
1207 int nNumber = Convert.ToInt16(txtNumber.Text);
1208 int nEnd = 0;
1209 string sOutput = "";
1210 if (txtEnd.Text != "")
1211 {
1212 nEnd = Convert.ToInt16(txtEnd.Text);
1213 sOutput = BMXNetLib.Piece(sInput, sDelim, nNumber, nEnd);
1214 }
1215 else
1216 {
1217 sOutput = BMXNetLib.Piece(sInput, sDelim, nNumber);
1218 }
1219
1220 txtResult.Text = sOutput;
1221 }
1222 catch (Exception ex)
1223 {
1224 MessageBox.Show(ex.Message, "BMXNetTest Error");
1225 }
1226 }
1227
1228 private void cmdTest3_Click(object sender, System.EventArgs e)
1229 {
1230 //How to create a low-level socket connection using
1231 //BMXNetLib and transmit a simple RPC.
1232
1233 //Always use try-catch blocks. BMXNet uses exceptions to report
1234 //errors and connection failures.
1235 try
1236 {
1237 BMXNetLib bnLib;
1238 bnLib = new BMXNetLib();
1239
1240 //Either collect your own connection information
1241 //or use the Windows Identity map to RPMS
1242 //and manually open a connection like this:
1243 //bnLib.MServerPort = nPort;
1244 //bnLib.OpenConnection(sIP, sAccess, sVerify);
1245 // -or-
1246 //bnLib.OpenConnection(sIP, WindowsIdentity.GetCurrent());
1247 //bnLib.AppContext = "BMXRPC";
1248 //If no exception thrown by OpenConnection, then connection
1249 //to rpms succeeded. If OpenConnection fails, then an exception
1250 //is thrown.
1251
1252 // -OR- Use BMXNetConnectInfo to establish connection
1253 //LoadConnectInfo will prompt for server and user info as needed
1254
1255 bnLib.MServerPort = m_ci.MServerPort;
1256 bnLib.OpenConnection("127.0.0.1",WindowsIdentity.GetCurrent());
1257// bnLib.OpenConnection("127.0.0.1","","");
1258 bnLib.AppContext = "BMXRPC";
1259
1260 string sDUZ = bnLib.DUZ;
1261 string sUser = bnLib.TransmitRPC("BMX USER", sDUZ);
1262 if (sUser.StartsWith("M ERROR=") == true)
1263 {
1264 Exception ex = new Exception(sUser);
1265 throw ex;
1266 }
1267 MessageBox.Show("Connection to RPMS succeeded. User name = " + sUser, "BMXNetLib Test");
1268 bnLib.CloseConnection();
1269 }
1270 catch (Exception ex)
1271 {
1272 MessageBox.Show(ex.Message, "BMXNetTest Error");
1273 }
1274
1275 }
1276
1277 private void cmdTest4_Click(object sender, System.EventArgs e)
1278 {
1279 /*Demo of retrieving multiple related tables,
1280 * joining them,
1281 * and attaching them to a grid that can
1282 * drill-down through the relations
1283 */
1284 try
1285 {
1286 if (m_ci.Connected == false)
1287 {
1288 throw new BMXNetException("Not connected to RPMS.");
1289 }
1290 frmVisitDemo frmVD = new frmVisitDemo();
1291 frmVD.InitializePage(m_ci);
1292 frmVD.ShowDialog(this);
1293 }
1294 catch (Exception ex)
1295 {
1296 MessageBox.Show(ex.Message, "BMXNetTest Error");
1297 }
1298
1299 }
1300
1301 private void cmdChangeServer_Click(object sender, System.EventArgs e)
1302 {
1303 //How to change the RPMS server in BMXNetConnectInfo
1304 try
1305 {
1306 m_ci.ChangeServerInfo();
1307 m_ci.LoadConnectInfo();
1308 }
1309 catch (Exception ex)
1310 {
1311 MessageBox.Show(ex.Message, "BMXNetTest");
1312 }
1313
1314 }
1315
1316 private void cmdChangeUser_Click(object sender, System.EventArgs e)
1317 {
1318 //How to change the RPMS user
1319 try
1320 {
1321 m_ci.LoadConnectInfo("","");
1322 m_ci.AppContext = "BMXRPC";
1323 MessageBox.Show("User changed to " + m_ci.UserName + " on Server " + m_ci.MServerAddress + ", on Port " + m_ci.MServerPort);
1324 }
1325 catch (Exception ex)
1326 {
1327 MessageBox.Show(ex.Message, "BMXNetTest");
1328 }
1329 }
1330
1331 private void cmdCancelChanges_Click(object sender, System.EventArgs e)
1332 {
1333 DataTable dt = (DataTable) dataGrid2.DataSource;
1334 dt.RejectChanges();
1335 }
1336
1337 private void cmdChangeContext_Click(object sender, System.EventArgs e)
1338 {
1339 try
1340 {
1341 m_ci.AppContext = txtContext.Text;
1342 MessageBox.Show("Context changed to " + m_ci.AppContext);
1343 }
1344 catch (Exception ex)
1345 {
1346 MessageBox.Show(ex.Message);
1347 }
1348 }
1349
1350 private void cmdChangeDivision_Click(object sender, System.EventArgs e)
1351 {
1352
1353 /*How to change user division:
1354 * You can either create your own dialog, populate
1355 * it with using the UserDivisions datatable and DUZ2 string
1356 * from ConnectInfo
1357 * and then manually reset ConnectInfo's DUZ2 property,
1358 * -OR-
1359 * you can invoke ConnectInfo's ChangeDivision method
1360 * which will display its own dialog for you. The
1361 * commented code below shows the 'manual' way (you will have to
1362 * first create a 'DSelectDivision' dialog class)
1363 */
1364
1365 if (m_ci.Connected == false)
1366 {
1367 throw new BMXNetException("Not connected to RPMS.");
1368 }
1369
1370// DSelectDivision dsd = new DSelectDivision();
1371// dsd.InitializePage(m_ci.UserDivisions, m_ci.DUZ2);
1372// if (dsd.ShowDialog(this) == DialogResult.Cancel)
1373// return;
1374// m_ci.DUZ2 = dsd.DUZ2;
1375
1376 m_ci.ChangeDivision(this);
1377 this.txtDivision.Text = m_ci.DivisionName;
1378 }
1379
1380 private void cmdExecuteQuery_Click(object sender, System.EventArgs e)
1381 {
1382 //This is the 'Execute' button on the form and demonstrates
1383 //how to use the BMXNet ADO.NET Data Provider to
1384 //retrieve an RPMS ADO.NET datatable.
1385 try
1386 {
1387 if (m_ci.Connected == false)
1388 {
1389 throw new Exception("Not connected to RPMS.");
1390 }
1391 //m_ci.bmxNetLib.StartLog("TestLog.txt");
1392 //m_ci.bmxNetLib.StartLog();
1393 m_ci.bmxNetLib.BMXRWL.AcquireWriterLock(5);
1394 dataGrid2.DataSource = m_ci.RPMSDataTable(txtCommand.Text, "SampleTable");
1395 }
1396 catch (Exception ex)
1397 {
1398 MessageBox.Show(ex.Message);
1399 return;
1400 }
1401 finally
1402 {
1403 if (m_ci.bmxNetLib.BMXRWL.IsWriterLockHeld == true)
1404 {
1405 m_ci.bmxNetLib.BMXRWL.ReleaseWriterLock();
1406 }
1407 //m_ci.bmxNetLib.StopLog();
1408
1409 }
1410 }
1411
1412 /// <summary>
1413 /// How to Accept Updates to an updateable recordset
1414 /// using the BMXNetDataAdapter's Update method
1415 /// </summary>
1416 /// <param name="sender"></param>
1417 /// <param name="e"></param>
1418 private void cmdAcceptChanges_Click(object sender, System.EventArgs e)
1419 {
1420 int nTimeOut = m_ci.ReceiveTimeout;
1421 try
1422 {
1423 m_ci.ReceiveTimeout = (90 * 1000);
1424 DataTable dtPrimary = (DataTable)dataGrid2.DataSource;
1425 DataSet ds = dtPrimary.DataSet;
1426 if ((dtPrimary.DataSet is DataSet) == false)
1427 {
1428 ds = new DataSet();
1429 ds.Tables.Add(dtPrimary);
1430 }
1431 foreach (DataTable dt in ds.Tables)
1432 {
1433 BMXNetConnection conn = new BMXNetConnection(m_ci.bmxNetLib);
1434 DataTable dtc = dt.GetChanges();
1435 if (dtc != null)
1436 {
1437
1438 BMXNetCommand bmxSelectCmd = (BMXNetCommand)conn.CreateCommand();
1439 bmxSelectCmd.CommandText = txtCommand.Text;
1440 m_da.SelectCommand = bmxSelectCmd;
1441
1442 DataTable dtSchema = m_da.FillSchema(dtc, SchemaType.Source);
1443
1444 //Build UPDATE command based on info stored in table's extended property set
1445 BMXNetCommand bmxUpdateCmd = new BMXNetCommand();
1446 bmxUpdateCmd.Connection = conn;
1447
1448 //Call BMXBuildUpdateCommand(dtSchema) to set up parameters
1449 bmxUpdateCmd.BMXBuildUpdateCommand(dtSchema);
1450
1451 //Link command to data adapeter
1452 m_da.UpdateCommand = bmxUpdateCmd;
1453
1454 //Call adapter's Update method
1455 m_da.Update(dtc);
1456
1457 //Accept the changes to the datagrid's datatable
1458 dt.AcceptChanges();
1459 }
1460 }
1461 }
1462 catch (Exception ex)
1463 {
1464 MessageBox.Show(ex.Message);
1465 }
1466 finally
1467 {
1468 m_ci.ReceiveTimeout = nTimeOut;
1469 }
1470 }
1471
1472 private void dataGrid2_Navigate(object sender, System.Windows.Forms.NavigateEventArgs ne)
1473 {
1474 string sDirection = (ne.Forward == true)?"forward":"backward";
1475 string myString = "Navigate event raised, moved " + sDirection;
1476 Debug.Write(myString + "\n");
1477
1478 }
1479
1480 private void cmdXML_Click(object sender, System.EventArgs e)
1481 {
1482 //Writes contents of the datagrid's current dataset to XML file
1483 //Also writes dataset structure to XSD schema file
1484 //Transforms the datetime data in the XML file to a format acceptable to
1485 // MS Excel by removing the UTC time conversion info from the end of the datetime string
1486 try
1487 {
1488 DataTable dtPrimary = (DataTable)dataGrid2.DataSource;
1489 DataSet ds = dtPrimary.DataSet;
1490
1491 if ((dtPrimary.DataSet is DataSet) == false)
1492 {
1493 ds = new DataSet();
1494 ds.Tables.Add(dtPrimary);
1495 }
1496
1497 SaveFileDialog saveFileDialog1 = new SaveFileDialog();
1498 saveFileDialog1.Filter = "XML Files (*.xml)|*.xml|All files (*.*)|*.*";
1499 saveFileDialog1.FilterIndex = 0;
1500 saveFileDialog1.RestoreDirectory = true;
1501 saveFileDialog1.AddExtension = true;
1502 saveFileDialog1.DefaultExt = "xml";
1503
1504 if (saveFileDialog1.ShowDialog() != DialogResult.OK)
1505 {
1506 return;
1507 }
1508
1509 //create file names based on user input.
1510 //sFile = the name of the XML file created by the dataset export
1511 //sSchemaFile = the schema generated by the dataset
1512 //xXSL file = the transform file applied to sFile
1513 //sFileOut = the final transformed XML file
1514 string sFile = saveFileDialog1.FileName;
1515 string sSchemaFile = sFile.Remove(sFile.Length - 4, 4);
1516 sSchemaFile = sSchemaFile + "Schema.xsd";
1517 string sFileOut = sFile;
1518 sFile = sFile.Remove(sFile.Length - 4, 4);
1519 sFile = sFile + "Input.xml";
1520 string sXSLFile = sSchemaFile.Remove(sSchemaFile.Length - 10, 10);
1521 sXSLFile = sXSLFile + "Transform.xslt";
1522
1523 // Open file to which to write schema
1524 System.IO.FileStream fsSchema = new System.IO.FileStream
1525 (sSchemaFile, System.IO.FileMode.Create);
1526 System.Xml.XmlTextWriter schemaWriter =
1527 new System.Xml.XmlTextWriter(fsSchema, System.Text.Encoding.ASCII);
1528 ds.WriteXmlSchema(schemaWriter);
1529 schemaWriter.Close();
1530
1531 // Write out the dataset to xml
1532 System.IO.FileStream myFileStream = new System.IO.FileStream
1533 (sFile, System.IO.FileMode.Create);
1534 System.Xml.XmlTextWriter myXmlWriter =
1535 new System.Xml.XmlTextWriter(myFileStream, System.Text.Encoding.ASCII);
1536 ds.WriteXml(myXmlWriter);
1537 myXmlWriter.Close();
1538
1539 //Create and apply an xslt file to reformat dates to be Excel compatible
1540 //First create the xslt transform
1541 this.CreateXSL(sSchemaFile, sXSLFile);
1542 //Apply the transform
1543 System.Xml.XmlResolver xmlr = null;
1544 XslTransform xslt = new XslTransform();
1545 //System.Xml.Xsl.XslCompiledTransform xslt = new XslCompiledTransform();
1546 try
1547 {
1548 xslt.Load(sXSLFile, xmlr);
1549 //xslt.Load(sXSLFile, null , xmlr);
1550
1551 xslt.Transform(sFile, sFileOut, xmlr);
1552 //xslt.Transform(
1553 }
1554 catch (Exception ex)
1555 {
1556 MessageBox.Show(ex.Message);
1557 }
1558 }
1559 catch (Exception ex)
1560 {
1561 MessageBox.Show(ex.Message);
1562 }
1563 }
1564
1565 private void CreateXSL(string sXsdFile, string sXsltFile)
1566 {
1567 //Given an xsd file, create an xsl transform to apply to xlm file
1568 //that will transform xml date format to Excel dates by removing UTC information
1569 //from the xml datetime value.
1570
1571 //Open the xsd input file and xsl output file
1572 //and associate with XML reader and writer
1573
1574 string sFileIn = sXsdFile;
1575 string sFileOut = sXsltFile;
1576
1577 //Open XMLTextWriter
1578 System.IO.FileStream fsOut = new System.IO.FileStream
1579 (sFileOut, System.IO.FileMode.Create);
1580 System.Xml.XmlTextWriter xwOut =
1581 new System.Xml.XmlTextWriter(fsOut, System.Text.Encoding.ASCII);
1582
1583 //Write to the output file
1584 xwOut.Formatting=Formatting.Indented;
1585
1586 xwOut.WriteStartElement("xsl", "stylesheet", "http://www.w3.org/1999/XSL/Transform");
1587 xwOut.WriteAttributeString("xmlns","msxsl",null, "urn:schemas-microsoft-com:xslt");
1588 xwOut.WriteAttributeString("xmlns","bmx",null, "http://bmx.ihs.gov");
1589 xwOut.WriteAttributeString("version", "1.0");
1590
1591 xwOut.WriteStartElement( "msxsl", "script", null);
1592 xwOut.WriteAttributeString("implements-prefix", "bmx");
1593 xwOut.WriteAttributeString("language", "C#");
1594
1595 string sCode = "\npublic string ExcelDate(string sXMLDate) {\n";
1596 sCode += "string sConverted;\n";
1597 sCode += "sConverted = sXMLDate.Remove(sXMLDate.Length - 15,15);\n";
1598 sCode += "return sConverted;\n";
1599 sCode += "}\n";
1600 xwOut.WriteCData(sCode);
1601 xwOut.WriteFullEndElement(); //msxsl script
1602
1603 xwOut.WriteStartElement("xsl", "output", null);
1604 xwOut.WriteAttributeString("method", "xml");
1605 xwOut.WriteAttributeString("indent", "yes");
1606 xwOut.WriteEndElement();
1607
1608 xwOut.WriteStartElement("xsl", "template", null);
1609 xwOut.WriteAttributeString("match", "@*|node()");
1610 xwOut.WriteStartElement("xsl", "copy", null);
1611 xwOut.WriteStartElement("xsl", "apply-templates", null);
1612 xwOut.WriteAttributeString("select", "@*|node()");
1613 xwOut.WriteEndElement(); //apply templates
1614 xwOut.WriteFullEndElement(); //copy
1615 xwOut.WriteFullEndElement(); //template
1616
1617 ArrayList alFieldNames = new ArrayList();
1618
1619 //read from schema file
1620 //Open XMLTextReader
1621 System.IO.FileStream fsIn = new System.IO.FileStream
1622 (sFileIn, System.IO.FileMode.Open);
1623 System.Xml.XmlTextReader xrIn =
1624 new System.Xml.XmlTextReader(fsIn);
1625
1626 string sFieldName = "";
1627 while (xrIn.Read())
1628 {
1629 if (xrIn.NodeType == XmlNodeType.Element)
1630 {
1631 switch (xrIn.LocalName)
1632 {
1633 case "element":
1634 if (xrIn.MoveToAttribute("name"))
1635 {
1636 sFieldName = xrIn.Value;
1637 if (xrIn.MoveToAttribute("type"))
1638 {
1639 if (xrIn.Value == "xs:dateTime")
1640 {
1641 alFieldNames.Add(sFieldName);
1642 }
1643 }
1644 }
1645 else
1646 {
1647 xrIn.Skip();
1648 }
1649 break;
1650 }//switch
1651 }//if
1652 }//while
1653
1654 //build conversion templates
1655 for (int j=0; j < alFieldNames.Count; j++)
1656 {
1657 sFieldName = alFieldNames[j].ToString();
1658 xwOut.WriteStartElement("xsl", "template", null);
1659 xwOut.WriteAttributeString("match", sFieldName);
1660
1661 xwOut.WriteStartElement("xsl", "element", null);
1662 xwOut.WriteAttributeString("name", sFieldName);
1663
1664 xwOut.WriteStartElement("xsl", "value-of", null);
1665 xwOut.WriteAttributeString("select", "bmx:ExcelDate(.)");
1666
1667 xwOut.WriteEndElement(); //value-of
1668 xwOut.WriteFullEndElement(); //element
1669 xwOut.WriteFullEndElement(); //template
1670 }
1671
1672 xwOut.WriteFullEndElement(); //stylesheet
1673 xwOut.Close();
1674 }
1675
1676 /*
1677 * Controls Demo
1678 * Demonstrates how to populate controls from a datatable
1679 */
1680 private void cmdCDLoad_Click(object sender, System.EventArgs e)
1681 {
1682 try
1683 {
1684 if (m_ci.Connected == false)
1685 {
1686 throw new BMXNetException("Not connected to RPMS.");
1687 }
1688
1689 string sCommandText = "BMX ADO SS^PATIENT DEMOGRAPHICS^^~1~50~";
1690 DataTable dt = m_ci.RPMSDataTable(sCommandText, "ControlsDemo");
1691
1692 txtCDName.DataBindings.Clear();
1693 txtCDSex.DataBindings.Clear();
1694 txtCDDOB.DataBindings.Clear();
1695 txtCDSSN.DataBindings.Clear();
1696 calCDDOB.DataBindings.Clear();
1697 dtpCDDOB.DataBindings.Clear();
1698 lstCDSex.DataBindings.Clear();
1699
1700 DataView dvCDPat = new DataView(dt);
1701 dvCDPat.Sort = "NAME ASC";
1702
1703 cboCDSelect.DataSource = dvCDPat;
1704 cboCDSelect.DisplayMember = "NAME";
1705 cboCDSelect.ValueMember = "BMXIEN";
1706
1707 txtCDName.DataBindings.Add("Text", dvCDPat, "NAME");
1708 txtCDSex.DataBindings.Add("Text", dvCDPat, "SEX");
1709 txtCDDOB.DataBindings.Add("Text", dvCDPat, "DOB");
1710 txtCDSSN.DataBindings.Add("Text", dvCDPat, "SSN");
1711
1712 calCDDOB.DataBindings.Add("SelectionStart", dvCDPat, "DOB");
1713 calCDDOB.DataBindings.Add("SelectionEnd", dvCDPat, "DOB");
1714
1715 dtpCDDOB.DataBindings.Add("Value", dvCDPat, "DOB");
1716
1717 lstCDSex.DataBindings.Add("SelectedItem", dvCDPat, "SEX");
1718
1719 }
1720 catch (Exception ex)
1721 {
1722 MessageBox.Show(ex.Message);
1723 return;
1724 }
1725 }
1726
1727 private void cmdAddAll_Click(object sender, System.EventArgs e)
1728 {
1729 /*
1730 * How to Accept Updates to an updateable recordset
1731 * using the new schema format and the data adapter's Update method
1732 */
1733
1734 try
1735 {
1736 DataTable dtPrimary = (DataTable) dataGrid2.DataSource;
1737 DataSet ds = dtPrimary.DataSet;
1738
1739
1740
1741 foreach (DataTable dt in ds.Tables)
1742 {
1743
1744 BMXNetConnection conn = new BMXNetConnection(m_ci.bmxNetLib);
1745
1746 object[] oVal = new object[dt.Columns.Count];
1747 //Call adapter's Update method
1748 int nRowCount = dt.Rows.Count;
1749 for (int j=0; j < nRowCount; j++ )
1750 {
1751 DataRow r = dt.Rows[j];
1752 for (int k = 0; k < dt.Columns.Count; k++)
1753 {
1754 oVal[k] = r[dt.Columns[k].ColumnName];
1755 }
1756 DataRow rAdd = dt.Rows.Add(oVal);
1757 }
1758
1759 DataTable dtc = dt.GetChanges();
1760 if (dtc != null)
1761 {
1762 DataTable dtSchema = m_da.FillSchema(dtc, SchemaType.Source);
1763
1764 //Build UPDATE command based on info stored in table's extended property set
1765 BMXNetCommand bmxUpdateCmd = new BMXNetCommand();
1766 bmxUpdateCmd.Connection = conn;
1767
1768 //Call BMXBuildUpdateCommand(dtSchema) to set up parameters
1769 bmxUpdateCmd.BMXBuildUpdateCommand(dtSchema);
1770
1771 //Link command to data adapter
1772 m_da.UpdateCommand = bmxUpdateCmd;
1773
1774 //Call adapter's Update method
1775 m_da.Update(dtc);
1776
1777 //Accept the changes to the datagrid's datatable
1778 dt.RejectChanges();
1779 }
1780 }
1781 }
1782 catch (Exception ex)
1783 {
1784 MessageBox.Show(ex.Message);
1785 }
1786 }
1787
1788 #region Event Handling and Asynchronous Calls
1789
1790 private string m_sTask;
1791 private void cmdAsyncCall_Click(object sender, System.EventArgs e)
1792 {
1793 try
1794 {
1795 //Use the windows handle to create a unique event name
1796 Process pCurrent = Process.GetCurrentProcess();
1797 string sID = Environment.MachineName + "-";
1798 sID += pCurrent.Id.ToString();
1799 m_ci.SubscribeEvent("BMX ASYNC RESULT READY" + sID ); // this.Handle.ToString());
1800 //nTask corresponds to TaskMan's ZTSK
1801 int nTask = m_ci.RPMSDataTableAsyncQue(this.txtAsyncCommand.Text, "BMX ASYNC RESULT READY" + sID) ;//this.Handle.ToString());
1802 //Save ZTSK for later comparison
1803 m_sTask = nTask.ToString();
1804 }
1805 catch (Exception ex)
1806 {
1807 MessageBox.Show(ex.Message);
1808 }
1809 }
1810
1811 private void BMXNetEventHandler(Object obj, BMXNet.BMXNetEventArgs e)
1812 {
1813 try
1814 {
1815 //BMXNet events arrive on a separate thread from the UI thread,
1816 //thus UI methods should be called using BeginInvoke or Invoke
1817 UpdateEventMessageTextDelegate dlgUEMT = new UpdateEventMessageTextDelegate(UpdateEventMessageText);
1818 this.Invoke(dlgUEMT, new object[] {e.BMXEvent, e.BMXParam});
1819
1820 Process pCurrent = Process.GetCurrentProcess();
1821 string sID = Environment.MachineName + "-";
1822 sID += pCurrent.Id.ToString();
1823 if (e.BMXEvent == "BMX ASYNC RESULT READY" + sID)
1824 {
1825 string sTask = BMXNetLib.Piece(e.BMXParam, "~", 1);
1826 string sAsyncInfo = BMXNetLib.Piece(e.BMXParam,"~",2);
1827 DataTable dtAsyncGrid = m_ci.RPMSDataTableAsyncGet(sAsyncInfo, "AsyncData");
1828 UpdateAsyncGridDelegate uagd = new UpdateAsyncGridDelegate(UpdateAsyncGrid);
1829 this.BeginInvoke(uagd, new object[] {sTask, dtAsyncGrid});
1830 }
1831 }
1832 catch (Exception ex)
1833 {
1834 Debug.Write("BMXNetEventHandler exception: " + ex.Message + "\n");
1835 }
1836 }
1837
1838 delegate void UpdateAsyncGridDelegate(string sTask, DataTable dt);
1839 private void UpdateAsyncGrid(string sTask, DataTable dt)
1840 {
1841 try
1842 {
1843 //Assert that invoke is not required in any UI method that may be called
1844 //by a worker thread (e.g. from an event)
1845 Debug.Assert(this.InvokeRequired == false);
1846
1847 //Check that this is the same job that we tasked
1848 if (m_sTask != sTask)
1849 return;
1850
1851 grdAsyncResult.DataSource = dt;
1852 m_ci.UnSubscribeEvent("BMX ASYNC RESULT READY" + this.Handle.ToString());
1853 }
1854 catch (Exception ex)
1855 {
1856 Debug.Write("UpdateAsyncGrid exception: " + ex.Message + "\n");
1857 }
1858 }
1859
1860 delegate void UpdateEventMessageTextDelegate(string EventName, string Param);
1861
1862 private void UpdateEventMessageText(string EventName, string Param)
1863 {
1864 Debug.Assert(this.InvokeRequired == false);
1865 txtEventMessages.Text = "BMXNet event " + EventName + " fired with parameter " + Param;
1866 if (txtEventMessages.BackColor == System.Drawing.Color.LightGreen)
1867 {
1868 txtEventMessages.BackColor = System.Drawing.Color.LightCoral;
1869 }
1870 else
1871 {
1872 txtEventMessages.BackColor = System.Drawing.Color.LightGreen;
1873 }
1874 }
1875
1876 private void cmdRegisterEvent_Click(object sender, System.EventArgs e)
1877 {
1878 m_ci.SubscribeEvent(this.txtRegisterEvent.Text);
1879 }
1880
1881 private void cmdUnregisterEvent_Click(object sender, System.EventArgs e)
1882 {
1883 m_ci.UnSubscribeEvent(this.txtUnregisterEvent.Text);
1884 }
1885
1886 private void cmdRaiseEvent_Click(object sender, System.EventArgs e)
1887 {
1888 m_ci.RaiseEvent(this.txtRaiseEvent.Text, txtEventParam.Text, chkEventRaiseBack.Checked);
1889 }
1890
1891 private void cmdAcquireLock_Click(object sender, System.EventArgs e)
1892 {
1893 try
1894 {
1895 m_ci.bmxNetLib.BMXRWL.AcquireWriterLock(5);
1896 }
1897 catch (Exception ex)
1898 {
1899 MessageBox.Show(ex.Message);
1900 }
1901 }
1902
1903 private void cmdReleaseLock_Click(object sender, System.EventArgs e)
1904 {
1905 try
1906 {
1907 m_ci.bmxNetLib.BMXRWL.ReleaseWriterLock();
1908 }
1909 catch (Exception ex)
1910 {
1911 MessageBox.Show(ex.Message);
1912 }
1913 }
1914
1915 private void chkEnableEvents_CheckedChanged(object sender, System.EventArgs e)
1916 {
1917 m_ci.EventPollingInterval = Convert.ToInt16(nudEventPollingInterval.Value);
1918 m_ci.EventPollingEnabled = chkEnableEvents.Checked;
1919 }
1920
1921 private void nudEventPollingInterval_ValueChanged(object sender, System.EventArgs e)
1922 {
1923 m_ci.EventPollingInterval = Convert.ToInt16(nudEventPollingInterval.Value);
1924 }
1925
1926 #endregion Event Handling
1927
1928 private void cmdTestSilent_Click(object sender, EventArgs e)
1929 {
1930 try
1931 {
1932 this.m_ci.CloseConnection();
1933
1934 string sA = "";
1935 string sV = "";
1936 string sAddress = "";
1937 int nPort = 10501;
1938 string sN = "";
1939
1940 m_ci.LoadConnectInfo(sAddress, nPort, sA, sV, sN);
1941 }
1942 catch (Exception ex)
1943 {
1944 MessageBox.Show(ex.Message);
1945 }
1946
1947 }
1948
1949 private void cmdTestReceiveTimeout_Click(object sender, EventArgs e)
1950 {
1951 int nTest = 5000;
1952 this.m_ci.ReceiveTimeout = nTest;
1953 }
1954
1955 private void cmdStartLogging_Click(object sender, EventArgs e)
1956 {
1957 try
1958 {
1959 m_ci.bmxNetLib.StartLog();
1960 }
1961 catch (Exception ex)
1962 {
1963 MessageBox.Show("Unable to start logging: " + ex.Message);
1964 }
1965 }
1966
1967 private void cmdStopLogging_Click(object sender, EventArgs e)
1968 {
1969 try
1970 {
1971 m_ci.bmxNetLib.StopLog();
1972 }
1973 catch (Exception ex)
1974 {
1975 MessageBox.Show("Unable to stop logging: " + ex.Message);
1976 }
1977 }
1978
1979 private void btnML_Click(object sender, EventArgs e)
1980 {
1981 string cmd = "KBAN BMX";
1982 string result = m_ci.bmxNetLib.TransmitRPC(cmd, txtML.Text);
1983 MessageBox.Show("What got sent and back is:" + result);
1984 }
1985
1986
1987
1988 }
1989}
Note: See TracBrowser for help on using the repository browser.