-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnit4.pas
More file actions
145 lines (127 loc) · 3.67 KB
/
Copy pathUnit4.pas
File metadata and controls
145 lines (127 loc) · 3.67 KB
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
unit Unit4;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf,
FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys,
FireDAC.VCLUI.Wait, FireDAC.Comp.Client, Vcl.Grids, Vcl.DBGrids, Vcl.StdCtrls,
Unit5, UDM, Vcl.ExtCtrls, Vcl.DBCtrls, Vcl.Buttons, Vcl.Mask, clientes, System.IniFiles;
type
TForm4 = class(TForm)
ButtonGetCientes: TButton;
ListBox1: TListBox;
ListBoxVenta: TListBox;
prodEdit: TEdit;
StaticText1: TStaticText;
ButtonAddProduct: TButton;
totalButton: TButton;
totalEdit: TEdit;
pagarButton: TButton;
EditMonto: TEdit;
StaticText2: TStaticText;
StaticText3: TStaticText;
ivaEdit: TEdit;
StaticText4: TStaticText;
EditCambio: TEdit;
StaticText5: TStaticText;
otraVentaButton: TButton;
ClienteNuevoButton: TButton;
EmpleadosButton: TButton;
ButtonSaveSett: TButton;
procedure ButtonGetCientesClick(Sender: TObject);
procedure ButtonAddProductClick(Sender: TObject);
procedure totalButtonClick(Sender: TObject);
procedure pagarButtonClick(Sender: TObject);
procedure otraVentaButtonClick(Sender: TObject);
procedure ClienteNuevoButtonClick(Sender: TObject);
procedure EmpleadosButtonClick(Sender: TObject);
procedure ButtonSaveSettClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
Empleado: CajaClass;
public
{ Public declarations }
end;
var
Form4: TForm4;
TestIni: TIniFile;
implementation
{$R *.dfm}
{$R 'New1.res' 'New1.rc'}
procedure TForm4.ButtonAddProductClick(Sender: TObject);
begin
Empleado.getProducto(StrToInt(prodEdit.Text), ListBoxVenta);
prodEdit.Clear;
end;
procedure TForm4.ButtonGetCientesClick(Sender: TObject);
begin
//Empleado.getEmpleado();
Empleado.getClientes(ListBox1);
end;
procedure TForm4.ButtonSaveSettClick(Sender: TObject);
begin
TestIni := TIniFile.Create((Application.ExeName)+'settings.ini');
try
TestIni.WriteInteger('Main','Left',Form4.Left);
TestIni.WriteInteger('Main','Top',Form4.Top);
TestIni.UpdateFile;
finally
TestIni.Free;
end;
end;
procedure TForm4.ClienteNuevoButtonClick(Sender: TObject);
begin
Empleado.terminarVenta();
ListBoxVenta.Clear;
totalEdit.Clear;
EditCambio.Clear;
EditMonto.Clear;
//Visible := False;
try
Fclientes.ShowModal;
finally
//Visible := True;
end;
end;
procedure TForm4.EmpleadosButtonClick(Sender: TObject);
var
Pack: HMODULE;
ClassP: TPersistentClass;
begin
Pack := LoadPackage('Package2.bpl');
if Pack <> 0 then
begin
//ShowMessage('Si hay BPL');
ClassP := GetClass('TForm2');
if ClassP <> nil then
with TComponentClass(ClassP).Create(Application) as TCustomForm do
begin
//ShowMessage('Si hay clase');
ShowModal;
end;
end;
end;
procedure TForm4.FormCreate(Sender: TObject);
begin
TestIni := TIniFile.Create((Application.ExeName)+'settings.ini');
try
Form4.Left := TestIni.ReadInteger('Main','Left', Left );
Form4.Top := TestIni.ReadInteger('Main','Top', Top );
finally
end;
end;
procedure TForm4.otraVentaButtonClick(Sender: TObject);
begin
ListBoxVenta.Clear;
end;
procedure TForm4.pagarButtonClick(Sender: TObject);
begin
Empleado.pagar(StrToCurr(EditMonto.Text), EditCambio);
end;
procedure TForm4.totalButtonClick(Sender: TObject);
begin
Empleado.getTotal(totalEdit);
end;
end.