public IList <Compromisso> Lista()
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.Compromisso.ToList());
     }
 }
Пример #2
0
 public IList <Comunicado> Lista()
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.Comunicado.ToList());
     }
 }
Пример #3
0
 public IList <Sala> Lista()
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.Sala.ToList());
     }
 }
Пример #4
0
 public IList <UsuarioAtividade> Lista()
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.UsuarioAtividade.ToList());
     }
 }
Пример #5
0
 public static void Remove(int Atividade)
 {
     using (var contexto = new SalaContext())
     {
         contexto.Remove(contexto.Atividade.Single(a => a.Id == Atividade));
         contexto.SaveChanges();
     }
 }
Пример #6
0
 public static void Remove(int Sala)
 {
     using (var contexto = new SalaContext())
     {
         contexto.Remove(contexto.Sala.Single(a => a.Id == Sala));
         contexto.SaveChanges();
     }
 }
Пример #7
0
 public void Atualiza(Sala Sala)
 {
     using (var contexto = new SalaContext())
     {
         contexto.Entry(Sala).State = EntityState.Modified;
         contexto.SaveChanges();
     }
 }
Пример #8
0
 public void Adiciona(Sala comp)
 {
     using (var context = new SalaContext())
     {
         context.Sala.Add(comp);
         context.SaveChanges();
     }
 }
Пример #9
0
 public void Adiciona(Usuario prof)
 {
     using (var context = new SalaContext())
     {
         context.Usuario.Add(prof);
         context.SaveChanges();
     }
 }
Пример #10
0
 public static void Remove(Comunicado Comunicado)
 {
     using (var contexto = new SalaContext())
     {
         contexto.Remove(contexto.Comunicado.Single(a => a.Id == Comunicado.Id));
         contexto.SaveChanges();
     }
 }
Пример #11
0
 public void Remove(AlunoSala AlunoSala)
 {
     using (var contexto = new SalaContext())
     {
         contexto.Remove(contexto.AlunoSala.Single(a => a.CodAluno == AlunoSala.CodAluno && a.CodSala == a.CodSala));
         contexto.SaveChanges();
     }
 }
Пример #12
0
 public void Adiciona(Compromisso comp)
 {
     using (var context = new SalaContext())
     {
         context.Compromisso.Add(comp);
         context.SaveChanges();
     }
 }
Пример #13
0
 public void Atualiza(UsuarioAtividade UsuarioAtividade)
 {
     using (var contexto = new SalaContext())
     {
         contexto.Entry(UsuarioAtividade).State = EntityState.Modified;
         contexto.SaveChanges();
     }
 }
Пример #14
0
 public void Remove(Compromisso compromisso)
 {
     using (var contexto = new SalaContext())
     {
         contexto.Remove(contexto.Compromisso.Single(a => a.Id == compromisso.Id));
         contexto.SaveChanges();
     }
 }
Пример #15
0
 public void Adiciona(UsuarioAtividade comp)
 {
     using (var context = new SalaContext())
     {
         context.UsuarioAtividade.Add(comp);
         context.SaveChanges();
     }
 }
Пример #16
0
 public void Atualiza(Compromisso Compromisso)
 {
     using (var contexto = new SalaContext())
     {
         contexto.Entry(Compromisso).State = EntityState.Modified;
         contexto.SaveChanges();
     }
 }
Пример #17
0
 public UsuarioAtividade BuscaPorId(int codigo)
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.UsuarioAtividade
                .Where(p => p.Id == codigo)
                .FirstOrDefault());
     }
 }
Пример #18
0
 public IList <Usuario> Pesquisa(string pesq)
 {
     using (var contexto = new SalaContext())
     {
         return((from p in contexto.Usuario
                 where (p.Nome.Contains(pesq))
                 select p).ToList());
     }
 }
Пример #19
0
 public IList <Compromisso> BuscaPorUsuario(int id)
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.Compromisso
                .Where(p => p.CodUsuario == id)
                .ToList());
     }
 }
Пример #20
0
 public Compromisso BuscaPorId(int codigo)
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.Compromisso
                .Where(p => p.Id == codigo)
                .FirstOrDefault());
     }
 }
Пример #21
0
 public IList <Sala> BuscaPorProfessor(int id)
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.Sala
                .Where(p => p.CodProfessor == id)
                .ToList());
     }
 }
Пример #22
0
 public AlunoSala BuscaPorId(int id)
 {
     using (var contexto = new SalaContext())
     {
         return((from c in contexto.AlunoSala
                 where c.Id == id
                 select c).FirstOrDefault());
     }
 }
Пример #23
0
 public IList <Comunicado> BuscaPorSala(int id)
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.Comunicado
                .Where(p => p.CodSala == id).OrderByDescending(x => x.Id)
                .ToList());
     }
 }
Пример #24
0
 public IList <Atividade> BuscaPorSala(int id)
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.Atividade
                .Where(p => p.CodSala == id)
                .ToList());
     }
 }
Пример #25
0
 public IList <UsuarioAtividade> BuscaPorAlunos(int id)
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.UsuarioAtividade
                .Where(p => p.CodAtividade == id)
                .ToList());
     }
 }
Пример #26
0
 public Usuario BuscaPorNomeCompleto(string usu)
 {
     using (var contexto = new SalaContext())
     {
         return(contexto.Usuario
                .Where(p => p.Nome == usu)
                .FirstOrDefault());
     }
 }
Пример #27
0
 public IList <Atividade> BuscaPorSala(int id)
 {
     using (var contexto = new SalaContext())
     {
         return((from p in contexto.Atividade
                 where p.CodSala == id
                 select p).ToList());
     }
 }
Пример #28
0
 public IList <AlunoSala> BuscaPorAlunosAux(int id)
 {
     using (var contexto = new SalaContext())
     {
         return((from e in contexto.AlunoSala
                 where e.CodSala == id
                 select e).ToList());
     }
 }
Пример #29
0
 public IList <UsuarioAtividade> BuscaPorAtividadesAux(int id)
 {
     using (var contexto = new SalaContext())
     {
         return((from e in contexto.UsuarioAtividade
                 join q in contexto.Usuario on e.CodUsuario equals q.Id
                 where q.Id == id
                 select e).ToList());
     }
 }
Пример #30
0
 public UsuarioAtividade BuscaPorIds(int aluno, int atividade)
 {
     using (var contexto = new SalaContext())
     {
         return((from ua in contexto.UsuarioAtividade
                 where ua.CodUsuario == aluno
                 where ua.CodAtividade == atividade
                 select ua).FirstOrDefault());
     }
 }