public void alterar(locacao loc) { using (locadoraEntities1 db = new locadoraEntities1()) { db.Entry(loc).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } }
public void excluir(locacao loc) { using (locadoraEntities1 db = new locadoraEntities1()) { db.Entry(loc).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } }
public void inserir(locacao loc) { using (locadoraEntities1 db = new locadoraEntities1()) { db.locacao.Add(loc); db.SaveChanges(); } }
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); }