Exemplo n.º 1
0
        internal static FloorPlanVm MapToFloorPlanVm(this FloorPlan floorPlan)
        {
            FloorPlanVm floorPlanVm = new FloorPlanVm();
            List <KeyValuePair <int, string> > bedrooms  = MSLivingChoices.Bcs.Components.ItemTypeBc.Instance.GetBedrooms();
            List <KeyValuePair <int, string> > bathrooms = MSLivingChoices.Bcs.Components.ItemTypeBc.Instance.GetBathrooms();
            List <Amenity> defaultAmenities = AmenityBc.Instance.GetDefaultAmenities(CommunityUnitType.FloorPlan);

            floorPlanVm.Id            = floorPlan.Id;
            floorPlanVm.Name          = floorPlan.Name;
            floorPlanVm.BedroomFromId = floorPlan.BedroomFromId;
            floorPlanVm.BedroomToId   = floorPlan.BedroomToId;
            floorPlanVm.AvailableBedroomsFromQuantity = bedrooms.ToSelectListItemList(floorPlan.BedroomFromId);
            floorPlanVm.AvailableBedroomsToQuantity   = bedrooms.ToSelectListItemList(floorPlan.BedroomToId);
            floorPlanVm.BathroomFromId = floorPlan.BathroomFromId;
            floorPlanVm.BathroomToId   = floorPlan.BathroomToId;
            floorPlanVm.AvailableBathroomsFromQuantity = bathrooms.ToSelectListItemList(floorPlan.BathroomFromId);
            floorPlanVm.AvailableBathroomsToQuantity   = bathrooms.ToSelectListItemList(floorPlan.BathroomToId);
            floorPlanVm.PriceRange       = floorPlan.PriceRange.MapToMeasureBoundaryVm <decimal, MoneyType>();
            floorPlanVm.Deposit          = floorPlan.Deposit.MapToMeasureBoundaryVm <decimal, MoneyType>();
            floorPlanVm.PetDeposit       = floorPlan.PetDeposit.MapToMeasureBoundaryVm <decimal, MoneyType>();
            floorPlanVm.ApplicationFee   = floorPlan.ApplicationFee.MapToMeasureBoundaryVm <decimal, MoneyType>();
            floorPlanVm.LivingSpace      = floorPlan.LivingSpace.MapToMeasureBoundaryVm <int, LivingSpaceMeasure>();
            floorPlanVm.DefaultAmenities = floorPlan.Amenities.MapToCheckBoxVmList(defaultAmenities);
            floorPlanVm.CustomAmenities  = floorPlan.Amenities.MapToAmenityVmList(defaultAmenities);
            floorPlanVm.Images           = floorPlan.Images.MapToImageListVm(DisplayNames.FloorPlanImages);
            return(floorPlanVm);
        }
        internal static FloorPlanVm MapToFloorPlanVm(this FloorPlan floorPlan)
        {
            FloorPlanVm floorPlanQuickViewVm = floorPlan.MapToFloorPlanQuickViewVm(new FloorPlanVm()) as FloorPlanVm;

            if (floorPlanQuickViewVm != null)
            {
                floorPlanQuickViewVm.Deposit        = floorPlan.Deposit.PriceCaption();
                floorPlanQuickViewVm.ApplicationFee = floorPlan.ApplicationFee.PriceCaption();
                floorPlanQuickViewVm.PetDeposit     = floorPlan.PetDeposit.PriceCaption();
                floorPlanQuickViewVm.Amenities      = floorPlan.Amenities;
            }
            return(floorPlanQuickViewVm);
        }