mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Sort dropdowns in companies admin pages.
This commit is contained in:
@@ -73,8 +73,8 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
// GET: Admin/Companies/Create
|
// GET: Admin/Companies/Create
|
||||||
public IActionResult Create()
|
public IActionResult Create()
|
||||||
{
|
{
|
||||||
ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric, "Id", "Name");
|
ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric.OrderBy(c => c.Name), "Id", "Name");
|
||||||
ViewData["SoldToId"] = new SelectList(_context.Companies, "Id", "Name");
|
ViewData["SoldToId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name");
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,8 +95,8 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
return RedirectToAction(nameof(Index));
|
return RedirectToAction(nameof(Index));
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric, "Id", "Name", company.CountryId);
|
ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric.OrderBy(c => c.Name), "Id", "Name", company.CountryId);
|
||||||
ViewData["SoldToId"] = new SelectList(_context.Companies, "Id", "Name", company.SoldToId);
|
ViewData["SoldToId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", company.SoldToId);
|
||||||
return View(company);
|
return View(company);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,8 +108,8 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
Company company = await _context.Companies.FindAsync(id);
|
Company company = await _context.Companies.FindAsync(id);
|
||||||
if(company == null) return NotFound();
|
if(company == null) return NotFound();
|
||||||
|
|
||||||
ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric, "Id", "Name", company.CountryId);
|
ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric.OrderBy(c => c.Name), "Id", "Name", company.CountryId);
|
||||||
ViewData["SoldToId"] = new SelectList(_context.Companies, "Id", "Name", company.SoldToId);
|
ViewData["SoldToId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", company.SoldToId);
|
||||||
return View(company);
|
return View(company);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,8 +142,8 @@ namespace cicm_web.Areas.Admin.Controllers
|
|||||||
return RedirectToAction(nameof(Index));
|
return RedirectToAction(nameof(Index));
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric, "Id", "Name", company.CountryId);
|
ViewData["CountryId"] = new SelectList(_context.Iso31661Numeric.OrderBy(c => c.Name), "Id", "Name", company.CountryId);
|
||||||
ViewData["SoldToId"] = new SelectList(_context.Companies, "Id", "Name", company.SoldToId);
|
ViewData["SoldToId"] = new SelectList(_context.Companies.OrderBy(c => c.Name), "Id", "Name", company.SoldToId);
|
||||||
return View(company);
|
return View(company);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.506</Version>
|
<Version>3.0.99.507</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