source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/IHS BMX Framework/IndianHealthService.BMXNet.WinForm/Forms/RpmsLoginDialog.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: 4.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Text;
7using System.Windows.Forms;
8using IndianHealthService.BMXNet.WinForm.Forms;
9using IndianHealthService.BMXNet.WinForm.Configuration;
10
11namespace IndianHealthService.BMXNet.Forms
12{
13 internal partial class RpmsLoginDialog : Form, RpmsLoginView
14 {
15 public RpmsLoginDialog()
16 {
17 InitializeComponent();
18 this.connectionComboBox.DisplayMember = "Name";
19 }
20
21 private bool _isSwitchServerModeEnabled = false;
22
23 public bool IsSwitchServerModeEnabled
24 {
25 get { return _isSwitchServerModeEnabled; }
26 set { _isSwitchServerModeEnabled = value; }
27 }
28
29 private void txtAccess_TextChanged(object sender, EventArgs e)
30 {
31 }
32
33 private void RpmsLoginDialog_Load(object sender, EventArgs e)
34 {
35 this.Icon = this.Owner.Icon;
36
37 if (this.IsSwitchServerModeEnabled)
38 {
39 this.connectionComboBox.DroppedDown = true;
40 this.connectionComboBox.Focus();
41 }
42 else
43 {
44 this.accessCodeEntry.Focus();
45 }
46 }
47
48 public void ShowView(IWin32Window anOwner)
49 {
50 this.ShowDialog(anOwner);
51 }
52
53 public IWin32Window UiOwner
54 {
55 get { return this.Owner; }
56 }
57
58
59 #region RpmsLoginView Members
60
61 public string Title
62 {
63 set { this.Text = value; }
64 }
65
66 public List<IndianHealthService.BMXNet.WinForm.Configuration.RpmsConnectionSpec> ConnectionSpecs
67 {
68 set
69 {
70 this.connectionComboBox.BeginUpdate();
71 this.connectionComboBox.SelectedIndex= - 1;
72 this.connectionComboBox.Items.Clear();
73 foreach (RpmsConnectionSpec each in value)
74 {
75 this.connectionComboBox.Items.Add(each);
76 }
77 this.connectionComboBox.EndUpdate();
78 }
79 }
80
81 public string AccessCode
82 {
83 get { return this.accessCodeEntry.Text; }
84 }
85
86 public string VerifyCode
87 {
88 get { return this.verifyCodeEntry.Text; }
89 }
90
91 public bool UseWindowsAuthentication
92 {
93 get
94 {
95 return this.useWindowAuthCheckbox.Checked;
96 }
97 set
98 {
99 this.useWindowAuthCheckbox.Checked = value;
100 }
101 }
102
103 public bool EnableUseWindowsAuthentication
104 {
105 get
106 {
107 return this.useWindowAuthCheckbox.Enabled;
108 }
109 set
110 {
111 this.useWindowAuthCheckbox.Enabled = value;
112 }
113 }
114
115 public RpmsConnectionSpec ConnectionSpec
116 {
117 get { return (RpmsConnectionSpec)this.connectionComboBox.SelectedItem; }
118 set
119 {
120 this.connectionComboBox.SelectedItem = value;
121 if (value != null)
122 {
123
124 this.accessCodeEntry.Focus();
125 }
126 }
127 }
128
129 public event EventHandler Ok;
130
131 public event EventHandler Cancel;
132
133 public event EventHandler ConnectionSpecSelected;
134
135 #endregion
136
137 private void connectionComboBox_SelectedIndexChanged(object sender, EventArgs e)
138 {
139 if (this.ConnectionSpecSelected != null)
140 {
141 this.ConnectionSpecSelected(this, new EventArgs());
142 }
143 }
144
145
146 public void CloseView()
147 {
148 this.Close();
149 }
150
151 private void okButton_Click(object sender, EventArgs e)
152 {
153 if (this.Ok != null)
154 {
155 this.Ok(this, new EventArgs());
156 }
157 }
158
159 private void cancelButton_Click(object sender, EventArgs e)
160 {
161 if (this.Cancel != null)
162 {
163 this.Cancel(this, new EventArgs());
164 }
165 }
166
167 public void ResetAccessVerifyCodes()
168 {
169 this.accessCodeEntry.Clear();
170 this.verifyCodeEntry.Clear();
171 this.accessCodeEntry.Focus();
172 }
173
174 public void ShowWait()
175 {
176 this.Cursor = Cursors.WaitCursor;
177 }
178
179 public void HideWait()
180 {
181 this.Cursor = Cursors.Default;
182 }
183
184
185 }
186}
Note: See TracBrowser for help on using the repository browser.