2024-04-28 17:11:40 +04:00
|
|
|
|
using ImplementerApp.Models;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using System.Diagnostics;
|
2024-04-28 21:35:19 +04:00
|
|
|
|
using BusinessLogic.BusinessLogic;
|
|
|
|
|
using Contracts.BusinessLogicsContracts;
|
2024-04-29 22:21:21 +04:00
|
|
|
|
using Contracts.ViewModels;
|
2024-04-30 00:44:32 +04:00
|
|
|
|
using DataModels.Models;
|
2024-04-28 17:11:40 +04:00
|
|
|
|
|
|
|
|
|
namespace ImplementerApp.Controllers
|
|
|
|
|
{
|
|
|
|
|
public class HomeController : Controller
|
|
|
|
|
{
|
|
|
|
|
private readonly ILogger<HomeController> _logger;
|
2024-04-28 21:35:19 +04:00
|
|
|
|
private readonly IDetailLogic _detailLogic;
|
|
|
|
|
private readonly IImplementerLogic _userLogic;
|
|
|
|
|
private readonly IProductLogic _productLogic;
|
|
|
|
|
private readonly IProductionLogic _productionLogic;
|
|
|
|
|
|
2024-04-28 17:11:40 +04:00
|
|
|
|
|
|
|
|
|
public HomeController(ILogger<HomeController> logger)
|
|
|
|
|
{
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IActionResult Index()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
2024-04-28 21:35:19 +04:00
|
|
|
|
public IActionResult Enter()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
public IActionResult Register()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
2024-04-28 17:11:40 +04:00
|
|
|
|
public IActionResult IndexDetail()
|
|
|
|
|
{
|
2024-04-30 00:44:32 +04:00
|
|
|
|
var details = new List<DetailViewModel>();
|
|
|
|
|
details.Add(new DetailViewModel
|
|
|
|
|
{
|
|
|
|
|
Id = 1,
|
|
|
|
|
Name = "Test",
|
|
|
|
|
Cost = 55.5,
|
|
|
|
|
UserId = 1
|
|
|
|
|
});
|
|
|
|
|
details.Add(new DetailViewModel
|
|
|
|
|
{
|
|
|
|
|
Id = 2,
|
|
|
|
|
Name = "Test1",
|
|
|
|
|
Cost = 32,
|
|
|
|
|
UserId = 2
|
|
|
|
|
});
|
|
|
|
|
return View(details);
|
2024-04-28 17:11:40 +04:00
|
|
|
|
}
|
|
|
|
|
public IActionResult CreateDetail()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IActionResult IndexProduct()
|
|
|
|
|
{
|
2024-04-29 22:21:21 +04:00
|
|
|
|
return View(new List<ProductViewModel>());
|
2024-04-28 17:11:40 +04:00
|
|
|
|
}
|
|
|
|
|
public IActionResult CreateProduct()
|
|
|
|
|
{
|
2024-04-30 00:44:32 +04:00
|
|
|
|
var details = new List<DetailViewModel>();
|
|
|
|
|
details.Add(new DetailViewModel
|
|
|
|
|
{
|
|
|
|
|
Id = 1,
|
|
|
|
|
Name = "Test",
|
|
|
|
|
Cost = 55.5,
|
|
|
|
|
UserId = 1
|
|
|
|
|
});
|
|
|
|
|
details.Add(new DetailViewModel
|
|
|
|
|
{
|
|
|
|
|
Id = 2,
|
|
|
|
|
Name = "Test1",
|
|
|
|
|
Cost = 32,
|
|
|
|
|
UserId = 2
|
|
|
|
|
});
|
|
|
|
|
return View(details);
|
2024-04-28 17:11:40 +04:00
|
|
|
|
}
|
|
|
|
|
public IActionResult IndexProduction()
|
|
|
|
|
{
|
2024-04-29 22:21:21 +04:00
|
|
|
|
return View(new List<ProductionViewModel>());
|
2024-04-28 17:11:40 +04:00
|
|
|
|
}
|
|
|
|
|
public IActionResult CreateProduction()
|
|
|
|
|
{
|
2024-04-30 00:44:32 +04:00
|
|
|
|
var details = new List<DetailViewModel>();
|
|
|
|
|
details.Add(new DetailViewModel
|
|
|
|
|
{
|
|
|
|
|
Id = 1,
|
|
|
|
|
Name = "Test",
|
|
|
|
|
Cost = 55.5,
|
|
|
|
|
UserId = 1
|
|
|
|
|
});
|
|
|
|
|
details.Add(new DetailViewModel
|
|
|
|
|
{
|
|
|
|
|
Id = 2,
|
|
|
|
|
Name = "Test1",
|
|
|
|
|
Cost = 32,
|
|
|
|
|
UserId = 2
|
|
|
|
|
});
|
|
|
|
|
return View(details);
|
2024-04-28 17:11:40 +04:00
|
|
|
|
}
|
|
|
|
|
public IActionResult Privacy()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
2024-04-30 00:44:32 +04:00
|
|
|
|
public IActionResult DetailTimeReport()
|
|
|
|
|
{
|
|
|
|
|
return View(new List<DetailTimeReport>());
|
|
|
|
|
}
|
|
|
|
|
public IActionResult DetailWorkshopReport()
|
|
|
|
|
{
|
|
|
|
|
return View(new List<DetailWorkshopReportViewModel>());
|
|
|
|
|
}
|
|
|
|
|
public IActionResult ReportsMenu()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
public IActionResult ProductMachineAdd()
|
|
|
|
|
{
|
|
|
|
|
List<MachineViewModel> machines = new List<MachineViewModel>
|
|
|
|
|
{
|
|
|
|
|
new MachineViewModel
|
|
|
|
|
{
|
|
|
|
|
Id = 1,
|
|
|
|
|
Title = "Токарный станок",
|
|
|
|
|
Country = "Германия",
|
|
|
|
|
UserId = 1,
|
|
|
|
|
WorkerMachines = new()
|
|
|
|
|
},
|
|
|
|
|
new MachineViewModel
|
|
|
|
|
{
|
|
|
|
|
Id = 2,
|
|
|
|
|
Title = "Фрезерный станок",
|
|
|
|
|
Country = "Япония",
|
|
|
|
|
UserId = 2,
|
|
|
|
|
WorkerMachines = new()
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
return View(machines);
|
|
|
|
|
}
|
2024-04-28 17:11:40 +04:00
|
|
|
|
|
|
|
|
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
|
|
|
public IActionResult Error()
|
|
|
|
|
{
|
|
|
|
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|