public async Task <IActionResult> Documents(int petitionID)
        {
            var user = await _userManager.GetUserAsync(User);

            var getPetition = _petitionService.GetPetition(petitionID);


            if (getPetition == null)
            {
                return(RedirectToAction("PetitionNotFound", "Petition"));
            }

            if (getPetition.UserID != user.Id)
            {
                return(RedirectToAction("PetitionDetailDenied", "Petition"));
            }


            string documentStatus = string.Empty;

            if (TempData["DocumentStatus"] != null)
            {
                documentStatus = TempData["DocumentStatus"].ToString();
            }

            ViewBag.DocumentStatus = documentStatus;
            ViewBag.petitionStatus = getPetition.Statu;
            ViewBag.petitionID     = petitionID;


            List <Document> documents = _documentService.ListDocuments(petitionID);

            return(View(documents));
        }
        public IActionResult SetPetitionOnProcess(int petitionID)
        {
            var getPetition = _petitionService.GetPetition(petitionID);

            if (getPetition == null)
            {
                TempData["Statu"] = "PetitionNotFound";
                return(Redirect($"/Admin/Petition"));
            }

            bool result = _petitionService.SetPetitionOnProcess(petitionID);

            if (result)
            {
                TempData["PetitionStatu"] = "PetitionUpdatedOnProcess";
                return(Redirect($"/Admin/Petition/Detail/{petitionID}"));
            }
            else
            {
                TempData["Statu"] = "Error";
                return(Redirect($"/Admin/Petition"));
            }
        }
        public async Task <IActionResult> Documents(int petitionID)
        {
            var user = await _userManager.GetUserAsync(User);

            var getPetition = _petitionService.GetPetition(petitionID);

            if (getPetition == null)
            {
                return(Redirect("/Admin/Petition/PetitionNotFound"));
            }

            List <Document> documents = _documentService.ListDocuments(petitionID);

            return(View(documents));
        }