mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add computer view.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using cicm_web.Models;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Computer = Cicm.Database.Schemas.Computer;
|
||||
|
||||
@@ -8,6 +9,13 @@ namespace cicm_web.Controllers
|
||||
{
|
||||
public class ComputerController : Controller
|
||||
{
|
||||
readonly IHostingEnvironment hostingEnvironment;
|
||||
|
||||
public ComputerController(IHostingEnvironment env)
|
||||
{
|
||||
hostingEnvironment = env;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
Program.Database.Operations.GetComputers(out List<Computer> computers);
|
||||
@@ -41,5 +49,12 @@ namespace cicm_web.Controllers
|
||||
|
||||
return View(ComputerMini.GetItemsFromYear(id));
|
||||
}
|
||||
|
||||
public IActionResult View(int id)
|
||||
{
|
||||
ViewBag.WebRootPath = hostingEnvironment.WebRootPath;
|
||||
|
||||
return View(Models.Computer.GetItem(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user