mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Sort instruction sets in admin page.
This commit is contained in:
@@ -49,7 +49,8 @@ namespace cicm_web.Areas.Admin.Controllers
|
||||
}
|
||||
|
||||
// GET: Admin/InstructionSets
|
||||
public async Task<IActionResult> Index() => View(await _context.InstructionSets.ToListAsync());
|
||||
public async Task<IActionResult> Index() =>
|
||||
View(await _context.InstructionSets.OrderBy(s => s.Name).ToListAsync());
|
||||
|
||||
// GET: Admin/InstructionSets/Details/5
|
||||
public async Task<IActionResult> Details(int? id)
|
||||
@@ -72,16 +73,13 @@ namespace cicm_web.Areas.Admin.Controllers
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create([Bind("Id,Name")] InstructionSet instructionSet)
|
||||
{
|
||||
if(ModelState.IsValid)
|
||||
{
|
||||
if(!ModelState.IsValid) return View(instructionSet);
|
||||
|
||||
_context.Add(instructionSet);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction(nameof(Index));
|
||||
}
|
||||
|
||||
return View(instructionSet);
|
||||
}
|
||||
|
||||
// GET: Admin/InstructionSets/Edit/5
|
||||
public async Task<IActionResult> Edit(int? id)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<Version>3.0.99.432</Version>
|
||||
<Version>3.0.99.433</Version>
|
||||
<Company>Canary Islands Computer Museum</Company>
|
||||
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
||||
<Product>Canary Islands Computer Museum Website</Product>
|
||||
|
||||
Reference in New Issue
Block a user