Index: VerpakkingsDefinitie/ApplicationContext.pas =================================================================== diff -u -r607 -r610 --- VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 607) +++ VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 610) @@ -12,21 +12,37 @@ // SUB CONTEXTS: klassen die overeenkomen met bepaalde sub-context (bv. alles gerelateerd met authenticatie). -// - User type + // Configs (uit INI bestand) + TConfigsContext = class + private + FIsProductieOmgeving: boolean; + // Productie + FSelectServerUrl: string; + FOptiServerUrl: string; + FUserServerUrl: string; + public + property IsProductieOmgeving: boolean read FIsProductieOmgeving write FIsProductieOmgeving; + property SelectServerUrl: string read FSelectServerUrl write FSelectServerUrl; + property OptiServerUrl: string read FOptiServerUrl write FOptiServerUrl; + property UserServerUrl: string read FUserServerUrl write FUserServerUrl; + end; + + // - User + TUserContext = class(TSubject) private FSessionKey: string; FGebruikersNaam: string; - FIsOK: Boolean; + FIsOK: boolean; FErrorMessage: string; FInternalErrorMessage: string; public procedure NotifyChanged(); property SessionKey: string read FSessionKey write FSessionKey; property GebruikersNaam: string read FGebruikersNaam write FGebruikersNaam; - property IsOK: Boolean read FIsOK write FIsOK; + property IsOK: boolean read FIsOK write FIsOK; property ErrorMessage: string read FErrorMessage write FErrorMessage; property InternalErrorMessage: string read FInternalErrorMessage write FInternalErrorMessage; end; @@ -43,7 +59,7 @@ FOptiTypeByKey: TDictionary; FOptiTypeByValue: TDictionary; - FIsOK: Boolean; + FIsOK: boolean; FErrorMessage: string; FInternalErrorMessage: string; public @@ -58,7 +74,7 @@ property OptiTypes: TDictionary read FOptiTypeByKey; property OptiTypesByValue: TDictionary read FOptiTypeByValue; - property IsOK: Boolean read FIsOK write FIsOK; + property IsOK: boolean read FIsOK write FIsOK; property ErrorMessage: string read FErrorMessage write FErrorMessage; property InternalErrorMessage: string read FInternalErrorMessage write FInternalErrorMessage; end; @@ -91,7 +107,7 @@ FProducten: TList; FGeselecteerdProduct: TProductInformatie; - FIsOK: Boolean; + FIsOK: boolean; FErrorMessage: string; FInternalErrorMessage: string; @@ -100,13 +116,13 @@ public constructor Create(); procedure NotifyChanged(); - procedure Reset(Notify: Boolean = True); + procedure Reset(Notify: boolean = True); property Producten: TReadOnlyList read GetProductenLijst; procedure SetProducten(Collection: TEnumerable); property GeselecteerdProduct: TProductInformatie read FGeselecteerdProduct write SetGeselecteerdProduct; - property IsOK: Boolean read FIsOK write FIsOK; + property IsOK: boolean read FIsOK write FIsOK; property ErrorMessage: string read FErrorMessage write FErrorMessage; property InternalErrorMessage: string read FInternalErrorMessage write FInternalErrorMessage; end; @@ -216,7 +232,7 @@ property Parameters: TReadOnlyList read GetParametersLijst; procedure SetParameters(Collection: TEnumerable); - function Equals(Obj: TObject): Boolean; override; + function Equals(Obj: TObject): boolean; override; constructor Create(); end; @@ -225,7 +241,7 @@ FProductVerpakkingen: TList; FGeselecteerdeVerpakking: TProductVerpakking; - FIsOK: Boolean; + FIsOK: boolean; FErrorMessage: string; FInternalErrorMessage: string; @@ -234,7 +250,7 @@ public constructor Create(); procedure NotifyChanged(); - procedure Reset(Notify: Boolean = True); + procedure Reset(Notify: boolean = True); property ProductVerpakkingen: TReadOnlyList read GetProductVerpakkingenLijst; procedure SetProductVerpakkingen(Collection: TEnumerable); @@ -243,7 +259,7 @@ function GetDeelVanOpties(ProductVerpakking: TProductVerpakking): TReadOnlyList; property GeselecteerdeVerpakking: TProductVerpakking read FGeselecteerdeVerpakking write SetGeselecteerdeVerpakking; - property IsOK: Boolean read FIsOK write FIsOK; + property IsOK: boolean read FIsOK write FIsOK; property ErrorMessage: string read FErrorMessage write FErrorMessage; property InternalErrorMessage: string read FInternalErrorMessage write FInternalErrorMessage; end; @@ -265,7 +281,7 @@ FProductGroepen: TList; FMetas: TList; - FIsOK: Boolean; + FIsOK: boolean; FErrorMessage: string; FInternalErrorMessage: string; @@ -278,7 +294,7 @@ property Metas: TReadOnlyList read GetProductMetas; procedure SetMetas(Collection: TEnumerable); - property IsOK: Boolean read FIsOK write FIsOK; + property IsOK: boolean read FIsOK write FIsOK; property ErrorMessage: string read FErrorMessage write FErrorMessage; property InternalErrorMessage: string read FInternalErrorMessage write FInternalErrorMessage; end; @@ -287,13 +303,15 @@ // Application context bevat alle sub-contexts TApplicationContext = class private + FConfigsContext: TConfigsContext; FUserContext: TUserContext; FUiInstellingenContext: TUiInstellingenContext; FProductsContext: TProductsContext; FProductDetailContext: TProductVerpakkingenContext; FProductVerpakkingMetaContext: TProductVerpakkingMetaContext; public constructor Create(); + property ConfigsContext: TConfigsContext read FConfigsContext write FConfigsContext; property UserContext: TUserContext read FUserContext write FUserContext; property UiInstellingenContext: TUiInstellingenContext read FUiInstellingenContext write FUiInstellingenContext; property ProductsContext: TProductsContext read FProductsContext write FProductsContext; @@ -360,7 +378,7 @@ end; // Enkel updaten wanneer nog niet op nil stond. -procedure TProductsContext.Reset(Notify: Boolean = True); +procedure TProductsContext.Reset(Notify: boolean = True); begin if (GeselecteerdProduct <> nil) or (FProducten.Count > 0) then begin @@ -418,7 +436,7 @@ self.Change(); end; -procedure TProductVerpakkingenContext.Reset(Notify: Boolean = True); +procedure TProductVerpakkingenContext.Reset(Notify: boolean = True); begin if (FGeselecteerdeVerpakking <> nil) or (FProductVerpakkingen.Count > 0) then begin @@ -504,7 +522,7 @@ FParameters := TList.Create(); end; -function TProductVerpakking.Equals(Obj: TObject): Boolean; +function TProductVerpakking.Equals(Obj: TObject): boolean; begin if Obj = nil then Result := False @@ -606,6 +624,7 @@ // APPLICATION CONTEXT constructor TApplicationContext.Create(); begin + FConfigsContext := TConfigsContext.Create(); FUserContext := TUserContext.Create(); FUiInstellingenContext := TUiInstellingenContext.Create(); FProductsContext := TProductsContext.Create();