Ejemplo n.º 1
0
        public async Task <ActionResult> PresentationDeleteConfirmed(int presentationID)
        {
            //await presentationRepository.DeleteAsync(presentationID);
            //return RedirectToAction("Index");
            try
            {
                //Se recuperan los mails de los auditores y se mantiene los datos de la Presentacion
                Presentation presentation = await presentationRepository.FindByIdAsync(presentationID);

                var mailReceipts = await presentationServices.GetMailsAuditors(presentation);

                var model = new PresentationViewModel(presentation);

                //Se elimina la Presentacion
                await presentationRepository.DeleteAsync(presentationID);

                //Se envian el mail avisando que se elimino una Presentacion
                await workflowMessageService.SendRequirementPresentationDeleteNotificationMessageAsync(model, mailReceipts);

                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                var errors = string.Join(",", e.Message);
                ModelState.AddModelError(string.Empty, errors);
            }

            return(View());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> PresentationDeleteConfirmed(int presentationID, int requirementID, int customerID, int contractorID)
        {
            await presentationRepository.DeleteAsync(presentationID);

            return(RedirectToAction("Index", "Requirements", new { customerID = customerID, contractorID = contractorID }));
            //return RedirectToAction("PresentationsIndex", "Requirements", new { requirementID = requirementID, customerID = customerID, contractorID = contractorID });
            //return RedirectToAction("Index");
        }