public async Task <IActionResult> Index() { ViewData["CityId"] = new SelectList(_cityApp.SelectAll(), "Id", "Name"); ViewData["ClassificationId"] = new SelectList(_classificationApp.SelectAll(), "Id", "Name"); ViewData["GenderId"] = new SelectList(_genderApp.SelectAll(), "Id", "Name"); ViewData["RegionId"] = new SelectList(_regionApp.SelectAll(), "Id", "Name"); ViewData["Sellers"] = new SelectList(await _userManager.GetUsersInRoleAsync(Enum.GetName(typeof(Roles), Roles.Seller)), "Id", "UserName"); var customerDTO = new CustomerDTO(); customerDTO.Customers = _customerApp.SelectAll() .Where(x => !User.IsInRole(Enum.GetName(typeof(Roles), Roles.Seller)) || x.IdentityUserId.Equals(User.FindFirstValue(ClaimTypes.NameIdentifier))); return(View(customerDTO)); }
public IActionResult Index() { var classificationsDTO = _classificationApp.SelectAll(); return(View(classificationsDTO)); }