Exemplo n.º 1
0
        public async Task Init()
        {
            if (TypeOfCity.Count == 0)
            {
                var cityList = await _typeOfCity.Get <List <Model.City> >(null);

                foreach (var city in cityList)
                {
                    TypeOfCity.Add(city);
                }
            }

            if (TypeOfApartments.Count == 0)
            {
                var typeOfApartmentList = await _typeOfApartments.Get <List <Model.TypeOfResidentialBuilding> >(null);

                foreach (var apartment in typeOfApartmentList)
                {
                    TypeOfApartments.Add(apartment);
                }
            }

            if (SelectedTypeOfCity != null)
            {
                ApartmentUserSearchRequest searchRequest = new ApartmentUserSearchRequest();
                searchRequest.CityId = SelectedTypeOfCity.Id;

                var listApartments = await _apartmentsService.Get <IEnumerable <Model.ResidentialBuilding> >(searchRequest);

                ApartmentsList.Clear();
                foreach (var apartments in listApartments)
                {
                    if (apartments.Rented == false)
                    {
                        ApartmentsList.Add(apartments);
                    }
                }
            }

            if (SelectedTypeOfApartments != null)
            {
                ApartmentUserSearchRequest searchRequest = new ApartmentUserSearchRequest();
                searchRequest.TypeOfResidentialBuildingId = SelectedTypeOfApartments.Id;

                var listApartments = await _apartmentsService.Get <IEnumerable <Model.ResidentialBuilding> >(searchRequest);

                ApartmentsList.Clear();
                foreach (var apartments in listApartments)
                {
                    if (apartments.Rented == false)
                    {
                        ApartmentsList.Add(apartments);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public async Task Init()
        {
            var list = await _apartmentsUserServicce.Get <List <Model.ResidentialBuilding> >();

            ApartmentsList.Clear();
            foreach (var apartment in list)
            {
                ApartmentsList.Add(apartment);
            }
        }
Exemplo n.º 3
0
        public async Task Init()
        {
            var listApartment = await _apartmentsService.Get <IEnumerable <Model.ResidentialBuilding> >(Apartment.Id);

            ApartmentsList.Clear();
            foreach (var apartments in listApartment)
            {
                if (apartments.Rented == false)
                {
                    ApartmentsList.Add(apartments);
                }
            }
        }