Example #1
0
        private void btnconf_Click(object sender, EventArgs e)
        {
            try
            {
                ClassVenda v = new ClassVenda();
                v.VALOR_TOTAL = double.Parse(txttotal.Text);
                v.DATA_PED = dtpPedido.Value.ToString("yyyyMMdd");

                v.Novo_Venda();
                DataTable dt = v.Pedido();
                string ID_p = dt.Rows[0]["max(idpedido)"].ToString();

                for (int i = 0; i < dtgVenda.Rows.Count - 1; i++)
                {
                    ItensVenda item = new ItensVenda();
                    item.ID_PED = int.Parse(ID_p);

                    item.ID_PROD = int.Parse(dtgVenda.Rows[i].Cells["idproduto"].Value.ToString());
                    item.PRECO = double.Parse(dtgVenda.Rows[i].Cells["preco_custo"].Value.ToString());
                    item.NovoItem();
                }

                MessageBox.Show("Venda concluĂ­da !");
                Venda vend = new Venda();
                vend.Show();
                this.Hide();

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #2
0
 private void btnVenda_Click(object sender, EventArgs e)
 {
     Venda v = new Venda();
     v.Show();
 }