Пример #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);
                    }
                }
            }
        }
        public async Task Init()
        {
            if (TypeOfRoomList.Count == 0)
            {
                var typeOfRoomList = await _typeOfRoom.Get <List <Model.TypeOfRoom> >(null);

                foreach (var room in typeOfRoomList)
                {
                    TypeOfRoomList.Add(room);
                }
            }

            if (TypeOfCity.Count == 0)
            {
                var cityList = await _typeOfCity.Get <List <Model.City> >(null);

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

            if (SelectedTypeOfRoom != null)
            {
                RoomUserSearchRequest searchRequest = new RoomUserSearchRequest();
                searchRequest.TypeOfRoomId = SelectedTypeOfRoom.Id;
                var listRoom = await _roomsService.Get <IEnumerable <Model.Room> >(searchRequest);

                RoomsList.Clear();
                foreach (var room in listRoom)
                {
                    if (room.Rented == false)
                    {
                        RoomsList.Add(room);
                    }
                }
            }

            if (SelectedTypeOfCity != null)
            {
                RoomUserSearchRequest searchRequest = new RoomUserSearchRequest();
                searchRequest.CityId = SelectedTypeOfCity.Id;
                var listRoom = await _roomsService.Get <IEnumerable <Model.Room> >(searchRequest);

                RoomsList.Clear();
                foreach (var room in listRoom)
                {
                    if (room.Rented == false)
                    {
                        RoomsList.Add(room);
                    }
                }
            }
        }