mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Implement edit page for document companies.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<h1>Edit</h1>
|
||||
|
||||
<h4>DocumentCompany</h4>
|
||||
<h4>Document company</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@@ -25,14 +25,17 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="CompanyId"
|
||||
<label asp-for="Company"
|
||||
class="control-label">
|
||||
</label>
|
||||
<input asp-for="CompanyId"
|
||||
class="form-control" />
|
||||
<span asp-validation-for="CompanyId"
|
||||
class="text-danger">
|
||||
</span>
|
||||
<select asp-for="CompanyId"
|
||||
class="form-control"
|
||||
asp-items="ViewBag.CompanyId">
|
||||
<option selected
|
||||
value="">
|
||||
None or unknown
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="hidden"
|
||||
asp-for="Id" />
|
||||
@@ -40,11 +43,12 @@
|
||||
<input class="btn btn-primary"
|
||||
type="submit"
|
||||
value="Save" />
|
||||
<a asp-action="Index" class="btn btn-secondary">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
@section Scripts {
|
||||
@{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<Version>3.0.99.857</Version>
|
||||
<Version>3.0.99.859</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