예제 #1
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            try
            {
                Apolice apolice = new Apolice();

                apolice.Id = Convert.ToInt32(dgvApolices.SelectedRows[0].Cells[0].Value);

                frmIncluirAlterarApolice janela = new frmIncluirAlterarApolice(apolice);
                if (janela.ShowDialog() == DialogResult.OK)
                {
                    AtualizarDgv();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #2
0
        private void btnNovaApolice_Click(object sender, EventArgs e)
        {
            try
            {
                Apolice apolice = new Apolice();
                apolice.Carro = new Carro();

                //carro que vai ter a apolice inserida
                apolice.Carro.Id = _carro.Id;

                frmIncluirAlterarApolice janela = new frmIncluirAlterarApolice(apolice);
                if (janela.ShowDialog() == DialogResult.OK)
                {
                    AtualizarDgv();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }