-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUCCaixa.pas
92 lines (80 loc) · 2.16 KB
/
UCCaixa.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
unit UCCaixa;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, UPadrao, FMTBcd, DB, SqlExpr, DBClient, Provider, StdCtrls, Buttons,
PngBitBtn, pngimage, ExtCtrls, DBCtrls, Mask, rxToolEdit, RXDBCtrl;
type
TfrmCCaixa = class(TfrmPadrao)
GroupBox2: TGroupBox;
Label5: TLabel;
Label6: TLabel;
DBEdit1: TDBEdit;
DBRadioGroup1: TDBRadioGroup;
DBEdit2: TDBEdit;
Label7: TLabel;
DBDateEdit1: TDBDateEdit;
Label8: TLabel;
DBEdit3: TDBEdit;
cdsTabCOD_LANCA: TIntegerField;
cdsTabDAT_LANCA: TDateField;
cdsTabCOD_TRANSACAO: TIntegerField;
cdsTabHISTORICO: TStringField;
cdsTabOPERACAO: TStringField;
cdsTabVLR_LANCA: TSingleField;
procedure btNovoClick(Sender: TObject);
procedure btEditarClick(Sender: TObject);
procedure btGravarClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmCCaixa: TfrmCCaixa;
implementation
uses UFuncoes;
{$R *.dfm}
procedure TfrmCCaixa.btEditarClick(Sender: TObject);
begin
inherited;
DBEdit2.SetFocus;
end;
procedure TfrmCCaixa.btGravarClick(Sender: TObject);
begin
if not DataValida(cdsTabDAT_LANCA.AsString) then begin
Application.MessageBox('Informe Uma Data Válida', 'Atenção', MB_ICONQUESTION);
DBDateEdit1.SetFocus;
Exit;
end;
if DBRadioGroup1.ItemIndex = -1 then begin
Application.MessageBox('Informe O Tipo de Operação', 'Atenção', MB_ICONQUESTION);
DBRadioGroup1.SetFocus;
Exit;
end;
if Vazio(DBEdit2.Text) then begin
Application.MessageBox('Informe o Histórico da Operação.', 'Atenção', MB_ICONQUESTION);
DBEdit2.SetFocus;
Exit;
end;
if Vazio(DBEdit3.Text) then begin
Application.MessageBox('Informe o Valor da Operação.', 'Atenção', MB_ICONQUESTION);
DBEdit3.SetFocus;
Exit;
end;
inherited;
end;
procedure TfrmCCaixa.btNovoClick(Sender: TObject);
begin
inherited;
cdsTabCOD_LANCA.AsInteger := PegaSequencia('GEN_LANCA_ID');
cdsTabDAT_LANCA.AsDateTime := Date;
DBEdit2.SetFocus;
end;
procedure TfrmCCaixa.FormShow(Sender: TObject);
begin
inherited;
CaixaAlta(Self);
end;
end.