// GET: Funcionarios/Create
        public async Task <IActionResult> Create()
        {
            /* ViewData["EmpresasId"] = new SelectList(_context.Empresas, "Id", "RazaoSocial");
             * ViewData["FiliaisId"] = new SelectList(_context.Filiais, "Id", "Id");
             * ViewData["LotacaoId"] = new SelectList(_context.Lotacao, "LotId", "LotNome");*/

            var emp = await _empresaService.FindAllAsync();

            var fil = await _filialService.FindAllAsync();

            var lot = await _lotacaoService.FindAllAsync();

            var func = new FuncionariosViewModel {
                Empresas = emp, Filiais = fil, Lotacao = lot
            };

            return(View(func));
        }
Exemplo n.º 2
0
        //public HomeController(ILogger<HomeController> logger)
        //{
        //    _logger = logger;
        //}

        public async Task <IActionResult> Index()
        {
            var emp = await _empresaService.FindAllAsync();

            var lot = await _lotacaoService.FindAllAsync();

            var usu = await _usuarioService.FindAllAsync();

            var fil = await _filialService.FindAllAsync();

            ViewData["QtdEmp"] = emp.Count;
            ViewData["QtdLot"] = lot.Count;
            ViewData["QtdUsu"] = usu.Count;
            ViewData["QtdFil"] = fil.Count;

            return(View());
        }