public void adicionarImagemAoImovel(imovel imo) { using (ImobGentilEntities db = new ImobGentilEntities()) { db.Entry(imo).State = System.Data.EntityState.Modified; db.SaveChanges(); } }
public void adicionarImovel(imovel imo) { using (ImobGentilEntities db = new ImobGentilEntities()) { db.imovel.Add(imo); db.SaveChanges(); } }
public void modificarStatusImovelPublicacao(imovel imo) { using (ImobGentilEntities db = new ImobGentilEntities()) { try { db.Entry(imo).State = System.Data.EntityState.Modified; db.SaveChanges(); } catch (Exception) { throw; } } }
public bool verificarDisponibilidadeImovel(string horario, DateTime data, int iddoimovel) { imovel imo = new imovel(); using (ImobGentilEntities db = new ImobGentilEntities()) { imo = (from vis in db.visita where vis.data == data && vis.hora == horario && vis.idimovel == iddoimovel join i in db.imovel on iddoimovel equals i.id select i).FirstOrDefault(); } if (imo == null) { return(true); } else { return(false); } }