source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/IHS BMX Framework/IndianHealthService.BMXNet.WinForm/Forms/ConnectionTest.cs@ 1146

Last change on this file since 1146 was 1146, checked in by Sam Habiel, 13 years ago

Initial Import of BMX4

File size: 2.0 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4using IndianHealthService.BMXNet.WinForm.Configuration;
5using System.Windows.Forms;
6using IndianHealthService.BMXNet.Services;
7
8namespace IndianHealthService.BMXNet.WinForm.Forms
9{
10 internal class ConnectionTest
11 {
12
13 private IWin32Window _uiOwner = null;
14
15 public IWin32Window UiOwner
16 {
17 get { return _uiOwner; }
18 set { _uiOwner = value; }
19 }
20
21
22 public void Test(RpmsConnectionSpec aSpec)
23 {
24 WinFramework framework = WinFramework.CreateWithNetworkBroker(false,new NullLog());
25 RpmsConnectionSettings settings = new RpmsConnectionSettings();
26 settings.AddConnectionSpec(aSpec);
27 framework.ConnectionSettings = settings;
28
29 LoginProcess login = framework.CreateLoginProcess();
30
31
32 if (login.HasDefaultConnectionWithUseWindowsAuth && login.AttemptWindowsAuthLogin())
33 {
34 if (login.AttemptWindowsAuthLogin())
35 {
36 MessageBox.Show("Windows Authication was succesful", "Connection Test");
37 framework.Close();
38 return;
39 }
40 else
41 {
42 MessageBox.Show("Windows Authication was failed", "Connection Test");
43 return;
44 }
45 }
46
47 if (!login.WasLoginAttempted || !login.WasSuccessful)
48 {
49 if (login.AttemptUserInputLogin("Test Login", 3, false,this.UiOwner))
50 {
51 MessageBox.Show("RPMS login was successful", "Connection Test");
52 framework.Close();
53 return;
54 }
55 else
56 {
57 MessageBox.Show("RPMS login faied", "Connection Test");
58 return;
59 }
60 }
61 }
62 }
63}
Note: See TracBrowser for help on using the repository browser.