Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
StarUML Evológica Plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
evologica
StarUML Evológica Plugin
Commits
7b8e54f3
Commit
7b8e54f3
authored
Mar 17, 2020
by
Lucio Sandrini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correção de alguns erros no Cadastro de Formulário.
parent
d7ffe4a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
24 deletions
+34
-24
ituCadastrarFormulario.lfm
EvoUMLPlugin/src/ituCadastrarFormulario.lfm
+1
-0
ituCadastrarFormulario.pas
EvoUMLPlugin/src/ituCadastrarFormulario.pas
+33
-24
No files found.
EvoUMLPlugin/src/ituCadastrarFormulario.lfm
View file @
7b8e54f3
...
@@ -5,6 +5,7 @@ object itCadastrarFormulario: TitCadastrarFormulario
...
@@ -5,6 +5,7 @@ object itCadastrarFormulario: TitCadastrarFormulario
Width = 937
Width = 937
ClientHeight = 482
ClientHeight = 482
ClientWidth = 937
ClientWidth = 937
OnDestroy = FormDestroy
LCLVersion = '2.1.0.0'
LCLVersion = '2.1.0.0'
object scrlbxTudo: TScrollBox
object scrlbxTudo: TScrollBox
Left = 0
Left = 0
...
...
EvoUMLPlugin/src/ituCadastrarFormulario.pas
View file @
7b8e54f3
...
@@ -51,6 +51,7 @@ type
...
@@ -51,6 +51,7 @@ type
procedure
cbbFormSelect
(
Sender
:
TObject
);
procedure
cbbFormSelect
(
Sender
:
TObject
);
procedure
edtDisplayNomeChange
(
Sender
:
TObject
);
procedure
edtDisplayNomeChange
(
Sender
:
TObject
);
procedure
edtNomeChange
(
Sender
:
TObject
);
procedure
edtNomeChange
(
Sender
:
TObject
);
procedure
FormDestroy
(
Sender
:
TObject
);
procedure
lstAtributosFill
(
piType
:
string
);
procedure
lstAtributosFill
(
piType
:
string
);
procedure
btnCancelarClick
(
Sender
:
TObject
);
procedure
btnCancelarClick
(
Sender
:
TObject
);
procedure
btnUpClick
(
Sender
:
TObject
);
procedure
btnUpClick
(
Sender
:
TObject
);
...
@@ -237,14 +238,19 @@ end;
...
@@ -237,14 +238,19 @@ end;
procedure
TitCadastrarFormulario
.
btnSalvarClick
(
Sender
:
TObject
);
procedure
TitCadastrarFormulario
.
btnSalvarClick
(
Sender
:
TObject
);
var
var
lField
,
lResponseField
,
lFormField
,
lFields
,
lNewForm
,
lField
,
lResponseField
,
lFormField
,
lFields
,
lNewForm
,
lFieldField
,
lTypeField
,
lTypeSelectRelation
:
utField
;
lFieldField
,
lTypeField
,
lTypeSelectRelation
,
lForm
:
utField
;
lOrder
,
lFormOID
:
Integer
;
lOrder
,
lFormOID
:
Integer
;
lItem
:
TListItem
;
lItem
:
TListItem
;
begin
begin
if
edtNomeForm
.
Text
=
''
then
raise
Exception
.
Create
(
'O Formulrio deve possuir um nome.'
);
lField
:=
utField
.
Create
;
lField
:=
utField
.
Create
;
lFormField
:=
lField
.
AddField
(
'Form'
);
lFormField
:=
lField
.
AddField
(
'Form'
);
if
cbbForm
.
Text
<>
'Novo'
then
lFormField
.
AddAttribute
(
'OID'
).
AsInteger
:=
Integer
(
cbbForm
.
Items
.
Objects
[
cbbForm
.
ItemIndex
]);
if
cbbForm
.
Text
<>
'Novo'
then
if
edtNomeForm
.
Text
<>
''
then
lFormField
.
AddAttribute
(
'name'
).
AsString
:=
edtNomeForm
.
Text
;
lFormField
.
AddAttribute
(
'OID'
).
AsInteger
:=
Integer
(
cbbForm
.
Items
.
Objects
[
cbbForm
.
ItemIndex
]);
lFormField
.
AddAttribute
(
'name'
).
AsString
:=
edtNomeForm
.
Text
;
lFields
:=
lFormField
.
AddField
(
'Fields'
);
lFields
:=
lFormField
.
AddField
(
'Fields'
);
lOrder
:=
0
;
lOrder
:=
0
;
...
@@ -290,31 +296,30 @@ begin
...
@@ -290,31 +296,30 @@ begin
{caso tenha sido salvo com sucesso}
{caso tenha sido salvo com sucesso}
if
lResponseField
.
HasField
(
'Form'
)
then
if
lResponseField
.
HasField
(
'Form'
)
then
begin
begin
lFormOID
:=
lResponseField
.
FieldByName
(
'Form'
).
AttributeByName
(
'OID'
).
AsInteger
;
application
.
MessageBox
(
'Formulrio salvo com sucesso.'
,
'StarUML'
,
MB_ICONASTERISK
+
MB_OK
);
lForm
:=
lResponseField
.
FieldByName
(
'Form'
);
lFormOID
:=
lForm
.
AttributeByName
(
'OID'
).
AsInteger
;
if
cbbForm
.
Text
=
'Novo'
then
if
cbbForm
.
Text
=
'Novo'
then
begin
begin
lblCodigoForm
2
.
Caption
:=
IntToStr
(
lFormOID
);
lblCodigoForm
.
Caption
:=
IntToStr
(
lFormOID
);
cbbForm
.
Items
.
Objects
[
cbbForm
.
ItemIndex
]
:=
Pointer
(
lFormOID
);
cbbForm
.
Items
.
Objects
[
cbbForm
.
ItemIndex
]
:=
Pointer
(
lFormOID
);
cbbForm
.
Items
[
cbbForm
.
ItemIndex
]
:=
IntToStr
(
lFormOID
);
{mudar para o nome depois---------------------}
cbbForm
.
AddItem
(
'Novo'
,
nil
);
cbbForm
.
AddItem
(
'Novo'
,
nil
);
l
NewForm
:=
fForms
.
AddField
(
'Form'
);
l
Form
.
Name
:=
IntToStr
(
lFormOID
);
lNewForm
.
Assign
(
lResponseField
.
FieldByName
(
'Form'
));
lNewForm
:=
fForms
.
AddField
(
IntToStr
(
lFormOID
));
lNewForm
.
Name
:=
IntToStr
(
lFormOID
);
lNewForm
.
Assign
(
lForm
);
end
end
else
else
begin
begin
//cbbForm.Text := IntToStr(lFormOID); {mudar para o nome depois---------------------}
lForm
.
Name
:=
IntToStr
(
lFormOID
);
fForms
.
FieldByName
(
IntToStr
(
lFormOID
)).
Assign
(
lResponseField
.
FieldByName
(
'Form'
));
fForms
.
FieldByName
(
IntToStr
(
lFormOID
)).
Assign
(
lForm
);
fForms
.
FieldByName
(
'Form'
).
Name
:=
IntToStr
(
lFormOID
);
end
;
end
;
if
lResponseField
.
FieldByName
(
'Form'
).
HasAttribute
(
'name'
)
then
cbbForm
.
Items
[
cbbForm
.
ItemIndex
]
:=
lForm
.
AttributeByName
(
'name'
).
AsString
;
begin
cbbForm
.
ItemIndex
:=
cbbForm
.
Items
.
IndexOf
(
lForm
.
AttributeByName
(
'name'
).
AsString
);
cbbForm
.
Items
[
cbbForm
.
ItemIndex
]
:=
lResponseField
.
FieldByName
(
'Form'
).
AttributeByName
(
'name'
).
AsString
;
edtNomeForm
.
Text
:=
lForm
.
AttributeByName
(
'name'
).
AsString
;
edtNomeForm
.
Text
:=
lResponseField
.
FieldByName
(
'Form'
).
AttributeByName
(
'name'
).
AsString
;
end
;
application
.
MessageBox
(
'Formulrio salvo com sucesso.'
,
'StarUML'
,
MB_ICONASTERISK
+
MB_OK
);
end
end
else
raise
Exception
.
Create
(
'Erro ao salvar formulrio.'
);
else
raise
Exception
.
Create
(
'Erro ao salvar formulrio.'
);
...
@@ -456,6 +461,7 @@ begin
...
@@ -456,6 +461,7 @@ begin
lItem
.
Checked
:=
True
;
lItem
.
Checked
:=
True
;
lItem
.
SubItems
[
__DISPLAY_NAME
]
:=
lFieldItem
.
AttributeByName
(
'displayName'
).
AsString
;
lItem
.
SubItems
[
__DISPLAY_NAME
]
:=
lFieldItem
.
AttributeByName
(
'displayName'
).
AsString
;
lItem
.
SubItems
[
__OBRIGATORIO
]
:=
lFieldItem
.
AttributeByName
(
'required'
).
AsString
;
lItem
.
SubItems
[
__OBRIGATORIO
]
:=
lFieldItem
.
AttributeByName
(
'required'
).
AsString
;
lItem
.
SubItems
[
__ID
]
:=
lFieldItem
.
AttributeByName
(
'id'
).
AsString
;
lItem
.
SubItems
[
__TIPO
]
:=
lFieldItem
.
FieldByName
(
'Type'
).
AttributeByName
(
'name'
).
AsString
;
lItem
.
SubItems
[
__TIPO
]
:=
lFieldItem
.
FieldByName
(
'Type'
).
AttributeByName
(
'name'
).
AsString
;
lFieldItem
.
Name
:=
IntToStr
(
lId
);
lFieldItem
.
Name
:=
IntToStr
(
lId
);
...
@@ -695,11 +701,14 @@ begin
...
@@ -695,11 +701,14 @@ begin
end
;
end
;
end
;
end
;
//procedure itCadastrarFormulario.Finalize;
procedure
TitCadastrarFormulario
.
FormDestroy
(
Sender
:
TObject
);
//begin
begin
// inherited;
if
Assigned
(
fTypesField
)
then
// if Assigned(fTypesField) then
fTypesField
.
Free
;
// fTypesField.Free;
if
Assigned
(
fForms
)
then
//end;
fForms
.
Free
;
if
Assigned
(
fFormFields
)
then
fFormFields
.
Free
;
end
;
end
.
end
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment