示例#1
0
        private void inserir()
        {
            segurado = new segurado_tb();

            pessoa_tb pessoa = new pessoa_tb();

            pessoa.nome     = txtNome.Text;
            pessoa.cpf_cnpj = txtCPF_CNPJ.Text;
            pessoa.email    = txtEmail.Text;

            segurado.pessoa_tb = pessoa;

            using (var ctx = new CTX_GERCOM())
            {
                try
                {
                    ctx.segurado_tb.Add(segurado);
                    ctx.SaveChanges();
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
示例#2
0
        private void alterar()
        {
            using (var ctx = new CTX_GERCOM())
            {
                proposta = new PropostaRepositorio().RecuperarPelaChave(ctx, Convert.ToInt32(Request["id"]));

                carregarEntidade();

                try
                {
                    ctx.SaveChanges();
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
示例#3
0
        private void inserir()
        {
            comissao = new recibo_comissao_tb();
            carregarEntidade();

            using (var ctx = new CTX_GERCOM())
            {
                try
                {
                    ctx.recibo_comissao_tb.Add(comissao);
                    ctx.SaveChanges();
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
示例#4
0
        private void inserir()
        {
            proposta = new proposta_tb();

            carregarEntidade();

            using (var ctx = new CTX_GERCOM())
            {
                try
                {
                    ctx.proposta_tb.Add(proposta);
                    ctx.SaveChanges();
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }
示例#5
0
        private void alterar()
        {
            using (var ctx = new CTX_GERCOM())
            {
                segurado = new Segurado().RecuperarPelaChave(ctx, Convert.ToInt32(Request["id"]));

                pessoa_tb pessoa = new pessoa_tb();

                pessoa.nome     = txtNome.Text;
                pessoa.cpf_cnpj = txtCPF_CNPJ.Text;
                pessoa.email    = txtEmail.Text;


                try
                {
                    segurado.pessoa_tb = pessoa;
                    ctx.SaveChanges();
                }
                catch (Exception ex)
                {
                    throw;
                }
            }
        }