This repository has been archived by the owner on Aug 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtelatransferencia.pas
148 lines (117 loc) · 3.5 KB
/
telatransferencia.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
unit telaTransferencia;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
maskedit, ExtCtrls;
type
{ TfrTransferencia }
TfrTransferencia = class(TForm)
btTransferenciaAvancar: TButton;
Button2: TButton;
Image2: TImage;
//Image3: TImage;
lbError: TLabel;
lbTransferenciaValor: TLabel;
lbTransferenciaAgencia: TLabel;
lbTransferenciaConta: TLabel;
lbTranferencia: TLabel;
edTransferenciaValor: TMaskEdit;
edTransferenciaAgencia: TMaskEdit;
edTransferenciaConta: TMaskEdit;
procedure btTransferenciaAvancarClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure edTransferenciaAgenciaKeyPress(Sender: TObject; var Key: char);
procedure edTransferenciaContaKeyPress(Sender: TObject; var Key: char);
procedure edTransferenciaValorKeyPress(Sender: TObject; var Key: char);
procedure FormKeyPress(Sender: TObject; var Key: char);
procedure FormShow(Sender: TObject);
//procedure Image3Click(Sender: TObject);
//procedure TfrSaqueUsuario.edSaqueValorKeyPress(Sender: TObject; var Key: Char);
private
{ private declarations }
public
{ public declarations }
end;
var
frTransferencia: TfrTransferencia;
// valorTransferencia : String;
implementation
uses LimparForms,telaStatusOperacao, FuncoesDeTransferencia, telaStatusTransferencia, dadosUsuario, telaUsuarioUser;
{$R *.lfm}
{ TfrTransferencia }
procedure TfrTransferencia.btTransferenciaAvancarClick(Sender: TObject);
begin
case validaTranferencia(edTransferenciaValor.Text, edTransferenciaAgencia.Text, edTransferenciaConta.Text) of
0:begin
lbError.Caption:='Todos os campos são obrigatorios';
Application.ProcessMessages;
Sleep(3000);
lbError.Caption:='';
end;
1:begin
tela:=2;
exibirTela(tela);
dadosContaDestino(edTransferenciaConta.Text);
frStatusTransferencia.Show;
frTransferencia.Close;
end;
2:begin
lbError.Caption:='Verifique o Saldo da sua conta e conta destino';
Application.ProcessMessages;
Sleep(3000);
lbError.Caption:='';
end;
end;
end;
procedure TfrTransferencia.Button2Click(Sender: TObject);
begin
limparFormTransferencia();
frTransferencia.Close;
FrUsuario.Show;
end;
procedure TfrTransferencia.edTransferenciaAgenciaKeyPress(Sender: TObject; var Key: char);
begin
if not (Key in['0'..'9',Chr(8)]) then
begin
Key:= #0;
lbError.Caption:='Insira somente numeros para a Agencia';
Application.ProcessMessages;
Sleep(300);
lbError.Caption:='';
end
end;
procedure TfrTransferencia.edTransferenciaContaKeyPress(Sender: TObject; var Key: char);
begin
if not (Key in['0'..'9',Chr(8)]) then
begin
Key:= #0;
lbError.Caption:='Insira somente numeros para a Conta';
Application.ProcessMessages;
Sleep(300);
lbError.Caption:='';
end
end;
procedure TfrTransferencia.edTransferenciaValorKeyPress(Sender: TObject; var Key: char);
begin
if not (Key in['0'..'9',Chr(8)]) then
begin
Key:= #0;
lbError.Caption:='Insira somente numeros para o Valor';
Application.ProcessMessages;
Sleep(300);
lbError.Caption:='';
end;
end;
procedure TfrTransferencia.FormKeyPress(Sender: TObject; var Key: char);
begin
if (Key = #88) OR (Key = #120) then
Button2Click(self);
if key =#13 then
btTransferenciaAvancarClick(self);
end;
procedure TfrTransferencia.FormShow(Sender: TObject);
begin
edTransferenciaValor.SetFocus;
end;
end.