Exemple #1
0
 public void alterar(locacao loc)
 {
     using (locadoraEntities1 db = new locadoraEntities1())
     {
         db.Entry(loc).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemple #2
0
 public void excluir(locacao loc)
 {
     using (locadoraEntities1 db = new locadoraEntities1())
     {
         db.Entry(loc).State = System.Data.Entity.EntityState.Deleted;
         db.SaveChanges();
     }
 }
Exemple #3
0
 public void inserir(locacao loc)
 {
     using (locadoraEntities1 db = new locadoraEntities1())
     {
         db.locacao.Add(loc);
         db.SaveChanges();
     }
 }
Exemple #4
0
        public locacao selecionar(int codigo)
        {
            locacao loc = null;

            using (locadoraEntities1 db = new locadoraEntities1())
            {
                loc = (from locacao in db.locacao where locacao.locacao_codigo == codigo select locacao).FirstOrDefault();
            }
            return(loc);
        }