public ViewResult CustomerList() => View( repo.GetAll() .OrderBy(l => l.LastName) .Include(a => a.ApplicationUser) .Include(a => a.Address) );
public async Task <ListingViewModel> GetDefaultViewModelEntry() { var viewModel = new ListingViewModel(); var heatingDbList = _listingRepo.GetAllHeating(); var propFeaturesDbList = _listingRepo.GetAllFeatures(); var customersDbList = _customerRepo.GetAll(); var agentsDbList = _userRepo.GetAllByRole(RoleNames.AGENT); await Task.WhenAll(heatingDbList, propFeaturesDbList, customersDbList, agentsDbList); viewModel.HeatingListToSelect = ListingViewHelperUtilites. GetHeatingTypesToListItems(heatingDbList.Result); viewModel.FeaturesListToSelect = ListingViewHelperUtilites. GetPropertyFeaturesToListItems(propFeaturesDbList.Result); viewModel.Agents = agentsDbList.Result; viewModel.Customers = customersDbList.Result; return(viewModel); }
// GET: Admin public ActionResult Index() { if (Session["vid"].ToString() == "101") { return(View(crepo.GetAll())); } else { return(RedirectToAction("Index", "Index")); } }
public IActionResult GetCustomer() { var result = new ObjectResult(_customerRepository.GetAll()) { StatusCode = (int)HttpStatusCode.OK }; Request.HttpContext.Response.Headers.Add("X-Count", _customerRepository.CountCustomer().ToString()); Request.HttpContext.Response.Headers.Add("X-Name", "Homoro"); return(result); }
public async Task <ActionResult> Index() { try { var customers = await _customerRepo.GetAll(); if (customers != null) { model.customerList = customers; } } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); } return(View(model)); }
public ActionResult <IEnumerable <Customer> > Get() => Ok(_repo.GetAll().ToList());
public IEnumerable <Customer> Get() => _repo.GetAll();
public IEnumerable <tCustomer> GetAll() { return(customerRepo.GetAll()); }
public IEnumerable <CustomerItem> GetAll() { return(_custRepo.GetAll()); }
public ActionResult <IList <Customer> > Get() { IEnumerable <Customer> customers = _repo.GetAll().ToList(); return(Ok(customers)); }