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; } } }
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; } } }
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; } } }
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; } } }
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; } } }