source: Scheduling/branches/GUI1.2/DAccessGroup.cs@ 1154

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

Initial committ of scheduling package

File size: 5.6 KB
Line 
1using System;
2using System.Drawing;
3using System.Collections;
4using System.ComponentModel;
5using System.Windows.Forms;
6using System.Data;
7//using System.Data.OleDb;
8using IndianHealthService.BMXNet;
9using System.Diagnostics;
10
11namespace IndianHealthService.ClinicalScheduling
12{
13 /// <summary>
14 /// Summary description for DAccessGroup.
15 /// </summary>
16 public class DAccessGroup : System.Windows.Forms.Form
17 {
18 private System.Windows.Forms.Panel pnlPageBottom;
19 private System.Windows.Forms.Button cmdCancel;
20 private System.Windows.Forms.Button cmdOK;
21 private System.Windows.Forms.TextBox txtAccessGroupName;
22 private System.Windows.Forms.Label label1;
23 /// <summary>
24 /// Required designer variable.
25 /// </summary>
26 private System.ComponentModel.Container components = null;
27
28 public DAccessGroup()
29 {
30 //
31 // Required for Windows Form Designer support
32 //
33 InitializeComponent();
34
35 //
36 // TODO: Add any constructor code after InitializeComponent call
37 //
38 m_sAccessGroupName = "";
39 }
40
41 /// <summary>
42 /// Clean up any resources being used.
43 /// </summary>
44 protected override void Dispose( bool disposing )
45 {
46 if( disposing )
47 {
48 if(components != null)
49 {
50 components.Dispose();
51 }
52 }
53 base.Dispose( disposing );
54 }
55
56 #region Windows Form Designer generated code
57 /// <summary>
58 /// Required method for Designer support - do not modify
59 /// the contents of this method with the code editor.
60 /// </summary>
61 private void InitializeComponent()
62 {
63 this.pnlPageBottom = new System.Windows.Forms.Panel();
64 this.cmdCancel = new System.Windows.Forms.Button();
65 this.cmdOK = new System.Windows.Forms.Button();
66 this.txtAccessGroupName = new System.Windows.Forms.TextBox();
67 this.label1 = new System.Windows.Forms.Label();
68 this.pnlPageBottom.SuspendLayout();
69 this.SuspendLayout();
70 //
71 // pnlPageBottom
72 //
73 this.pnlPageBottom.Controls.Add(this.cmdCancel);
74 this.pnlPageBottom.Controls.Add(this.cmdOK);
75 this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
76 this.pnlPageBottom.Location = new System.Drawing.Point(0, 158);
77 this.pnlPageBottom.Name = "pnlPageBottom";
78 this.pnlPageBottom.Size = new System.Drawing.Size(496, 40);
79 this.pnlPageBottom.TabIndex = 7;
80 //
81 // cmdCancel
82 //
83 this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
84 this.cmdCancel.Location = new System.Drawing.Point(376, 8);
85 this.cmdCancel.Name = "cmdCancel";
86 this.cmdCancel.Size = new System.Drawing.Size(56, 24);
87 this.cmdCancel.TabIndex = 2;
88 this.cmdCancel.Text = "Cancel";
89 //
90 // cmdOK
91 //
92 this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
93 this.cmdOK.Enabled = false;
94 this.cmdOK.Location = new System.Drawing.Point(296, 8);
95 this.cmdOK.Name = "cmdOK";
96 this.cmdOK.Size = new System.Drawing.Size(64, 24);
97 this.cmdOK.TabIndex = 1;
98 this.cmdOK.Text = "OK";
99 this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
100 //
101 // txtAccessGroupName
102 //
103 this.txtAccessGroupName.Location = new System.Drawing.Point(184, 72);
104 this.txtAccessGroupName.Name = "txtAccessGroupName";
105 this.txtAccessGroupName.Size = new System.Drawing.Size(256, 20);
106 this.txtAccessGroupName.TabIndex = 0;
107 this.txtAccessGroupName.Text = "";
108 this.txtAccessGroupName.TextChanged += new System.EventHandler(this.txtAccessGroupName_TextChanged);
109 //
110 // label1
111 //
112 this.label1.Location = new System.Drawing.Point(48, 72);
113 this.label1.Name = "label1";
114 this.label1.Size = new System.Drawing.Size(136, 16);
115 this.label1.TabIndex = 9;
116 this.label1.Text = "Access Group Name:";
117 //
118 // DAccessGroup
119 //
120 this.AcceptButton = this.cmdOK;
121 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
122 this.ClientSize = new System.Drawing.Size(496, 198);
123 this.Controls.Add(this.txtAccessGroupName);
124 this.Controls.Add(this.label1);
125 this.Controls.Add(this.pnlPageBottom);
126 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
127 this.Name = "DAccessGroup";
128 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
129 this.Text = "Access Group";
130 this.pnlPageBottom.ResumeLayout(false);
131 this.ResumeLayout(false);
132
133 }
134 #endregion
135
136 private string m_sAccessGroupName;
137
138 public void InitializePage(int nSelectedRGID, DataSet dsGlobal)
139 {
140
141 if (nSelectedRGID < 0) //then we're in ADD mode
142 {
143 this.Text = "Add New Access Group";
144 this.cmdOK.Enabled = false;
145 }
146 else //we're in EDIT mode
147 {
148 this.Text = "Edit Access Group";
149 }
150 UpdateDialogData(true);
151 }
152
153
154 /// <summary>
155 /// If b is true, moves member vars into control data
156 /// otherwise, moves control data into member vars
157 /// </summary>
158 /// <param name="b"></param>
159 private void UpdateDialogData(bool b)
160 {
161 if (b == true)
162 {
163 txtAccessGroupName.Text = m_sAccessGroupName;
164 }
165 else
166 {
167 m_sAccessGroupName = txtAccessGroupName.Text;
168 }
169 }
170
171 private void txtAccessGroupName_TextChanged(object sender, System.EventArgs e)
172 {
173 string sText = txtAccessGroupName.Text;
174 if ((sText.Length > 2) && (sText.Length < 30))
175 {
176 cmdOK.Enabled = true;
177 }
178 else
179 {
180 cmdOK.Enabled = false;
181 }
182 }
183
184 private void cmdOK_Click(object sender, System.EventArgs e)
185 {
186 UpdateDialogData(false);
187 }
188
189 /// <summary>
190 /// Gets the name of the Access Group;
191 /// </summary>
192 public string AccessGroupName
193 {
194 get
195 {
196 return m_sAccessGroupName;
197 }
198 set
199 {
200 m_sAccessGroupName = value;
201 }
202 }
203 }
204}
Note: See TracBrowser for help on using the repository browser.