Skip to content

Commit 7c67ee8

Browse files
committed
aula-12-final
1 parent de3fa65 commit 7c67ee8

3 files changed

Lines changed: 328 additions & 6 deletions

File tree

Lines changed: 261 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,263 @@
11
object ClientesCadastrarView: TClientesCadastrarView
2-
Width = 788
3-
Height = 559
2+
Width = 1055
3+
Height = 704
4+
Caption = 'Cadastro de clientes'
5+
ElementFont = efCSS
6+
ElementPopupClassName = 'bg-dark'
7+
Font.Charset = DEFAULT_CHARSET
8+
Font.Color = clWindowText
9+
Font.Height = -12
10+
Font.Name = 'Segoe UI'
11+
Font.Style = []
12+
ParentFont = False
13+
OnShow = WebFormShow
14+
object lbNome: TWebLabel
15+
Left = 136
16+
Top = 200
17+
Width = 33
18+
Height = 15
19+
Caption = 'Nome'
20+
ElementID = 'lbNome'
21+
ElementFont = efCSS
22+
ElementPosition = epIgnore
23+
HeightStyle = ssAuto
24+
HeightPercent = 100.000000000000000000
25+
WidthStyle = ssAuto
26+
WidthPercent = 100.000000000000000000
27+
end
28+
object lbCodigo: TWebLabel
29+
Left = 136
30+
Top = 120
31+
Width = 39
32+
Height = 15
33+
Caption = 'C'#243'digo'
34+
ElementID = 'lbCodigo'
35+
ElementFont = efCSS
36+
ElementPosition = epIgnore
37+
HeightStyle = ssAuto
38+
HeightPercent = 100.000000000000000000
39+
WidthStyle = ssAuto
40+
WidthPercent = 100.000000000000000000
41+
end
42+
object lbProfissao: TWebLabel
43+
Left = 256
44+
Top = 200
45+
Width = 48
46+
Height = 15
47+
Caption = 'Profiss'#227'o'
48+
ElementID = 'lbProfissao'
49+
ElementFont = efCSS
50+
ElementPosition = epIgnore
51+
HeightStyle = ssAuto
52+
HeightPercent = 100.000000000000000000
53+
WidthStyle = ssAuto
54+
WidthPercent = 100.000000000000000000
55+
end
56+
object lbIdCidade: TWebLabel
57+
Left = 241
58+
Top = 120
59+
Width = 63
60+
Height = 15
61+
Caption = 'C'#243'd. cidade'
62+
ElementID = 'lbIdCidade'
63+
ElementFont = efCSS
64+
ElementPosition = epIgnore
65+
HeightStyle = ssAuto
66+
HeightPercent = 100.000000000000000000
67+
WidthStyle = ssAuto
68+
WidthPercent = 100.000000000000000000
69+
end
70+
object lbLimite: TWebLabel
71+
Left = 136
72+
Top = 270
73+
Width = 33
74+
Height = 15
75+
Caption = 'Limite'
76+
ElementID = 'lbLimite'
77+
ElementFont = efCSS
78+
ElementPosition = epIgnore
79+
HeightStyle = ssAuto
80+
HeightPercent = 100.000000000000000000
81+
WidthStyle = ssAuto
82+
WidthPercent = 100.000000000000000000
83+
end
84+
object lbPorcentagem: TWebLabel
85+
Left = 256
86+
Top = 270
87+
Width = 71
88+
Height = 15
89+
Caption = 'Porcentagem'
90+
ElementID = 'lbPorcentagem'
91+
ElementFont = efCSS
92+
ElementPosition = epIgnore
93+
HeightStyle = ssAuto
94+
HeightPercent = 100.000000000000000000
95+
WidthStyle = ssAuto
96+
WidthPercent = 100.000000000000000000
97+
end
98+
object lbAtivo: TWebLabel
99+
Left = 266
100+
Top = 342
101+
Width = 28
102+
Height = 15
103+
Caption = 'Ativo'
104+
ElementID = 'lbAtivo'
105+
ElementFont = efCSS
106+
ElementPosition = epIgnore
107+
HeightStyle = ssAuto
108+
HeightPercent = 100.000000000000000000
109+
WidthStyle = ssAuto
110+
WidthPercent = 100.000000000000000000
111+
end
112+
object ckAtivo: TWebCheckBox
113+
Left = 136
114+
Top = 338
115+
Width = 96
116+
Height = 25
117+
Caption = 'Ativo'
118+
ElementID = 'ckAtivo'
119+
ElementFont = efCSS
120+
ElementPosition = epIgnore
121+
HeightStyle = ssAuto
122+
HeightPercent = 100.000000000000000000
123+
WidthStyle = ssAuto
124+
WidthPercent = 100.000000000000000000
125+
end
126+
object btnGravar: TWebButton
127+
Left = 120
128+
Top = 384
129+
Width = 96
130+
Height = 25
131+
Caption = 'Gravar'
132+
ChildOrder = 2
133+
ElementID = 'btnGravar'
134+
ElementFont = efCSS
135+
ElementPosition = epIgnore
136+
HeightStyle = ssAuto
137+
HeightPercent = 100.000000000000000000
138+
WidthStyle = ssAuto
139+
WidthPercent = 100.000000000000000000
140+
OnClick = btnGravarClick
141+
end
142+
object btnLimpar: TWebButton
143+
Left = 238
144+
Top = 384
145+
Width = 96
146+
Height = 25
147+
Caption = 'Limpar'
148+
ChildOrder = 3
149+
ElementID = 'btnLimpar'
150+
ElementFont = efCSS
151+
ElementPosition = epIgnore
152+
HeightStyle = ssAuto
153+
HeightPercent = 100.000000000000000000
154+
WidthStyle = ssAuto
155+
WidthPercent = 100.000000000000000000
156+
OnClick = btnLimparClick
157+
end
158+
object edtNome: TWebEdit
159+
Left = 136
160+
Top = 221
161+
Width = 96
162+
Height = 25
163+
ChildOrder = 4
164+
ElementID = 'edtNome'
165+
ElementFont = efCSS
166+
ElementPosition = epIgnore
167+
HeightStyle = ssAuto
168+
HeightPercent = 100.000000000000000000
169+
Text = 'edtNome'
170+
WidthStyle = ssAuto
171+
WidthPercent = 100.000000000000000000
172+
end
173+
object edtProfissao: TWebEdit
174+
Left = 256
175+
Top = 221
176+
Width = 96
177+
Height = 25
178+
ChildOrder = 6
179+
ElementID = 'edtProfissao'
180+
ElementFont = efCSS
181+
ElementPosition = epIgnore
182+
HeightStyle = ssAuto
183+
HeightPercent = 100.000000000000000000
184+
Text = 'edtProfissao'
185+
WidthStyle = ssAuto
186+
WidthPercent = 100.000000000000000000
187+
end
188+
object edtCodigo: TWebEdit
189+
Left = 136
190+
Top = 141
191+
Width = 96
192+
Height = 25
193+
ChildOrder = 9
194+
ElementID = 'edtCodigo'
195+
ElementFont = efCSS
196+
ElementPosition = epIgnore
197+
HeightStyle = ssAuto
198+
HeightPercent = 100.000000000000000000
199+
Text = 'edtCodigo'
200+
WidthStyle = ssAuto
201+
WidthPercent = 100.000000000000000000
202+
end
203+
object edtPorcentagem: TWebSpinEdit
204+
Left = 256
205+
Top = 291
206+
Width = 96
207+
Height = 25
208+
ElementID = 'edtPorcentagem'
209+
HeightStyle = ssAuto
210+
WidthStyle = ssAuto
211+
AutoSize = False
212+
BorderStyle = bsSingle
213+
ChildOrder = 12
214+
Color = clWhite
215+
ElementFont = efCSS
216+
ElementPosition = epIgnore
217+
Increment = 1
218+
MaxValue = 100
219+
MinValue = 0
220+
Role = ''
221+
Value = 0
222+
end
223+
object edtLimite: TWebSpinEdit
224+
Left = 136
225+
Top = 291
226+
Width = 96
227+
Height = 25
228+
ElementID = 'edtLimite'
229+
HeightStyle = ssAuto
230+
WidthStyle = ssAuto
231+
AutoSize = False
232+
BorderStyle = bsSingle
233+
ChildOrder = 13
234+
Color = clWhite
235+
ElementFont = efCSS
236+
ElementPosition = epIgnore
237+
Increment = 1
238+
MaxValue = 100
239+
MinValue = 0
240+
Role = ''
241+
Value = 0
242+
end
243+
object edtIdCidade: TWebSpinEdit
244+
Left = 238
245+
Top = 141
246+
Width = 96
247+
Height = 25
248+
ElementID = 'edtIdCidade'
249+
HeightStyle = ssAuto
250+
WidthStyle = ssAuto
251+
AutoSize = False
252+
BorderStyle = bsSingle
253+
ChildOrder = 14
254+
Color = clWhite
255+
ElementFont = efCSS
256+
ElementPosition = epIgnore
257+
Increment = 1
258+
MaxValue = 100
259+
MinValue = 0
260+
Role = ''
261+
Value = 0
262+
end
4263
end

