Example #1
0
        private void tsbRetrieve_Click(object sender, EventArgs e)
        {
            Datalayer d = Datalayer.Instance;

            try
            {
                Properties.Settings s = Properties.Settings.Default;

                statusLabel.Text = String.Format("Locations {0}", d.Open(s.OraUsername, s.OraPassword, s.OraTNS));
                txtLocation.Text = txtLocation.Text.ToUpper();
                DataTable dt = d.LocationClass(txtLocation.Text);

                if (dt.Rows.Count > 0)
                {
                    DataRow row = dt.Rows[0];
                    lblLocationDesc.Text = row["locdescription"].ToString();
                    lblEqClassCode.Text  = row["eqclasscode"].ToString();
                    lblEqClassDesc.Text  = row["eqclassdesc"].ToString();
                    lblSpecCode.Text     = row["classificationid"].ToString();
                    lblSpecDesc.Text     = row["classdescription"].ToString();

                    DataTable ds = d.LocationAttributes(txtLocation.Text, row["classstructureid"].ToString());
                    bindingSource1.DataSource = ds;
                    dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
                }
                else
                {
                    statusLabel.Text = String.Format("There is no Location {0}", txtLocation.Text);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }