예제 #1
0
 public IList <Funcionario> ListaFuncionarios()
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Funcionarios.Include(c => c.Pessoa).Where(a => a.Ativo == true).ToList());
     }
 }
예제 #2
0
 public Cliente Busca(string login, string senha)
 {
     using (var soft = new SoftnessContext())
     {
         return(soft.Clientes.Include(f => f.Pessoa).FirstOrDefault(f => f.NomeUsuario == login && f.Senha == senha));
     }
 }
예제 #3
0
 public CategoriaDoProduto BuscaPorId(int id)
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Categorias.Find(id));
     }
 }
예제 #4
0
 public Cliente BuscaPorId(int id)
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Clientes.Include(p => p.Pessoa).ThenInclude(e => e.Endereco).Where(i => i.Id == id).FirstOrDefault());
     }
 }
예제 #5
0
 public Exercicio BuscaPorId(int id)
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Exercicios.Find(id));
     }
 }
예제 #6
0
 public IList <CategoriaDoProduto> Lista()
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Categorias.ToList());
     }
 }
예제 #7
0
 public Funcionario Busca(string login, string senha)
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Funcionarios.Include(f => f.Pessoa).FirstOrDefault(f => f.NomeDeUsuario == login && f.Senha == senha));
     }
 }
예제 #8
0
 public IList <Cliente> ListaClientes()
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Clientes.Include(c => c.Pessoa).Where(a => a.Ativo == true).ToList());
     }
 }
예제 #9
0
 public IList <Exercicio> ListaExercicios()
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Exercicios.ToList());
     }
 }
예제 #10
0
 public IList <Produto> Lista()
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Produtos.Include("Categoria").ToList());
     }
 }
예제 #11
0
 public Treino BuscaPorId(int id)
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Treinos.Find(id));
     }
 }
예제 #12
0
 public IList <Treino> Lista()
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Treinos.ToList());
     }
 }
예제 #13
0
 public void Atualiza(Cliente cliente)
 {
     using (var contexto = new SoftnessContext())
     {
         contexto.Clientes.Update(cliente);
         contexto.SaveChanges();
     }
 }
예제 #14
0
 public void Remover(FichaTreino ficha)
 {
     using (var context = new SoftnessContext())
     {
         context.FichaTreinos.Remove(ficha);
         context.SaveChanges();
     }
 }
예제 #15
0
 public void Atualiza(CategoriaDoProduto categoria)
 {
     using (var contexto = new SoftnessContext())
     {
         contexto.Entry(categoria).State = EntityState.Modified;
         contexto.SaveChanges();
     }
 }
예제 #16
0
 public void Atualiza(Funcionario funcionario)
 {
     using (var contexto = new SoftnessContext())
     {
         contexto.Funcionarios.Update(funcionario);
         contexto.SaveChanges();
     }
 }
예제 #17
0
 public void Adiciona(Funcionario funcionario)
 {
     using (var context = new SoftnessContext())
     {
         context.Funcionarios.Add(funcionario);
         context.SaveChanges();
     }
 }
예제 #18
0
 public void Atualiza(Exercicio exercicio)
 {
     using (var contexto = new SoftnessContext())
     {
         contexto.Exercicios.Update(exercicio);
         contexto.SaveChanges();
     }
 }
예제 #19
0
 public void Adiciona(CategoriaDoProduto categoria)
 {
     using (var context = new SoftnessContext())
     {
         context.Categorias.Add(categoria);
         context.SaveChanges();
     }
 }
예제 #20
0
 public void Adiciona(Exercicio exercicio)
 {
     using (var context = new SoftnessContext())
     {
         context.Exercicios.Add(exercicio);
         context.SaveChanges();
     }
 }
예제 #21
0
 public void Adiciona(Treino treino)
 {
     using (var context = new SoftnessContext())
     {
         context.Treinos.Add(treino);
         context.SaveChanges();
     }
 }
예제 #22
0
 public void Adiciona(Cliente cliente)
 {
     using (var context = new SoftnessContext())
     {
         context.Clientes.Add(cliente);
         context.SaveChanges();
     }
 }
예제 #23
0
 public void Atualiza(Produto produto)
 {
     using (var contexto = new SoftnessContext())
     {
         contexto.Entry(produto).State = EntityState.Modified;
         contexto.SaveChanges();
     }
 }
예제 #24
0
 public void Adiciona(Produto produto)
 {
     using (var context = new SoftnessContext())
     {
         context.Produtos.Add(produto);
         context.SaveChanges();
     }
 }
예제 #25
0
 public void Adiciona(FichaTreino ficha)
 {
     using (var context = new SoftnessContext())
     {
         context.FichaTreinos.Add(ficha);
         context.SaveChanges();
     }
 }
예제 #26
0
 public void Remover(Treino treino)
 {
     using (var context = new SoftnessContext())
     {
         context.Treinos.Remove(treino);
         context.SaveChanges();
     }
 }
예제 #27
0
 public void Atualiza(Treino Treinos)
 {
     using (var contexto = new SoftnessContext())
     {
         contexto.Entry(Treinos).State = EntityState.Modified;
         contexto.SaveChanges();
     }
 }
예제 #28
0
 public Produto BuscaPorId(int id)
 {
     using (var contexto = new SoftnessContext())
     {
         return(contexto.Produtos.Include("Categoria")
                .Where(p => p.Id == id)
                .FirstOrDefault());
     }
 }
예제 #29
0
 public void Remover(int id)
 {
     using (var context = new SoftnessContext())
     {
         var exercicio = new ExercicioDAO().BuscaPorId(id);
         context.Entry(exercicio).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
예제 #30
0
 public void Remover(int id)
 {
     using (var context = new SoftnessContext())
     {
         var cliente = new ClienteDAO().BuscaPorId(id);
         cliente.Ativo = false;
         context.Entry(cliente).State = EntityState.Modified;
         context.SaveChanges();
     }
 }