Beispiel #1
0
        public async Task <IActionResult> CloseTicket(int id, string userId, string returnUrl)
        {
            await _scheduleService.CloseTicket(id);

            if (string.IsNullOrEmpty(userId))
            {
                userId = _userManager.GetUserId(User);
            }

            var user = await _userManager.FindByIdAsync(userId);

            if (await _userManager.IsInRoleAsync(user, "Pacient"))
            {
                return(RedirectToAction(nameof(PacientTickets), new { id = userId, returnUrl = returnUrl, status = "" }));
            }

            return(RedirectToAction(nameof(DoctorTickets), new { id = userId, returnUrl = returnUrl, status = "Талон закрыт" }));
        }