2019-11-17 22:32:50 +00:00
|
|
|
using System.Linq;
|
2019-11-07 22:43:37 +00:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using DiscImageChef.Server.Models;
|
2019-11-08 00:37:51 +00:00
|
|
|
using Microsoft.AspNetCore.Authorization;
|
2019-11-07 22:43:37 +00:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.Server.Areas.Admin.Controllers
|
|
|
|
|
{
|
2019-11-08 20:30:13 +00:00
|
|
|
[Area("Admin"), Authorize]
|
2019-11-07 22:43:37 +00:00
|
|
|
public class UsbVendorsController : Controller
|
|
|
|
|
{
|
|
|
|
|
readonly DicServerContext _context;
|
|
|
|
|
|
|
|
|
|
public UsbVendorsController(DicServerContext context) => _context = context;
|
|
|
|
|
|
|
|
|
|
// GET: Admin/UsbVendors
|
2019-11-17 22:32:50 +00:00
|
|
|
public async Task<IActionResult> Index() => View(await _context.UsbVendors.OrderBy(v => v.Vendor).ThenBy(v => v.VendorId).ToListAsync());
|
2019-11-07 22:43:37 +00:00
|
|
|
|
|
|
|
|
// GET: Admin/UsbVendors/Details/5
|
|
|
|
|
public async Task<IActionResult> Details(int? id)
|
|
|
|
|
{
|
|
|
|
|
if(id == null)
|
|
|
|
|
{
|
|
|
|
|
return NotFound();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UsbVendor usbVendor = await _context.UsbVendors.FirstOrDefaultAsync(m => m.Id == id);
|
|
|
|
|
|
|
|
|
|
if(usbVendor == null)
|
|
|
|
|
{
|
|
|
|
|
return NotFound();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return View(usbVendor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|