-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuMain.pas
103 lines (81 loc) · 2.26 KB
/
uMain.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
unit uMain;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
br.com.factorysolution.command.Interfaces;
type
TForm4 = class(TForm)
mmDados: TMemo;
btnCommand: TButton;
btnFactory: TButton;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure btnCommandClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btnFactoryClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
FNota : iNotaFiscal;
procedure Exibir(Value : String);
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
uses
br.com.factorysolution.factory,
br.com.factorysolution.interfaces,
br.com.factorysolution.abstractfactory,
br.com.factorycolution.singleton,
br.com.factorysolution.facade.impl,
br.com.factorysolution.prototype.pessoa,
br.com.factorysolution.prototype.interfaces,
br.com.factorysolution.command.notafiscal;
{$R *.dfm}
procedure TForm4.btnCommandClick(Sender: TObject);
begin
FNota.EnviarNotaFiscal;
mmDados.Lines.Add('-------');
FNota.EnviarNotaSemEmail
end;
procedure TForm4.btnFactoryClick(Sender: TObject);
begin
ShowMessage(TRefrigeranteFactory.New.GetRefrigerante(trGuarana).GetName)
end;
procedure TForm4.Button1Click(Sender: TObject);
begin
ShowMessage(TAbstractFactory.New.GetFanta.GetName);
end;
procedure TForm4.Button2Click(Sender: TObject);
begin
TMyClass.GetInstance.Valor('adad');
ShowMessage(TMyClass.GetInstance.Teste);
end;
procedure TForm4.Button3Click(Sender: TObject);
begin
ShowMessage(TFacade.New.CalcularCustoProduto(200).GetValorCalculado.ToString);
end;
procedure TForm4.Button4Click(Sender: TObject);
var
Pessoa: IPessoa;
begin
Pessoa := TPessoa.New.SetNome('aaa').SetSobrenome('aa').Clone;
ShowMessage(Pessoa.GetNome);
end;
procedure TForm4.Exibir(Value: String);
begin
mmDados.Lines.Add(Value);
end;
procedure TForm4.FormCreate(Sender: TObject);
begin
FNota := TModelNotaFiscal.New.Display(Exibir);
end;
end.