Index: VerpakkingsDefinitie/ApplicationContext.pas =================================================================== diff -u -r597 -r598 --- VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 597) +++ VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 598) @@ -135,12 +135,12 @@ FCutOrder: Integer; FVolumeVanCaption: string; - FBreedte: Integer; - FDefaultBreedte: Integer; - FDiepte: Integer; - FDefaultDiepte: Integer; - FHoogte: Integer; - FDefaultHoogte: Integer; + FBreedte: string; + FDefaultBreedte: string; + FDiepte: string; + FDefaultDiepte: string; + FHoogte: string; + FDefaultHoogte: string; FAantal: string; FMaxCombinAantal: string; FPlaatsing: string; @@ -162,19 +162,26 @@ FMetaCaption: string; function GetMetaCaptionDisplay(): string; + function GetBreedteDisplay: string; + function GetDiepteDisplay: string; + function GetHoogteDisplay: string; + function GetParametersLijst: TReadOnlyList; public property RawData: TObject read FRawData write FRawData; property ID: string read FID write FID; property CutOrder: Integer read FCutOrder write FCutOrder; property VolumeVanCaption: string read FVolumeVanCaption write FVolumeVanCaption; - property Breedte: Integer read FBreedte write FBreedte; - property DefaultBreedte: Integer read FDefaultBreedte write FDefaultBreedte; - property Diepte: Integer read FDiepte write FDiepte; - property DefaultDiepte: Integer read FDefaultDiepte write FDefaultDiepte; - property Hoogte: Integer read FHoogte write FHoogte; - property DefaultHoogte: Integer read FDefaultHoogte write FDefaultHoogte; + property BreedteDisplay: string read GetBreedteDisplay; + property Breedte: string read FBreedte write FBreedte; + property DefaultBreedte: string read FDefaultBreedte write FDefaultBreedte; + property DiepteDisplay: string read GetDiepteDisplay; + property Diepte: string read FDiepte write FDiepte; + property DefaultDiepte: string read FDefaultDiepte write FDefaultDiepte; + property HoogteDisplay: string read GetHoogteDisplay; + property Hoogte: string read FHoogte write FHoogte; + property DefaultHoogte: string read FDefaultHoogte write FDefaultHoogte; property Aantal: string read FAantal write FAantal; property MaxCombinAantal: string read FMaxCombinAantal write FMaxCombinAantal; property Plaatsing: string read FPlaatsing write FPlaatsing; @@ -187,8 +194,8 @@ property Richtingen: TList read FRichtingen; property DefaultRichtingen: TList read FDefaultRichtingen; - property Parameters: TList read FParameters; - { TODO : Immutable list } + property Parameters: TReadOnlyList read GetParametersLijst; + procedure SetParameters(Collection: TEnumerable); property DeelVanID: string read FDeelVanID write FDeelVanID; property DeelVanCaption: string read FDeelVanCaption write FDeelVanCaption; @@ -447,6 +454,47 @@ Result := ''; end; +function TProductVerpakking.GetBreedteDisplay: string; +begin + if FBreedte <> '' then + Result := FBreedte + else if FDefaultBreedte <> '' then + Result := FDefaultBreedte + else + Result := '0'; +end; + +function TProductVerpakking.GetDiepteDisplay: string; +begin + if FDiepte <> '' then + Result := FDiepte + else if FDefaultDiepte <> '' then + Result := FDefaultDiepte + else + Result := '0'; +end; + +function TProductVerpakking.GetHoogteDisplay: string; +begin + if FHoogte <> '' then + Result := FHoogte + else if FDefaultHoogte <> '' then + Result := FDefaultHoogte + else + Result := '0'; +end; + +function TProductVerpakking.GetParametersLijst: TReadOnlyList; +begin + Result := TReadOnlyList.Create(FParameters); +end; + +procedure TProductVerpakking.SetParameters(Collection: TEnumerable); +begin + FParameters.Clear(); + FParameters.AddRange(Collection); +end; + // APPLICATION CONTEXT constructor TApplicationContext.Create(); begin