Commit 7b8cb443 authored by Thiago Anders's avatar Thiago Anders

Commit Inicial

parents
*.dproj
*.exe
*.~*
{
"generator-curio": {
"srv": {
"path": "srv/src",
"dprname": "HelloWorld"
},
"cli": {
"path": "cli/win/",
"dpkname": "HelloWorld"
}
}
}
\ No newline at end of file
-- CLASS ngCliente
CREATE TABLE CLIENTE (
ID_CLIENTE INT PRIMARY KEY,
NOME VARCHAR(256) NOT NULL,
CPF VARCHAR(11) NOT NULL
);
-- CLASS ngEmprestimo
CREATE TABLE EMPRESTIMO (
ID_EMPRESTIMO INT PRIMARY KEY,
RETIRADA DATETIME NOT NULL,
PREVISTADEV DATETIME NOT NULL,
DATADEV DATETIME NOT NULL,
ID_EXEMPLAR INT NOT NULL,
ID_CLIENTE INT NOT NULL
);
-- CLASS ngEmprestimo
-- RELATION ngExemplar(0..*) <----> (1..1)ngEmprestimo
ALTER TABLE EMPRESTIMO ADD CONSTRAINT F3000ID_EXEMPLAR FOREIGN KEY (ID_EXEMPLAR) REFERENCES EXEMPLAR(ID_EXEMPLAR);
CREATE INDEX I3000ID_EXEMPLAR ON EMPRESTIMO (ID_EXEMPLAR);
-- RELATION ngCliente(0..*) <----> (1..1)ngEmprestimo
ALTER TABLE EMPRESTIMO ADD CONSTRAINT F3000ID_CLIENTE FOREIGN KEY (ID_CLIENTE) REFERENCES CLIENTE(ID_CLIENTE);
CREATE INDEX I3000ID_CLIENTE ON EMPRESTIMO (ID_CLIENTE);
-- CLASS ngExemplar
CREATE TABLE EXEMPLAR (
ID_EXEMPLAR INT PRIMARY KEY,
CODIGO VARCHAR(32) NOT NULL,
ID_SITUACAOEXEMPLAR INT NOT NULL,
ID_LIVRO INT NOT NULL
);
-- CLASS ngExemplar
-- RELATION ngSituacaoExemplar(0..*) <----> (1..1)ngExemplar
ALTER TABLE EXEMPLAR ADD CONSTRAINT F2999ID_SITUACAOEXEMPLAR FOREIGN KEY (ID_SITUACAOEXEMPLAR) REFERENCES SITUACAOEXEMPLAR(ID_SITUACAOEXEMPLAR);
CREATE INDEX I2999ID_SITUACAOEXEMPLAR ON EXEMPLAR (ID_SITUACAOEXEMPLAR);
-- RELATION ngLivro(0..*) <----> (1..1)ngExemplar
ALTER TABLE EXEMPLAR ADD CONSTRAINT F2999ID_LIVRO FOREIGN KEY (ID_LIVRO) REFERENCES LIVRO(ID_LIVRO);
CREATE INDEX I2999ID_LIVRO ON EXEMPLAR (ID_LIVRO);
-- CLASS ngLivro
CREATE TABLE LIVRO (
ID_LIVRO INT PRIMARY KEY,
TITULO VARCHAR(200) NOT NULL,
AUTOR VARCHAR(128) NOT NULL,
EDICAO VARCHAR(64) NOT NULL
);
-- CLASS ngSituacaoExemplar
CREATE TABLE SITUACAOEXEMPLAR (
ID_SITUACAOEXEMPLAR INT PRIMARY KEY,
CODIGO VARCHAR(32) NOT NULL,
DESCRICAO VARCHAR(128) NOT NULL
);
<?xml version="1.0" encoding="UTF-8" ?>
<Config>
<Application DefaultSecurityDriver="NativeSecurityDriver">
<Service Name="svHelloWorld" DisplayName="Idexa - HelloWorld" Description="exemplo" Port="7878"/>
<Database ActiveConnectionString="ConnectionString1">
<ConnectionString1>Provider=SQLOLEDB.1;Password=conexo;Persist Security Info=True;User ID=sa;Initial Catalog=BD_HELLO_WORLD_THIAGO;Data Source=srvd1;Application Name=Produto;cxsqldialect=SQLServer</ConnectionString1>
</Database>
<UseXMLEncode version="1"/>
</Application>
</Config>
This diff is collapsed.
package HelloWorld;
{$R *.res}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS OFF}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION ON}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO OFF}
{$SAFEDIVIDE OFF}
{$STACKFRAMES OFF}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DESCRIPTION 'Conexo HelloWorld'}
{$RUNONLY}
{$IMPLICITBUILD ON}
{$DEFINE RELEASE}
{$DEFINE DEBUG}
requires
rtl,
CXClient,
vcl,
JvCore,
dbrtl,
vcljpg,
vclx,
JclVcl,
Jcl,
vclimg,
JvStdCtrls,
JvSystem,
JvMM,
JvControls,
elpackD11,
tee,
teeUI,
teedb,
vcldb,
JvDB,
JvDlgs,
JvCustom,
JvGlobus,
bdertl,
xmlrtl,
vclie,
VclSmp,
JvWizards;
contains
ituHelloWorldMain in 'itu\ituHelloWorldMain.pas';
end.
unit ituHelloWorldMain;
interface
uses
ituInterfaceFactory, ituMain, ituMainPortal;
type
itHelloWorldMain = class(itMainPortal)
protected
function InitialLevel: integer; override;
public
procedure Initialize; override;
end;
var
fUsuario, fSenha, fCodigoSusep : string;
implementation
procedure itHelloWorldMain.Initialize;
begin
MainPortal := TMainPortal.Create(nil);
inherited;
end;
function itHelloWorldMain.InitialLevel: integer;
begin
result := 0;
end;
initialization
gInterfaceFactory.RegisterClass(ITCTLMAIN, itHelloWorldMain);
finalization
gInterfaceFactory.UnregisterClass(ITCTLMAIN);
end.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID('SISBTNUMER') AND type in ('U'))
DROP TABLE SISBTNUMER
CREATE TABLE SISBTNUMER(
SISBDSNUME varchar(50) PRIMARY KEY,
SISBNONUME int NOT NULL,
)
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID('VERSAO_BANCO') AND type in ('U'))
DROP TABLE VERSAO_BANCO
CREATE TABLE VERSAO_BANCO (
ID_VERSAO_BANCO int NOT NULL PRIMARY KEY,
VERSAO INT NOT NULL,
BRANCH varchar(50) NOT NULL,
NOME_ARQUIVO varchar(50) NOT NULL,
DATA_ATUALIZACAO datetime NOT NULL,
)
INSERT IESATSISTE (IESAIDSIST, IESANMSIST, IESADSSIST, IESAVERSAO, IESACDSIST, IESACDSITU)
VALUES (1, 'SISEG', 'Sistema de Seguranca', '1.0', 19, 'A')
INSERT IESDTCATEG (IESDIDCATE, IESDNMCATE, IESDCDCATE, IESDCDSITU)
VALUES (1, 'Processos', 1, 'A')
INSERT IESOTINTER (IESOIDINTE, IESONMINTE, IESOCDINTE, IESODSINTE, IESOCDSITU)
VALUES (1, 'itImportaConfiguracaoSistema', 183, 'itImportaConfiguracaoSistema', 'A')
INSERT IESCTENTID (IESCIDENTI, IESCNMENTI, IESCCDENTI, IESCTIENTI, IESCCDSITU)
VALUES (1, 'Configuracoes', 168, 'Configuracoes', 'A')
INSERT IESFTCUICO (IESFIDCUIC, IESFDSCUIC, IESFCDCUIC, IESFCDSITU)
VALUES (1, 'Processo', 1, 'A')
INSERT IESBTCASOU (IESBIDCASO, IESBDSCASO, IESBNMCASO, IESBCDCASO, IESBTPCASO, IESBIDCUIC, IESBIDENTI, IESBIDCATE, IESBCDSITU)
VALUES (1, 'Importa configuracao sistema', 'Importa configuracao sistema', 1327, NULL, 1, 1, 1, 'A')
INSERT IESETSISCU (IESEIDSIST, IESEIDCASO, IESEIDSISC, IESECDSITU)
VALUES (1, 1, 1, 'A')
INSERT IESJTOPERA (IESJIDOPER, IESJDSOPER, IESJCDOPER, IESJCDSITU)
VALUES (1, 'Executar', 5, 'A')
INSERT IESPTSISIN (IESPIDSISI, IESPIDCASO, IESPIDSIST, IESPIDINTE, IESPCDSITU)
VALUES (1, 1, 1, 1, 'A')
INSERT IESGTCUOPE (IESGIDCUOP, IESGIDCASO, IESGIDOPER, IESGCDSITU)
VALUES (1, 1, 1, 'A')
INSERT SEGDTNAUSU (SEGDIDNAUS, SEGDCDNAUS, SEGDDSNAUS)
VALUES (1, 0, 'ADMINISTRADOR')
INSERT SEGDTNAUSU (SEGDIDNAUS, SEGDCDNAUS, SEGDDSNAUS)
VALUES (2, 3, 'OUTROS')
INSERT SEGETSINAU (SEGEIDSIST, SEGEIDNAUS)
VALUES (1, 1)
INSERT SEGATUSUAR (SEGAIDUSUA, SEGACDUSUA, SEGASENHAU, SEGADTULSE, SEGADTCADU, SEGAINCANC, SEGACDHERA, SEGACDREFE, SEGAIDNAUS, SEGAFORMSE, SEGASALTSE, SEGAMOBILE, SEGAEEMAIL, SEGALEMAIL, SEGASENHAQ, SEGASENHAA, SEGABLOQUE, SEGAULTLGN, SEGAULTBLQ, SEGAFSACOU, SEGAFSAWST, SEGAFSAACO, SEGAFSAAWS, SEGACOMMEN, SEGAULTACT, SEGAPRSETC)
VALUES (1, 'Administrador', '', NULL, CAST(0x00009BBE00000000 AS DateTime), 'N', -6, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
\ No newline at end of file
program HelloWorld;
{$R 'VersionInfo.res' 'VersionInfo.rc'}
{$R 'mmenu.res' 'mmenu.rc'}
uses
Classes,
SvcMgr,
acuNativeSecurityDriver,
acuConexoSecurityDriver,
acuSQLDialectDB2,
acuSQLDialectOracle,
acuSQLDialectSQLServer,
acuObject,
ucuManager,
acuCollection,
ucuUseCase,
nguEvent,
nguOperation,
nguPermission,
utuMessage,
utuRequest,
utuRequestQueue,
utuParamFields,
mxuConnectionServer,
utuLinksManager,
utuLink,
utuLinkSharedMemory,
utuLinkSock,
blcksock,
synsock,
mxuUseCaseCommCenter,
mxuCommCenter,
utuProtectedList,
sucuBuscaObjetosBasica,
utuFactory,
ucuUseCaseFactory,
acOQL,
acuRepositorySQL,
ucuMain,
ucuSecurityManager,
acuUseCaseServer,
acuContainers,
acuPersistenceLog,
acuApplicationLog,
acuPersistenceEventsToApplicationLogSubscriber,
utuStateMachine,
acuSystem,
acuQuerySQLADO,
NGUAuditEvent,
NGUAuditEventData,
nguSystemConfigUpdateLog,
nguUser,
nguCategory,
nguEntity,
nguGUITicket,
nguIcon,
nguLevel,
nguSystem,
nguMessage,
nguSystemGUITickets,
nguSystemUseCaseTicket,
nguUseCaseTicket,
nguUseCaseTicketOperation,
nguBusinessEvent,
NGuBusinessEventDistributed,
nguBusinessEventSubscriber,
NGuBusinessEventSubscriberError,
nguBusinessEventType,
NGuBusinessSubscriberNotifierEventualTimeWindow,
NGuBusinessSubscriberNotifierTimeGrid,
NGuBusinessSubscriberNotifierTimeWindow,
ucuCadastroBasicoV4,
SysUtils,
acuFramework,
ucuExplorerV4,
ucuControlPanelConsole,
ucuProfiler,
sucuBuscaObjetosServidores,
ucuControlPanel,
sucuBuscaObjetosUsuarioV4,
sucuBuscaLogAtualizacaoSistema,
sucuBuscaNaturezas,
ucuCadastroNatureza,
ucuControleAcesso,
ucuPropriedadesDoServico,
ucuDetalhesAtualizacaoSistema,
ucuImportaConfiguracaoSistema,
ucuCadastroUsuarioSistema,
utuSysUtils,
acuRegisterModelMappings in 'lib\acuRegisterModelMappings.pas',
nguVersaoBanco in 'ngu\nguVersaoBanco.pas',
ucuHelloWorldMain in 'ucu\ucuHelloWorldMain.pas',
svuHelloWorld in 'svuHelloWorld.pas' {svHelloWorld: TService},
ucuHelloWorld in 'ucu\ucuHelloWorld.pas';
var
lErros : TStringList;
begin
gDefaultConnetionString := gSystem.ParamByName['Application.Database.' + gSystem.ParamByName['Application.Database.@ActiveConnectionString']];
Application.Initialize;
RegisterModelMappings(PersistenceManager.DefaultMetaModel);
PersistenceManager.Initialize;
lErros := TStringList.Create;
try
if not PersistenceManager.DefaultMetaModel.ImplementationOK(lErros) then
begin
lErros.SaveToFile(IncludeTrailingPathDelimiter(ExtractFileDir(ParamStr(0))) + 'ModelErrors.log');
raise Exception.Create('Error initalizing service, check ModelErrors.log for details.');
end;
finally
lErros.Free;
end;
Application.CreateForm(TsvHelloWorld, svHelloWorld);
Application.Run;
end.
// Version Information Resource File
1 VERSIONINFO
FILEVERSION 1, 0, 8, 12
PRODUCTVERSION 1, 0, 8, 12
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
//FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
{
BLOCK "StringFileInfo"
{
BLOCK "041604E4"
{
VALUE "CompanyName", "CONEXO Projetos e Sistemas Ltda\000"
VALUE "FileVersion", "1.0.8.12\000"
VALUE "ProductName", "GED - Gest�o Eletr�nica de Documentos\000"
VALUE "ProductVersion", "1.0.8.12\000"
VALUE "LegalCopyright", "Copyright (C) CONEXO Projetos e Sistemas Ltda. Todos os direitos reservados\000"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 1046, 1252
}
}
This diff is collapsed.
<?xml version="1.0" encoding="iso-8859-1"?>
<SYSMSG>
<System Name="HelloWorld">
<Menu>
</Menu>
</System>
</SYSMSG>
\ No newline at end of file
mmenu RCDATA mainmenu.xml
\ No newline at end of file
unit nguCliente;
interface
uses
acuframework;
type
ngCliente = class(acPersistentObject)
private
FNome: acString;
FCPF: acString;
fEmprestimos: acRelationPartnerList;
published
property Nome: acString read FNome write FNome;
property CPF: acString read FCPF write FCPF;
property Emprestimos: acRelationPartnerList read fEmprestimos write fEmprestimos;
end;
implementation
initialization
PersistenceManager.RegisterClass(ngCliente);
end.
unit nguEmprestimo;
interface
uses
acuframework;
type
ngEmprestimo = class(acPersistentObject)
private
FRetirada: acDateTime;
FPrevistaDev: acDateTime;
FDataDev: acDateTime;
fCliente: acRelationPartnerShip;
fExemplar: acRelationPartnerShip;
published
property Retirada: acDateTime read FRetirada write FRetirada;
property PrevistaDev: acDateTime read FPrevistaDev write FPrevistaDev;
property DataDev: acDateTime read FDataDev write FDataDev;
property Cliente: acRelationPartnerShip read fCliente write fCliente;
property Exemplar: acRelationPartnerShip read fExemplar write fExemplar;
end;
implementation
initialization
PersistenceManager.RegisterClass(ngEmprestimo);
end.
unit nguExemplar;
interface
uses
acuframework;
type
ngExemplar = class(acPersistentObject)
private
FCodigo: acString;
fLivro: acRelationPartnerShip;
fSituacao: acRelationPartnerShip;
fEmprestimos: acRelationPartnerList;
published
property Codigo: acString read FCodigo write FCodigo;
property Livro: acRelationPartnerShip read fLivro write fLivro;
property Situacao: acRelationPartnerShip read fSituacao write fSituacao;
property Emprestimos: acRelationPartnerList read fEmprestimos write fEmprestimos;
end;
implementation
initialization
PersistenceManager.RegisterClass(ngExemplar);
end.
unit nguLivro;
interface
uses
acuframework;
type
ngLivro = class(acPersistentObject)
private
FTitulo: acString;
FAutor: acString;
FEdicao: acString;
fExemplares: acRelationPartnerList;
published
property Titulo: acString read FTitulo write FTitulo;
property Autor: acString read FAutor write FAutor;
property Edicao: acString read FEdicao write FEdicao;
property Exemplares: acRelationPartnerList read fExemplares write fExemplares;
end;
implementation
initialization
PersistenceManager.RegisterClass(ngLivro);
end.
unit nguSituacaoExemplar;
interface
uses
acuframework;
type
ngSituacaoExemplar = class(acPersistentObject)
private
FCodigo: acString;
FDescricao: acString;
published
property Codigo: acString read FCodigo write FCodigo;
property Descricao: acString read FDescricao write FDescricao;
end;
implementation
initialization
PersistenceManager.RegisterClass(ngSituacaoExemplar);
end.
unit nguVersaoBanco;
interface
uses
acuframework;
type
ngVersaoBanco = class(acPersistentObject)
private
FVersao: acInt;
FBranch: acString;
FNomeArquivo: acString;
FDataAtualizacao: acDateTime;
published
property Versao: acInt read FVersao write FVersao;
property Branch: acString read FBranch write FBranch;
property NomeArquivo: acString read FNomeArquivo write FNomeArquivo;
property DataAtualizacao: acDateTime read FDataAtualizacao write FDataAtualizacao;
end;
implementation
initialization
PersistenceManager.RegisterClass(ngVersaoBanco);
end.
object svHelloWorld: TsvHelloWorld
OldCreateOrder = False
OnCreate = ServiceCreate
DisplayName = 'svHelloWorld'
BeforeInstall = ServiceBeforeInstall
AfterInstall = ServiceAfterInstall
AfterUninstall = ServiceAfterUninstall
OnStart = ServiceStart
OnStop = ServiceStop
Height = 150
Width = 215
end
unit svuHelloWorld;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, SvcMgr,
mxuConnectionServer;
type
TsvHelloWorld = class(TService)
procedure ServiceStart(Sender: TService; var Started: Boolean);
procedure ServiceBeforeInstall(Sender: TService);
procedure ServiceCreate(Sender: TObject);
procedure ServiceAfterInstall(Sender: TService);
procedure ServiceAfterUninstall(Sender: TService);
procedure ServiceStop(Sender: TService; var Stopped: Boolean);
private
fConnectionServer: mxConnectionServer;
fDescription: string;
fPortNumber : Word;
procedure LerConfiguracao;
public
function GetServiceController: TServiceController; override;
end;
var
svHelloWorld: TsvHelloWorld;
implementation
{$R *.DFM}
uses
Registry,
acuSystem;
procedure ServiceController(CtrlCode: DWord); stdcall;
begin
svHelloWorld.Controller(CtrlCode);
end;
function TsvHelloWorld.GetServiceController: TServiceController;
begin
Result := ServiceController;
end;
procedure TsvHelloWorld.LerConfiguracao;
begin
if gSystem.HasParam('Application.Service') then
begin
Self.Name:=gSystem.ParamByName['Application.Service.@Name'];
Self.DisplayName:=gSystem.ParamByName['Application.Service.@DisplayName'];
Self.fPortNumber:=StrToInt(gSystem.ParamByName['Application.Service.@Port']);
Self.fDescription:=gSystem.ParamByName['Application.Service.@Description']
end;
end;
procedure TsvHelloWorld.ServiceAfterInstall(Sender: TService);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create(KEY_READ or KEY_WRITE);
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
//entrada do registro com a descri��o do servi�o
if Reg.OpenKey('\SYSTEM\CurrentControlSet\Services\' + Self.Name, false) then
begin
Reg.WriteString('Description', fDescription);
Reg.CloseKey;
end;
//Entrada do registro com a vincula��o dos eventos do event viewer
{ if Reg.OpenKey('\SYSTEM\CurrentControlSet\Services\Eventlog\Application\' + Self.Name, True) then
begin
Reg.WriteString('EventMessageFile', ParamStr(0));
Reg.WriteInteger('TypesSupported', 7);
Reg.CloseKey;
end; }
finally
Reg.Free;
end;
end;
procedure TsvHelloWorld.ServiceAfterUninstall(Sender: TService);
{var
Reg : TRegistry;
Chave : string;}
begin
//Remover entrada no registro da vincula��o com o event viewer
{ Chave := '\SYSTEM\CurrentControlSet\Services\Eventlog\Application\' + Self.Name;
Reg := TRegistry.Create(KEY_READ or KEY_WRITE);
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.KeyExists(Chave) then
Reg.DeleteKey(Chave);
finally
Reg.Free;
end;}
end;
procedure TsvHelloWorld.ServiceBeforeInstall(Sender: TService);
begin
LerConfiguracao;
end;
procedure TsvHelloWorld.ServiceCreate(Sender: TObject);
begin
LerConfiguracao;
end;
procedure TsvHelloWorld.ServiceStart(Sender: TService; var Started: Boolean);
begin
fConnectionServer := mxConnectionServer.Create;
if fPortNumber > 0 then fConnectionServer.Start(fPortNumber) else fConnectionServer.Start;
end;
procedure TsvHelloWorld.ServiceStop(Sender: TService; var Stopped: Boolean);
begin
fConnectionServer.Free;
end;
initialization
finalization
end.
unit ucuEmprestarLivro;
interface
uses
utuStateMachine, utuRequest, ucuUseCase;
type
ucEmprestarLivro = class(ucUseCase)
public
procedure Initialize; Override;
procedure Finalize; Override;
published
procedure Effect_PesquisarUsuario(piRequest: utRequest; piTransition: utTransition);
procedure Effect_EscolherUsuario(piRequest: utRequest; piTransition: utTransition);
procedure Effect_PesquisarExemplar(piRequest: utRequest; piTransition: utTransition);
procedure Effect_CancelarEscolhaExemplar(piRequest: utRequest; piTransition: utTransition);
procedure Effect_ConcluirEdicaoEmprestimo(piRequest: utRequest; piTransition: utTransition);
procedure Effect_RemoverExemplar(piRequest: utRequest; piTransition: utTransition);
procedure Effect_ConfirmarEmprestimo(piRequest: utRequest; piTransition: utTransition);
procedure Effect_CancelarEmprestimo(piRequest: utRequest; piTransition: utTransition);
end;
implementation
uses
ucuManager;
procedure ucEmprestarLivro.Initialize;
begin
inherited;
end;
procedure ucEmprestarLivro.Finalize;
begin
inherited;
end;
procedure ucEmprestarLivro.Effect_PesquisarUsuario(piRequest: utRequest; piTransition: utTransition);
begin
piRequest.Processed := True;
end;
procedure ucEmprestarLivro.Effect_EscolherUsuario(piRequest: utRequest; piTransition: utTransition);
begin
piRequest.Processed := True;
end;
procedure ucEmprestarLivro.Effect_PesquisarExemplar(piRequest: utRequest; piTransition: utTransition);
begin
piRequest.Processed := True;
end;
procedure ucEmprestarLivro.Effect_CancelarEscolhaExemplar(piRequest: utRequest; piTransition: utTransition);
begin
piRequest.Processed := True;
end;
procedure ucEmprestarLivro.Effect_ConcluirEdicaoEmprestimo(piRequest: utRequest; piTransition: utTransition);
begin
piRequest.Processed := True;
end;
procedure ucEmprestarLivro.Effect_RemoverExemplar(piRequest: utRequest; piTransition: utTransition);
begin
piRequest.Processed := True;
end;
procedure ucEmprestarLivro.Effect_ConfirmarEmprestimo(piRequest: utRequest; piTransition: utTransition);
begin
piRequest.Processed := True;
end;
procedure ucEmprestarLivro.Effect_CancelarEmprestimo(piRequest: utRequest; piTransition: utTransition);
begin
piRequest.Processed := True;
end;
initialization
gucManager.RegisterClass(3219,ucEmprestarLivro);
end.
unit ucuHelloWorld;
interface
uses
utuStateMachine, utuRequest, ucuUseCase, utuMessage;
type
ucHelloWorld = class(ucUseCase)
private
fNome: String;
public
procedure Initialize; Override;
procedure Finalize; Override;
published
procedure Effect_Cumprimentar(piRequest: utRequest; piTransition: utTransition);
procedure Effect_Despedir(piRequest: utRequest; piTransition: utTransition);
end;
implementation
uses
ucuManager;
procedure ucHelloWorld.Initialize;
begin
inherited;
end;
procedure ucHelloWorld.Finalize;
begin
inherited;
end;
procedure ucHelloWorld.Effect_Cumprimentar(piRequest: utRequest; piTransition: utTransition);
var
lFieldCumprimento: utField;
begin
fNome := piRequest.Message.RootField.FieldByName('Nome').AsString;
lFieldCumprimento := piRequest.Response.RootField.AddField('Cumprimento');
lFieldCumprimento.asString := 'Ol, ' + fNome;
piRequest.Processed := True;
end;
procedure ucHelloWorld.Effect_Despedir(piRequest: utRequest; piTransition: utTransition);
var
lFieldDespedida: utField;
begin
lFieldDespedida := piRequest.Response.RootField.AddField('Despedida');
lFieldDespedida.asString := 'Tchau, ' + fNome;
piRequest.Processed := True;
end;
initialization
gucManager.RegisterClass(3215,ucHelloWorld);
end.
unit ucuHelloWorldMain;
interface
uses
ucuMain;
type
ucHelloWorldMain = class(ucMain)
protected
function GetGUIXML(piLevel: Integer): string; override;
private
end;
implementation
uses
acuSystem, SysUtils, SvcMgr, ucuManager, Classes, Windows;
function ucHelloWorldMain.GetGUIXML(piLevel: Integer): string;
var
lStream: TResourceStream;
lResult: TStringStream;
begin
lStream := TResourceStream.Create(HInstance, 'mmenu', RT_RCDATA);
try
lResult := TStringStream.Create('');
try
lResult.CopyFrom(lStream, lStream.Size);
Result := lResult.DataString;
finally
lResult.Free;
end;
finally
lStream.Free;
end;
end;
initialization
gucManager.RegisterClass(UCAPLMAIN, ucHelloWorldMain);
end.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment