Implement edit page for document companies.

This commit is contained in:
2019-06-30 12:22:49 +01:00
parent 88a2d670e5
commit 64d7d702a9
3 changed files with 20 additions and 11 deletions

View File

@@ -80,8 +80,11 @@ namespace cicm_web.Areas.Admin.Controllers
if(id == null) return NotFound();
DocumentCompany documentCompany = await _context.DocumentCompanies.FindAsync(id);
if(documentCompany == null) return NotFound();
ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name).Select(c => new {c.Id, c.Name}), "Id", "Name", documentCompany.CompanyId);
return View(documentCompany);
}
@@ -111,6 +114,8 @@ namespace cicm_web.Areas.Admin.Controllers
return RedirectToAction(nameof(Index));
}
ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name).Select(c => new {c.Id, c.Name}), "Id", "Name", documentCompany.CompanyId);
return View(documentCompany);
}