mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Sort companies in company descriptions admin pages.
This commit is contained in:
@@ -58,7 +58,7 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
{
|
{
|
||||||
IIncludableQueryable<CompanyDescription, Company> cicmContext =
|
IIncludableQueryable<CompanyDescription, Company> cicmContext =
|
||||||
_context.CompanyDescriptions.Include(c => c.Company);
|
_context.CompanyDescriptions.Include(c => c.Company);
|
||||||
return View(await cicmContext.ToListAsync());
|
return View(await cicmContext.OrderBy(c => c.Company.Name).ToListAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: CompanyDescription/Details/5
|
// GET: CompanyDescription/Details/5
|
||||||
@@ -77,7 +77,7 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
// GET: CompanyDescription/Create
|
// GET: CompanyDescription/Create
|
||||||
public IActionResult Create()
|
public IActionResult Create()
|
||||||
{
|
{
|
||||||
ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name");
|
ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name");
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +96,8 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
return RedirectToAction(nameof(Index));
|
return RedirectToAction(nameof(Index));
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", companyDescription.CompanyId);
|
ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name",
|
||||||
|
companyDescription.CompanyId);
|
||||||
return View(companyDescription);
|
return View(companyDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +109,8 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
CompanyDescription companyDescription = await _context.CompanyDescriptions.FindAsync(id);
|
CompanyDescription companyDescription = await _context.CompanyDescriptions.FindAsync(id);
|
||||||
if(companyDescription == null) return NotFound();
|
if(companyDescription == null) return NotFound();
|
||||||
|
|
||||||
ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", companyDescription.CompanyId);
|
ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name",
|
||||||
|
companyDescription.CompanyId);
|
||||||
return View(companyDescription);
|
return View(companyDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +141,8 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
return RedirectToAction(nameof(Index));
|
return RedirectToAction(nameof(Index));
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", companyDescription.CompanyId);
|
ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name",
|
||||||
|
companyDescription.CompanyId);
|
||||||
return View(companyDescription);
|
return View(companyDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||||
<Version>3.0.99.513</Version>
|
<Version>3.0.99.515</Version>
|
||||||
<Company>Canary Islands Computer Museum</Company>
|
<Company>Canary Islands Computer Museum</Company>
|
||||||
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
<Copyright>Copyright © 2003-2018 Natalia Portillo</Copyright>
|
||||||
<Product>Canary Islands Computer Museum Website</Product>
|
<Product>Canary Islands Computer Museum Website</Product>
|
||||||
|
|||||||
Reference in New Issue
Block a user