public CustomerController(ICustomerRepository customerRepository, ITypesRepository <CustomerType> customerTypeRepository, ITypesRepository <CustomerTypeCustomer> customerTypeCustomerRepository, IMapper mapper)
 {
     _mapper                         = mapper;
     _customerRepository             = customerRepository;
     _customerTypeRepository         = customerTypeRepository;
     _customerTypeCustomerRepository = customerTypeCustomerRepository;
     _customerTypes                  = _customerTypeRepository.GetAllTTypes().ToList();
 }
示例#2
0
 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);
 }
示例#3
0
 public IActionResult GetDistricts(int cityId)
 {
     return(Ok(_districtRepository.GetAllTTypes().Where(x => x.CityId == cityId).OrderBy(x => x.Name).ToList()));
 }
示例#4
0
 public IActionResult Index()
 {
     ViewBag.Cities       = _cityRepository.GetAllTTypes();
     ViewBag.HeatingTypes = _heatingTypesRepository.GetAllTTypes();
     return(View(_estateRepository.GetAll().OrderByDescending(x => x.ModifiedDate).ToList()));
 }