示例#1
0
 public ViewResult CustomerList()
 => View(
     repo.GetAll()
     .OrderBy(l => l.LastName)
     .Include(a => a.ApplicationUser)
     .Include(a => a.Address)
     );
示例#2
0
        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"));
            }
        }
示例#4
0
        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));
        }
示例#6
0
 public ActionResult <IEnumerable <Customer> > Get() => Ok(_repo.GetAll().ToList());
示例#7
0
 public IEnumerable <Customer> Get() => _repo.GetAll();
示例#8
0
 public IEnumerable <tCustomer> GetAll()
 {
     return(customerRepo.GetAll());
 }
 public IEnumerable <CustomerItem> GetAll()
 {
     return(_custRepo.GetAll());
 }
示例#10
0
        public ActionResult <IList <Customer> > Get()
        {
            IEnumerable <Customer> customers = _repo.GetAll().ToList();

            return(Ok(customers));
        }