diff --git a/Source/ApplicationBase/ApplicationBase.dpk b/Source/ApplicationBase/ApplicationBase.dpk
index d93f8ee5..e90d3289 100644
Binary files a/Source/ApplicationBase/ApplicationBase.dpk and b/Source/ApplicationBase/ApplicationBase.dpk differ
diff --git a/Source/ApplicationBase/ApplicationBase.dproj b/Source/ApplicationBase/ApplicationBase.dproj
index ded35f7d..8dff930d 100644
--- a/Source/ApplicationBase/ApplicationBase.dproj
+++ b/Source/ApplicationBase/ApplicationBase.dproj
@@ -53,13 +53,89 @@
- VCL for the Web Design Package for CodeGear RAD Studio
- CodeGear WebSnap Components
- CodeGear SOAP Components
- Microsoft Office XP Sample Automation Server Wrapper Components
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RemObjects Data Abstract - SQLite Driver
Microsoft Office 2000 Sample Automation Server Wrapper Components
- CodeGear C++Builder Office 2000 Servers Package
- CodeGear C++Builder Office XP Servers Package
+ Microsoft Office XP Sample Automation Server Wrapper Components
ApplicationBase.dpkFalse
@@ -67,6 +143,35 @@
MainSource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TCustomView
+
+
+
+ TFrame
+
@@ -139,21 +244,7 @@
TCustomView
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Source/ApplicationBase/Configuracion/Controller/Views/uIViewConfiguracionBase.dcu b/Source/ApplicationBase/Configuracion/Controller/Views/uIViewConfiguracionBase.dcu
new file mode 100644
index 00000000..b8bf8b47
Binary files /dev/null and b/Source/ApplicationBase/Configuracion/Controller/Views/uIViewConfiguracionBase.dcu differ
diff --git a/Source/ApplicationBase/Configuracion/Controller/Views/uIViewConfiguracionBase.pas b/Source/ApplicationBase/Configuracion/Controller/Views/uIViewConfiguracionBase.pas
new file mode 100644
index 00000000..65ffcf8c
--- /dev/null
+++ b/Source/ApplicationBase/Configuracion/Controller/Views/uIViewConfiguracionBase.pas
@@ -0,0 +1,15 @@
+unit uIViewConfiguracionBase;
+
+interface
+
+type
+ IViewConfiguracionBase = interface
+ ['{E9716327-4819-4B1F-8D21-D7CE17D7E48F}']
+ procedure CargarValores;
+ procedure GuardarValores;
+ end;
+
+
+implementation
+
+end.
diff --git a/Source/ApplicationBase/Configuracion/Controller/uConfiguracionController.dcu b/Source/ApplicationBase/Configuracion/Controller/uConfiguracionController.dcu
new file mode 100644
index 00000000..b089e34c
Binary files /dev/null and b/Source/ApplicationBase/Configuracion/Controller/uConfiguracionController.dcu differ
diff --git a/Source/ApplicationBase/Configuracion/Controller/uConfiguracionController.pas b/Source/ApplicationBase/Configuracion/Controller/uConfiguracionController.pas
new file mode 100644
index 00000000..9d87b73b
--- /dev/null
+++ b/Source/ApplicationBase/Configuracion/Controller/uConfiguracionController.pas
@@ -0,0 +1,180 @@
+unit uConfiguracionController;
+
+interface
+
+uses
+ Classes, SysUtils, uDADataTable, uControllerBase, uIViewConfiguracionBase,
+ uViewConfiguracionBase, uClassRegistryUtils, JvAppXMLStorage;
+
+type
+ IPluginConfigurable = interface
+ ['{30063608-BFD2-47B9-80FA-F10A5067AF82}']
+ function GetVistaConfiguracion : TClass;
+ function GetEtiquetaConfiguracion : String;
+ end;
+
+ IConfiguracionController = interface(IObservador)
+ ['{F29215BA-0D34-4AE9-B9A9-C80ABF49A81D}']
+ procedure ConfigurarAplicacion;
+ procedure SalvarConfiguracion;
+ procedure CargarConfiguracion;
+
+ function GetSettingAsString(const ASettingName: String; const ADefaultValue : String = ''): String;
+ function GetSettingAsInteger(const ASettingName: String; const ADefaultValue : Integer = 0): Integer;
+ function GetSettingAsFloat(const ASettingName: String; const ADefaultValue : Float = 0): Float;
+ function GetSettingAsBoolean(const ASettingName: String; const ADefaultValue : Boolean = False): Boolean;
+
+ procedure SetSettingAsString(const ASettingName: String; AValue : String);
+ procedure SetSettingAsInteger(const ASettingName: String; AValue : Integer);
+ procedure SetSettingAsFloat(const ASettingName: String; AValue : Float);
+ procedure SetSettingAsBoolean(const ASettingName: String; AValue : Boolean);
+ end;
+
+ TConfiguracionController = class(TObservador, IConfiguracionController)
+ private
+ FAppXMLFileStorage : TJvAppXMLFileStorage;
+ public
+ procedure SalvarConfiguracion;
+ procedure CargarConfiguracion;
+ procedure ConfigurarAplicacion;
+
+ function GetSettingAsString(const ASettingName: String; const ADefaultValue : String = ''): String;
+ function GetSettingAsInteger(const ASettingName: String; const ADefaultValue : Integer = 0): Integer;
+ function GetSettingAsFloat(const ASettingName: String; const ADefaultValue : Float = 0): Float;
+ function GetSettingAsBoolean(const ASettingName: String; const ADefaultValue : Boolean = False): Boolean;
+
+ procedure SetSettingAsString(const ASettingName: String; AValue : String);
+ procedure SetSettingAsInteger(const ASettingName: String; AValue : Integer);
+ procedure SetSettingAsFloat(const ASettingName: String; AValue : Float);
+ procedure SetSettingAsBoolean(const ASettingName: String; AValue : Boolean);
+
+ constructor Create; override;
+ destructor Destroy; override;
+ end;
+
+implementation
+
+uses
+ Forms, uEditorConfiguracion, uViewConfiguracionGeneral,
+ JvAppStorage, uAppInfoUtils, Controls, uViewConfiguracionRegistryUtils;
+
+const
+ CONFIG_INI_FILE = 'config.xml';
+
+{ TGestorConfiguracion }
+
+procedure TConfiguracionController.CargarConfiguracion;
+begin
+ FAppXMLFileStorage.Reload;
+end;
+
+procedure TConfiguracionController.ConfigurarAplicacion;
+var
+ i: Integer;
+ AViewList : TStringList;
+ AEditor : TfConfiguracionEditor;
+ AView : TfrViewConfiguracionBase;
+ AEtiqueta : String;
+begin
+ AViewList := TStringList.Create;
+ try
+ ViewConfiguracionRegistry.GetRegisteredClasses(AViewList);
+ AEditor := TfConfiguracionEditor.Create(NIL);
+ try
+ for i := 0 to AViewList.Count - 1 do
+ begin
+ AEtiqueta := AViewList[i];
+ AView := TfrViewConfiguracionBase(ViewConfiguracionRegistry.CreateView(AEtiqueta, AEditor));
+ AEditor.AnadirVista(AView, AEtiqueta);
+ end;
+
+ AEditor.CargarValores;
+ if (AEditor.ShowModal = mrOK) then
+ AEditor.GuardarValores;
+
+ finally
+ FreeANDNIL(AEditor)
+ end;
+ finally
+ FreeANDNIL(AViewList)
+ end;
+end;
+
+constructor TConfiguracionController.Create;
+begin
+ inherited;
+ FAppXMLFileStorage := TJvAppXMLFileStorage.Create(NIL);
+ with FAppXMLFileStorage do
+ begin
+ StorageOptions.BooleanStringTrueValues := 'TRUE, YES, Y';
+ StorageOptions.BooleanStringFalseValues := 'FALSE, NO, N';
+ StorageOptions.InvalidCharReplacement := '_';
+ Location := flUserFolder;
+ RootNodeName := 'Configuration';
+ FileName := 'Rodax Software' + PathDelim + GetAppName + PathDelim + CONFIG_INI_FILE;
+ end;
+
+ ViewConfiguracionRegistry.RegisterClass(TfrViewConfiguracionGeneral, 'General');
+end;
+
+destructor TConfiguracionController.Destroy;
+begin
+ FreeANDNIL(FAppXMLFileStorage);
+ inherited;
+end;
+
+function TConfiguracionController.GetSettingAsBoolean(
+ const ASettingName: String; const ADefaultValue: Boolean): Boolean;
+begin
+ Result := FAppXMLFileStorage.ReadBoolean(ASettingName, ADefaultValue)
+end;
+
+function TConfiguracionController.GetSettingAsFloat(const ASettingName: String;
+ const ADefaultValue: Float): Float;
+begin
+ Result := FAppXMLFileStorage.ReadFloat(ASettingName, ADefaultValue);
+end;
+
+function TConfiguracionController.GetSettingAsInteger(
+ const ASettingName: String; const ADefaultValue: Integer): Integer;
+begin
+ Result := FAppXMLFileStorage.ReadInteger(ASettingName, ADefaultValue);
+end;
+
+function TConfiguracionController.GetSettingAsString(const ASettingName,
+ ADefaultValue: String): String;
+begin
+ Result := FAppXMLFileStorage.ReadString(ASettingName, ADefaultValue);
+end;
+
+procedure TConfiguracionController.SalvarConfiguracion;
+begin
+ FAppXMLFileStorage.Flush;
+end;
+
+procedure TConfiguracionController.SetSettingAsBoolean(
+ const ASettingName: String; AValue: Boolean);
+begin
+ FAppXMLFileStorage.WriteBoolean(ASettingName, AValue);
+end;
+
+procedure TConfiguracionController.SetSettingAsFloat(const ASettingName: String;
+ AValue: Float);
+begin
+ FAppXMLFileStorage.WriteFloat(ASettingName, AValue);
+end;
+
+procedure TConfiguracionController.SetSettingAsInteger(
+ const ASettingName: String; AValue: Integer);
+begin
+ FAppXMLFileStorage.WriteInteger(ASettingName, AValue);
+end;
+
+procedure TConfiguracionController.SetSettingAsString(
+ const ASettingName: String; AValue: String);
+begin
+ FAppXMLFileStorage.WriteString(ASettingName, AValue);
+end;
+
+
+end.
diff --git a/Source/ApplicationBase/Configuracion/Views/uEditorConfiguracion.dcu b/Source/ApplicationBase/Configuracion/Views/uEditorConfiguracion.dcu
new file mode 100644
index 00000000..e4572445
Binary files /dev/null and b/Source/ApplicationBase/Configuracion/Views/uEditorConfiguracion.dcu differ
diff --git a/Source/ApplicationBase/Configuracion/Views/uEditorConfiguracion.dfm b/Source/ApplicationBase/Configuracion/Views/uEditorConfiguracion.dfm
new file mode 100644
index 00000000..e24562a9
--- /dev/null
+++ b/Source/ApplicationBase/Configuracion/Views/uEditorConfiguracion.dfm
@@ -0,0 +1,92 @@
+object fConfiguracionEditor: TfConfiguracionEditor
+ Left = 0
+ Top = 0
+ Caption = 'Configuraci'#243'n de FactuGES'
+ ClientHeight = 524
+ ClientWidth = 635
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'Tahoma'
+ Font.Style = []
+ OldCreateOrder = False
+ Position = poMainFormCenter
+ OnCreate = FormCreate
+ OnDestroy = FormDestroy
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object dxNavBar: TdxNavBar
+ AlignWithMargins = True
+ Left = 8
+ Top = 8
+ Width = 150
+ Height = 466
+ Margins.Left = 8
+ Margins.Top = 8
+ Margins.Right = 4
+ Margins.Bottom = 8
+ Align = alLeft
+ ActiveGroupIndex = 0
+ TabOrder = 0
+ View = 17
+ ViewStyle.ColorSchemeName = 'Blue'
+ OptionsBehavior.SideBar.AllowSelectLinks = True
+ OptionsView.Common.ShowGroupCaptions = False
+ OptionsView.NavigationPane.ShowHeader = False
+ OptionsView.NavigationPane.ShowOverflowPanel = False
+ OnLinkClick = dxNavBarLinkClick
+ object GroupCategorias: TdxNavBarGroup
+ Caption = 'Categor'#237'as'
+ SelectedLinkIndex = -1
+ TopVisibleLinkIndex = 0
+ Links = <>
+ end
+ end
+ object Panel2: TPanel
+ Left = 0
+ Top = 482
+ Width = 635
+ Height = 42
+ Align = alBottom
+ BevelOuter = bvNone
+ TabOrder = 1
+ DesignSize = (
+ 635
+ 42)
+ object bCancelar: TButton
+ Left = 552
+ Top = 10
+ Width = 75
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = '&Cancelar'
+ ModalResult = 2
+ TabOrder = 0
+ end
+ object bAceptar: TButton
+ Left = 471
+ Top = 10
+ Width = 75
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = '&Aceptar'
+ ModalResult = 1
+ TabOrder = 1
+ end
+ end
+ object PageControlMain: TPageControl
+ AlignWithMargins = True
+ Left = 166
+ Top = 6
+ Width = 461
+ Height = 468
+ Margins.Left = 4
+ Margins.Top = 6
+ Margins.Right = 8
+ Margins.Bottom = 8
+ Align = alClient
+ TabOrder = 2
+ end
+end
diff --git a/Source/ApplicationBase/Configuracion/Views/uEditorConfiguracion.pas b/Source/ApplicationBase/Configuracion/Views/uEditorConfiguracion.pas
new file mode 100644
index 00000000..46ecdc13
--- /dev/null
+++ b/Source/ApplicationBase/Configuracion/Views/uEditorConfiguracion.pas
@@ -0,0 +1,112 @@
+unit uEditorConfiguracion;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+ Dialogs, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinCaramel, dxSkinCoffee,
+ dxSkinGlassOceans, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky,
+ dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMoneyTwins, dxSkinOffice2007Black,
+ dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
+ dxSkinOffice2007Silver, dxSkinSilver, dxSkinStardust, dxSkinsDefaultPainters,
+ dxSkinValentine, dxSkinXmas2008Blue, dxSkinsdxNavBar2Painter, StdCtrls,
+ ExtCtrls, cxControls, dxNavBar, dxNavBarCollns, cxClasses, dxNavBarBase,
+ ComCtrls, uViewConfiguracionBase;
+
+type
+ TfConfiguracionEditor = class(TForm)
+ dxNavBar: TdxNavBar;
+ Panel2: TPanel;
+ bCancelar: TButton;
+ bAceptar: TButton;
+ GroupCategorias: TdxNavBarGroup;
+ PageControlMain: TPageControl;
+ procedure dxNavBarLinkClick(Sender: TObject; ALink: TdxNavBarItemLink);
+ procedure FormShow(Sender: TObject);
+ procedure FormDestroy(Sender: TObject);
+ procedure FormCreate(Sender: TObject);
+ private
+ FListaVistas : TStringList;
+ public
+ procedure CargarValores;
+ procedure GuardarValores;
+ procedure AnadirVista(AVista : TfrViewConfiguracionBase; const AEtiqueta : String);
+ end;
+
+
+implementation
+
+{$R *.dfm}
+
+{ TfConfiguracionEditor }
+
+procedure TfConfiguracionEditor.AnadirVista(AVista: TfrViewConfiguracionBase;
+ const AEtiqueta: String);
+var
+ AItem : TdxNavBarItem;
+ ATab : TTabSheet;
+begin
+ if Assigned(AVista) then
+ begin
+ ATab := TTabSheet.Create(PageControlMain);
+ ATab.PageControl := PageControlMain;
+ ATab.TabVisible := False;
+
+ AVista.Parent := ATab;
+
+ AItem := dxNavBar.Items.Add;
+ AItem.Tag := ATab.PageIndex;
+ AItem.Caption := AEtiqueta;
+ AItem.Name := 'ItemName' + IntToStr(ATab.PageIndex);
+ dxNavBar.Groups.Items[0].CreateLink(AItem);
+
+ FListaVistas.AddObject(AEtiqueta, AVista);
+ end;
+end;
+
+procedure TfConfiguracionEditor.CargarValores;
+var
+ I: Integer;
+begin
+ for I := 0 to FListaVistas.Count - 1 do
+ TfrViewConfiguracionBase(FListaVistas.Objects[i]).CargarValores;
+end;
+
+procedure TfConfiguracionEditor.dxNavBarLinkClick(Sender: TObject;
+ ALink: TdxNavBarItemLink);
+var
+ APageIndex : Integer;
+begin
+ APageIndex := ALink.Item.Tag;
+ if (APageIndex > -1) and (APageIndex < PageControlMain.PageCount) then
+ PageControlMain.ActivePageIndex := APageIndex;
+end;
+
+procedure TfConfiguracionEditor.FormCreate(Sender: TObject);
+begin
+ FListaVistas := TStringList.Create;
+end;
+
+procedure TfConfiguracionEditor.FormDestroy(Sender: TObject);
+begin
+ FreeANDNIL(FListaVistas);
+end;
+
+procedure TfConfiguracionEditor.FormShow(Sender: TObject);
+begin
+ PageControlMain.ActivePageIndex := 0;
+ dxNavBar.Groups[0].Links[0].Selected := True;
+end;
+
+procedure TfConfiguracionEditor.GuardarValores;
+var
+ I: Integer;
+begin
+ for I := 0 to FListaVistas.Count - 1 do
+ TfrViewConfiguracionBase(FListaVistas.Objects[i]).GuardarValores;
+end;
+
+end.
+
+
+
diff --git a/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionBase.dcu b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionBase.dcu
new file mode 100644
index 00000000..decc0120
Binary files /dev/null and b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionBase.dcu differ
diff --git a/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionBase.dfm b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionBase.dfm
new file mode 100644
index 00000000..9bfef9a7
--- /dev/null
+++ b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionBase.dfm
@@ -0,0 +1,69 @@
+object frViewConfiguracionBase: TfrViewConfiguracionBase
+ Left = 0
+ Top = 0
+ Width = 451
+ Height = 304
+ Align = alClient
+ AutoScroll = True
+ TabOrder = 0
+ object Panel1: TPanel
+ AlignWithMargins = True
+ Left = 5
+ Top = 46
+ Width = 441
+ Height = 22
+ Margins.Left = 5
+ Margins.Top = 0
+ Margins.Right = 5
+ Margins.Bottom = 0
+ Align = alTop
+ Alignment = taLeftJustify
+ AutoSize = True
+ BevelInner = bvSpace
+ BevelOuter = bvNone
+ Color = clInactiveCaptionText
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clHotLight
+ Font.Height = -12
+ Font.Name = 'Tahoma'
+ Font.Style = [fsBold]
+ Padding.Left = 5
+ Padding.Top = 3
+ Padding.Right = 5
+ Padding.Bottom = 3
+ ParentBackground = False
+ ParentFont = False
+ TabOrder = 0
+ object Label3: TLabel
+ Left = 6
+ Top = 4
+ Width = 85
+ Height = 14
+ Align = alTop
+ Caption = 'Configuraci'#243'n'
+ end
+ end
+ object JvGradientHeaderPanel1: TJvGradientHeaderPanel
+ Left = 0
+ Top = 0
+ Width = 451
+ Height = 46
+ GradientStartColor = clInactiveCaptionText
+ GradientEndColor = clNone
+ GradientStyle = grVertical
+ LabelLeft = 20
+ LabelTop = 15
+ LabelCaption = 'Configuraci'#243'n general'
+ LabelFont.Charset = DEFAULT_CHARSET
+ LabelFont.Color = clMenuText
+ LabelFont.Height = -12
+ LabelFont.Name = 'Tahoma'
+ LabelFont.Style = []
+ LabelAlignment = taLeftJustify
+ Align = alTop
+ BevelInner = bvNone
+ BevelOuter = bvNone
+ DoubleBuffered = True
+ TabOrder = 1
+ end
+end
diff --git a/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionBase.pas b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionBase.pas
new file mode 100644
index 00000000..96d12228
--- /dev/null
+++ b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionBase.pas
@@ -0,0 +1,28 @@
+unit uViewConfiguracionBase;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+ Dialogs, ExtCtrls, StdCtrls, JvExControls, uIViewConfiguracionBase,
+ JvGradientHeaderPanel;
+
+type
+ TfrViewConfiguracionBase = class(TFrame, IViewConfiguracionBase)
+ Panel1: TPanel;
+ Label3: TLabel;
+ JvGradientHeaderPanel1: TJvGradientHeaderPanel;
+ public
+ class function GetViewClass : TClass; virtual; abstract;
+ class function DarEtiqueta : String; virtual; abstract;
+ procedure CargarValores; virtual; abstract;
+ procedure GuardarValores; virtual; abstract;
+ end;
+
+implementation
+
+{$R *.dfm}
+
+{ TfrViewConfiguracionBase }
+
+end.
diff --git a/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionGeneral.dcu b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionGeneral.dcu
new file mode 100644
index 00000000..7e005776
Binary files /dev/null and b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionGeneral.dcu differ
diff --git a/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionGeneral.dfm b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionGeneral.dfm
new file mode 100644
index 00000000..d6b850fd
--- /dev/null
+++ b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionGeneral.dfm
@@ -0,0 +1,211 @@
+inherited frViewConfiguracionGeneral: TfrViewConfiguracionGeneral
+ inherited Panel1: TPanel
+ inherited Label3: TLabel
+ Width = 429
+ Caption = 'Apariencia'
+ ExplicitWidth = 63
+ end
+ end
+ object Panel2: TPanel
+ AlignWithMargins = True
+ Left = 5
+ Top = 109
+ Width = 441
+ Height = 22
+ Margins.Left = 5
+ Margins.Top = 0
+ Margins.Right = 5
+ Margins.Bottom = 0
+ Align = alTop
+ Alignment = taLeftJustify
+ AutoSize = True
+ BevelInner = bvSpace
+ BevelOuter = bvNone
+ Color = clInactiveCaptionText
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clHotLight
+ Font.Height = -12
+ Font.Name = 'Tahoma'
+ Font.Style = [fsBold]
+ Padding.Left = 5
+ Padding.Top = 3
+ Padding.Right = 5
+ Padding.Bottom = 3
+ ParentBackground = False
+ ParentFont = False
+ TabOrder = 2
+ object Label2: TLabel
+ Left = 6
+ Top = 4
+ Width = 429
+ Height = 14
+ Align = alTop
+ Caption = 'Seguridad'
+ ExplicitWidth = 62
+ end
+ end
+ object Panel3: TPanel
+ AlignWithMargins = True
+ Left = 5
+ Top = 68
+ Width = 441
+ Height = 41
+ Margins.Left = 5
+ Margins.Top = 0
+ Margins.Right = 5
+ Margins.Bottom = 0
+ Align = alTop
+ BevelOuter = bvNone
+ ParentColor = True
+ TabOrder = 3
+ object Label1: TLabel
+ Left = 17
+ Top = 14
+ Width = 88
+ Height = 13
+ Caption = 'Esquema de color:'
+ end
+ object cbEsquemaColor: TComboBox
+ Left = 111
+ Top = 11
+ Width = 168
+ Height = 21
+ ItemHeight = 13
+ TabOrder = 0
+ Text = 'cbEsquemaColor'
+ end
+ end
+ object Panel4: TPanel
+ AlignWithMargins = True
+ Left = 5
+ Top = 131
+ Width = 441
+ Height = 72
+ Margins.Left = 5
+ Margins.Top = 0
+ Margins.Right = 5
+ Margins.Bottom = 0
+ Align = alTop
+ BevelOuter = bvNone
+ ParentColor = True
+ TabOrder = 4
+ object Label4: TLabel
+ Left = 17
+ Top = 43
+ Width = 237
+ Height = 13
+ Caption = 'N'#186' m'#225'ximo de intentos de inicio de sesi'#243'n fallidos:'
+ end
+ object CheckBox1: TCheckBox
+ Left = 17
+ Top = 12
+ Width = 336
+ Height = 17
+ Caption =
+ 'Recordar usuario y contrase'#241'a del '#250'ltimo inicio de sesi'#243'n v'#225'lido' +
+ '.'
+ TabOrder = 0
+ end
+ object edtNumIntentos: TcxSpinEdit
+ Left = 260
+ Top = 40
+ Properties.ImmediatePost = True
+ Properties.MaxValue = 10.000000000000000000
+ Style.LookAndFeel.Kind = lfStandard
+ Style.LookAndFeel.NativeStyle = True
+ StyleDisabled.LookAndFeel.Kind = lfStandard
+ StyleDisabled.LookAndFeel.NativeStyle = True
+ StyleFocused.LookAndFeel.Kind = lfStandard
+ StyleFocused.LookAndFeel.NativeStyle = True
+ StyleHot.LookAndFeel.Kind = lfStandard
+ StyleHot.LookAndFeel.NativeStyle = True
+ TabOrder = 1
+ Width = 45
+ end
+ end
+ object Panel5: TPanel
+ AlignWithMargins = True
+ Left = 5
+ Top = 203
+ Width = 441
+ Height = 22
+ Margins.Left = 5
+ Margins.Top = 0
+ Margins.Right = 5
+ Margins.Bottom = 0
+ Align = alTop
+ Alignment = taLeftJustify
+ AutoSize = True
+ BevelInner = bvSpace
+ BevelOuter = bvNone
+ Color = clInactiveCaptionText
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clHotLight
+ Font.Height = -12
+ Font.Name = 'Tahoma'
+ Font.Style = [fsBold]
+ Padding.Left = 5
+ Padding.Top = 3
+ Padding.Right = 5
+ Padding.Bottom = 3
+ ParentBackground = False
+ ParentFont = False
+ TabOrder = 5
+ object Label5: TLabel
+ Left = 6
+ Top = 4
+ Width = 429
+ Height = 14
+ Align = alTop
+ Caption = 'Usuarios'
+ ExplicitWidth = 51
+ end
+ end
+ object Panel6: TPanel
+ AlignWithMargins = True
+ Left = 5
+ Top = 225
+ Width = 441
+ Height = 72
+ Margins.Left = 5
+ Margins.Top = 0
+ Margins.Right = 5
+ Margins.Bottom = 0
+ Align = alTop
+ BevelOuter = bvNone
+ ParentColor = True
+ TabOrder = 6
+ ExplicitTop = 224
+ object lblLongMinPass: TLabel
+ Left = 17
+ Top = 43
+ Width = 163
+ Height = 13
+ Caption = 'Longitud m'#237'nima de la contrase'#241'a:'
+ end
+ object cbPassObligatoria: TCheckBox
+ Left = 17
+ Top = 12
+ Width = 262
+ Height = 17
+ Caption = 'Contrase'#241'a obligatoria para los usuarios'
+ TabOrder = 0
+ end
+ object edtLongMinPass: TcxSpinEdit
+ Left = 186
+ Top = 40
+ Properties.ImmediatePost = True
+ Properties.MaxValue = 10.000000000000000000
+ Style.LookAndFeel.Kind = lfStandard
+ Style.LookAndFeel.NativeStyle = True
+ StyleDisabled.LookAndFeel.Kind = lfStandard
+ StyleDisabled.LookAndFeel.NativeStyle = True
+ StyleFocused.LookAndFeel.Kind = lfStandard
+ StyleFocused.LookAndFeel.NativeStyle = True
+ StyleHot.LookAndFeel.Kind = lfStandard
+ StyleHot.LookAndFeel.NativeStyle = True
+ TabOrder = 1
+ Width = 45
+ end
+ end
+end
diff --git a/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionGeneral.pas b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionGeneral.pas
new file mode 100644
index 00000000..a591196e
--- /dev/null
+++ b/Source/ApplicationBase/Configuracion/Views/uViewConfiguracionGeneral.pas
@@ -0,0 +1,77 @@
+unit uViewConfiguracionGeneral;
+
+interface
+
+uses
+ Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+ Dialogs, uViewConfiguracionBase, StdCtrls, ExtCtrls, dxGDIPlusClasses,
+ JvExControls, JvGradientHeaderPanel, Mask, dxSkinsCore, dxSkinBlack,
+ dxSkinBlue, dxSkinCaramel, dxSkinCoffee, dxSkinGlassOceans, dxSkiniMaginary,
+ dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin,
+ dxSkinMoneyTwins, dxSkinOffice2007Black, dxSkinOffice2007Blue,
+ dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver,
+ dxSkinSilver, dxSkinStardust, dxSkinsDefaultPainters, dxSkinValentine,
+ dxSkinXmas2008Blue, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
+ cxSpinEdit;
+
+type
+ TfrViewConfiguracionGeneral = class(TfrViewConfiguracionBase)
+ cbEsquemaColor: TComboBox;
+ Label1: TLabel;
+ Panel2: TPanel;
+ Label2: TLabel;
+ Panel3: TPanel;
+ Panel4: TPanel;
+ Label4: TLabel;
+ CheckBox1: TCheckBox;
+ edtNumIntentos: TcxSpinEdit;
+ Panel5: TPanel;
+ Label5: TLabel;
+ Panel6: TPanel;
+ lblLongMinPass: TLabel;
+ cbPassObligatoria: TCheckBox;
+ edtLongMinPass: TcxSpinEdit;
+ private
+ { Private declarations }
+ public
+ class function GetViewClass : TClass; override;
+ class function DarEtiqueta : String; override;
+ procedure CargarValores; override;
+ procedure GuardarValores; override;
+ end;
+
+implementation
+
+uses uFactuGES_App;
+
+{$R *.dfm}
+
+{ TfrViewConfiguracionGeneral }
+
+procedure TfrViewConfiguracionGeneral.CargarValores;
+begin
+ inherited;
+ edtLongMinPass.Text := AppFactuGES.Configuracion.GetSettingAsString('MinPasswordLength', '3');
+ edtNumIntentos.Text := AppFactuGES.Configuracion.GetSettingAsString('MaxLoginAttempts', '3');
+ cbPassObligatoria.Checked := AppFactuGES.Configuracion.GetSettingAsBoolean('ForcePassword', True);
+end;
+
+class function TfrViewConfiguracionGeneral.DarEtiqueta: String;
+begin
+ Result := 'General';
+end;
+
+class function TfrViewConfiguracionGeneral.GetViewClass: TClass;
+begin
+ Result := TfrViewConfiguracionGeneral;
+end;
+
+procedure TfrViewConfiguracionGeneral.GuardarValores;
+begin
+ inherited;
+ AppFactuGES.Configuracion.SetSettingAsString('MinPasswordLength', edtLongMinPass.Text);
+ AppFactuGES.Configuracion.SetSettingAsString('MaxLoginAttempts', edtNumIntentos.Text);
+ AppFactuGES.Configuracion.SetSettingAsBoolean('ForcePassword', cbPassObligatoria.Checked);
+end;
+
+end.
diff --git a/Source/ApplicationBase/Ejercicios/Controller/uEjerciciosController.pas b/Source/ApplicationBase/Ejercicios/Controller/uEjerciciosController.pas
index 1d9c7d05..46c3d59b 100644
--- a/Source/ApplicationBase/Ejercicios/Controller/uEjerciciosController.pas
+++ b/Source/ApplicationBase/Ejercicios/Controller/uEjerciciosController.pas
@@ -2,10 +2,10 @@ unit uEjerciciosController;
interface
-
uses
Classes, SysUtils, uDADataTable, uControllerBase,
uBizEjercicios, uIDataModuleEjercicios;
+
type
IEjerciciosController = interface(IObservador)
['{94E5F2B6-64C8-4331-B9CB-3ED730478529}']
diff --git a/Source/ApplicationBase/Ejercicios/Model/schEjerciciosClient_Intf.pas b/Source/ApplicationBase/Ejercicios/Model/schEjerciciosClient_Intf.pas
index 7d0f4e26..d6a187e6 100644
--- a/Source/ApplicationBase/Ejercicios/Model/schEjerciciosClient_Intf.pas
+++ b/Source/ApplicationBase/Ejercicios/Model/schEjerciciosClient_Intf.pas
@@ -9,11 +9,19 @@ const
{ Data table rules ids
Feel free to change them to something more human readable
but make sure they are unique in the context of your application }
- RID_Ejercicios = '{773C8468-2B44-4968-A704-E0A34C02F5CA}';
+ RID_darEjercicioActivo = '{68559186-9ED1-4884-8DF9-41250D6FE517}';
+ RID_Ejercicios = '{DF458DDE-C3C4-4996-8F9D-48C58CA8BC14}';
{ Data table names }
+ nme_darEjercicioActivo = 'darEjercicioActivo';
nme_Ejercicios = 'Ejercicios';
+ { darEjercicioActivo fields }
+ fld_darEjercicioActivoID = 'ID';
+
+ { darEjercicioActivo field indexes }
+ idx_darEjercicioActivoID = 0;
+
{ Ejercicios fields }
fld_EjerciciosID = 'ID';
fld_EjerciciosID_EMPRESA = 'ID_EMPRESA';
@@ -41,9 +49,44 @@ const
idx_EjerciciosACTIVO = 10;
type
+ { IdarEjercicioActivo }
+ IdarEjercicioActivo = interface(IDAStronglyTypedDataTable)
+ ['{2A3446B7-E843-4491-ABAD-53295D49F75E}']
+ { Property getters and setters }
+ function GetIDValue: Integer;
+ procedure SetIDValue(const aValue: Integer);
+ function GetIDIsNull: Boolean;
+ procedure SetIDIsNull(const aValue: Boolean);
+
+
+ { Properties }
+ property ID: Integer read GetIDValue write SetIDValue;
+ property IDIsNull: Boolean read GetIDIsNull write SetIDIsNull;
+ end;
+
+ { TdarEjercicioActivoDataTableRules }
+ TdarEjercicioActivoDataTableRules = class(TIntfObjectDADataTableRules, IdarEjercicioActivo)
+ private
+ protected
+ { Property getters and setters }
+ function GetIDValue: Integer; virtual;
+ procedure SetIDValue(const aValue: Integer); virtual;
+ function GetIDIsNull: Boolean; virtual;
+ procedure SetIDIsNull(const aValue: Boolean); virtual;
+
+ { Properties }
+ property ID: Integer read GetIDValue write SetIDValue;
+ property IDIsNull: Boolean read GetIDIsNull write SetIDIsNull;
+
+ public
+ constructor Create(aDataTable: TDADataTable); override;
+ destructor Destroy; override;
+
+ end;
+
{ IEjercicios }
IEjercicios = interface(IDAStronglyTypedDataTable)
- ['{911EC4DB-1692-4398-AAA2-3127E0B1239C}']
+ ['{C260D056-8242-4264-BE09-82A833A7EABF}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -200,6 +243,39 @@ implementation
uses Variants, uROBinaryHelpers;
+{ TdarEjercicioActivoDataTableRules }
+constructor TdarEjercicioActivoDataTableRules.Create(aDataTable: TDADataTable);
+begin
+ inherited;
+end;
+
+destructor TdarEjercicioActivoDataTableRules.Destroy;
+begin
+ inherited;
+end;
+
+function TdarEjercicioActivoDataTableRules.GetIDValue: Integer;
+begin
+ result := DataTable.Fields[idx_darEjercicioActivoID].AsInteger;
+end;
+
+procedure TdarEjercicioActivoDataTableRules.SetIDValue(const aValue: Integer);
+begin
+ DataTable.Fields[idx_darEjercicioActivoID].AsInteger := aValue;
+end;
+
+function TdarEjercicioActivoDataTableRules.GetIDIsNull: boolean;
+begin
+ result := DataTable.Fields[idx_darEjercicioActivoID].IsNull;
+end;
+
+procedure TdarEjercicioActivoDataTableRules.SetIDIsNull(const aValue: Boolean);
+begin
+ if aValue then
+ DataTable.Fields[idx_darEjercicioActivoID].AsVariant := Null;
+end;
+
+
{ TEjerciciosDataTableRules }
constructor TEjerciciosDataTableRules.Create(aDataTable: TDADataTable);
begin
@@ -444,6 +520,7 @@ end;
initialization
+ RegisterDataTableRules(RID_darEjercicioActivo, TdarEjercicioActivoDataTableRules);
RegisterDataTableRules(RID_Ejercicios, TEjerciciosDataTableRules);
end.
diff --git a/Source/ApplicationBase/Ejercicios/Model/schEjerciciosServer_Intf.pas b/Source/ApplicationBase/Ejercicios/Model/schEjerciciosServer_Intf.pas
index 4cd11fe6..2d5ca818 100644
--- a/Source/ApplicationBase/Ejercicios/Model/schEjerciciosServer_Intf.pas
+++ b/Source/ApplicationBase/Ejercicios/Model/schEjerciciosServer_Intf.pas
@@ -9,12 +9,47 @@ const
{ Delta rules ids
Feel free to change them to something more human readable
but make sure they are unique in the context of your application }
- RID_EjerciciosDelta = '{CDD1664B-E7FC-4A22-B77D-7FE7419A3314}';
+ RID_darEjercicioActivoDelta = '{92BF2686-F344-464C-A6B2-AC5B79B3A840}';
+ RID_EjerciciosDelta = '{8F263DB9-3ECD-4F2F-B263-867262A0AEA2}';
type
+ { IdarEjercicioActivoDelta }
+ IdarEjercicioActivoDelta = interface(IdarEjercicioActivo)
+ ['{92BF2686-F344-464C-A6B2-AC5B79B3A840}']
+ { Property getters and setters }
+ function GetOldIDValue : Integer;
+
+ { Properties }
+ property OldID : Integer read GetOldIDValue;
+ end;
+
+ { TdarEjercicioActivoBusinessProcessorRules }
+ TdarEjercicioActivoBusinessProcessorRules = class(TDABusinessProcessorRules, IdarEjercicioActivo, IdarEjercicioActivoDelta)
+ private
+ protected
+ { Property getters and setters }
+ function GetIDValue: Integer; virtual;
+ function GetIDIsNull: Boolean; virtual;
+ function GetOldIDValue: Integer; virtual;
+ function GetOldIDIsNull: Boolean; virtual;
+ procedure SetIDValue(const aValue: Integer); virtual;
+ procedure SetIDIsNull(const aValue: Boolean); virtual;
+
+ { Properties }
+ property ID : Integer read GetIDValue write SetIDValue;
+ property IDIsNull : Boolean read GetIDIsNull write SetIDIsNull;
+ property OldID : Integer read GetOldIDValue;
+ property OldIDIsNull : Boolean read GetOldIDIsNull;
+
+ public
+ constructor Create(aBusinessProcessor: TDABusinessProcessor); override;
+ destructor Destroy; override;
+
+ end;
+
{ IEjerciciosDelta }
IEjerciciosDelta = interface(IEjercicios)
- ['{CDD1664B-E7FC-4A22-B77D-7FE7419A3314}']
+ ['{8F263DB9-3ECD-4F2F-B263-867262A0AEA2}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_EMPRESAValue : Integer;
@@ -171,6 +206,49 @@ implementation
uses
Variants, uROBinaryHelpers, uDAInterfaces;
+{ TdarEjercicioActivoBusinessProcessorRules }
+constructor TdarEjercicioActivoBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
+begin
+ inherited;
+end;
+
+destructor TdarEjercicioActivoBusinessProcessorRules.Destroy;
+begin
+ inherited;
+end;
+
+function TdarEjercicioActivoBusinessProcessorRules.GetIDValue: Integer;
+begin
+ result := BusinessProcessor.CurrentChange.NewValueByName[fld_darEjercicioActivoID];
+end;
+
+function TdarEjercicioActivoBusinessProcessorRules.GetIDIsNull: Boolean;
+begin
+ result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_darEjercicioActivoID]);
+end;
+
+function TdarEjercicioActivoBusinessProcessorRules.GetOldIDValue: Integer;
+begin
+ result := BusinessProcessor.CurrentChange.OldValueByName[fld_darEjercicioActivoID];
+end;
+
+function TdarEjercicioActivoBusinessProcessorRules.GetOldIDIsNull: Boolean;
+begin
+ result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_darEjercicioActivoID]);
+end;
+
+procedure TdarEjercicioActivoBusinessProcessorRules.SetIDValue(const aValue: Integer);
+begin
+ BusinessProcessor.CurrentChange.NewValueByName[fld_darEjercicioActivoID] := aValue;
+end;
+
+procedure TdarEjercicioActivoBusinessProcessorRules.SetIDIsNull(const aValue: Boolean);
+begin
+ if aValue then
+ BusinessProcessor.CurrentChange.NewValueByName[fld_darEjercicioActivoID] := Null;
+end;
+
+
{ TEjerciciosBusinessProcessorRules }
constructor TEjerciciosBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor);
begin
@@ -525,6 +603,7 @@ end;
initialization
+ RegisterBusinessProcessorRules(RID_darEjercicioActivoDelta, TdarEjercicioActivoBusinessProcessorRules);
RegisterBusinessProcessorRules(RID_EjerciciosDelta, TEjerciciosBusinessProcessorRules);
end.
diff --git a/Source/ApplicationBase/Empresas/Model/schEmpresasClient_Intf.pas b/Source/ApplicationBase/Empresas/Model/schEmpresasClient_Intf.pas
index 4b813fed..c4aa9034 100644
--- a/Source/ApplicationBase/Empresas/Model/schEmpresasClient_Intf.pas
+++ b/Source/ApplicationBase/Empresas/Model/schEmpresasClient_Intf.pas
@@ -9,9 +9,9 @@ const
{ Data table rules ids
Feel free to change them to something more human readable
but make sure they are unique in the context of your application }
- RID_EmpresasTiendas = '{1596A2D4-D5EA-4AB8-A87F-3472E14D95B7}';
- RID_Empresas = '{36C6A689-7D4A-45D8-AE4A-E7B1AC5D603D}';
- RID_EmpresasDatosBanco = '{EF50F778-8A79-4E98-A584-F7409D676979}';
+ RID_EmpresasTiendas = '{7691DBC8-C1A5-4495-B66F-FADD68AF373A}';
+ RID_Empresas = '{591782AE-DFE0-4EF5-9F14-6C24F113B6C6}';
+ RID_EmpresasDatosBanco = '{770FD731-3914-4222-8C72-DE644036A8FD}';
{ Data table names }
nme_EmpresasTiendas = 'EmpresasTiendas';
@@ -129,7 +129,7 @@ const
type
{ IEmpresasTiendas }
IEmpresasTiendas = interface(IDAStronglyTypedDataTable)
- ['{5717EA22-3BD0-4D84-8C13-44878475A8A4}']
+ ['{5AB99CD0-0101-4D3C-B829-F8FA2D78ABA0}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -344,7 +344,7 @@ type
{ IEmpresas }
IEmpresas = interface(IDAStronglyTypedDataTable)
- ['{8F3B7830-6A3B-4041-9226-8A4768462EEC}']
+ ['{A5EABBE6-C793-4CBD-B0D7-E460BACC895D}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
@@ -643,7 +643,7 @@ type
{ IEmpresasDatosBanco }
IEmpresasDatosBanco = interface(IDAStronglyTypedDataTable)
- ['{F70DFC8E-6577-4105-A32D-B29CC4ED64F9}']
+ ['{CE9EA55E-D8DD-458D-99E0-65D68127E258}']
{ Property getters and setters }
function GetIDValue: Integer;
procedure SetIDValue(const aValue: Integer);
diff --git a/Source/ApplicationBase/Empresas/Model/schEmpresasServer_Intf.pas b/Source/ApplicationBase/Empresas/Model/schEmpresasServer_Intf.pas
index b3c25928..c6e49c85 100644
--- a/Source/ApplicationBase/Empresas/Model/schEmpresasServer_Intf.pas
+++ b/Source/ApplicationBase/Empresas/Model/schEmpresasServer_Intf.pas
@@ -9,14 +9,14 @@ const
{ Delta rules ids
Feel free to change them to something more human readable
but make sure they are unique in the context of your application }
- RID_EmpresasTiendasDelta = '{78EE7516-DCC4-4DF7-862E-593572864080}';
- RID_EmpresasDelta = '{30CE5020-5913-4D58-BE4E-DF2E33A4BC6D}';
- RID_EmpresasDatosBancoDelta = '{E775BE8F-E903-49EE-A902-0644D3FB4CBC}';
+ RID_EmpresasTiendasDelta = '{DCB989E4-D085-4440-B7AA-43454431AB6E}';
+ RID_EmpresasDelta = '{FE56DEB0-3242-4852-8C8C-68B235BBB329}';
+ RID_EmpresasDatosBancoDelta = '{89B3E6FF-5C24-4695-ADBD-2899BCA0879D}';
type
{ IEmpresasTiendasDelta }
IEmpresasTiendasDelta = interface(IEmpresasTiendas)
- ['{78EE7516-DCC4-4DF7-862E-593572864080}']
+ ['{DCB989E4-D085-4440-B7AA-43454431AB6E}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_EMPRESAValue : Integer;
@@ -231,7 +231,7 @@ type
{ IEmpresasDelta }
IEmpresasDelta = interface(IEmpresas)
- ['{30CE5020-5913-4D58-BE4E-DF2E33A4BC6D}']
+ ['{FE56DEB0-3242-4852-8C8C-68B235BBB329}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldNIF_CIFValue : String;
@@ -531,7 +531,7 @@ type
{ IEmpresasDatosBancoDelta }
IEmpresasDatosBancoDelta = interface(IEmpresasDatosBanco)
- ['{E775BE8F-E903-49EE-A902-0644D3FB4CBC}']
+ ['{89B3E6FF-5C24-4695-ADBD-2899BCA0879D}']
{ Property getters and setters }
function GetOldIDValue : Integer;
function GetOldID_EMPRESAValue : Integer;
diff --git a/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas b/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas
index 83c1f37f..ccbf48db 100644
--- a/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas
+++ b/Source/ApplicationBase/Usuarios/Controller/uUsuariosController.pas
@@ -102,6 +102,7 @@ type
procedure AsignarDataModule;
procedure InicializarUserControl;
+ procedure RecogerConfiguracion;
function GetCurrentUser: IBizUsuario;
function AnadirUsuario(AUser : IBizUsuario): Boolean;
@@ -576,9 +577,7 @@ begin
AutoStart := False;
Criptografia := cMD5;
CheckValidationKey := True;
- Login.MaxLoginAttempts := 3;
- UserPasswordChange.ForcePassword := True;
- UserPasswordChange.MinPasswordLength := 3;
+ RecogerConfiguracion;
end;
FDataModule.InicializarUserControl(FUserControl);
end;
@@ -678,6 +677,16 @@ begin
//
end;
+procedure TUsuariosController.RecogerConfiguracion;
+begin
+ with FUserControl do
+ begin
+ Login.MaxLoginAttempts := AppFactuGES.Configuracion.GetSettingAsInteger('MaxLoginAttempts', 3);
+ UserPasswordChange.ForcePassword := AppFactuGES.Configuracion.GetSettingAsBoolean('ForcePassword', True);
+ UserPasswordChange.MinPasswordLength := AppFactuGES.Configuracion.GetSettingAsInteger('MinPasswordLength', 3);
+ end;
+end;
+
procedure TUsuariosController.SetMaxIntentosLogin(const Value: Integer);
begin
FUserControl.Login.MaxLoginAttempts := Value;
@@ -708,16 +717,23 @@ function TUsuariosController.ValidarPassword(const APassword : string;
begin
Result := False;
AMsg := '';
- if (FUserControl.UserPasswordChange.ForcePassword) and (Length(Trim(APassword)) = 0) then
- AMsg := FUserControl.UserSettings.CommonMessages.ChangePasswordError.PasswordRequired
- else
- if (Length(Trim(APassword)) < FUserControl.UserPasswordChange.MinPasswordLength) then
- AMsg := Format(FUserControl.UserSettings.CommonMessages.ChangePasswordError.MinPasswordLength, [FUserControl.UserPasswordChange.MinPasswordLength])
+
+ RecogerConfiguracion;
+ if (FUserControl.UserPasswordChange.ForcePassword) then
+ begin
+ if (Length(Trim(APassword)) = 0) then
+ AMsg := FUserControl.UserSettings.CommonMessages.ChangePasswordError.PasswordRequired
else
- if FUsarPasswordsSeguras and (Pos(LowerCase(APassword), 'abcdeasdfqwerzxcv1234567890321654987test' + LowerCase(ALogin) + LowerCase(AMsg)) > 0) then
- AMsg := FUserControl.UserSettings.CommonMessages.ChangePasswordError.InvalidNewPassword
+ if (Length(Trim(APassword)) < FUserControl.UserPasswordChange.MinPasswordLength) then
+ AMsg := Format(FUserControl.UserSettings.CommonMessages.ChangePasswordError.MinPasswordLength, [FUserControl.UserPasswordChange.MinPasswordLength])
else
- Result := true;
+ if FUsarPasswordsSeguras and (Pos(LowerCase(APassword), 'abcdeasdfqwerzxcv1234567890321654987test' + LowerCase(ALogin) + LowerCase(AMsg)) > 0) then
+ AMsg := FUserControl.UserSettings.CommonMessages.ChangePasswordError.InvalidNewPassword
+ else
+ Result := True;
+ end
+ else
+ Result := True;
end;
function TUsuariosController.ValidarPerfil(APerfil: IBizPerfilUsuario): Boolean;
diff --git a/Source/ApplicationBase/uFactuGES_App.pas b/Source/ApplicationBase/uFactuGES_App.pas
index 792747bc..fae47c24 100644
--- a/Source/ApplicationBase/uFactuGES_App.pas
+++ b/Source/ApplicationBase/uFactuGES_App.pas
@@ -4,7 +4,7 @@ interface
uses
SysUtils, Classes, Forms, uBizUsuarios, uBizEmpresas, uBizEjercicios, uControllerBase,
- uEmpresasController, uUsuariosController, uHostManager;
+ uEmpresasController, uUsuariosController, uHostManager, uConfiguracionController;
type
TDoLoadModulesEvent = procedure;
@@ -33,7 +33,8 @@ type
function GetEjercicioActivo: IBizEjercicio;
function GetModuleManager : THostManager;
function GetTerminated: Boolean;
-
+ function GetConfiguracionController : IConfiguracionController;
+
function GetLoadModulesEvent : TDoLoadModulesEvent;
procedure SetLoadModulesEvent (ALoadModulesEvent : TDoLoadModulesEvent);
@@ -52,6 +53,8 @@ type
procedure Run;
procedure Terminate;
+ procedure Configurar;
+
property AppVersion : String read GetAppVersion;
property AppName : String read GetAppName;
property AppFullName : String read GetAppFullName;
@@ -66,6 +69,7 @@ type
property DoMainFormEvent : TDoMainFormEvent read GetDoMainFormEvent write SetDoMainFormEvent;
property DoLoadModulesEvent : TDoLoadModulesEvent read GetLoadModulesEvent write SetLoadModulesEvent;
property Terminated : Boolean read GetTerminated;
+ property Configuracion : IConfiguracionController read GetConfiguracionController;
function getVAR_IDTIENDA : Integer;
procedure setVAR_IDTIENDA (AValue : Integer);
@@ -88,6 +92,8 @@ type
FUsuariosController: IUsuariosController;
FEmpresaActiva: IBizEmpresa;
FEjercicioActivo: IBizEjercicio;
+ FConfiguracionController : IConfiguracionController;
+
FAppSplashForm : IAppSplashForm;
FHostManager : THostManager;
FTerminated : Boolean;
@@ -106,6 +112,7 @@ type
function GetEjercicioActivo: IBizEjercicio;
function GetModuleManager : THostManager;
function GetTerminated: Boolean;
+ function GetConfiguracionController : IConfiguracionController;
function GetLoadModulesEvent : TDoLoadModulesEvent;
procedure SetLoadModulesEvent (ALoadModulesEvent : TDoLoadModulesEvent);
@@ -136,6 +143,8 @@ type
procedure Run;
procedure Terminate;
+ procedure Configurar;
+
procedure CambiarEmpresa(const AIDEmpresa : Integer);
procedure CambiarEjercicio(const AIDEmpresa : Integer);
@@ -153,7 +162,8 @@ type
property DoMainFormEvent : TDoMainFormEvent read GetDoMainFormEvent write SetDoMainFormEvent;
property DoLoadModulesEvent : TDoLoadModulesEvent read GetLoadModulesEvent write SetLoadModulesEvent;
property Terminated : Boolean read GetTerminated;
-
+ property Configuracion : IConfiguracionController read GetConfiguracionController;
+
function getVAR_IDTIENDA : Integer;
procedure setVAR_IDTIENDA (AValue : Integer);
function getVAR_TIENDA : String;
@@ -203,8 +213,6 @@ begin
Aux.DataTable.Active := True;
if not Aux.IsEmpty then
FEmpresaActiva := Aux;
-
-
end;
//Establece el ejercicio activo de la empresa activa
@@ -219,6 +227,11 @@ begin
FDoLoadModulesEvent();
end;
+procedure TAppFactuGES.Configurar;
+begin
+ FConfiguracionController.ConfigurarAplicacion;
+end;
+
procedure TAppFactuGES.PonerTiendaPorDefecto;
var
AIdTienda: Integer;
@@ -227,7 +240,7 @@ begin
//Nos devuelve el id de la tienda a la que pertenece el vendedor que tiene asignado
//el usuario con el que ha accedido a la aplicación.
//Esto funciona mientras la relación sea 1 a 1, cuando sea 1 a n (un usuario pertenece a varios vendedores deja de funcionar)
- UsuariosController.darIDTiendaVendedorUsuario(UsuarioActivo.ID, AIdTienda, ATienda);
+ UsuariosController.DarIDTiendaVendedorUsuario(UsuarioActivo.ID, AIdTienda, ATienda);
VAR_IDTIENDA := AIdTienda;
VAR_TIENDA := ATienda;
end;
@@ -249,6 +262,8 @@ begin
// Ruta por defecto de los módulos
BPLPath := ExtractFilePath(Application.ExeName) + PathDelim;
end;
+
+ FConfiguracionController := TConfiguracionController.Create;
end;
destructor TAppFactuGES.Destroy;
@@ -256,8 +271,11 @@ begin
FAppSplashForm := NIL;
FHostManager.UnloadModules;
+
FreeAndNIL(FHostManager);
+ FConfiguracionController := NIL;
+
FEmpresaActiva := NIL;
FUsuariosController := NIL;
FEmpresasController := NIL;
@@ -303,6 +321,11 @@ begin
Result := uAppInfoUtils.GetAppVersion;
end;
+function TAppFactuGES.GetConfiguracionController: IConfiguracionController;
+begin
+ Result := FConfiguracionController;
+end;
+
function TAppFactuGES.GetEjercicioActivo: IBizEjercicio;
begin
Result := FEjercicioActivo;
diff --git a/Source/Base/Base.dpk b/Source/Base/Base.dpk
index 290b4936..7009ab7a 100644
Binary files a/Source/Base/Base.dpk and b/Source/Base/Base.dpk differ
diff --git a/Source/Base/Base.dproj b/Source/Base/Base.dproj
index bee213cf..c0abff9b 100644
--- a/Source/Base/Base.dproj
+++ b/Source/Base/Base.dproj
@@ -51,6 +51,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
VCL for the Web Design Package for CodeGear RAD Studio
CodeGear WebSnap Components
CodeGear SOAP Components
@@ -65,89 +86,75 @@
MainSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TForm
-
-
-
- TDataModule
-
-
-
- TDataModule
-
-
-
-
-
-
- TDataModule
-
-
-
- TDataModule
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+