コード例 #1
0
        public ActionResult JogosDisponiveis()
        {
            var listJogoModel = new List<JogoModel>();

            string path = @"C:\Users\eric.gottschalk\Documents\CWICrescer2015-2\crescer-2015-2\src\modulo-04-c-sharp\dia-05\Locadora\Locadora.Web\files\game-store.xml";
            var unit = new GameUnitOfWork(path);
            var service = new GameDomainService(unit);
            var list = service.Get().ToList();

            foreach (var jogo in list)
            {
                var jogoModel = new JogoModel()
                {
                    Id = jogo.Id,
                    Name = jogo.Name,
                    Category = jogo.Category,
                    Price = jogo.Price,
                    Available = jogo.Available
                };

                listJogoModel.Add(jogoModel);
            }

            var relatrio = new RelatorioModel(listJogoModel);
            return View(relatrio);
        }
コード例 #2
0
 // GET: Relatorio
 public ActionResult Relatorio()
 {
     var model = new RelatorioModel();
     return View(model);
 }