예제 #1
0
        public async Task <IActionResult> Cancel(int id)
        {
            var isAuthorized =
                User.IsInRole(RoleName.Administrator) ||
                User.IsInRole(RoleName.Manager) || User.IsInRole(RoleName.BoatOwner);

            if (isAuthorized)
            {
                try
                {
                    await _bookingLineService.CancelBookingLine(id);

                    return(RedirectToAction("Index"));
                }
                catch
                {
                    throw;
                }
            }

            return(Forbid());
        }
        public async Task <ActionResult <bool> > CancelBookingLine(int id)
        {
            await _bookingLineService.CancelBookingLine(id);

            return(Ok());
        }