Пример #1
0
        public static dynamic BuscaCliente(string cliente)
        {
            var lista = new List <dynamic>();

            using (var repo = new LojaContext())
            {
                IList <Cliente> clientes = repo.clientes.Where(c => c.Cli_Nome.Contains(cliente)).ToList();
                return(clientes);
            }
        }
Пример #2
0
 public static dynamic AtualizaProdutoQtd(int qtd, int codigo)
 {
     using (var repo = new LojaContext())
     {
         Produto p = repo.produtos.First(q => q.Id_Pro == codigo);
         p.Prod_Qtd = qtd;
         repo.SaveChanges();
     }
     return(null);
 }
Пример #3
0
        public static dynamic GastoData(DateTime inicial, DateTime final)
        {
            var lista = new List <dynamic>();

            using (var repo = new LojaContext())
            {
                IList <Gasto> gastos = repo.gastos.Where(d => d.Gas_data >= inicial & d.Gas_data <= final).ToList();

                return(gastos);
            }
        }
Пример #4
0
        public static dynamic RecuperarGastos()
        {
            var lista = new List <dynamic>();

            using (var repo = new LojaContext())
            {
                IList <Gasto> gastos = repo.gastos.ToList();

                return(gastos);
            }
        }
Пример #5
0
        /*  public static dynamic RecuperarUsuario(string email,string senha)
         * {
         *
         *    using (var repo = new LojaContext())
         *    {
         *
         *        IList<LoginViewModel> usuarios = repo.usuarios
         *                                         .Where(u => u.Email == email && u.Senha == senha)
         *                                         .ToList();
         *        usuarios = usuarios;
         *        return usuarios;
         *    }
         * }*/

        public static dynamic RecuperarClientes()
        {
            var lista = new List <dynamic>();

            using (var repo = new LojaContext())
            {
                IList <Cliente> clientes = repo.clientes.ToList();



                return(clientes);
            }
        }
Пример #6
0
        public static dynamic RecuperarProdutos()
        {
            var lista = new List <dynamic>();

            using (var repo = new LojaContext())
            {
                IList <Produto> produtos = repo.produtos.ToList();
                // IList<Produto> produtos = repo.produtos.Where(p => p.Id_Pro == 8).ToList();
                //lista.Add(produtos);

                return(produtos);
            }
        }
Пример #7
0
 public ProdutoDAO()
 {
     this.contexto = new LojaContext();
 }
Пример #8
0
 public GastoDAO()
 {
     this.contexto = new LojaContext();
 }