source: Scheduling/branches/GUI1.2/DAccessGroupItem.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: 6.0 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 DAccessGroupItem.
15 /// </summary>
16 public class DAccessGroupItem : 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.Label label1;
22 private System.Windows.Forms.ComboBox cboAccessType;
23 /// <summary>
24 /// Required designer variable.
25 /// </summary>
26 private System.ComponentModel.Container components = null;
27
28 public DAccessGroupItem()
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 }
39
40 /// <summary>
41 /// Clean up any resources being used.
42 /// </summary>
43 protected override void Dispose( bool disposing )
44 {
45 if( disposing )
46 {
47 if(components != null)
48 {
49 components.Dispose();
50 }
51 }
52 base.Dispose( disposing );
53 }
54
55 #region Windows Form Designer generated code
56 /// <summary>
57 /// Required method for Designer support - do not modify
58 /// the contents of this method with the code editor.
59 /// </summary>
60 private void InitializeComponent()
61 {
62 this.pnlPageBottom = new System.Windows.Forms.Panel();
63 this.cmdCancel = new System.Windows.Forms.Button();
64 this.cmdOK = new System.Windows.Forms.Button();
65 this.label1 = new System.Windows.Forms.Label();
66 this.cboAccessType = new System.Windows.Forms.ComboBox();
67 this.pnlPageBottom.SuspendLayout();
68 this.SuspendLayout();
69 //
70 // pnlPageBottom
71 //
72 this.pnlPageBottom.Controls.AddRange(new System.Windows.Forms.Control[] {
73 this.cmdCancel,
74 this.cmdOK});
75 this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
76 this.pnlPageBottom.Location = new System.Drawing.Point(0, 112);
77 this.pnlPageBottom.Name = "pnlPageBottom";
78 this.pnlPageBottom.Size = new System.Drawing.Size(472, 40);
79 this.pnlPageBottom.TabIndex = 6;
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.Location = new System.Drawing.Point(296, 8);
94 this.cmdOK.Name = "cmdOK";
95 this.cmdOK.Size = new System.Drawing.Size(64, 24);
96 this.cmdOK.TabIndex = 1;
97 this.cmdOK.Text = "OK";
98 this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
99 //
100 // label1
101 //
102 this.label1.Location = new System.Drawing.Point(24, 40);
103 this.label1.Name = "label1";
104 this.label1.Size = new System.Drawing.Size(120, 16);
105 this.label1.TabIndex = 10;
106 this.label1.Text = "Select Access Type:";
107 this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
108 //
109 // cboAccessType
110 //
111 this.cboAccessType.Location = new System.Drawing.Point(152, 40);
112 this.cboAccessType.Name = "cboAccessType";
113 this.cboAccessType.Size = new System.Drawing.Size(248, 21);
114 this.cboAccessType.TabIndex = 9;
115 this.cboAccessType.Text = "cboAccessType";
116 //
117 // DAccessGroupItem
118 //
119 this.AcceptButton = this.cmdOK;
120 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
121 this.CancelButton = this.cmdCancel;
122 this.ClientSize = new System.Drawing.Size(472, 152);
123 this.Controls.AddRange(new System.Windows.Forms.Control[] {
124 this.label1,
125 this.cboAccessType,
126 this.pnlPageBottom});
127 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
128 this.Name = "DAccessGroupItem";
129 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
130 this.Text = "DAccessGroupItem";
131 this.pnlPageBottom.ResumeLayout(false);
132 this.ResumeLayout(false);
133
134 }
135 #endregion
136
137 #region Fields
138 int m_nAccessTypeID;
139 string m_sAccessTypeName;
140 #endregion Fields
141
142
143 public void InitializePage(int nSelectedATID, DataSet dsGlobal)
144 {
145
146 //Datasource the ACCESS GROUP combo box
147 DataTable dtAccessType = dsGlobal.Tables["AccessTypes"];
148 DataView dvAccessType = new DataView(dtAccessType);
149
150
151 cboAccessType.DataSource = dvAccessType;
152 cboAccessType.DisplayMember = "ACCESS_TYPE_NAME";
153 cboAccessType.ValueMember = "BMXIEN";
154
155 Debug.Assert(nSelectedATID == -1); //We're always in ADD mode
156
157 this.Text = "Add New Access Type to Group";
158 m_nAccessTypeID = 0;
159 m_sAccessTypeName = "";
160 UpdateDialogData(true);
161 }
162
163 /// <summary>
164 /// If b is true, moves member vars into control data
165 /// otherwise, moves control data into member vars
166 /// </summary>
167 /// <param name="b"></param>
168 private void UpdateDialogData(bool b)
169 {
170 if (b == true)
171 {
172 cboAccessType.SelectedValue = m_nAccessTypeID;
173 }
174 else
175 {
176 m_nAccessTypeID = Convert.ToInt16(cboAccessType.SelectedValue);
177 m_sAccessTypeName = cboAccessType.DisplayMember;
178 }
179 }
180
181 private void cmdOK_Click(object sender, System.EventArgs e)
182 {
183 UpdateDialogData(false);
184 }
185
186 #region Properties
187
188 /// <summary>
189 /// Contains the IEN of the AccessType in the BSDX_ACCESS_TYPE file
190 /// </summary>
191 public int AccessTypeID
192 {
193 get
194 {
195 return m_nAccessTypeID;
196 }
197 }
198
199 /// <summary>
200 /// Contains the name of the AccessType
201 /// </summary>
202 public string AccessTypeName
203 {
204 get
205 {
206 return m_sAccessTypeName;
207 }
208 }
209 #endregion Properties
210
211 }
212}
Note: See TracBrowser for help on using the repository browser.