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
Width = 937
ClientHeight = 482
ClientWidth = 937
OnDestroy = FormDestroy
LCLVersion = '2.1.0.0'
object scrlbxTudo: TScrollBox
Left = 0
...
...
EvoUMLPlugin/src/ituCadastrarFormulario.pas
View file @
7b8e54f3
...
...
@@ -51,6 +51,7 @@ type
procedure
cbbFormSelect
(
Sender
:
TObject
);
procedure
edtDisplayNomeChange
(
Sender
:
TObject
);
procedure
edtNomeChange
(
Sender
:
TObject
);
procedure
FormDestroy
(
Sender
:
TObject
);
procedure
lstAtributosFill
(
piType
:
string
);
procedure
btnCancelarClick
(
Sender
:
TObject
);
procedure
btnUpClick
(
Sender
:
TObject
);
...
...
@@ -237,14 +238,19 @@ end;
procedure
TitCadastrarFormulario
.
btnSalvarClick
(
Sender
:
TObject
);
var
lField
,
lResponseField
,
lFormField
,
lFields
,
lNewForm
,
lFieldField
,
lTypeField
,
lTypeSelectRelation
:
utField
;
lFieldField
,
lTypeField
,
lTypeSelectRelation
,
lForm
:
utField
;
lOrder
,
lFormOID
:
Integer
;
lItem
:
TListItem
;
begin
if
edtNomeForm
.
Text
=
''
then
raise
Exception
.
Create
(
'O Formulrio deve possuir um nome.'
);
lField
:=
utField
.
Create
;
lFormField
:=
lField
.
AddField
(
'Form'
);
if
cbbForm
.
Text
<>
'Novo'
then
lFormField
.
AddAttribute
(
'OID'
).
AsInteger
:=
Integer
(
cbbForm
.
Items
.
Objects
[
cbbForm
.
ItemIndex
]);
if
edtNomeForm
.
Text
<>
''
then
lFormField
.
AddAttribute
(
'name'
).
AsString
:=
edtNomeForm
.
Text
;
if
cbbForm
.
Text
<>
'Novo'
then
lFormField
.
AddAttribute
(
'OID'
).
AsInteger
:=
Integer
(
cbbForm
.
Items
.
Objects
[
cbbForm
.
ItemIndex
]);
lFormField
.
AddAttribute
(
'name'
).
AsString
:=
edtNomeForm
.
Text
;
lFields
:=
lFormField
.
AddField
(
'Fields'
);
lOrder
:=
0
;
...
...
@@ -290,31 +296,30 @@ begin
{caso tenha sido salvo com sucesso}
if
lResponseField
.
HasField
(
'Form'
)
then
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
begin
lblCodigoForm
2
.
Caption
:=
IntToStr
(
lFormOID
);
lblCodigoForm
.
Caption
:=
IntToStr
(
lFormOID
);
cbbForm
.
Items
.
Objects
[
cbbForm
.
ItemIndex
]
:=
Pointer
(
lFormOID
);
cbbForm
.
Items
[
cbbForm
.
ItemIndex
]
:=
IntToStr
(
lFormOID
);
{mudar para o nome depois---------------------}
cbbForm
.
AddItem
(
'Novo'
,
nil
);
l
NewForm
:=
fForms
.
AddField
(
'Form'
);
lNewForm
.
Assign
(
lResponseField
.
FieldByName
(
'Form'
));
lNewForm
.
Name
:=
IntToStr
(
lFormOID
);
l
Form
.
Name
:=
IntToStr
(
lFormOID
);
lNewForm
:=
fForms
.
AddField
(
IntToStr
(
lFormOID
));
lNewForm
.
Assign
(
lForm
);
end
else
begin
//cbbForm.Text := IntToStr(lFormOID); {mudar para o nome depois---------------------}
fForms
.
FieldByName
(
IntToStr
(
lFormOID
)).
Assign
(
lResponseField
.
FieldByName
(
'Form'
));
fForms
.
FieldByName
(
'Form'
).
Name
:=
IntToStr
(
lFormOID
);
lForm
.
Name
:=
IntToStr
(
lFormOID
);
fForms
.
FieldByName
(
IntToStr
(
lFormOID
)).
Assign
(
lForm
);
end
;
if
lResponseField
.
FieldByName
(
'Form'
).
HasAttribute
(
'name'
)
then
begin
cbbForm
.
Items
[
cbbForm
.
ItemIndex
]
:=
lResponseField
.
FieldByName
(
'Form'
).
AttributeByName
(
'name'
).
AsString
;
edtNomeForm
.
Text
:=
lResponseField
.
FieldByName
(
'Form'
).
AttributeByName
(
'name'
).
AsString
;
end
;
application
.
MessageBox
(
'Formulrio salvo com sucesso.'
,
'StarUML'
,
MB_ICONASTERISK
+
MB_OK
);
cbbForm
.
Items
[
cbbForm
.
ItemIndex
]
:=
lForm
.
AttributeByName
(
'name'
).
AsString
;
cbbForm
.
ItemIndex
:=
cbbForm
.
Items
.
IndexOf
(
lForm
.
AttributeByName
(
'name'
).
AsString
);
edtNomeForm
.
Text
:=
lForm
.
AttributeByName
(
'name'
).
AsString
;
end
else
raise
Exception
.
Create
(
'Erro ao salvar formulrio.'
);
...
...
@@ -456,6 +461,7 @@ begin
lItem
.
Checked
:=
True
;
lItem
.
SubItems
[
__DISPLAY_NAME
]
:=
lFieldItem
.
AttributeByName
(
'displayName'
).
AsString
;
lItem
.
SubItems
[
__OBRIGATORIO
]
:=
lFieldItem
.
AttributeByName
(
'required'
).
AsString
;
lItem
.
SubItems
[
__ID
]
:=
lFieldItem
.
AttributeByName
(
'id'
).
AsString
;
lItem
.
SubItems
[
__TIPO
]
:=
lFieldItem
.
FieldByName
(
'Type'
).
AttributeByName
(
'name'
).
AsString
;
lFieldItem
.
Name
:=
IntToStr
(
lId
);
...
...
@@ -695,11 +701,14 @@ begin
end
;
end
;
//procedure itCadastrarFormulario.Finalize;
//begin
// inherited;
// if Assigned(fTypesField) then
// fTypesField.Free;
//end;
procedure
TitCadastrarFormulario
.
FormDestroy
(
Sender
:
TObject
);
begin
if
Assigned
(
fTypesField
)
then
fTypesField
.
Free
;
if
Assigned
(
fForms
)
then
fForms
.
Free
;
if
Assigned
(
fFormFields
)
then
fFormFields
.
Free
;
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