Exemplo n.º 1
0
        private void deletar_Click(object sender, EventArgs e)
        {
            int id = int.Parse(grid_cervejas.SelectedRows[0].Cells[0].Value.ToString());
            Cerveja_Controle cerveja_control = new Cerveja_Controle();

            cerveja_control.Deletar_Cerveja(id);
            this.cervejaTableAdapter.Fill(this.shabbaDataSet5.cerveja);
        }
Exemplo n.º 2
0
        private void ok_cerveja_Click(object sender, EventArgs e)
        {
            Cerveja          cerveja         = new Cerveja();
            Cerveja_Controle cerveja_control = new Cerveja_Controle();
            int id_pais = Convert.ToInt32((cbxPais.SelectedValue.ToString()));
            int id_tipo = Convert.ToInt32((cbxTipoCerveja.SelectedValue.ToString()));

            cerveja.Nome = txbCervaNome.Text;
            cerveja.Pais = id_pais;
            cerveja.Qtd  = Convert.ToInt32(txbQtd_cerveja.Text);
            cerveja.Tipo = id_tipo;
            cerveja_control.Inserir_Cerveja(cerveja);
            this.cervejaTableAdapter.Fill(this.shabbaDataSet5.cerveja);
        }