diff --git a/Source/Modulos/Impresiones/Data/uDataModuleImpresiones.dfm b/Source/Modulos/Impresiones/Data/uDataModuleImpresiones.dfm new file mode 100644 index 0000000..5a31686 --- /dev/null +++ b/Source/Modulos/Impresiones/Data/uDataModuleImpresiones.dfm @@ -0,0 +1,16 @@ +inherited DataModuleImpresiones: TDataModuleImpresiones + OnCreate = DAClientDataModuleCreate + Height = 195 + Width = 209 + object Bin2DataStreamer: TDABin2DataStreamer + Left = 48 + Top = 88 + end + object RORemoteService: TRORemoteService + Message = dmConexion.ROMessage + Channel = dmConexion.ROChannel + ServiceName = 'srvImpresiones' + Left = 48 + Top = 24 + end +end diff --git a/Source/Modulos/Impresiones/Data/uDataModuleImpresiones.pas b/Source/Modulos/Impresiones/Data/uDataModuleImpresiones.pas new file mode 100644 index 0000000..2ab3e0e --- /dev/null +++ b/Source/Modulos/Impresiones/Data/uDataModuleImpresiones.pas @@ -0,0 +1,42 @@ +unit uDataModuleImpresiones; + +interface + +uses + SysUtils, Classes, DB, uDAInterfaces, uDADataTable, + uDAScriptingProvider, uDAMemDataTable, uDADataStreamer, uDABin2DataStreamer, + uDARemoteDataAdapter, uROClient, uRORemoteService, uDataModuleBase; + +type + TDataModuleImpresiones = class(TDataModuleBase) + Bin2DataStreamer: TDABin2DataStreamer; + RORemoteService: TRORemoteService; + procedure DAClientDataModuleCreate(Sender: TObject); + public + function AnadirMarcaImpresion(const Tabla: String; IdsTabla: String): Boolean; + end; + +var + dmImpresiones: TDataModuleImpresiones; + +implementation +{$R *.DFM} + +uses + Dialogs, FactuGES_Intf, uDataModuleConexion, uDataTableUtils, cxControls; + +{ TdmFamilias } + +function TDataModuleImpresiones.AnadirMarcaImpresion(const Tabla: String; IdsTabla: String): Boolean; +begin + Result := (RORemoteService as IsrvImpresiones).AnadirMarcaImpresion(Tabla, IdsTabla); +end; + +procedure TDataModuleImpresiones.DAClientDataModuleCreate(Sender: TObject); +begin + RORemoteService.Channel := dmConexion.Channel; + RORemoteService.Message := dmConexion.Message; +end; + + +end. diff --git a/Source/Modulos/Impresiones/Model/schImpresionesClient_Intf.pas b/Source/Modulos/Impresiones/Model/schImpresionesClient_Intf.pas new file mode 100644 index 0000000..671a23b --- /dev/null +++ b/Source/Modulos/Impresiones/Model/schImpresionesClient_Intf.pas @@ -0,0 +1,204 @@ +unit schImpresionesClient_Intf; + +interface + +uses + Classes, DB, schBase_Intf, SysUtils, uROClasses, uDAInterfaces, uDADataTable, FmtBCD, uROXMLIntf; + +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_Impresiones = '{4FC454B2-6684-42FE-AE0D-D76A280E6A48}'; + + { Data table names } + nme_Impresiones = 'Impresiones'; + + { Impresiones fields } + fld_ImpresionesID = 'ID'; + fld_ImpresionesTABLA = 'TABLA'; + fld_ImpresionesID_TABLA = 'ID_TABLA'; + fld_ImpresionesNUM_COPIAS = 'NUM_COPIAS'; + + { Impresiones field indexes } + idx_ImpresionesID = 0; + idx_ImpresionesTABLA = 1; + idx_ImpresionesID_TABLA = 2; + idx_ImpresionesNUM_COPIAS = 3; + +type + { IImpresiones } + IImpresiones = interface(IDAStronglyTypedDataTable) + ['{4A737C11-3502-4F70-82EB-9CB986AD2940}'] + { Property getters and setters } + function GetIDValue: Integer; + procedure SetIDValue(const aValue: Integer); + function GetIDIsNull: Boolean; + procedure SetIDIsNull(const aValue: Boolean); + function GetTABLAValue: String; + procedure SetTABLAValue(const aValue: String); + function GetTABLAIsNull: Boolean; + procedure SetTABLAIsNull(const aValue: Boolean); + function GetID_TABLAValue: Integer; + procedure SetID_TABLAValue(const aValue: Integer); + function GetID_TABLAIsNull: Boolean; + procedure SetID_TABLAIsNull(const aValue: Boolean); + function GetNUM_COPIASValue: Integer; + procedure SetNUM_COPIASValue(const aValue: Integer); + function GetNUM_COPIASIsNull: Boolean; + procedure SetNUM_COPIASIsNull(const aValue: Boolean); + + + { Properties } + property ID: Integer read GetIDValue write SetIDValue; + property IDIsNull: Boolean read GetIDIsNull write SetIDIsNull; + property TABLA: String read GetTABLAValue write SetTABLAValue; + property TABLAIsNull: Boolean read GetTABLAIsNull write SetTABLAIsNull; + property ID_TABLA: Integer read GetID_TABLAValue write SetID_TABLAValue; + property ID_TABLAIsNull: Boolean read GetID_TABLAIsNull write SetID_TABLAIsNull; + property NUM_COPIAS: Integer read GetNUM_COPIASValue write SetNUM_COPIASValue; + property NUM_COPIASIsNull: Boolean read GetNUM_COPIASIsNull write SetNUM_COPIASIsNull; + end; + + { TImpresionesDataTableRules } + TImpresionesDataTableRules = class(TIntfObjectDADataTableRules, IImpresiones) + 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; + function GetTABLAValue: String; virtual; + procedure SetTABLAValue(const aValue: String); virtual; + function GetTABLAIsNull: Boolean; virtual; + procedure SetTABLAIsNull(const aValue: Boolean); virtual; + function GetID_TABLAValue: Integer; virtual; + procedure SetID_TABLAValue(const aValue: Integer); virtual; + function GetID_TABLAIsNull: Boolean; virtual; + procedure SetID_TABLAIsNull(const aValue: Boolean); virtual; + function GetNUM_COPIASValue: Integer; virtual; + procedure SetNUM_COPIASValue(const aValue: Integer); virtual; + function GetNUM_COPIASIsNull: Boolean; virtual; + procedure SetNUM_COPIASIsNull(const aValue: Boolean); virtual; + + { Properties } + property ID: Integer read GetIDValue write SetIDValue; + property IDIsNull: Boolean read GetIDIsNull write SetIDIsNull; + property TABLA: String read GetTABLAValue write SetTABLAValue; + property TABLAIsNull: Boolean read GetTABLAIsNull write SetTABLAIsNull; + property ID_TABLA: Integer read GetID_TABLAValue write SetID_TABLAValue; + property ID_TABLAIsNull: Boolean read GetID_TABLAIsNull write SetID_TABLAIsNull; + property NUM_COPIAS: Integer read GetNUM_COPIASValue write SetNUM_COPIASValue; + property NUM_COPIASIsNull: Boolean read GetNUM_COPIASIsNull write SetNUM_COPIASIsNull; + + public + constructor Create(aDataTable: TDADataTable); override; + destructor Destroy; override; + + end; + +implementation + +uses Variants, uROBinaryHelpers; + +{ TImpresionesDataTableRules } +constructor TImpresionesDataTableRules.Create(aDataTable: TDADataTable); +begin + inherited; +end; + +destructor TImpresionesDataTableRules.Destroy; +begin + inherited; +end; + +function TImpresionesDataTableRules.GetIDValue: Integer; +begin + result := DataTable.Fields[idx_ImpresionesID].AsInteger; +end; + +procedure TImpresionesDataTableRules.SetIDValue(const aValue: Integer); +begin + DataTable.Fields[idx_ImpresionesID].AsInteger := aValue; +end; + +function TImpresionesDataTableRules.GetIDIsNull: boolean; +begin + result := DataTable.Fields[idx_ImpresionesID].IsNull; +end; + +procedure TImpresionesDataTableRules.SetIDIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_ImpresionesID].AsVariant := Null; +end; + +function TImpresionesDataTableRules.GetTABLAValue: String; +begin + result := DataTable.Fields[idx_ImpresionesTABLA].AsString; +end; + +procedure TImpresionesDataTableRules.SetTABLAValue(const aValue: String); +begin + DataTable.Fields[idx_ImpresionesTABLA].AsString := aValue; +end; + +function TImpresionesDataTableRules.GetTABLAIsNull: boolean; +begin + result := DataTable.Fields[idx_ImpresionesTABLA].IsNull; +end; + +procedure TImpresionesDataTableRules.SetTABLAIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_ImpresionesTABLA].AsVariant := Null; +end; + +function TImpresionesDataTableRules.GetID_TABLAValue: Integer; +begin + result := DataTable.Fields[idx_ImpresionesID_TABLA].AsInteger; +end; + +procedure TImpresionesDataTableRules.SetID_TABLAValue(const aValue: Integer); +begin + DataTable.Fields[idx_ImpresionesID_TABLA].AsInteger := aValue; +end; + +function TImpresionesDataTableRules.GetID_TABLAIsNull: boolean; +begin + result := DataTable.Fields[idx_ImpresionesID_TABLA].IsNull; +end; + +procedure TImpresionesDataTableRules.SetID_TABLAIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_ImpresionesID_TABLA].AsVariant := Null; +end; + +function TImpresionesDataTableRules.GetNUM_COPIASValue: Integer; +begin + result := DataTable.Fields[idx_ImpresionesNUM_COPIAS].AsInteger; +end; + +procedure TImpresionesDataTableRules.SetNUM_COPIASValue(const aValue: Integer); +begin + DataTable.Fields[idx_ImpresionesNUM_COPIAS].AsInteger := aValue; +end; + +function TImpresionesDataTableRules.GetNUM_COPIASIsNull: boolean; +begin + result := DataTable.Fields[idx_ImpresionesNUM_COPIAS].IsNull; +end; + +procedure TImpresionesDataTableRules.SetNUM_COPIASIsNull(const aValue: Boolean); +begin + if aValue then + DataTable.Fields[idx_ImpresionesNUM_COPIAS].AsVariant := Null; +end; + + +initialization + RegisterDataTableRules(RID_Impresiones, TImpresionesDataTableRules); + +end. diff --git a/Source/Modulos/Impresiones/Model/schImpresionesServer_Intf.pas b/Source/Modulos/Impresiones/Model/schImpresionesServer_Intf.pas new file mode 100644 index 0000000..c7de901 --- /dev/null +++ b/Source/Modulos/Impresiones/Model/schImpresionesServer_Intf.pas @@ -0,0 +1,229 @@ +unit schImpresionesServer_Intf; + +interface + +uses + Classes, DB, SysUtils, uROClasses, uDADataTable, uDABusinessProcessor, FmtBCD, uROXMLIntf, schImpresionesClient_Intf; + +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_ImpresionesDelta = '{39C9B388-CB4D-4288-9919-83D9F9D40263}'; + +type + { IImpresionesDelta } + IImpresionesDelta = interface(IImpresiones) + ['{39C9B388-CB4D-4288-9919-83D9F9D40263}'] + { Property getters and setters } + function GetOldIDValue : Integer; + function GetOldTABLAValue : String; + function GetOldID_TABLAValue : Integer; + function GetOldNUM_COPIASValue : Integer; + + { Properties } + property OldID : Integer read GetOldIDValue; + property OldTABLA : String read GetOldTABLAValue; + property OldID_TABLA : Integer read GetOldID_TABLAValue; + property OldNUM_COPIAS : Integer read GetOldNUM_COPIASValue; + end; + + { TImpresionesBusinessProcessorRules } + TImpresionesBusinessProcessorRules = class(TDABusinessProcessorRules, IImpresiones, IImpresionesDelta) + 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; + function GetTABLAValue: String; virtual; + function GetTABLAIsNull: Boolean; virtual; + function GetOldTABLAValue: String; virtual; + function GetOldTABLAIsNull: Boolean; virtual; + procedure SetTABLAValue(const aValue: String); virtual; + procedure SetTABLAIsNull(const aValue: Boolean); virtual; + function GetID_TABLAValue: Integer; virtual; + function GetID_TABLAIsNull: Boolean; virtual; + function GetOldID_TABLAValue: Integer; virtual; + function GetOldID_TABLAIsNull: Boolean; virtual; + procedure SetID_TABLAValue(const aValue: Integer); virtual; + procedure SetID_TABLAIsNull(const aValue: Boolean); virtual; + function GetNUM_COPIASValue: Integer; virtual; + function GetNUM_COPIASIsNull: Boolean; virtual; + function GetOldNUM_COPIASValue: Integer; virtual; + function GetOldNUM_COPIASIsNull: Boolean; virtual; + procedure SetNUM_COPIASValue(const aValue: Integer); virtual; + procedure SetNUM_COPIASIsNull(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; + property TABLA : String read GetTABLAValue write SetTABLAValue; + property TABLAIsNull : Boolean read GetTABLAIsNull write SetTABLAIsNull; + property OldTABLA : String read GetOldTABLAValue; + property OldTABLAIsNull : Boolean read GetOldTABLAIsNull; + property ID_TABLA : Integer read GetID_TABLAValue write SetID_TABLAValue; + property ID_TABLAIsNull : Boolean read GetID_TABLAIsNull write SetID_TABLAIsNull; + property OldID_TABLA : Integer read GetOldID_TABLAValue; + property OldID_TABLAIsNull : Boolean read GetOldID_TABLAIsNull; + property NUM_COPIAS : Integer read GetNUM_COPIASValue write SetNUM_COPIASValue; + property NUM_COPIASIsNull : Boolean read GetNUM_COPIASIsNull write SetNUM_COPIASIsNull; + property OldNUM_COPIAS : Integer read GetOldNUM_COPIASValue; + property OldNUM_COPIASIsNull : Boolean read GetOldNUM_COPIASIsNull; + + public + constructor Create(aBusinessProcessor: TDABusinessProcessor); override; + destructor Destroy; override; + + end; + +implementation + +uses + Variants, uROBinaryHelpers, uDAInterfaces; + +{ TImpresionesBusinessProcessorRules } +constructor TImpresionesBusinessProcessorRules.Create(aBusinessProcessor: TDABusinessProcessor); +begin + inherited; +end; + +destructor TImpresionesBusinessProcessorRules.Destroy; +begin + inherited; +end; + +function TImpresionesBusinessProcessorRules.GetIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID]; +end; + +function TImpresionesBusinessProcessorRules.GetIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID]); +end; + +function TImpresionesBusinessProcessorRules.GetOldIDValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesID]; +end; + +function TImpresionesBusinessProcessorRules.GetOldIDIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesID]); +end; + +procedure TImpresionesBusinessProcessorRules.SetIDValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID] := aValue; +end; + +procedure TImpresionesBusinessProcessorRules.SetIDIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID] := Null; +end; + +function TImpresionesBusinessProcessorRules.GetTABLAValue: String; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesTABLA]; +end; + +function TImpresionesBusinessProcessorRules.GetTABLAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesTABLA]); +end; + +function TImpresionesBusinessProcessorRules.GetOldTABLAValue: String; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesTABLA]; +end; + +function TImpresionesBusinessProcessorRules.GetOldTABLAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesTABLA]); +end; + +procedure TImpresionesBusinessProcessorRules.SetTABLAValue(const aValue: String); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesTABLA] := aValue; +end; + +procedure TImpresionesBusinessProcessorRules.SetTABLAIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesTABLA] := Null; +end; + +function TImpresionesBusinessProcessorRules.GetID_TABLAValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID_TABLA]; +end; + +function TImpresionesBusinessProcessorRules.GetID_TABLAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID_TABLA]); +end; + +function TImpresionesBusinessProcessorRules.GetOldID_TABLAValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesID_TABLA]; +end; + +function TImpresionesBusinessProcessorRules.GetOldID_TABLAIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesID_TABLA]); +end; + +procedure TImpresionesBusinessProcessorRules.SetID_TABLAValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID_TABLA] := aValue; +end; + +procedure TImpresionesBusinessProcessorRules.SetID_TABLAIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesID_TABLA] := Null; +end; + +function TImpresionesBusinessProcessorRules.GetNUM_COPIASValue: Integer; +begin + result := BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesNUM_COPIAS]; +end; + +function TImpresionesBusinessProcessorRules.GetNUM_COPIASIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesNUM_COPIAS]); +end; + +function TImpresionesBusinessProcessorRules.GetOldNUM_COPIASValue: Integer; +begin + result := BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesNUM_COPIAS]; +end; + +function TImpresionesBusinessProcessorRules.GetOldNUM_COPIASIsNull: Boolean; +begin + result := VarIsNull(BusinessProcessor.CurrentChange.OldValueByName[fld_ImpresionesNUM_COPIAS]); +end; + +procedure TImpresionesBusinessProcessorRules.SetNUM_COPIASValue(const aValue: Integer); +begin + BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesNUM_COPIAS] := aValue; +end; + +procedure TImpresionesBusinessProcessorRules.SetNUM_COPIASIsNull(const aValue: Boolean); +begin + if aValue then + BusinessProcessor.CurrentChange.NewValueByName[fld_ImpresionesNUM_COPIAS] := Null; +end; + + +initialization + RegisterBusinessProcessorRules(RID_ImpresionesDelta, TImpresionesBusinessProcessorRules); + +end. diff --git a/Source/Modulos/Impresiones/Servidor/srvImpresiones_Impl.dfm b/Source/Modulos/Impresiones/Servidor/srvImpresiones_Impl.dfm new file mode 100644 index 0000000..4c39e4e --- /dev/null +++ b/Source/Modulos/Impresiones/Servidor/srvImpresiones_Impl.dfm @@ -0,0 +1,142 @@ +object srvImpresiones: TsrvImpresiones + OldCreateOrder = True + ConnectionName = 'IBX' + ServiceSchema = schImpresiones + ServiceDataStreamer = Bin2DataStreamer + AllowExecuteSQL = True + ExportedDataTables = <> + BeforeAcquireConnection = DataAbstractServiceBeforeAcquireConnection + Height = 202 + Width = 392 + object Diagrams: TDADiagrams + Left = 150 + Top = 90 + DiagramData = ''#13#10''#13#10 + end + object DataDictionary: TDADataDictionary + Fields = < + item + Name = 'Referencias_CODIGO' + DataType = datString + Size = 50 + DisplayLabel = 'CODIGO' + end + item + Name = 'Referencias_DESCRIPCION' + DataType = datString + Size = 255 + DisplayLabel = 'Referencias' + end + item + Name = 'Referencias_VALOR' + DataType = datString + Size = 255 + DisplayLabel = 'C'#243'digo' + end + item + Name = 'Referencias_ID_EMPRESA' + DataType = datInteger + DisplayLabel = 'ID_EMPRESA' + end> + Left = 150 + Top = 24 + end + object schImpresiones: TDASchema + ConnectionManager = dmServer.ConnectionManager + DataDictionary = DataDictionary + Diagrams = Diagrams + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'IBX' + TargetTable = 'IMPRESIONES' + SQL = 'select ID, TABLA, ID_TABLA, NUM_COPIAS'#10'from IMPRESIONES' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ID' + TableField = 'ID' + end + item + DatasetField = 'TABLA' + TableField = 'TABLA' + end + item + DatasetField = 'ID_TABLA' + TableField = 'ID_TABLA' + end + item + DatasetField = 'NUM_COPIAS' + TableField = 'NUM_COPIAS' + end> + end> + Name = 'Impresiones' + Fields = < + item + Name = 'ID' + DataType = datAutoInc + GeneratorName = 'GEN_IMPRESIONES_ID' + InPrimaryKey = True + end + item + Name = 'TABLA' + DataType = datString + Size = 255 + end + item + Name = 'ID_TABLA' + DataType = datInteger + end + item + Name = 'NUM_COPIAS' + DataType = datInteger + end> + end> + JoinDataTables = <> + UnionDataTables = <> + Commands = < + item + Params = < + item + Name = 'Tabla' + DataType = datString + Size = 255 + Value = '' + ParamType = daptInput + end + item + Name = 'IdTabla' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + TargetTable = 'IMPRESIONES' + SQL = 'execute procedure PRO_ANADIR_MARCA_IMPRESION :Tabla, :IdTabla' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'AnadirMarcaImpresion' + end> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 48 + Top = 24 + end + object bpImpresiones: TDABusinessProcessor + Schema = schImpresiones + UpdateCommandName = 'Update_Referencias' + ReferencedDataset = 'Referencias' + ProcessorOptions = [poAutoGenerateRefreshDataset, poPrepareCommands] + UpdateMode = updWhereKeyOnly + Left = 248 + Top = 24 + end + object Bin2DataStreamer: TDABin2DataStreamer + Left = 48 + Top = 80 + end +end diff --git a/Source/Modulos/Impresiones/Servidor/srvImpresiones_Impl.pas b/Source/Modulos/Impresiones/Servidor/srvImpresiones_Impl.pas new file mode 100644 index 0000000..fe6c381 --- /dev/null +++ b/Source/Modulos/Impresiones/Servidor/srvImpresiones_Impl.pas @@ -0,0 +1,111 @@ +unit srvImpresiones_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +interface + +uses + {vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} uDABusinessProcessor, uDABin2DataStreamer, uDADataStreamer, + uDAScriptingProvider, uDAClasses, + FactuGES_Intf, uDAInterfaces; + + +type + { TsrvImpresiones } + TsrvImpresiones = class(TDataAbstractService, IsrvImpresiones) + Diagrams: TDADiagrams; + bpImpresiones: TDABusinessProcessor; + schImpresiones: TDASchema; + DataDictionary: TDADataDictionary; + Bin2DataStreamer: TDABin2DataStreamer; + procedure DataAbstractServiceBeforeAcquireConnection(aSender: TObject; + var aConnectionName: string); + public + { IsrvImpresiones methods } + function AnadirMarcaImpresion(const NombreTabla: AnsiString; const IdsTabla: AnsiString): Boolean; + function prueba: Boolean; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils, + uROClasses; + +procedure Create_srvImpresiones(out anInstance : IUnknown); +begin + anInstance := TsrvImpresiones.Create(NIL); +end; + +{ srvImpresiones } + +function TsrvImpresiones.AnadirMarcaImpresion(const NombreTabla: AnsiString; const IdsTabla: AnsiString): Boolean; +var + ASchema : TDASchema; + AConn : IDAConnection; + dsCommand: IDASQLCommand; + ListaIds: TStringList; + i: Integer; + +begin + Result := False; + + ASchema := schImpresiones; + AConn := dmServer.ConnectionManager.NewConnection(dmServer.ConnectionManager.GetDefaultConnectionName); + + try + try + ListaIds := TStringList.Create; + ListaIds.CommaText := IdsTabla; + + //Vamos generando todas y cada una de las marcas de impresion + for i := 0 to ListaIds.Count - 1 do + begin + dsCommand := ASchema.NewCommand(AConn, 'AnadirMarcaImpresion'); + with dsCommand do + begin + ParamByName('TABLA').AsString := NombreTabla; + ParamByName('IDTABLA').AsString := ListaIds.Strings[i]; + end; + dsCommand.Execute; + AConn.CommitTransaction; + end; + + FreeAndNil(ListaIds); + Result := True; + except + RaiseError('Error al aņadir una nueva marca de impresion ' + NombreTabla + ' en tablas'); + AConn.RollbackTransaction; + end; + finally + dsCommand := NIL; + end; +end; + +procedure TsrvImpresiones.DataAbstractServiceBeforeAcquireConnection( + aSender: TObject; var aConnectionName: string); +begin + ConnectionName := dmServer.ConnectionName; +end; + +function TsrvImpresiones.prueba: Boolean; +begin + Result := True; +end; + +initialization + TROClassFactory.Create('srvImpresiones', Create_srvImpresiones, TsrvImpresiones_Invoker); + +finalization + +end. diff --git a/Source/Modulos/Registro de correos/Data/uDataModuleRegistroCorreos.dfm b/Source/Modulos/Registro de correos/Data/uDataModuleRegistroCorreos.dfm new file mode 100644 index 0000000..a6b3275 --- /dev/null +++ b/Source/Modulos/Registro de correos/Data/uDataModuleRegistroCorreos.dfm @@ -0,0 +1,16 @@ +inherited DataModuleRegistroCorreos: TDataModuleRegistroCorreos + OnCreate = DAClientDataModuleCreate + Height = 195 + Width = 390 + object RORemoteService: TRORemoteService + Message = dmConexion.ROMessage + Channel = dmConexion.ROChannel + ServiceName = 'srvRegistroCorreos' + Left = 48 + Top = 24 + end + object Bin2DataStreamer: TDABin2DataStreamer + Left = 48 + Top = 88 + end +end diff --git a/Source/Modulos/Registro de correos/Data/uDataModuleRegistroCorreos.pas b/Source/Modulos/Registro de correos/Data/uDataModuleRegistroCorreos.pas new file mode 100644 index 0000000..51210b0 --- /dev/null +++ b/Source/Modulos/Registro de correos/Data/uDataModuleRegistroCorreos.pas @@ -0,0 +1,84 @@ +unit uDataModuleRegistroCorreos; + +interface + +uses + SysUtils, Classes, DB, uDAInterfaces, uDADataTable, + uDAScriptingProvider, uDAMemDataTable, uDADataStreamer, uDABin2DataStreamer, + uDARemoteDataAdapter, uROClient, uRORemoteService, uDataModuleBase, uIntegerListUtils; + +type + TDataModuleRegistroCorreos = class(TDataModuleBase) + RORemoteService: TRORemoteService; + Bin2DataStreamer: TDABin2DataStreamer; + procedure DAClientDataModuleCreate(Sender: TObject); + public + function AnadirMarcaEnvioCorreo(const Tabla: String; IDTabla: Integer): Boolean; overload; + function AnadirMarcaEnvioCorreo(const Tabla: String; IDsTabla: TIntegerList): Boolean; overload; + end; + +function AnadirMarcaEnvioCorreo(const Tabla: String; IDTabla: Integer): Boolean; overload; +function AnadirMarcaEnvioCorreo(const Tabla: String; IDsTabla: TIntegerList): Boolean; overload; + +implementation +{$R *.DFM} + +uses + FactuGES_Intf, uDataModuleConexion, uDataTableUtils, cxControls; + +{ TdmFamilias } + +function AnadirMarcaEnvioCorreo(const Tabla: String; IDTabla: Integer): Boolean; +var + ADM : TDataModuleRegistroCorreos; +begin + ADM := TDataModuleRegistroCorreos.Create(nil); + try + Result := ADM.AnadirMarcaEnvioCorreo(Tabla, IDTabla); + finally + FreeANDNIL(ADM); + end; +end; + +function AnadirMarcaEnvioCorreo(const Tabla: String; IDsTabla: TIntegerList): Boolean; +var + ADM : TDataModuleRegistroCorreos; +begin + ADM := TDataModuleRegistroCorreos.Create(nil); + try + ADM.AnadirMarcaEnvioCorreo(Tabla, IDsTabla); + finally + FreeANDNIL(ADM); + end; +end; + +{ TdmImpresiones } + +function TDataModuleRegistroCorreos.AnadirMarcaEnvioCorreo(const Tabla: String; + IDTabla: Integer): Boolean; +var + AList : TIntegerList; +begin + AList := TIntegerList.Create; + try + AList.Add(IDTabla); + Result := Self.AnadirMarcaEnvioCorreo(Tabla, AList); + finally + FreeANDNIL(AList) + end; +end; + +function TDataModuleRegistroCorreos.AnadirMarcaEnvioCorreo(const Tabla: String; + IDsTabla: TIntegerList): Boolean; +begin + Result := (RORemoteService as IsrvRegistroCorreos).AnadirMarcaEnvio(Tabla, IDsTabla.ToIntegerArray); +end; + +procedure TDataModuleRegistroCorreos.DAClientDataModuleCreate(Sender: TObject); +begin + RORemoteService.Channel := dmConexion.Channel; + RORemoteService.Message := dmConexion.Message; +end; + + +end. diff --git a/Source/Modulos/Registro de correos/Servidor/srvRegistroCorreos_Impl.dfm b/Source/Modulos/Registro de correos/Servidor/srvRegistroCorreos_Impl.dfm new file mode 100644 index 0000000..a7acae5 --- /dev/null +++ b/Source/Modulos/Registro de correos/Servidor/srvRegistroCorreos_Impl.dfm @@ -0,0 +1,47 @@ +object srvRegistroCorreos: TsrvRegistroCorreos + OldCreateOrder = True + ServiceSchema = schRegistroCorreo + ServiceDataStreamer = Bin2DataStreamer + ExportedDataTables = <> + Height = 300 + Width = 300 + object Bin2DataStreamer: TDABin2DataStreamer + Left = 48 + Top = 80 + end + object schRegistroCorreo: TDASchema + ConnectionManager = dmServer.ConnectionManager + Datasets = <> + JoinDataTables = <> + UnionDataTables = <> + Commands = < + item + Params = < + item + Name = 'TABLA' + DataType = datString + Size = 50 + Value = '' + ParamType = daptInput + end + item + Name = 'IDTABLA' + Value = '' + end> + Statements = < + item + Connection = 'IBX' + TargetTable = 'REGISTRO_CORREOS' + SQL = 'execute procedure PRO_ANADIR_MARCA_ENVIO_CORREO :TABLA, :IDTABLA' + StatementType = stSQL + ColumnMappings = <> + end> + Name = 'AnadirMarcaEnvio' + end> + RelationShips = <> + UpdateRules = <> + Version = 0 + Left = 48 + Top = 24 + end +end diff --git a/Source/Modulos/Registro de correos/Servidor/srvRegistroCorreos_Impl.pas b/Source/Modulos/Registro de correos/Servidor/srvRegistroCorreos_Impl.pas new file mode 100644 index 0000000..b0a882a --- /dev/null +++ b/Source/Modulos/Registro de correos/Servidor/srvRegistroCorreos_Impl.pas @@ -0,0 +1,93 @@ +unit srvRegistroCorreos_Impl; + +{----------------------------------------------------------------------------} +{ This unit was automatically generated by the RemObjects SDK after reading } +{ the RODL file associated with this project . } +{ } +{ This is where you are supposed to code the implementation of your objects. } +{----------------------------------------------------------------------------} + +{$I RemObjects.inc} + +interface + +uses +{vcl:} Classes, SysUtils, + {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, + {Ancestor Implementation:} DataAbstractService_Impl, + {Used RODLs:} DataAbstract4_Intf, + {Generated:} uDABusinessProcessor, uDABin2DataStreamer, uDADataStreamer, + uDAScriptingProvider, uDAClasses, + FactuGES_Intf, uDAInterfaces; + +type + { TsrvRegistroCorreos } + TsrvRegistroCorreos = class(TDataAbstractService, IsrvRegistroCorreos) + Bin2DataStreamer: TDABin2DataStreamer; + schRegistroCorreo: TDASchema; + private + protected + { IsrvRegistroCorreos methods } + function AnadirMarcaEnvio(const NombreTabla: AnsiString; const IdsTabla: TIntegerArray): Boolean; + end; + +implementation + +{$R *.dfm} +uses + {Generated:} FactuGES_Invk, uDataModuleServer, uDatabaseUtils, uROClasses; + +procedure Create_srvRegistroCorreos(out anInstance : IUnknown); +begin + anInstance := TsrvRegistroCorreos.Create(nil); +end; + +{ srvRegistroCorreos } +function TsrvRegistroCorreos.AnadirMarcaEnvio(const NombreTabla: AnsiString; const IdsTabla: TIntegerArray): Boolean; +var + ASchema : TDASchema; + AConn : IDAConnection; + dsCommand: IDASQLCommand; + i: Integer; + +begin + Result := False; + + ASchema := schRegistroCorreo; + AConn := dmServer.ConnectionManager.NewConnection(dmServer.ConnectionManager.GetDefaultConnectionName); + try + try + + //Vamos generando todas y cada una de las marcas de impresion + for i := 0 to IdsTabla.Count - 1 do + begin + dsCommand := ASchema.NewCommand(AConn, 'AnadirMarcaEnvio'); + with dsCommand do + begin + ParamByName('TABLA').AsString := NombreTabla; + ParamByName('IDTABLA').AsInteger := IdsTabla.Items[i]; + end; + dsCommand.Execute; + end; + AConn.CommitTransaction; + Result := True; + except + RaiseError('Error al aņadir una nueva marca de envio ' + NombreTabla + ' en tablas'); + AConn.RollbackTransaction; + end; + finally + dsCommand := NIL; + ASchema := NIL; + end; +end; + +var + fClassFactory: IROClassFactory; +initialization + fClassFactory := TROClassFactory.Create('srvRegistroCorreos', Create_srvRegistroCorreos, TsrvRegistroCorreos_Invoker); + +finalization + UnRegisterClassFactory(fClassFactory); + fClassFactory := nil; + +end.