Implement machine photo edit admin page.

This commit is contained in:
2019-05-28 23:50:22 +01:00
parent 593b044506
commit 2c3dc16161
4 changed files with 115 additions and 59 deletions

View File

@@ -378,6 +378,14 @@ namespace cicm_web.Areas.Admin.Controllers
MachinePhoto machinePhoto = await _context.MachinePhotos.FindAsync(id);
if(machinePhoto == null) return NotFound();
ViewData["MachineId"] =
new
SelectList(_context.Machines.OrderBy(m => m.Company.Name).ThenBy(m => m.Name).Select(m => new {m.Id, Name = $"{m.Company.Name} {m.Name}"}),
"Id", "Name", machinePhoto.MachineId);
ViewData["LicenseId"] =
new SelectList(_context.Licenses.OrderBy(l => l.Name).Select(l => new {l.Id, l.Name}), "Id", "Name",
machinePhoto.LicenseId);
return View(machinePhoto);
}