public int editar(Laboratorio lab) { dbLaboratorioEntities context = new dbLaboratorioEntities(); context.Entry(lab).State = EntityState.Modified; return(context.SaveChanges()); }
public int excluir(int id) { dbLaboratorioEntities context = new dbLaboratorioEntities(); Laboratorio s = new Laboratorio(); s.id = id; context.Entry(s).State = EntityState.Deleted; return(context.SaveChanges()); }
public bool Inserir(Laboratorio lab) { dbLaboratorioEntities context = new dbLaboratorioEntities(); context.Laboratorio.Add(lab); int retorno = context.SaveChanges(); return(retorno == 1); }
public Laboratorio getById(int id) { dbLaboratorioEntities context = new dbLaboratorioEntities(); var lstLab = (from l in context.Laboratorio where l.id == id select l); Laboratorio lab = new Laboratorio(); foreach (var item in lstLab) { lab.id = item.id; lab.nome = item.nome; lab.projetor = item.projetor; lab.qtdeAlunos = item.qtdeAlunos; lab.qtdeComputadores = item.qtdeComputadores; lab.sistemaOperacional = item.sistemaOperacional; lab.software1 = item.software1; lab.software2 = item.software2; lab.software3 = item.software3; } return(lab); }
public List <Laboratorio> Listar() { var context = new dbLaboratorioEntities(); return(context.Laboratorio.ToList()); }