Beispiel #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            SearchJob mySJob = null;
            string cnnstr = connectionString;
            string JobDescription = null;
            string customer = null;
            string customerTerms = null;
            string PONumber = "";

            try
            {

                dgvShipments.Columns.Clear();
                dgvItm.Columns.Clear();

                mySJob = new SearchJob(cnnstr);
                mySJob.getJobData(this.txtJobNum.Text.Trim(),
                                   ref JobDescription,
                                   ref customer,
                                   ref customerTerms, ref PONumber, dgvShipments
                                   );

                this.txtJobDes.Text = JobDescription;
                this.txtCustomer.Text = customer;
                this.txtCustomerTems.Text = customerTerms;
                this.txtCustomerPONum.Text  = PONumber;

                mySJob.getitem(txtJobNum.Text, myRowIndex, dgvItm);
                dgvShipments.Rows[0].Selected = true;

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                mySJob = null;
            }
        }