コード例 #1
0
        // GET: Produto/Create
        public ActionResult Cadastrar()
        {
            var lista = aplicacao.ListarTodos();

            ViewBag.Cliente = new SelectList(appCliente.ListarTodos(), "IdCliente", "Nome");
            //ViewBag.Cliente2 = (from p in lista
            //                    select p.Cliente.Nome).Distinct();
            return(View());
        }
コード例 #2
0
        public ActionResult Cadastrar()
        {
            if (Session["Usuario"] == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            ViewBag.ClienteId = new SelectList(appCliente.ListarTodos(), "ClienteId", "Nome");
            return(View());
        }
コード例 #3
0
        public ActionResult Index()
        {
            if (Session["Usuario"] == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            var lista = aplicacao.ListarTodos();

            return(View(lista));
        }
コード例 #4
0
        public ActionResult About()
        {
            //ViewBag.Message = "Your application description page.";
            var lista   = aplicacao.ListarTodos();
            var cliente = from p in lista
                          group p by p.DataCadastro into grupo
                          select new ClienteEstatistica()
            {
                Data     = grupo.Key,
                Contador = grupo.Count()
            };

            return(View(cliente));
        }
コード例 #5
0
        public ActionResult About()
        {
            if (Session["Usuario"] == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            //ViewBag.Message = "Your application description page.";
            var cliente = aplicacao.ListarTodos();

            var model = from p in cliente
                        group p by p.DataCadastro into grupo
                        select new ClienteEstatistica()
            {
                Data     = grupo.Key,
                Contador = grupo.Count()
            };

            return(View(model));
        }