示例#1
0
        private void btnFiltrar_Click(object sender, EventArgs e)
        {
            if (txtPesquisa.Text != string.Empty)
            {
                Camadas.BLL.Fabricante          bllFabricante = new Camadas.BLL.Fabricante();
                List <Camadas.Model.Fabricante> lstFabricante = new List <Camadas.Model.Fabricante>();

                if (rdbCodigo.Checked)
                {
                    lstFabricante = bllFabricante.SelectById(Convert.ToInt32(txtPesquisa.Text));
                }
                else if (rdbNome.Checked)
                {
                    lstFabricante = bllFabricante.SelectByNome(txtPesquisa.Text);
                }

                dgvFabricante.DataSource = "";
                dgvFabricante.DataSource = lstFabricante;
            }
            else
            {
                string msg = "Campo Pesquisa esta vazio...";
                MessageBox.Show(msg, "Pesquisa", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#2
0
        private void RecuperarDadosFabricante()
        {
            Camadas.BLL.Fabricante          bllFabricante = new Camadas.BLL.Fabricante();
            List <Camadas.Model.Fabricante> lstFabr       = new List <Camadas.Model.Fabricante>();

            lstFabr = bllFabricante.SelectById(Convert.ToInt32(txtIdFrabr.Text));
            if (lstFabr != null)
            {
                fabricante = lstFabr[0];
            }
            else
            {
                MessageBox.Show("Fornecedor não encontrado");
            }
        }