Index: BMXNET_RPMS_dotNET_UTILITIES-BMX/trunk/cs/bmx_0200scr/BMX2/BMXNet/DSelectDivision.cs
===================================================================
--- BMXNET_RPMS_dotNET_UTILITIES-BMX/trunk/cs/bmx_0200scr/BMX2/BMXNet/DSelectDivision.cs	(revision 815)
+++ BMXNET_RPMS_dotNET_UTILITIES-BMX/trunk/cs/bmx_0200scr/BMX2/BMXNet/DSelectDivision.cs	(revision 923)
@@ -30,106 +30,107 @@
 		private void InitializeComponent()
 		{
-			this.pnlPageBottom = new System.Windows.Forms.Panel();
-			this.cmdCancel = new System.Windows.Forms.Button();
-			this.cmdOK = new System.Windows.Forms.Button();
-			this.pnlDescription = new System.Windows.Forms.Panel();
-			this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
-			this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
-			this.lstDivision = new System.Windows.Forms.ListBox();
-			this.label1 = new System.Windows.Forms.Label();
-			this.pnlPageBottom.SuspendLayout();
-			this.pnlDescription.SuspendLayout();
-			this.grpDescriptionResourceGroup.SuspendLayout();
-			this.SuspendLayout();
-			// 
-			// pnlPageBottom
-			// 
-			this.pnlPageBottom.Controls.Add(this.cmdCancel);
-			this.pnlPageBottom.Controls.Add(this.cmdOK);
-			this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
-			this.pnlPageBottom.Location = new System.Drawing.Point(0, 262);
-			this.pnlPageBottom.Name = "pnlPageBottom";
-			this.pnlPageBottom.Size = new System.Drawing.Size(456, 40);
-			this.pnlPageBottom.TabIndex = 7;
-			// 
-			// cmdCancel
-			// 
-			this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
-			this.cmdCancel.Location = new System.Drawing.Point(376, 8);
-			this.cmdCancel.Name = "cmdCancel";
-			this.cmdCancel.Size = new System.Drawing.Size(56, 24);
-			this.cmdCancel.TabIndex = 4;
-			this.cmdCancel.Text = "Cancel";
-			// 
-			// cmdOK
-			// 
-			this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
-			this.cmdOK.Location = new System.Drawing.Point(296, 8);
-			this.cmdOK.Name = "cmdOK";
-			this.cmdOK.Size = new System.Drawing.Size(64, 24);
-			this.cmdOK.TabIndex = 3;
-			this.cmdOK.Text = "OK";
-			this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
-			// 
-			// pnlDescription
-			// 
-			this.pnlDescription.Controls.Add(this.grpDescriptionResourceGroup);
-			this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
-			this.pnlDescription.Location = new System.Drawing.Point(0, 190);
-			this.pnlDescription.Name = "pnlDescription";
-			this.pnlDescription.Size = new System.Drawing.Size(456, 72);
-			this.pnlDescription.TabIndex = 8;
-			// 
-			// grpDescriptionResourceGroup
-			// 
-			this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
-			this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
-			this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
-			this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(456, 72);
-			this.grpDescriptionResourceGroup.TabIndex = 1;
-			this.grpDescriptionResourceGroup.TabStop = false;
-			this.grpDescriptionResourceGroup.Text = "Description";
-			// 
-			// lblDescriptionResourceGroup
-			// 
-			this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
-			this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
-			this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
-			this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(450, 53);
-			this.lblDescriptionResourceGroup.TabIndex = 0;
-			this.lblDescriptionResourceGroup.Text = "Use this panel to select the Division.";
-			// 
-			// lstDivision
-			// 
-			this.lstDivision.Location = new System.Drawing.Point(40, 48);
-			this.lstDivision.Name = "lstDivision";
-			this.lstDivision.Size = new System.Drawing.Size(384, 121);
-			this.lstDivision.TabIndex = 9;
-			// 
-			// label1
-			// 
-			this.label1.Location = new System.Drawing.Point(40, 24);
-			this.label1.Name = "label1";
-			this.label1.Size = new System.Drawing.Size(240, 16);
-			this.label1.TabIndex = 10;
-			this.label1.Text = "Select Division:";
-			// 
-			// DSelectDivision
-			// 
-			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
-			this.ClientSize = new System.Drawing.Size(456, 302);
-			this.Controls.Add(this.label1);
-			this.Controls.Add(this.lstDivision);
-			this.Controls.Add(this.pnlDescription);
-			this.Controls.Add(this.pnlPageBottom);
-			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
-			this.Name = "DSelectDivision";
-			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
-			this.Text = "Select Division";
-			this.pnlPageBottom.ResumeLayout(false);
-			this.pnlDescription.ResumeLayout(false);
-			this.grpDescriptionResourceGroup.ResumeLayout(false);
-			this.ResumeLayout(false);
+            this.pnlPageBottom = new System.Windows.Forms.Panel();
+            this.cmdCancel = new System.Windows.Forms.Button();
+            this.cmdOK = new System.Windows.Forms.Button();
+            this.pnlDescription = new System.Windows.Forms.Panel();
+            this.grpDescriptionResourceGroup = new System.Windows.Forms.GroupBox();
+            this.lblDescriptionResourceGroup = new System.Windows.Forms.Label();
+            this.lstDivision = new System.Windows.Forms.ListBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.pnlPageBottom.SuspendLayout();
+            this.pnlDescription.SuspendLayout();
+            this.grpDescriptionResourceGroup.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // pnlPageBottom
+            // 
+            this.pnlPageBottom.Controls.Add(this.cmdCancel);
+            this.pnlPageBottom.Controls.Add(this.cmdOK);
+            this.pnlPageBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlPageBottom.Location = new System.Drawing.Point(0, 262);
+            this.pnlPageBottom.Name = "pnlPageBottom";
+            this.pnlPageBottom.Size = new System.Drawing.Size(456, 40);
+            this.pnlPageBottom.TabIndex = 7;
+            // 
+            // cmdCancel
+            // 
+            this.cmdCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.cmdCancel.Location = new System.Drawing.Point(376, 8);
+            this.cmdCancel.Name = "cmdCancel";
+            this.cmdCancel.Size = new System.Drawing.Size(56, 24);
+            this.cmdCancel.TabIndex = 4;
+            this.cmdCancel.Text = "Cancel";
+            // 
+            // cmdOK
+            // 
+            this.cmdOK.DialogResult = System.Windows.Forms.DialogResult.OK;
+            this.cmdOK.Location = new System.Drawing.Point(296, 8);
+            this.cmdOK.Name = "cmdOK";
+            this.cmdOK.Size = new System.Drawing.Size(64, 24);
+            this.cmdOK.TabIndex = 3;
+            this.cmdOK.Text = "OK";
+            this.cmdOK.Click += new System.EventHandler(this.cmdOK_Click);
+            // 
+            // pnlDescription
+            // 
+            this.pnlDescription.Controls.Add(this.grpDescriptionResourceGroup);
+            this.pnlDescription.Dock = System.Windows.Forms.DockStyle.Bottom;
+            this.pnlDescription.Location = new System.Drawing.Point(0, 190);
+            this.pnlDescription.Name = "pnlDescription";
+            this.pnlDescription.Size = new System.Drawing.Size(456, 72);
+            this.pnlDescription.TabIndex = 8;
+            // 
+            // grpDescriptionResourceGroup
+            // 
+            this.grpDescriptionResourceGroup.Controls.Add(this.lblDescriptionResourceGroup);
+            this.grpDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.grpDescriptionResourceGroup.Location = new System.Drawing.Point(0, 0);
+            this.grpDescriptionResourceGroup.Name = "grpDescriptionResourceGroup";
+            this.grpDescriptionResourceGroup.Size = new System.Drawing.Size(456, 72);
+            this.grpDescriptionResourceGroup.TabIndex = 1;
+            this.grpDescriptionResourceGroup.TabStop = false;
+            this.grpDescriptionResourceGroup.Text = "Description";
+            // 
+            // lblDescriptionResourceGroup
+            // 
+            this.lblDescriptionResourceGroup.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.lblDescriptionResourceGroup.Location = new System.Drawing.Point(3, 16);
+            this.lblDescriptionResourceGroup.Name = "lblDescriptionResourceGroup";
+            this.lblDescriptionResourceGroup.Size = new System.Drawing.Size(450, 53);
+            this.lblDescriptionResourceGroup.TabIndex = 0;
+            this.lblDescriptionResourceGroup.Text = "Use this panel to select the Division.";
+            // 
+            // lstDivision
+            // 
+            this.lstDivision.Location = new System.Drawing.Point(40, 48);
+            this.lstDivision.Name = "lstDivision";
+            this.lstDivision.Size = new System.Drawing.Size(384, 121);
+            this.lstDivision.TabIndex = 9;
+            this.lstDivision.DoubleClick += new System.EventHandler(this.lstDivision_DoubleClick);
+            // 
+            // label1
+            // 
+            this.label1.Location = new System.Drawing.Point(40, 24);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(240, 16);
+            this.label1.TabIndex = 10;
+            this.label1.Text = "Select Division:";
+            // 
+            // DSelectDivision
+            // 
+            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+            this.ClientSize = new System.Drawing.Size(456, 302);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.lstDivision);
+            this.Controls.Add(this.pnlDescription);
+            this.Controls.Add(this.pnlPageBottom);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+            this.Name = "DSelectDivision";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "Select Division";
+            this.pnlPageBottom.ResumeLayout(false);
+            this.pnlDescription.ResumeLayout(false);
+            this.grpDescriptionResourceGroup.ResumeLayout(false);
+            this.ResumeLayout(false);
 
 		}
