示例#1
0
 public void alterarCorretorVendasAluguel(corretor cor)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.Entry(cor).State = System.Data.EntityState.Modified;
         db.SaveChanges();
     }
 }
示例#2
0
        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);
            }
        }
示例#3
0
 public void AdicionarCorretor(corretor cor)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.corretor.Add(cor);
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
示例#4
0
 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;
         }
     }
 }