예제 #1
0
 private void subCategoriaToolStripMenuItem_Click(object sender, EventArgs e)
 {
   using (frmPesquisarSubCategoria pesquisar = new frmPesquisarSubCategoria())
   {
     pesquisar.ShowDialog();
   }
 }
예제 #2
0
        private void btnLocalizar_Click(object sender, EventArgs e)
        {
            using (frmPesquisarSubCategoria pesquisar = new frmPesquisarSubCategoria())
            {
                pesquisar.ShowDialog();

                if (pesquisar.codigo != 0)
                {
                    ModeloSubCategoria modelo = QueryDB.CarregaSubCategoria(Convert.ToInt32(pesquisar.codigo));

                    txtCodigoSubCategoria.Text = Convert.ToString(modelo.SCatCod);
                    txtNomeSubCategoria.Text   = modelo.SCatNome;
                    cbCategoria.SelectedValue  = modelo.CatCod;

                    this.AlteraBotoes(Convert.ToInt32(OperacaoFormulario.Alterar_Excluir_Cancelar));
                }
                else
                {
                    this.LimparDadosDaTela();
                    this.AlteraBotoes(Convert.ToInt32(OperacaoFormulario.Inserir_Localizar));
                }
            }
        }