2024-04-30 02:44:02 +04:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using ServiceStationContracts.ViewModels;
|
|
|
|
|
using ServiceStationExecutorApp.Models;
|
2024-04-30 14:59:16 +04:00
|
|
|
|
using System.Collections.Generic;
|
2024-04-30 02:44:02 +04:00
|
|
|
|
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();
|
|
|
|
|
}
|
2024-04-30 14:59:16 +04:00
|
|
|
|
public IActionResult UpdateDefect()
|
|
|
|
|
{
|
|
|
|
|
ViewBag.Defects = new List<DefectViewModel>();
|
|
|
|
|
return View();
|
|
|
|
|
}
|
2024-04-30 02:44:02 +04:00
|
|
|
|
public IActionResult CreateCar()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
2024-04-30 14:59:16 +04:00
|
|
|
|
public IActionResult CreateDefect()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
public IActionResult AddCarToDefect()
|
|
|
|
|
{
|
|
|
|
|
var defect = new DefectViewModel
|
|
|
|
|
{
|
|
|
|
|
Id = 1,
|
|
|
|
|
DefectType = "type1",
|
|
|
|
|
DefectPrice = 1000.0,
|
|
|
|
|
ExecutorId = 1
|
|
|
|
|
};
|
|
|
|
|
var car = new CarViewModel
|
|
|
|
|
{
|
|
|
|
|
Id = 1,
|
|
|
|
|
CarNumber = "111",
|
|
|
|
|
CarBrand = "lamba"
|
|
|
|
|
};
|
|
|
|
|
List<DefectViewModel> defects = new List<DefectViewModel>();
|
|
|
|
|
List <CarViewModel> cars = new List<CarViewModel>();
|
|
|
|
|
defects.Add(defect);
|
|
|
|
|
cars.Add(car);
|
|
|
|
|
return View(Tuple.Create(defects, cars));
|
|
|
|
|
}
|
2024-04-30 02:44:02 +04:00
|
|
|
|
|
|
|
|
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
|
|
|
|
public IActionResult Error()
|
|
|
|
|
{
|
|
|
|
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|