Esempio n. 1
0
        public async Task <IActionResult> Create()
        {
            try
            {
                ViewBag.Users            = new SelectList(await _usersGRUD.GetAllAsync(), "Id", "Email");
                ViewBag.DefaultUserEmail = null;
            }
            catch (Exception ex)
            {
                _logger.ErrorMessage(ex.Message);
                return(BadRequest());
            }

            return(View());
        }
Esempio n. 2
0
        public async Task <IActionResult> Index()
        {
            List <User>   users   = null;
            List <Report> reports = null;

            try
            {
                users = await _usersGRUD.GetAllAsync();

                reports = await _reportsGRUD.GetAllAsync();
            }
            catch (Exception ex)
            {
                _logger.ErrorMessage(ex.Message);
                return(BadRequest());
            }

            IndexModelUserPerson usersAndPersons = new IndexModelUserPerson()
            {
                Reports = reports,
                Users   = users
            };

            return(View(usersAndPersons));
        }