예제 #1
0
        private void dgvVenda_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            dgvVenda.CurrentRow.Selected = true;



            string mensagem = "Deseja fazer reclamacoes/elogios dessa venda? ";
            string fechar   = "fechando cadastro!!";
            var    result   = MessageBox.Show(mensagem, fechar,
                                              MessageBoxButtons.YesNo,
                                              MessageBoxIcon.Question);

            if (result != DialogResult.No)
            {
                vend.IdVenda = int.Parse(this.dgvVenda.CurrentRow.Cells[0].Value.ToString());

                Formularios.frmElogiosReclamacoes ER = new Formularios.frmElogiosReclamacoes();

                ER.RecebendoValorDgv(vend.IdVenda);
                ER.Show();
            }
            else
            {
                string cancelado   = "Deseja Cancelar essa Venda? ";
                string fecharvenda = "fechando cadastro!!";
                var    result1     = MessageBox.Show(cancelado, fecharvenda,
                                                     MessageBoxButtons.YesNo,
                                                     MessageBoxIcon.Question);



                if (result1 != DialogResult.No)
                {
                    vend.IdVenda     = int.Parse(this.dgvVenda.CurrentRow.Cells[0].Value.ToString());
                    vend.IdCliente   = int.Parse(this.dgvVenda.CurrentRow.Cells[1].Value.ToString());
                    vend.DataVenda   = DateTime.Parse(this.dgvVenda.CurrentRow.Cells[6].Value.ToString());
                    vend.TotalVendas = float.Parse(this.dgvVenda.CurrentRow.Cells[4].Value.ToString());

                    vend.CadastrarVendaCancelada();
                    vend.LimpandoProdutoVendido();


                    vend.ExcluirVEnda();

                    MessageBox.Show("Venda Cancelada com sucesso!!");
                }
            }
        }