mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Add Index and ByCountry to Company.
This commit is contained in:
@@ -29,8 +29,10 @@
|
||||
*******************************************************************************/
|
||||
|
||||
using cicm_web.Models;
|
||||
using Cicm.Database.Schemas;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Company = cicm_web.Models.Company;
|
||||
|
||||
namespace cicm_web.Controllers
|
||||
{
|
||||
@@ -65,5 +67,23 @@ namespace cicm_web.Controllers
|
||||
ViewBag.WebRootPath = hostingEnvironment.WebRootPath;
|
||||
return View(company);
|
||||
}
|
||||
|
||||
public IActionResult ByCountry(int id)
|
||||
{
|
||||
Iso3166 iso3166 = Program.Database.Operations.GetIso3166(id);
|
||||
|
||||
ViewBag.Iso3166 = iso3166;
|
||||
|
||||
Company[] companies = iso3166 == null ? Company.GetAllItems() : Company.GetItemsByCountry(id);
|
||||
|
||||
ViewBag.WebRootPath = hostingEnvironment.WebRootPath;
|
||||
return View(companies);
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
ViewBag.WebRootPath = hostingEnvironment.WebRootPath;
|
||||
return View(Company.GetAllItems());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user