119 lines
4.4 KiB
ObjectPascal
119 lines
4.4 KiB
ObjectPascal
|
|
unit srvTiendaWeb_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:} DARemoteService_Impl,
|
|||
|
|
{Used RODLs:} DataAbstract_Intf,
|
|||
|
|
{Generated:} FactuGES_Intf, uDAScriptingProvider, uDABusinessProcessor,
|
|||
|
|
uDAClasses, uDADataTable, uDABINAdapter,
|
|||
|
|
uDAInterfaces;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
{ TsrvTiendaWeb }
|
|||
|
|
TsrvTiendaWeb = class(TDARemoteService, IsrvTiendaWeb)
|
|||
|
|
DABINAdapter: TDABINAdapter;
|
|||
|
|
Diagrams: TDADiagrams;
|
|||
|
|
bpTiendaWeb: TDABusinessProcessor;
|
|||
|
|
bp_osc_Customers: TDABusinessProcessor;
|
|||
|
|
bp_osc_Customers_info: TDABusinessProcessor;
|
|||
|
|
bp_osc_AddressBook: TDABusinessProcessor;
|
|||
|
|
bp_osc_Manufacturers: TDABusinessProcessor;
|
|||
|
|
schTiendaWeb: TDASchema;
|
|||
|
|
DataDictionary: TDADataDictionary;
|
|||
|
|
procedure DARemoteServiceBeforeGetDatasetData(const Dataset: IDADataset;
|
|||
|
|
const IncludeSchema: Boolean; const MaxRecords: Integer);
|
|||
|
|
procedure DARemoteServiceCreate(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
procedure AsignarConexion (const AConnectionName: string);
|
|||
|
|
protected
|
|||
|
|
function GetNextAutoInc(const GeneratorName: String): Integer;
|
|||
|
|
function GetDatasetSchemaOSC(const aDatasetName: String): Binary;
|
|||
|
|
function GetDatasetDataExOSC(const DatasetName: String; const Params: TDADatasetParamArray; const UserFilter: String; const IncludeSchema: Boolean;
|
|||
|
|
const MaxRecords: Integer): Binary;
|
|||
|
|
function UpdateDataOSC(const Delta: Binary): Binary;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
uses
|
|||
|
|
{Generated:} FactuGES_Invk, uDataModuleServer, schTiendaWebClient_Intf,
|
|||
|
|
uDatabaseUtils, uRestriccionesUsuarioUtils, Dialogs, uBizTiendaWebServer,
|
|||
|
|
uBizOscCustomerServer, uBizOscAddressBookServer, uBizOscManufacturerServer;
|
|||
|
|
|
|||
|
|
procedure Create_srvTiendaWeb(out anInstance : IUnknown);
|
|||
|
|
begin
|
|||
|
|
anInstance := TsrvTiendaWeb.Create(NIL);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
{ srvTiendaWeb }
|
|||
|
|
procedure TsrvTiendaWeb.AsignarConexion(const AConnectionName: string);
|
|||
|
|
begin
|
|||
|
|
Self.ConnectionName := AConnectionName;
|
|||
|
|
Connection := dmServer.ConnectionManager.NewConnection(Self.ConnectionName);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TsrvTiendaWeb.DARemoteServiceBeforeGetDatasetData(
|
|||
|
|
const Dataset: IDADataset; const IncludeSchema: Boolean;
|
|||
|
|
const MaxRecords: Integer);
|
|||
|
|
begin
|
|||
|
|
if DataSet.Name = nme_TiendaWeb then
|
|||
|
|
begin
|
|||
|
|
{ Aqu<EFBFBD> se asegura que el usuario s<EFBFBD>lo accede a los RemesasCliente
|
|||
|
|
de las empresas a las que tiene permiso para acceder
|
|||
|
|
filtrando DataSet por ID_EMPRESA. }
|
|||
|
|
FiltrarAccesoUsuario(Session, dmServer.DarNuevaConexion, schTiendaWeb, DataSet, fld_TiendaWebID_EMPRESA);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TsrvTiendaWeb.DARemoteServiceCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SessionManager := dmServer.SessionManager;
|
|||
|
|
bpTiendaWeb.BusinessRulesID := BIZ_SERVER_TIENDA_WEB;
|
|||
|
|
bp_osc_Customers.BusinessRulesID := BIZ_SERVER_OSC_CUSTOMER;
|
|||
|
|
bp_osc_AddressBook.BusinessRulesID := BIZ_SERVER_OSC_ADDRESSBOOK;
|
|||
|
|
bp_osc_Manufacturers.BusinessRulesID := BIZ_SERVER_OSC_MANUFACTURER;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TsrvTiendaWeb.GetDatasetDataExOSC(const DatasetName: String;
|
|||
|
|
const Params: TDADatasetParamArray; const UserFilter: String;
|
|||
|
|
const IncludeSchema: Boolean; const MaxRecords: Integer): Binary;
|
|||
|
|
begin
|
|||
|
|
AsignarConexion('MySQL');
|
|||
|
|
Result := GetDatasetDataEx(DatasetName, Params, UserFilter, IncludeSchema, MaxRecords);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TsrvTiendaWeb.GetDatasetSchemaOSC(const aDatasetName: String): Binary;
|
|||
|
|
begin
|
|||
|
|
AsignarConexion('MySQL');
|
|||
|
|
Result := GetDatasetSchema(aDatasetName);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TsrvTiendaWeb.GetNextAutoInc(const GeneratorName: String): Integer;
|
|||
|
|
begin
|
|||
|
|
Result := uDatabaseUtils.GetNextAutoInc(GeneratorName)
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TsrvTiendaWeb.UpdateDataOSC(const Delta: Binary): Binary;
|
|||
|
|
begin
|
|||
|
|
AsignarConexion('MySQL');
|
|||
|
|
Result := UpdateData(Delta);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
initialization
|
|||
|
|
TROClassFactory.Create('srvTiendaWeb', Create_srvTiendaWeb, TsrvTiendaWeb_Invoker);
|
|||
|
|
|
|||
|
|
finalization
|
|||
|
|
|
|||
|
|
end.
|