Exemple #1
0
        public bool verificarDisponibilidadeCliente(string horario, DateTime data, int iddocliente)
        {
            cliente imo = new cliente();

            using (ImobGentilEntities db = new ImobGentilEntities())
            {
                imo = (from vis in db.visita
                       where vis.data == data && vis.hora == horario && vis.idcliente == iddocliente
                       join i in db.cliente
                       on iddocliente equals i.id
                       select i).FirstOrDefault();
            }
            if (imo == null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
 public void alterarCli(pessoa pes, cliente cli, 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(cli).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;
         }
     }
 }