using Contracts.BusinessLogicsContracts; using Contracts.ViewModels; using GuarantorAPP.Models; using Microsoft.AspNetCore.Mvc; using System.Diagnostics; namespace GuarantorAPP.Controllers { public class HomeController : Controller { private readonly ILogger _logger; private readonly IGuarantorLogic _userLogic; private readonly IMachineLogic _machineLogic; private readonly IWorkerLogic _workerLogic; private readonly IWorkshopLogic _workshopLogic; public HomeController(ILogger logger) { _logger = logger; } public IActionResult Index() { return View(); } public IActionResult Enter() { return View(); } public IActionResult Register() { return View(); } public IActionResult IndexMachine() { List machines = new List { new MachineViewModel { Id = 1, Title = "Токарный станок", Country = "Китай", UserId = 1 }, new MachineViewModel { Id = 2, Title = "Фрезерный станок", Country = "Россия", UserId = 2 } }; return View(machines); } public IActionResult CreateMachine() { var workers = new List(); workers.Add(new WorkerViewModel { Id = 1, Name = "Фролов Феодосий Валерьевич", Birthday = new DateTime(1989, 03, 29), Specialization = "Металлург", Salary = 55000, UserId = 1 }); workers.Add(new WorkerViewModel { Id = 2, Name = "Медведков Андрей Алексеевич", Birthday = new DateTime(2004, 02, 29), Specialization = "Слесарь", Salary = 25000, UserId = 2 }); return View(workers); } public IActionResult IndexWorker() { var workers = new List(); workers.Add(new WorkerViewModel { Id = 1, Name = "Фролов Феодосий Валерьевич", Birthday = new DateTime(1989, 03, 29), Specialization = "Металлург", Salary = 55000, UserId = 1 }); workers.Add(new WorkerViewModel { Id = 2, Name = "Медведков Андрей Алексеевич", Birthday = new DateTime(2004, 02, 29), Specialization = "Слесарь", Salary = 25000, UserId = 2 }); return View(workers); } public IActionResult CreateWorker() { return View(); } public IActionResult IndexWorkshop() { List workshops = new List { new WorkshopViewModel { Id = 1, Title = "Механический цех", Address = "Ул. Пушкина, колотушкина", Director = "Главный Андрей цеха", UserId = 1, ProductionId = 1, }, new WorkshopViewModel { Id = 2, Title = "Сварочный цех", Address = "Ул. Пушкина, колотушкина 22", Director = "Фрезер Давыд Анатольевич", UserId = 2, ProductionId = 2, } }; return View(workshops); } public IActionResult CreateWorkshop() { var workers = new List(); workers.Add(new WorkerViewModel { Id = 1, Name = "Фролов Феодосий Валерьевич", Birthday = new DateTime(1989, 03, 29), Specialization = "Металлург", Salary = 55000, UserId = 1 }); workers.Add(new WorkerViewModel { Id = 2, Name = "Медведков Андрей Алексеевич", Birthday = new DateTime(2004, 02, 29), Specialization = "Слесарь", Salary = 25000, UserId = 2 }); return View(workers); } public IActionResult Privacy() { GuarantorViewModel user = new() { Email = "mailtatar@mail.ru", Login = "tatar", Password = "password", Name = "User", }; return View(user); } public IActionResult MachineWorkshopTimeReport() { List machineWorkshopTimeReports = new List { new MachineWorkshopTimeReport { WorkshopName = "Цех А", Machines = new List { "Фрезерный станок", "Токарный станок" } }, new MachineWorkshopTimeReport { WorkshopName = "Цех В", Machines = new List { "Станок А", "Станок В" } } }; return View(machineWorkshopTimeReports); } public IActionResult WorkerProductReport() { List workerProductReports = new List { new WorkerProductReportViewModel { WorkerName = "Работник 1", Products = new List { "Изделие первое", "Изделие второе" } }, new WorkerProductReportViewModel { WorkerName = "Работник 2", Products = new List { "Изделие одно", "Изделие второе" } } }; return View(workerProductReports); } public IActionResult ReportsMenu() { return View(); } public IActionResult WorkshopProductionAdd() { List production = new List { new ProductionViewModel { Id = 1, Name = "Производство старое", Cost = 1, UserId = 1, }, new ProductionViewModel { Id = 2, Name = "Производство новое", Cost = 2, UserId = 2, } }; return View(production); } [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } } }