Example #1
0
 public void adicionarImovel(imovel imo)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.imovel.Add(imo);
         db.SaveChanges();
     }
 }
Example #2
0
 public void adicionarImagemGaleria(imagem img)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.imagem.Add(img);
         db.SaveChanges();
     }
 }
Example #3
0
 public void alterarCorretorVendasAluguel(corretor cor)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.Entry(cor).State = System.Data.EntityState.Modified;
         db.SaveChanges();
     }
 }
Example #4
0
 public void adicionarRegistroPermissaoParaNovoUsuario(permissoes per)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.permissoes.Add(per);
         db.SaveChanges();
     }
 }
Example #5
0
 public void adicionarPagamento(pagamentos pag)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.pagamentos.Add(pag);
         db.SaveChanges();
     }
 }
Example #6
0
 public void adicionarVenda(vendas ven)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.vendas.Add(ven);
         db.SaveChanges();
     }
 }
Example #7
0
 public void modificarPermissao(permissoes per)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.Entry(per).State = System.Data.EntityState.Modified;
         db.SaveChanges();
     }
 }
Example #8
0
 public void adicionarImagemAoImovel(imovel imo)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.Entry(imo).State = System.Data.EntityState.Modified;
         db.SaveChanges();
     }
 }
Example #9
0
 public int adicionarAluguelRetornaID(locacoes aluguel)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.locacoes.Add(aluguel);
         db.SaveChanges();
         db.Entry(aluguel).GetDatabaseValues();
         return(aluguel.id);
     }
 }
Example #10
0
 public void modificarUsuario(usuario usu)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.Entry(usu).State = System.Data.EntityState.Modified;
             db.SaveChanges();
         }
         catch (Exception)
         {
             //só para não dar erro
         }
     }
 }
Example #11
0
 public void AdicionarCliente(cliente cli)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.cliente.Add(cli);
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Example #12
0
 public void AdicionarEspecializacao(especializacao esp)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.especializacao.Add(esp);
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Example #13
0
 public void AdicionarCorretor(corretor cor)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.corretor.Add(cor);
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Example #14
0
 public void AdicionarUsuario(usuario usu)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.usuario.Add(usu);
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Example #15
0
 public void AdicionarEnderecoIDUsuario(pessoa pes)//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;
         }
     }
 }
Example #16
0
 public void modificarStatusImovelPublicacao(imovel imo)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.Entry(imo).State = System.Data.EntityState.Modified;
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Example #17
0
 public void modificarPessoa(pessoa pes)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.Entry(pes).State = System.Data.EntityState.Modified;
             db.SaveChanges();
         }
         catch (Exception)
         {
             // throw;
         }
     }
 }
Example #18
0
 public void modificarStatusInteresse(interesse inte)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.Entry(inte).State = System.Data.EntityState.Modified;
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Example #19
0
 public void modificarCorretor(endereco end)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.Entry(end).State = System.Data.EntityState.Modified;
             db.SaveChanges();
         }
         catch (Exception)
         {
             //throw;
         }
     }
 }
Example #20
0
 public void modificarStatusVisita(visita vis)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.Entry(vis).State = System.Data.EntityState.Modified;
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Example #21
0
 public void AdicionarAgendamento(visita vis)
 {
     try
     {
         using (ImobGentilEntities db = new ImobGentilEntities())
         {
             db.visita.Add(vis);
             db.SaveChanges();
         }
     }
     catch (Exception e)
     {
         throw e;
         //MessageBox.Show(e.Message);
     }
 }
Example #22
0
 public void AdicionarInteresse(interesse inte)
 {
     try
     {
         using (ImobGentilEntities db = new ImobGentilEntities())
         {
             db.interesse.Add(inte);
             db.SaveChanges();
         }
     }
     catch (Exception e)
     {
         throw e;
         //MessageBox.Show(e.Message);
     }
 }
Example #23
0
 public void AdicionarPessoa(pessoa pes)
 {
     try
     {
         using (ImobGentilEntities db = new ImobGentilEntities())
         {//adicionar pessoa e vir com a opção, se a mesma vai ser usuario, cliente ou corretor
             db.pessoa.Add(pes);
             //é necessario adicionar no banco, depois fazer um select ou arranjar uma forma de pegar o ultimo adicionado e adicionar a chave estrangeira no usuario
             db.SaveChanges();
         }
     }
     catch (Exception e)
     {
         throw e;
         //MessageBox.Show(e.Message);
     }
 }
Example #24
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;
         }
     }
 }