| | | 1 | | using Hangfire; |
| | | 2 | | using Hangfire.Storage.Monitoring; |
| | | 3 | | using Microsoft.AspNetCore.Authorization; |
| | | 4 | | using Microsoft.AspNetCore.Mvc; |
| | | 5 | | using Newtonsoft.Json; |
| | | 6 | | using OzonOrdersWeb.ViewModels; |
| | | 7 | | using OzonOrdersWeb.WebServices.Sidebar; |
| | | 8 | | using System.Diagnostics; |
| | | 9 | | using System.Globalization; |
| | | 10 | | |
| | | 11 | | namespace OzonOrdersWeb.Controllers |
| | | 12 | | { |
| | | 13 | | [Area("Studio2")] |
| | | 14 | | public class HomeController : Controller |
| | | 15 | | { |
| | | 16 | | private readonly ILogger<HomeController> _logger; |
| | | 17 | | |
| | 3 | 18 | | public HomeController(ILogger<HomeController> logger) |
| | | 19 | | { |
| | 3 | 20 | | _logger = logger; |
| | 3 | 21 | | } |
| | | 22 | | |
| | | 23 | | [Authorize(Roles = "User,Admin")] |
| | | 24 | | public IActionResult Index() |
| | | 25 | | { |
| | 0 | 26 | | return View(SidebarNavigationCatalog.For(User.IsInRole("Admin"))); |
| | | 27 | | } |
| | | 28 | | |
| | | 29 | | |
| | | 30 | | public IActionResult Privacy() |
| | | 31 | | { |
| | 0 | 32 | | return View(); |
| | | 33 | | } |
| | | 34 | | |
| | | 35 | | [AllowAnonymous] |
| | | 36 | | [IgnoreAntiforgeryToken] |
| | | 37 | | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] |
| | | 38 | | public IActionResult Error(int? statusCode = null) |
| | | 39 | | { |
| | 3 | 40 | | var code = statusCode |
| | 3 | 41 | | ?? (Response.StatusCode >= StatusCodes.Status400BadRequest |
| | 3 | 42 | | ? Response.StatusCode |
| | 3 | 43 | | : StatusCodes.Status500InternalServerError); |
| | | 44 | | |
| | 3 | 45 | | Response.StatusCode = code; |
| | 3 | 46 | | ViewBag.StatusCode = code; |
| | 3 | 47 | | ViewBag.TraceId = HttpContext.TraceIdentifier; |
| | 3 | 48 | | return View("~/Areas/Studio2/Views/Shared/Error.cshtml"); |
| | | 49 | | } |
| | | 50 | | } |
| | | 51 | | } |