private void btnSalva_Click(object sender, EventArgs e) { try { Classes.Go acao = new Classes.Go(); Classes.Del limpa = new Classes.Del(); TiposDeProdutos produto = new TiposDeProdutos(); foreach (DataGridViewRow linha in dgvpedido.Rows) { produto.DataPedido = Convert.ToDateTime(txtData.Text); produto.Funcionario = txtFuncionario.Text; produto.Cod = (int)linha.Cells[1].Value; produto.ProdutoSaida = linha.Cells[2].Value.ToString(); produto.Quantidade = (int)linha.Cells[3].Value; produto.CustoS = Convert.ToDecimal(linha.Cells[4].Value); produto.VendaS = Convert.ToDecimal(linha.Cells[6].Value); acao.InserirHistoricoSaida(produto); } this.Close(); limpa.LimparTabelaPedido(); } catch (System.FormatException) { MessageBox.Show("Ops ,Algo esta errado com a sua Data, por favor verifique ! "); } }
private void btnSalvar_Click(object sender, EventArgs e) { Classes.Go acao = new Classes.Go(); TiposDeProdutos produto = new TiposDeProdutos() { //criar aqui a parte de captura dos dados para mandar para a composto stage 4 }; }
private void btnSalvar_Click_1(object sender, EventArgs e) { Classes.Go acao = new Classes.Go(); TiposDeProdutos produto = new TiposDeProdutos() { NomeProduto = txtNome.Text, CustoProduto = Convert.ToDecimal(txtCusto.Text), VendaProduto = Convert.ToDecimal(txtVenda.Text), Tipo = "s" }; acao.InserirNovoProdutoSimples(produto); this.Close(); }
private void btnIncluir_Click(object sender, EventArgs e) { try { Classes.Go acao = new Classes.Go(); Classes.TiposDeProdutos produto = new Classes.TiposDeProdutos() { IDProdutoS = (int)dgvPedido.CurrentRow.Cells[0].Value, Produto = dgvPedido.CurrentRow.Cells[1].Value.ToString(), Und = Convert.ToInt32(txbQuantidade.Text), Custo = Convert.ToDecimal(dgvPedido.CurrentRow.Cells[2].Value), SubTotal = Convert.ToInt32(txbQuantidade.Text) * Convert.ToDecimal(dgvPedido.CurrentRow.Cells[2].Value), Venda = Convert.ToDecimal(dgvPedido.CurrentRow.Cells[3].Value) }; acao.InserirDadosPedido(produto); this.Close(); } catch (System.FormatException) { MessageBox.Show("Opa, você esqueceu de lançar a quantidade "); } }