예제 #1
0
 public Produtos iniciarForm()
 {
     produto = null;
     limparForm();
     popularTabela();
     ShowDialog();
     return produto;
 }
예제 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     BuscaProdutoForm bpform = new BuscaProdutoForm();
     p = bpform.iniciarForm();
     if (p != null)
     {
         popularProduto();
     }
 }
예제 #3
0
 private void dgvTabela_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     int id =
         Convert.ToInt32(dgvTabela.Rows[dgvTabela.CurrentRow.Index].Cells[0].Value.ToString());
     var prod = (from p in Conn.db.Produtos
                where p.idProdutos == id
                select p).First();
     produto = prod;
     popularCampos();
 }
예제 #4
0
 private void bloquearForm()
 {
     limparForm();
     tbDescricao.Enabled = false;
     tbNomeProduto.Enabled = false;
     tbQntd.Enabled = false;
     dgvTabela.Enabled = false;
     bAdicionarProduto.Enabled = false;
     bBuscarProduto.Enabled = false;
     bExcluir.Enabled = false;
     p = null;
     e = null;
 }
예제 #5
0
 private void limparCampos()
 {
     tbBuscar.Clear();
     tbEstoque.Clear();
     tbNome.Clear();
     tbUnd.Clear();
     lId.Text = "";
     produto = new Produtos();
 }
예제 #6
0
 private void retornarProduto()
 {
     int id =
         Convert.ToInt32(dgvTabela.Rows[dgvTabela.CurrentRow.Index].Cells[0].Value.ToString());
     var prod = (from p in Conn.db.Produtos
                 where p.idProdutos == id
                 select p).First();
     produto = prod;
     Dispose();
 }
예제 #7
0
 private void limparForm()
 {
     limparCampos();
     limparTabela();
     produto = null;
 }