Ejemplo n.º 1
0
        private void txtProveedor_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (checkBox2.Checked)
            {
                //
                try
                {
                    DataSet1TableAdapters.SupplierTableAdapter ta = new DataSet1TableAdapters.SupplierTableAdapter();
                    DataSet1.SupplierDataTable dt = ta.GetDataByBuscarIDProveedor(txtProveedor.Text);
                    //ta.GetDataByIdSupplier(txtBusquedaProv.Text);


                    ta.FillByBuscarIDProveedor(dt, txtProveedor.Text);


                    dgvProveedor.DataSource = dt;
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                //
            }
            else
            {
                try
                {
                    DataSet1TableAdapters.SupplierTableAdapter ta = new DataSet1TableAdapters.SupplierTableAdapter();
                    DataSet1.SupplierDataTable dt = ta.GetDataByFilteringSupplier(txtProveedor.Text);


                    ta.FillByFilteringSupplier(dt, txtProveedor.Text);


                    dgvProveedor.DataSource = dt;
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }


            //try
            //{
            //    DataSet1TableAdapters.SupplierTableAdapter ta = new DataSet1TableAdapters.SupplierTableAdapter();
            //    DataSet1.SupplierDataTable dt = ta.GetDataByFilteringSupplier(txtProveedor.Text);


            //    ta.FillByFilteringSupplier(dt, txtProveedor.Text);


            //    dgvProveedor.DataSource = dt;

            //}
            //catch (System.Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}
        }
Ejemplo n.º 2
0
        private void txtBusquedaProv_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (checkBox1.Checked)
            {
                //
                try
                {
                    DataSet1TableAdapters.SupplierTableAdapter ta = new DataSet1TableAdapters.SupplierTableAdapter();
                    DataSet1.SupplierDataTable dt = ta.GetDataByBuscarIDProveedor(txtBusquedaProv.Text);
                    //ta.GetDataByIdSupplier(txtBusquedaProv.Text);


                    ta.FillByBuscarIDProveedor(dt, txtBusquedaProv.Text);


                    dataGridView1.DataSource = dt;
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                //
            }
            else
            {
                try
                {
                    DataSet1TableAdapters.SupplierTableAdapter ta = new DataSet1TableAdapters.SupplierTableAdapter();
                    DataSet1.SupplierDataTable dt = ta.GetDataByFilteringSupplier(txtBusquedaProv.Text);


                    ta.FillByFilteringSupplier(dt, txtBusquedaProv.Text);


                    dataGridView1.DataSource = dt;
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }

            //

            /*
             * try
             * {
             *  DataSet1TableAdapters.SupplierTableAdapter ta = new DataSet1TableAdapters.SupplierTableAdapter();
             *  DataSet1.SupplierDataTable dt = ta.GetDataByFilteringSupplier(txtBusquedaProv.Text);
             *
             *
             *  ta.FillByFilteringSupplier(dt, txtBusquedaProv.Text);
             *
             *
             *  dataGridView1.DataSource = dt;
             *
             * }
             * catch (System.Exception ex)
             * {
             *  MessageBox.Show(ex.Message);
             * }*/
        }