public async Task <IActionResult> RemovePaymentRequest(string id)
        {
            var result = await _PaymentRequestRepository.RemovePaymentRequest(id, GetUserId());

            if (result)
            {
                TempData[WellKnownTempData.SuccessMessage] = "Payment request successfully removed";
                return(RedirectToAction("GetPaymentRequests"));
            }
            else
            {
                TempData[WellKnownTempData.ErrorMessage] = "Payment request could not be removed. Any request that has generated invoices cannot be removed.";
                return(RedirectToAction("GetPaymentRequests"));
            }
        }
Пример #2
0
        public async Task <IActionResult> RemovePaymentRequest(string id)
        {
            var result = await _PaymentRequestRepository.RemovePaymentRequest(id, GetUserId());

            if (result)
            {
                return(RedirectToAction("GetPaymentRequests",
                                        new { StatusMessage = "Payment request successfully removed" }));
            }
            else
            {
                return(RedirectToAction("GetPaymentRequests",
                                        new
                {
                    StatusMessage =
                        "Payment request could not be removed. Any request that has generated invoices cannot be removed."
                }));
            }
        }
        public async Task <IActionResult> RemovePaymentRequest(string id)
        {
            var result = await _PaymentRequestRepository.RemovePaymentRequest(id, GetUserId());

            if (result)
            {
                return(RedirectToAction("GetPaymentRequests",
                                        new { StatusMessage = "Solicitud de pago eliminado exitosamente" }));
            }
            else
            {
                return(RedirectToAction("GetPaymentRequests",
                                        new
                {
                    StatusMessage =
                        "Error: Solicitud de pago no se pudo eliminar. Cualquier solicitud que haya generado facturas no puede ser eliminada."
                }));
            }
        }