public void alterarCorretorVendasAluguel(corretor cor) { using (ImobGentilEntities db = new ImobGentilEntities()) { db.Entry(cor).State = System.Data.EntityState.Modified; db.SaveChanges(); } }
public corretor selecionarCorretorcomCPF(string cpf) { corretor corret = new corretor();; using (ImobGentilEntities db = new ImobGentilEntities()) { corret = (from p in db.pessoa join c in db.corretor on p.id equals c.idpessoa where cpf == p.cpf select c).FirstOrDefault(); return(corret); } }
public void AdicionarCorretor(corretor cor) { using (ImobGentilEntities db = new ImobGentilEntities()) { try { db.corretor.Add(cor); db.SaveChanges(); } catch (Exception) { throw; } } }
public void alterarCorretor(pessoa pes, corretor cor, endereco end)//funciona para adicionar o ID em todos { using (ImobGentilEntities db = new ImobGentilEntities()) { try { db.Entry(pes).State = System.Data.EntityState.Modified; db.SaveChanges(); } catch (Exception) { throw; } } using (ImobGentilEntities db = new ImobGentilEntities()) { try { db.Entry(cor).State = System.Data.EntityState.Modified; db.SaveChanges(); } catch (Exception) { throw; } } using (ImobGentilEntities db = new ImobGentilEntities()) { try { db.Entry(end).State = System.Data.EntityState.Modified; db.SaveChanges(); } catch (Exception) { throw; } } }