public CustomerController(ICustomerRepository customerRepository, ITypesRepository <CustomerType> customerTypeRepository, ITypesRepository <CustomerTypeCustomer> customerTypeCustomerRepository, IMapper mapper) { _mapper = mapper; _customerRepository = customerRepository; _customerTypeRepository = customerTypeRepository; _customerTypeCustomerRepository = customerTypeCustomerRepository; _customerTypes = _customerTypeRepository.GetAllTTypes().ToList(); }
public void BagAllTypes() { ViewBag.EstateTypes = _estateTypesRepository.GetAllTTypes(); ViewBag.HeatingTypes = _heatingTypesRepository.GetAllTTypes(); ViewBag.Cities = _cityRepository.GetAllTTypes(); ViewBag.Districts = _districtRepository.GetAllTTypes(); ViewBag.Customers = _customerRepository.GetAll().OrderByDescending(x => x.ModifiedDate); }
public IActionResult GetDistricts(int cityId) { return(Ok(_districtRepository.GetAllTTypes().Where(x => x.CityId == cityId).OrderBy(x => x.Name).ToList())); }
public IActionResult Index() { ViewBag.Cities = _cityRepository.GetAllTTypes(); ViewBag.HeatingTypes = _heatingTypesRepository.GetAllTTypes(); return(View(_estateRepository.GetAll().OrderByDescending(x => x.ModifiedDate).ToList())); }