Пример #1
0
 public void adicionarImovel(imovel imo)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.imovel.Add(imo);
         db.SaveChanges();
     }
 }
Пример #2
0
 public void adicionarImagemGaleria(imagem img)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.imagem.Add(img);
         db.SaveChanges();
     }
 }
Пример #3
0
 public void alterarCorretorVendasAluguel(corretor cor)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.Entry(cor).State = System.Data.EntityState.Modified;
         db.SaveChanges();
     }
 }
Пример #4
0
 public void adicionarRegistroPermissaoParaNovoUsuario(permissoes per)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.permissoes.Add(per);
         db.SaveChanges();
     }
 }
Пример #5
0
 public void adicionarPagamento(pagamentos pag)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.pagamentos.Add(pag);
         db.SaveChanges();
     }
 }
Пример #6
0
 public void adicionarVenda(vendas ven)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.vendas.Add(ven);
         db.SaveChanges();
     }
 }
Пример #7
0
 public void modificarPermissao(permissoes per)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.Entry(per).State = System.Data.EntityState.Modified;
         db.SaveChanges();
     }
 }
Пример #8
0
 public void adicionarImagemAoImovel(imovel imo)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         db.Entry(imo).State = System.Data.EntityState.Modified;
         db.SaveChanges();
     }
 }
Пример #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);
     }
 }
Пример #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
         }
     }
 }
Пример #11
0
 public void AdicionarCliente(cliente cli)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.cliente.Add(cli);
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Пример #12
0
 public void AdicionarEspecializacao(especializacao esp)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.especializacao.Add(esp);
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Пример #13
0
 public void AdicionarCorretor(corretor cor)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.corretor.Add(cor);
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Пример #14
0
 public void AdicionarUsuario(usuario usu)
 {
     using (ImobGentilEntities db = new ImobGentilEntities())
     {
         try
         {
             db.usuario.Add(usu);
             db.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Пример #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;
         }
     }
 }
Пример #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;
         }
     }
 }
Пример #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;
         }
     }
 }
Пример #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;
         }
     }
 }
Пример #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;
         }
     }
 }
Пример #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;
         }
     }
 }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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;
         }
     }
 }