ClientWeb/Src/ClientesCadastrar/Clientes.Cadastrar.View.pas

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,33 @@ interface
44

55
uses
66
System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
7-
WEBLib.Forms, WEBLib.Dialogs;
7+
WEBLib.Forms, WEBLib.Dialogs, Vcl.Controls, WEBLib.StdCtrls, Vcl.StdCtrls;
88

99
type
1010
TClientesCadastrarView = class(TWebForm)
11+
ckAtivo: TWebCheckBox;
12+
lbNome: TWebLabel;
13+
btnGravar: TWebButton;
14+
btnLimpar: TWebButton;
15+
edtNome: TWebEdit;
16+
lbCodigo: TWebLabel;
17+
edtProfissao: TWebEdit;
18+
lbProfissao: TWebLabel;
19+
lbIdCidade: TWebLabel;
20+
edtCodigo: TWebEdit;
21+
lbLimite: TWebLabel;
22+
lbPorcentagem: TWebLabel;
23+
edtPorcentagem: TWebSpinEdit;
24+
edtLimite: TWebSpinEdit;
25+
edtIdCidade: TWebSpinEdit;
26+
lbAtivo: TWebLabel;
27+
procedure btnGravarClick(Sender: TObject);
28+
procedure WebFormShow(Sender: TObject);
29+
procedure btnLimparClick(Sender: TObject);
1130
private
12-
{ Private declarations }
31+
procedure LimparTela;
1332
public
14-
{ Public declarations }
33+
1534
end;
1635

