示例#1
0
 public List <uf> listaUfs()
 {
     using (var db = new ReservasModel1())
     {
         return(db.ufs.ToList());
     }
 }
示例#2
0
 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);
     }
 }
示例#4
0
 public void delete(string sigla)
 {
     using (var db = new ReservasModel1())
     {
         db.ufs.Remove(db.ufs.Find(sigla));
         db.SaveChanges();
     }
 }
示例#5
0
 public void insert(uf uf)
 {
     using (var db = new ReservasModel1())
     {
         db.ufs.Add(uf);
         db.SaveChanges();
     }
 }
示例#6
0
 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();
     }
 }
示例#7
0
        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);
            }
        }