-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUDM.pas
More file actions
104 lines (93 loc) · 2.86 KB
/
UDM.pas
File metadata and controls
104 lines (93 loc) · 2.86 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
unit UDM;
interface
uses
System.SysUtils, System.Classes, 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.Phys.SQLite,
FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs, FireDAC.VCLUI.Wait, Data.DB,
FireDAC.Comp.Client, FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf,
FireDAC.DApt, FireDAC.Comp.DataSet, Datasnap.DBClient, Datasnap.Provider,
Data.Win.ADODB, Vcl.Dialogs, System.IniFiles;
type
Tdm = class(TDataModule)
db: TFDConnection;
dbRun: TFDConnection;
q_empleado: TFDQuery;
q_empleadoid_empleadoi: TIntegerField;
q_empleadonombre_empleado: TStringField;
q_empleadoap_empleado: TStringField;
q_empleadoam_empleado: TStringField;
q_producto: TFDQuery;
q_horario: TFDQuery;
q_cliente: TFDQuery;
q_empleadoid_horario: TIntegerField;
q_horarioid_horario_caja: TIntegerField;
q_horariohora_entrada: TTimeField;
q_horariohora_salida: TTimeField;
q_clienteid_cliente: TIntegerField;
q_clientenombre_cliente: TStringField;
q_clientetarjeta_cliente: TLargeintField;
q_clienteadeudo_cliente: TFloatField;
q_productoid_producto: TIntegerField;
q_productonombre_producto: TStringField;
q_productoprecio_producto: TFloatField;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
ADOQuery1tsr_seq: TIntegerField;
ADOQuery1tsr_nombre: TStringField;
ADOQuery1tsr_medido: TBooleanField;
DataSetProvider1: TDataSetProvider;
ClientDataSet1: TClientDataSet;
ClientDataSet1tsr_seq: TIntegerField;
ClientDataSet1tsr_nombre: TStringField;
ClientDataSet1tsr_medido: TBooleanField;
procedure DataModuleCreate(Sender: TObject);
procedure dbAfterConnect(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
dm: Tdm;
dbIni: TIniFile;
dbName: String;
driver: String;
DatabaseLocation: String;
login: Boolean;
lock: String;
implementation
{%CLASSGROUP 'Vcl.Controls.TControl'}
{$R *.dfm}
procedure Tdm.DataModuleCreate(Sender: TObject);
begin
dbRun := TFDConnection.Create(nil);
with dbRun do
begin
DriverName := driver;
LoginPrompt := login;
end;
with dbRun.Params do
begin
Database := DatabaseLocation;
end;
dbRun.Connected := True;
end;
procedure Tdm.dbAfterConnect(Sender: TObject);
begin
//ShowMessage('antes');
dbIni := TIniFile.Create('C:\ConnectionCaja.ini');
try
with dbIni do
begin
dbName := ReadString('dbc','dbName','');
driver := ReadString('dbc','driverId','');
DatabaseLocation := ReadString('dbc','DatabaseLocation','');
login := ReadBool('dbc','login',True);
lock := ReadString('dbc','locking','');
end;
finally
dbIni.Free
end;
end;
end.