88 lines
2.2 KiB
C#
88 lines
2.2 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using ServiceStationContracts.ViewModels;
|
|
using ServiceStationExecutorApp.Models;
|
|
using System.Diagnostics;
|
|
|
|
namespace ServiceStationExecutorApp.Controllers
|
|
{
|
|
public class HomeController : Controller
|
|
{
|
|
private readonly ILogger<HomeController> _logger;
|
|
|
|
public HomeController(ILogger<HomeController> logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public IActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public IActionResult Privacy()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public IActionResult Enter()
|
|
{
|
|
return View();
|
|
}
|
|
public IActionResult Register()
|
|
{
|
|
return View();
|
|
}
|
|
public IActionResult ListCars()
|
|
{
|
|
var cars = new List<CarViewModel>();
|
|
cars.Add(new CarViewModel
|
|
{
|
|
Id = 1,
|
|
CarNumber = "111",
|
|
CarBrand = "lamba",
|
|
ExecutorId = 1
|
|
});
|
|
|
|
return View(cars);
|
|
}
|
|
public IActionResult ListDefects()
|
|
{
|
|
var defects = new List<DefectViewModel>();
|
|
defects.Add(new DefectViewModel
|
|
{
|
|
Id = 1,
|
|
DefectType = "type1",
|
|
DefectPrice = 100.0,
|
|
ExecutorId = 1
|
|
});
|
|
|
|
return View(defects);
|
|
}
|
|
public IActionResult DeleteCar()
|
|
{
|
|
ViewBag.Cars = new List<CarViewModel>();
|
|
return View();
|
|
}
|
|
public IActionResult DeleteDefect()
|
|
{
|
|
ViewBag.Defects = new List<DefectViewModel>();
|
|
return View();
|
|
}
|
|
public IActionResult UpdateCar()
|
|
{
|
|
ViewBag.Cars = new List<CarViewModel>();
|
|
return View();
|
|
}
|
|
public IActionResult CreateCar()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
public IActionResult Error()
|
|
{
|
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
}
|
|
}
|
|
}
|