private static void ValidateFlatToCount(int count)
        {
            Debug.Assert(roomService.GetAll().Count() == count);
            Debug.Assert(flatService.GetAll().Count() == count);
            Debug.Assert(residenceService.GetAll().Count() == count);
            Debug.Assert(houseService.GetAll().Count() == count);
            var plots = plotService.GetAll();

            Debug.Assert(plots.Count() == count);
        }
예제 #2
0
        private List <SelectListItem> GetHouseList()
        {
            var houses     = _houseService.GetAll(null);
            var housesList = houses.Select(c => new SelectListItem
            {
                Text  = $"{c.StreetNumber} {c.StreetName}",
                Value = c.HouseId.ToString()
            }).ToList();

            return(housesList);
        }
예제 #3
0
        // GET: /<controller>/
        public IActionResult Index(string searchTerm = null)
        {
            var houseViewModel = _houseService.GetAll(searchTerm)
                                 .Select(a => new HOMEIndexViewModel
            {
                HouseId         = a.HouseId,
                StreetNumber    = a.StreetNumber,
                StreetName      = a.StreetName,
                Description     = a.Description,
                CategoryName    = a.CategoryName,
                FullName        = a.FullName,
                ImageThumbnail  = a.ImageThumbnail,
                InvoicesBalance = a.InvoicesBalance
            }).Where(o => o.InvoicesBalance > 10)
                                 .OrderByDescending(a => a.InvoicesBalance);

            bool isAjaxCall = HttpContext.Request.Headers["x-requested-with"] == "XMLHttpRequest";

            if (isAjaxCall)
            {
                return(PartialView("_Houses", houseViewModel));
            }

            return(View(houseViewModel));
        }
예제 #4
0
        public async Task <ActionResult <IEnumerable <HouseDto> > > GetHouses()
        {
            // TODO: Your code here
            await Task.Yield();

            var houseEntities = _houseService.GetAll();
            var response      = _mapper.Map <IEnumerable <HouseDto> >(houseEntities);

            return(Ok(response));
        }
        public IActionResult GetAll()
        {
            var result = _houseService.GetAll();

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
예제 #6
0
        public async Task <IActionResult> HousesSection()
        {
            var sellableHouses = await _houseService.GetAll();

            return(View(new HousesSectionViewModel()
            {
                Houses = _mapper.Map <IEnumerable <SectionHouseViewModel> >(sellableHouses),
                HousesMaxPrice = await _houseService.GetMaxHousePrice(),
                HousesMinPrice = await _houseService.GetMinHousePrice()
            }));
        }
예제 #7
0
        public async Task <IActionResult> List()
        {
            await Task.Yield();

            var model = new RentListViewModel()
            {
                Houses    = _houseService.GetAll(),
                Features  = _featureService.GetAll(),
                Provinces = _provinceService.GetAll()
            };

            return(View(model));
        }
예제 #8
0
 public IActionResult Get()
 {
     try
     {
         var house       = _houseService.GetAll();
         var houseModels = house.Select(c => c.ToApiModel());
         return(Ok(houseModels));
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("GetHouse", ex.Message);
         return(BadRequest(ModelState));
     }
 }
예제 #9
0
 public IHttpActionResult Get()
 {
     return(Ok(_houseService.GetAll()));
 }
예제 #10
0
        public async Task <IActionResult> GetAll()
        {
            var houses = await _houseService.GetAll();

            return(Ok(houses));
        }
예제 #11
0
 public IEnumerable <HouseDto> Get()
 {
     return(_houseService.GetAll());
 }
예제 #12
0
        public IActionResult Index()
        {
            var houses = _houseService.GetAll(User.Identity.GetId());

            return(View(houses));
        }
예제 #13
0
 public IEnumerable <House> GetHouses()
 {
     return(_houseService.GetAll());
 }
예제 #14
0
 // GET: House
 public IActionResult List()
 {
     return(View(_houseService.GetAll()));
 }