コード例 #1
0
        public async Task <ActionResult> Index(int?pageNumber = 0, int pageSize = 6, int?cityId = null, int?propertyTypeId = null, bool?onlyRentalSearches = null)
        {
            #region Dropdowns

            var propertyTypes = await _propertyManager.GetPropertyTypes();

            ViewBag.PropertyTypes = propertyTypes;
            ViewBag.Cities        = await _cityManager.GetCitiesForDropDown(40);

            #endregion

            #region Current Filters

            ViewBag.pageNumber         = pageNumber;
            ViewBag.paegSize           = pageSize;
            ViewBag.cityId             = cityId;
            ViewBag.propertyTypeId     = propertyTypeId;
            ViewBag.onlyRentalSearches = onlyRentalSearches;

            #endregion

            #region Paging

            var searchesCount = await _propertySearchServices.CountAsync(onlyRentalSearches);

            ViewBag.PagesCount = (int)Math.Ceiling((double)searchesCount / (double)pageSize);

            #endregion

            var propertySearches = await _propertySearchServices.ListAsync(pageSize, pageNumber, cityId, propertyTypeId);

            return(View(propertySearches));
        }
コード例 #2
0
        public async Task <ActionResult> Index(int?cityId                  = null, string cityDistrict = null
                                               , int?propertyTypeId        = null
                                               , string phoneNumber        = null, int?dealTypeId = null
                                               , int?contactedPersonTypeId = null
                                               , int?negotiationStateId    = null)
        {
            //Filling dropdowns
            ViewBag.PropertyTypes = await _propertyManager.GetPropertyTypes();

            ViewBag.Cities = await _cityManager.GetCitiesForDropDown(40);

            ViewBag.DealTypes = await _contactsDiaryServices.ListDealTypes();

            ViewBag.NegotiationStages = await _contactsDiaryServices.ListNegotiationStages();

            ViewBag.PersonTypes = await _contactsDiaryServices.ListPersonType();

            ViewBag.Agents = await _agentServices.GetAgentsForDropDown();

            //---------

            var records = await _contactsDiaryServices.List(cityId : cityId, propertyTypeId : propertyTypeId
                                                            , phoneNumber : phoneNumber, dealTypeId : dealTypeId
                                                            , contactedPersonTypeId : contactedPersonTypeId
                                                            , cityDistrict : cityDistrict, negotiationStateId : negotiationStateId);

            return(View(records));
        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: Stefoajc/RealEstate
        //GET: Properties
        public async Task <ActionResult> Index()
        {
            ViewBag.SliderProperties = await propertyManager.GetPropertiesForMainSlider(3);

            ViewBag.Cities = await citiesManager.GetCitiesForDropDown(40);

            ViewBag.PropertyTypes = await propertyManager.GetPropertyTypes();

            ViewBag.RelatedProperties = await propertyManager.GetRelatedPropertiesBriefInfo();

            ViewBag.HappyClient = await reviewsManager.ListClientReviews();

            var propertiesAggregated = await propertyManager.GetPropertiesForHomePage();

            ViewBag.PropertiesAll = propertiesAggregated.PropertiesForSell;
            ViewBag.Houses        = propertiesAggregated.HousesForSell;
            ViewBag.Offices       = propertiesAggregated.OfficesForSell;
            ViewBag.Apartments    = propertiesAggregated.ApartmentsForSell;

            ViewBag.PropertiesRentedAll = propertiesAggregated.PropertiesForRent;
            ViewBag.HousesRented        = propertiesAggregated.HousesForRent;
            ViewBag.OfficesRented       = propertiesAggregated.OfficesForRent;
            ViewBag.ApartmentsRented    = propertiesAggregated.ApartmentsForRent;

            //Agents List
            ViewBag.Agents = await userServices.GetTopTwoAgents();

            return(View());
        }
コード例 #4
0
        public async Task <ActionResult> Create(int propertyId)
        {
            ViewBag.Platforms = await _webPlatformsManager.ListAsync();

            ViewBag.PromotionMediae = await _promotionMediaServices.ListAsKeyValue();

            ViewBag.Brokers = await _partnerServices.ListBrokersForDropdown();

            ViewBag.Cities = await _cityServices.GetCitiesForDropDown(40);

            ViewBag.Owner = await _ownersManager.GetOwner(propertyId);

            return(View(propertyId));
        }
コード例 #5
0
        // GET: ColleaguesDiary
        public async Task <ActionResult> Index()
        {
            //Dropdowns Init
            ViewBag.Cities = await _cityManager.GetCitiesForDropDown(40);

            ViewBag.Agents = await _agentServices.GetAgentsForDropDown();

            ViewBag.PartnerTypes = await _partnersManager.ListTypes();

            //

            var currUserId = User.Identity.GetUserId();
            var partners   = await _partnersManager.ListAsync(currUserId);

            return(View(partners));
        }
コード例 #6
0
 // GET: Cities/GetCitiesInCountry?countryId=<int>
 public async Task <ActionResult> GetCitiesInCountry(int countryId)
 {
     return(Json(await _cityManager.GetCitiesForDropDown(countryId), JsonRequestBehavior.AllowGet));
 }