| | | 1 | | using Microsoft.AspNetCore.Authorization; |
| | | 2 | | using Microsoft.AspNetCore.Mvc; |
| | | 3 | | using Services.ApiServices._1CApi.OData; |
| | | 4 | | |
| | | 5 | | namespace OzonOrdersWeb.Areas.OneCFresh.Controllers; |
| | | 6 | | |
| | | 7 | | [Authorize(Roles = "User,Admin")] |
| | | 8 | | [Area("OneCFresh")] |
| | | 9 | | [Route("OneCFresh/[controller]/[action]")] |
| | | 10 | | [Route("OneCFresh")] |
| | | 11 | | public class HomeController : Controller |
| | | 12 | | { |
| | | 13 | | private readonly IOneCODataReferenceService _refService; |
| | | 14 | | |
| | 0 | 15 | | public HomeController(IOneCODataReferenceService refService) |
| | | 16 | | { |
| | 0 | 17 | | _refService = refService; |
| | 0 | 18 | | } |
| | | 19 | | |
| | | 20 | | [HttpGet("/OneCFresh")] |
| | | 21 | | [HttpGet("/OneCFresh/Home/Index")] |
| | | 22 | | public async Task<IActionResult> Index() |
| | | 23 | | { |
| | 0 | 24 | | ViewData["Title"] = "1С Fresh — Главное меню"; |
| | 0 | 25 | | var warehouses = await _refService.GetWarehousesAsync(); |
| | 0 | 26 | | var counterparties = await _refService.GetCounterpartiesAsync(); |
| | 0 | 27 | | ViewBag.WarehouseCount = warehouses.Count; |
| | 0 | 28 | | ViewBag.CounterpartyCount = counterparties.Count; |
| | 0 | 29 | | return View(); |
| | 0 | 30 | | } |
| | | 31 | | } |