Esempio n. 1
0
        private void frmCadastroProduto_Load(object sender, EventArgs e)
        {
            alterarBotoes(1);

            ////COMBO DA CATEGORIA
            DALConexao conexao = new DALConexao(DadosDaConexao.StringDeConexao);
            BLLCategoria daoCategoria = new BLLCategoria(conexao);
            cboCategoria.DataSource = daoCategoria.Localizar("");
            cboCategoria.DisplayMember = "cat_nome";
            cboCategoria.ValueMember = "cat_cod";
            //cboCategoria.AutoCompleteMode = AutoCompleteMode.Suggest;
            //cboCategoria.AutoCompleteSource = AutoCompleteSource.ListItems;
            try
            {
                BLLSubCategoria sub = new BLLSubCategoria(conexao);
                cboSubCategoria.DataSource = sub.LocalizaPorCategoria(1);
                //cbSubCategoria.DataSource = sub.LocalizaPorCategoria((int)cbCategoria.SelectedValue);
                cboSubCategoria.DisplayMember = "scat_nome";
                cboSubCategoria.ValueMember = "scat_cod";

            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            //COMBO UNIDADE DE MEDIDA
            BLLUnidMedida daoUniMedida = new BLLUnidMedida(conexao);
            cboUnidMedida.DataSource = daoUniMedida.Localizar("");
            cboUnidMedida.DisplayMember = "umed_nome";
            cboUnidMedida.ValueMember = "umed_cod";
        }
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            DALConexao    conexao    = new DALConexao(DadosDaConexao.StringDeConexao);
            BLLUnidMedida unidMedida = new BLLUnidMedida(conexao);

            GridUnidade.DataSource = unidMedida.Localizar(txtPesquisa.Text.ToUpper());
        }