public List <uf> listaUfs() { using (var db = new ReservasModel1()) { return(db.ufs.ToList()); } }
public uf find(string sigla) { using (var db = new ReservasModel1()) { return(db.ufs.Find(sigla)); } }
public List <Hotel> listar(string uf) { using (var db = new ReservasModel1()) { List <Hotel> lista = db.Hotels.Where(h => h.Uf == uf).ToList(); return(lista); } }
public void delete(string sigla) { using (var db = new ReservasModel1()) { db.ufs.Remove(db.ufs.Find(sigla)); db.SaveChanges(); } }
public void insert(uf uf) { using (var db = new ReservasModel1()) { db.ufs.Add(uf); db.SaveChanges(); } }
public void update(uf uf) { using (var db = new ReservasModel1()) { db.ufs.Attach(uf); db.Entry(uf).Property(u => u.desc_uf).IsModified = true; db.SaveChanges(); } }
public int IncluirTurista(Turista turista) { using (var db = new ReservasModel1()) { db.Turistas.Add(turista); db.SaveChanges(); return(turista.Id); } }
public int IncluirHotel(Hotel hotel) { using (var db = new ReservasModel1()) { db.Hotels.Add(hotel); db.SaveChanges(); return(hotel.Id); } }