1736
var
@@ -21,4 +40,44 @@ implementation
2140

2241
{$R *.dfm}
2342

43+
procedure TClientesCadastrarView.WebFormShow(Sender: TObject);
44+
begin
45+
Self.LimparTela;
46+
end;
47+
48+
procedure TClientesCadastrarView.btnGravarClick(Sender: TObject);
49+
begin
50+
if Trim(edtIdCidade.Text).IsEmpty then
51+
begin
52+
ShowMessage('Campo obrigatorio, id cidade');
53+
edtIdCidade.SetFocus;
54+
Exit;
55+
end;
56+
57+
if Trim(edtNome.Text).IsEmpty then
58+
begin
59+
ShowMessage('Campo obrigatorio, nome');
60+
edtNome.SetFocus;
61+
Exit;
62+
end;
63+
64+
Self.Close;
65+
end;
66+
67+
procedure TClientesCadastrarView.btnLimparClick(Sender: TObject);
68+
begin
69+
Self.LimparTela;
70+
end;
71+
72+
procedure TClientesCadastrarView.LimparTela;
73+
begin
74+
edtNome.Text := '';
75+
edtProfissao.Text := '';
76+
edtCodigo.Text := '';
77+
edtPorcentagem.Value := 0;
78+
edtLimite.Value := 0;
79+
edtIdCidade.Value := 0;
80+
ckAtivo.Checked := False;
81+
end;
82+
2483
end.

ClientWeb/Src/Main.View.pas

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ procedure TMainView.btnPostClick(Sender: TObject);
241241
TAwait.ExecP<TModalResult>(LView.Execute);
242242

243243
mmTeste.Lines.Clear;
244-
mmTeste.Lines.Add('Formulário fechado');
244+
mmTeste.Lines.Add('Nome: ' + LView.edtNome.Text);
245+
mmTeste.Lines.Add('Profissão: ' + LView.edtProfissao.Text);
246+
mmTeste.Lines.Add('Porcentagem: ' + LView.edtPorcentagem.Text);
247+
mmTeste.Lines.Add('Limite: ' + LView.edtLimite.Text);
248+
mmTeste.Lines.Add('Id cidade: ' + LView.edtIdCidade.Text);
245249
finally
246250
LView.Free;
247251
end;

0 commit comments

Comments
 (0)