[815] | 1 | using System;
|
---|
| 2 | using System.Drawing;
|
---|
| 3 | using System.Collections;
|
---|
| 4 | using System.ComponentModel;
|
---|
| 5 | using System.Windows.Forms;
|
---|
| 6 | using System.Data;
|
---|
| 7 |
|
---|
| 8 | namespace IndianHealthService.BMXNet
|
---|
| 9 | {
|
---|
| 10 | /// <summary>
|
---|
| 11 | /// Summary description for DSelectDivision.
|
---|
| 12 | /// </summary>
|
---|
| 13 | public partial class DSelectDivision : System.Windows.Forms.Form
|
---|
| 14 | {
|
---|
| 15 | private System.Windows.Forms.Panel pnlPageBottom;
|
---|
| 16 | private System.Windows.Forms.Button cmdCancel;
|
---|
| 17 | private System.Windows.Forms.Button cmdOK;
|
---|
| 18 | private System.Windows.Forms.Panel pnlDescription;
|
---|
| 19 | private System.Windows.Forms.GroupBox grpDescriptionResourceGroup;
|
---|
| 20 | private System.Windows.Forms.Label lblDescriptionResourceGroup;
|
---|
| 21 | private System.Windows.Forms.ListBox lstDivision;
|
---|
| 22 | private System.Windows.Forms.Label label1;
|
---|
| 23 | private System.ComponentModel.Container components = null;
|
---|
| 24 |
|
---|
| 25 | #region Windows Form Designer generated code
|
---|
| 26 | /// <summary>
|
---|
| 27 | /// Required method for Designer support - do not modify
|
---|
| 28 | /// the contents of this method with the code editor.
|
---|
| 29 | /// </summary>
|
---|
| 30 | private void InitializeComponent()
|
---|
| 31 | {
|
---|
| 32 | this.pnlPageBottom = new System.Windows.Forms.Panel();
|
---|
| 33 | this.cmdCancel = new System.Windows.Forms.Button();
|
---|
| 34 | this.cmdOK = new System.Windows.Forms.Button();
|
---|
| 35 | this.pnlDescription = new System.Windows.Forms.Panel();
|
---|
| 36 | this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
|
---|
| 37 | this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
|
---|
| 38 | this.lstDivision = new System.Windows.Forms.ListBox();
|
---|
| 39 | this.label1 = new System.Windows.Forms.Label();
|
---|
| 40 | this.pnlPageBottom.SuspendLayout();
|
---|
| 41 | this.pnlDescription.SuspendLayout();
|
---|
| 42 | this.grpDescriptionResourceGroup.SuspendLayout();
|
---|
| 43 | this.SuspendLayout();
|
---|
| 44 | //
|
---|
| 45 | // pnlPageBottom
|
---|
| 46 | //
|
---|
| 47 | this.pnlPageBottom.Controls.Add(this.cmdCancel);
|
---|
| 48 | this.pnlPageBottom.Controls.Add(this.cmdOK);
|
---|
| 49 | this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
|
---|
| 50 | this.pnlPageBottom.Location = new System.Drawing.Point(0, 262);
|
---|
| 51 | this.pnlPageBottom.Name = "pnlPageBottom";
|
---|
| 52 | this.pnlPageBottom.Size = new System.Drawing.Size(456, 40);
|
---|
| 53 | this.pnlPageBottom.TabIndex = 7;
|
---|
| 54 | //
|
---|
| 55 | // cmdCancel
|
---|
| 56 | //
|
---|
| 57 | this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
---|
| 58 | this.cmdCancel.Location = new System.Drawing.Point(376, 8);
|
---|
| 59 | this.cmdCancel.Name = "cmdCancel";
|
---|
| 60 | this.cmdCancel.Size = new System.Drawing.Size(56, 24);
|
---|
| 61 | this.cmdCancel.TabIndex = 4;
|
---|
| 62 | this.cmdCancel.Text = "Cancel";
|
---|
| 63 | //
|
---|
| 64 | // cmdOK
|
---|
| 65 | //
|
---|
| 66 | this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
|
---|
| 67 | this.cmdOK.Location = new System.Drawing.Point(296, 8);
|
---|
| 68 | this.cmdOK.Name = "cmdOK";
|
---|
| 69 | this.cmdOK.Size = new System.Drawing.Size(64, 24);
|
---|
| 70 | this.cmdOK.TabIndex = 3;
|
---|
| 71 | this.cmdOK.Text = "OK";
|
---|
| 72 | this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
|
---|
| 73 | //
|
---|
| 74 | // pnlDescription
|
---|
| 75 | //
|
---|
| 76 | this.pnlDescription.Controls.Add(this.grpDescriptionResourceGroup);
|
---|
| 77 | this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
|
---|
| 78 | this.pnlDescription.Location = new System.Drawing.Point(0, 190);
|
---|
| 79 | this.pnlDescription.Name = "pnlDescription";
|
---|
| 80 | this.pnlDescription.Size = new System.Drawing.Size(456, 72);
|
---|
| 81 | this.pnlDescription.TabIndex = 8;
|
---|
| 82 | //
|
---|
| 83 | // grpDescriptionResourceGroup
|
---|
| 84 | //
|
---|
| 85 | this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
|
---|
| 86 | this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
|
---|
| 87 | this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
|
---|
| 88 | this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
|
---|
| 89 | this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(456, 72);
|
---|
| 90 | this.grpDescriptionResourceGroup.TabIndex = 1;
|
---|
| 91 | this.grpDescriptionResourceGroup.TabStop = false;
|
---|
| 92 | this.grpDescriptionResourceGroup.Text = "Description";
|
---|
| 93 | //
|
---|
| 94 | // lblDescriptionResourceGroup
|
---|
| 95 | //
|
---|
| 96 | this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
|
---|
| 97 | this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
|
---|
| 98 | this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
|
---|
| 99 | this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(450, 53);
|
---|
| 100 | this.lblDescriptionResourceGroup.TabIndex = 0;
|
---|
| 101 | this.lblDescriptionResourceGroup.Text = "Use this panel to select the Division.";
|
---|
| 102 | //
|
---|
| 103 | // lstDivision
|
---|
| 104 | //
|
---|
| 105 | this.lstDivision.Location = new System.Drawing.Point(40, 48);
|
---|
| 106 | this.lstDivision.Name = "lstDivision";
|
---|
| 107 | this.lstDivision.Size = new System.Drawing.Size(384, 121);
|
---|
| 108 | this.lstDivision.TabIndex = 9;
|
---|
| 109 | //
|
---|
| 110 | // label1
|
---|
| 111 | //
|
---|
| 112 | this.label1.Location = new System.Drawing.Point(40, 24);
|
---|
| 113 | this.label1.Name = "label1";
|
---|
| 114 | this.label1.Size = new System.Drawing.Size(240, 16);
|
---|
| 115 | this.label1.TabIndex = 10;
|
---|
| 116 | this.label1.Text = "Select Division:";
|
---|
| 117 | //
|
---|
| 118 | // DSelectDivision
|
---|
| 119 | //
|
---|
| 120 | this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
|
---|
| 121 | this.ClientSize = new System.Drawing.Size(456, 302);
|
---|
| 122 | this.Controls.Add(this.label1);
|
---|
| 123 | this.Controls.Add(this.lstDivision);
|
---|
| 124 | this.Controls.Add(this.pnlDescription);
|
---|
| 125 | this.Controls.Add(this.pnlPageBottom);
|
---|
| 126 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
---|
| 127 | this.Name = "DSelectDivision";
|
---|
| 128 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
---|
| 129 | this.Text = "Select Division";
|
---|
| 130 | this.pnlPageBottom.ResumeLayout(false);
|
---|
| 131 | this.pnlDescription.ResumeLayout(false);
|
---|
| 132 | this.grpDescriptionResourceGroup.ResumeLayout(false);
|
---|
| 133 | this.ResumeLayout(false);
|
---|
| 134 |
|
---|
| 135 | }
|
---|
| 136 | #endregion
|
---|
| 137 |
|
---|
| 138 | #region Fields
|
---|
| 139 |
|
---|
| 140 | private DataTable m_dtDivisions;
|
---|
| 141 | private string m_sDUZ2;
|
---|
| 142 | private string m_sDivisionName;
|
---|
| 143 |
|
---|
| 144 | #endregion Fields
|
---|
| 145 |
|
---|
| 146 | #region Properties
|
---|
| 147 |
|
---|
| 148 | public string DivisionName
|
---|
| 149 | {
|
---|
| 150 | get
|
---|
| 151 | {
|
---|
| 152 | return this.m_sDivisionName;
|
---|
| 153 | }
|
---|
| 154 | }
|
---|
| 155 |
|
---|
| 156 | public string DUZ2
|
---|
| 157 | {
|
---|
| 158 | get
|
---|
| 159 | {
|
---|
| 160 | return this.m_sDUZ2;
|
---|
| 161 | }
|
---|
| 162 | }
|
---|
| 163 | #endregion Properties
|
---|
| 164 |
|
---|
| 165 | #region Methods
|
---|
| 166 |
|
---|
| 167 | public void InitializePage(DataTable dtDivisions, string sDUZ2)
|
---|
| 168 | {
|
---|
| 169 | m_dtDivisions = dtDivisions;
|
---|
| 170 | m_sDUZ2 = sDUZ2;
|
---|
| 171 | UpdateDialogData(true);
|
---|
| 172 | }
|
---|
| 173 |
|
---|
| 174 | /// <summary>
|
---|
| 175 | /// If b is true, moves member vars into control data
|
---|
| 176 | /// otherwise, moves control data into member vars
|
---|
| 177 | /// </summary>
|
---|
| 178 | /// <param name="b"></param>
|
---|
| 179 | private void UpdateDialogData(bool b)
|
---|
| 180 | {
|
---|
| 181 | if (b == true) //move member vars into controls
|
---|
| 182 | {
|
---|
| 183 | this.lstDivision.DataSource = m_dtDivisions;
|
---|
| 184 | lstDivision.DisplayMember = "FACILITY_NAME";
|
---|
| 185 | lstDivision.ValueMember = "FACILITY_IEN";
|
---|
| 186 | lstDivision.SelectedValue = m_sDUZ2;
|
---|
| 187 | }
|
---|
| 188 | else //move control data into member vars
|
---|
| 189 | {
|
---|
| 190 | this.m_sDUZ2 = lstDivision.SelectedValue.ToString();
|
---|
| 191 | this.m_sDivisionName = lstDivision.Text;
|
---|
| 192 | }
|
---|
| 193 | }
|
---|
| 194 |
|
---|
| 195 | /// <summary>
|
---|
| 196 | /// Clean up any resources being used.
|
---|
| 197 | /// </summary>
|
---|
| 198 | protected override void Dispose( bool disposing )
|
---|
| 199 | {
|
---|
| 200 | if( disposing )
|
---|
| 201 | {
|
---|
| 202 | if(components != null)
|
---|
| 203 | {
|
---|
| 204 | components.Dispose();
|
---|
| 205 | }
|
---|
| 206 | }
|
---|
| 207 | base.Dispose( disposing );
|
---|
| 208 | }
|
---|
| 209 |
|
---|
| 210 | public DSelectDivision()
|
---|
| 211 | {
|
---|
| 212 | InitializeComponent();
|
---|
| 213 | }
|
---|
| 214 |
|
---|
| 215 | #endregion Methods
|
---|
| 216 |
|
---|
| 217 | private void cmdOK_Click(object sender, System.EventArgs e)
|
---|
| 218 | {
|
---|
| 219 | this.UpdateDialogData(false);
|
---|
| 220 | return;
|
---|
| 221 | }
|
---|
| 222 | }
|
---|
| 223 | }
|
---|