Пример #1
0
        public static string GetDisplayNameForCommunityUnitImages(CommunityUnitType communityUnitType)
        {
            string displayName;

            switch (communityUnitType)
            {
            case CommunityUnitType.FloorPlan:
            {
                displayName = DisplayNames.FloorPlanImages;
                break;
            }

            case CommunityUnitType.SpecHome:
            {
                displayName = DisplayNames.SpecHomeImages;
                break;
            }

            case CommunityUnitType.House:
            {
                displayName = DisplayNames.HouseImages;
                break;
            }

            default:
            {
                displayName = string.Empty;
                break;
            }
            }
            return(displayName);
        }
Пример #2
0
        public List <Amenity> GetDefaultAmenities(CommunityUnitType unitType)
        {
            GetDefaultAmenitiesCommand getDefaultAmenitiesCommand = new GetDefaultAmenitiesCommand(unitType);

            getDefaultAmenitiesCommand.Execute();
            return(getDefaultAmenitiesCommand.CommandResult);
        }
        public static SpecHomeVm GetCommunityUnit(CommunityUnitType communityUnitType)
        {
            SpecHomeVm specHomeVm = new SpecHomeVm()
            {
                PriceRange     = new MeasureBoundaryVm <decimal, MoneyType>(),
                LivingSpace    = new MeasureBoundaryVm <int, LivingSpaceMeasure>(),
                Deposit        = new MeasureBoundaryVm <decimal, MoneyType>(),
                ApplicationFee = new MeasureBoundaryVm <decimal, MoneyType>(),
                PetDeposit     = new MeasureBoundaryVm <decimal, MoneyType>(),
                AvailableBedroomsFromQuantity  = MSLivingChoices.Bcs.Components.ItemTypeBc.Instance.GetBedrooms().ToSelectListItemList(),
                AvailableBedroomsToQuantity    = specHomeVm.AvailableBedroomsFromQuantity,
                AvailableBathroomsFromQuantity = MSLivingChoices.Bcs.Components.ItemTypeBc.Instance.GetBathrooms().ToSelectListItemList(),
                AvailableBathroomsToQuantity   = specHomeVm.AvailableBathroomsFromQuantity,
                CustomAmenities = new List <AmenityVm>()
                {
                    new AmenityVm()
                },
                DefaultAmenities = AmenityBc.Instance.GetDefaultAmenities(communityUnitType).ConvertAll <CheckBoxVm>((Amenity m) => new CheckBoxVm()
                {
                    Value = m.ClassId.ToString(),
                    Text  = m.Name
                }),
                Images = new ImageListVm(DisplayHelpers.GetDisplayNameForCommunityUnitImages(communityUnitType))
            };

            return(specHomeVm);
        }
 public GetDefaultAmenitiesCommand(CommunityUnitType unitType)
 {
     base.StoredProcedureName = AdminStoredProcedures.SpGetCommunityUnitAmenityType;
     this.ParameterName       = "@CommunityUnitClassId";
     this.SpParameter         = new int?(unitType);
     base.CacheKey            = CachedBaseCommand <List <Amenity> > .GetCacheKey(new string[] { base.StoredProcedureName, this.ParameterName, this.SpParameter.ToString() });
 }
 public GetDefaultAmenitiesCommand(CommunityUnitType unitType)
 {
     base.StoredProcedureName = AdminStoredProcedures.SpGetCommunityUnitAmenityType;
     ParameterName            = "@CommunityUnitClassId";
     SpParameter   = (int)unitType;
     base.CacheKey = CachedBaseCommand <List <Amenity> > .GetCacheKey(base.StoredProcedureName, ParameterName, SpParameter.ToString());
 }
Пример #6
0
        public static Tuple <List <FloorPlan>, List <SpecHome>, List <House> > GetCommunityUnits(this SqlDataReader reader)
        {
            List <KeyValuePair <long, CommunityUnitType> > communityUnitIdsAndTypes = new List <KeyValuePair <long, CommunityUnitType> >();
            List <FloorPlan> floorPlans = new List <FloorPlan>();
            List <SpecHome>  specHomes  = new List <SpecHome>();
            List <House>     houses     = new List <House>();
            Tuple <List <FloorPlan>, List <SpecHome>, List <House> > tuple = new Tuple <List <FloorPlan>, List <SpecHome>, List <House> >(floorPlans, specHomes, houses);

            while (reader.Read())
            {
                long key = (long)reader["CommunityUnitId"];
                CommunityUnitType value = (CommunityUnitType)reader["CommunityUnitClassId"];
                communityUnitIdsAndTypes.Add(new KeyValuePair <long, CommunityUnitType>(key, value));
            }
            foreach (KeyValuePair <long, CommunityUnitType> item in
                     from x in communityUnitIdsAndTypes
                     where x.Value == CommunityUnitType.FloorPlan
                     select x)
            {
                GetFloorPlanCommand command = new GetFloorPlanCommand(item.Key);
                command.Execute();
                floorPlans.Add(command.CommandResult);
            }
            foreach (KeyValuePair <long, CommunityUnitType> item in
                     from x in communityUnitIdsAndTypes
                     where x.Value == CommunityUnitType.SpecHome
                     select x)
            {
                GetSpecHomeCommand command = new GetSpecHomeCommand(item.Key);
                command.Execute();
                specHomes.Add(command.CommandResult);
            }
            foreach (KeyValuePair <long, CommunityUnitType> item in
                     from x in communityUnitIdsAndTypes
                     where x.Value == CommunityUnitType.House
                     select x)
            {
                GetHouseCommand command = new GetHouseCommand(item.Key);
                command.Execute();
                houses.Add(command.CommandResult);
            }
            return(tuple);
        }
Пример #7
0
 public List <Amenity> GetDefaultAmenities(CommunityUnitType unitType)
 {
     return(this._amenityDac.GetDefaultAmenities(unitType));
 }
Пример #8
0
 public SaveDefaultAmenities(CommunityUnitType communityUnitType, List <Amenity> amenities) : this(amenities, null, new CommunityUnitType?(communityUnitType))
 {
 }
Пример #9
0
 public void SaveDefaultCommunityUnitAmenities(CommunityUnitType communityUnitType, List <Amenity> amenities)
 {
     this._itemTypeDac.SaveDefaultCommunityUnitAmenities(communityUnitType, amenities);
 }
Пример #10
0
 public void SaveDefaultCommunityUnitAmenities(CommunityUnitType communityUnitType, List <Amenity> amenities)
 {
     (new SaveDefaultAmenities(communityUnitType, amenities)).Execute();
 }