@@ -165,8 +166,7 @@
 		#region Methods
 
-		public void InitializePage(DataTable dtDivisions, string sDUZ2)
+		public void InitializePage(DataTable dtDivisions)
 		{
 			m_dtDivisions = dtDivisions;
-			m_sDUZ2 = sDUZ2;
 			UpdateDialogData(true);
 		}
@@ -181,8 +181,9 @@
 			if (b == true) //move member vars into controls
 			{
-				this.lstDivision.DataSource = m_dtDivisions;
+                m_dtDivisions.DefaultView.Sort="DEFAULT ASC";
+                this.lstDivision.DataSource = m_dtDivisions.DefaultView;
 				lstDivision.DisplayMember = "FACILITY_NAME";
 				lstDivision.ValueMember = "FACILITY_IEN";
-				lstDivision.SelectedValue = m_sDUZ2;
+                lstDivision.SelectedIndex = m_dtDivisions.DefaultView.Find(1);
 			}
 			else //move control data into member vars
@@ -217,7 +218,27 @@
 		private void cmdOK_Click(object sender, System.EventArgs e)
 		{
+            if (lstDivision.SelectedIndex < 0) {
+                this.lblDescriptionResourceGroup.Text="Must select a division";
+                this.lblDescriptionResourceGroup.ForeColor = Color.Red;
+                this.DialogResult = DialogResult.None; //forestall acceptance.
+                return;
+            }
 			this.UpdateDialogData(false);
 			return;
 		}
+
+        private void lstDivision_DoubleClick(object sender, EventArgs e)
+        {
+            if (lstDivision.SelectedIndex < 0) {
+                this.lblDescriptionResourceGroup.Text = "Must select a division";
+                this.lblDescriptionResourceGroup.ForeColor = Color.Red; 
+                return;
+            }
+            this.UpdateDialogData(false);
+            this.DialogResult = DialogResult.OK;
+            return;
+        }
+
+
 	}
 }
