// GET: PeopleDatas
        public async Task <IActionResult> Index()
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                return(RedirectToAction(nameof(AccountController.Login), "Account"));
                // throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
            }
            else
            {
                try
                {
                    ViewBag.sms = TempData["sms"].ToString();
                }
                catch
                {
                }
                //  var empleado = new PeopleData();

                var model = new PeopleDataViewModel();

                model.Notificaciones = _empleadosData.GetNotifications();
                model.Empleados      = _empleadosData.GetEmpleados();

                return(View(model));
                // return View(await _context.PeopleData.ToListAsync());
            }
        }
Esempio n. 2
0
        public IActionResult Dashboard()

        {
            var model = new IndexViewModel();

            model.Notificaciones = _EmpleadosData.GetNotifications();
            model.Empleados      = _EmpleadosData.GetEmpleados();
            model.Galeria        = _EmpleadosData.GetAllPictures();
            model.Motivos        = _EmpleadosData.GetAllTheReasons();
            model.Servicios      = _EmpleadosData.GetAllServices();
            return(View(model));
        }