Exemplo n.º 1
0
        public async Task <IActionResult> UpdateStatus(int Id, int statId)
        {
            var report = await reportRepo.GetReport(Id);

            if (report == null)
            {
                ViewBag.ErrorMessage = "The report does not exist";
                return(View("NotFound"));
            }

            await reportRepo.ChangeStatus(report, statId);

            await reportRepo.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }