-
Notifications
You must be signed in to change notification settings - Fork 0
/
ARI_DataModule.~pas
205 lines (185 loc) · 7.14 KB
/
ARI_DataModule.~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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
unit ARI_DataModule;
interface
uses
SysUtils, Classes, IBDatabase, DB, IBCustomDataSet, dxCntner, ImgList,
Forms,Controls,Dialogs, IBQuery,DateUtils;
type
TARI_DM = class(TDataModule)
ARI_IBDatabase: TIBDatabase;
IBTransaction1: TIBTransaction;
FIS_IBDataSet: TIBDataSet;
FIS_DataSource: TDataSource;
ToolbarImageList: TImageList;
dxEditStyleController: TdxEditStyleController;
EKIP_IBDataSet: TIBDataSet;
EKIP_DataSource: TDataSource;
PERSONEL_IBDataSet: TIBDataSet;
PERSONEL_DataSource: TDataSource;
PERSONEL_IBDataSetPERSONELADSOYAD: TIBStringField;
PERSONEL_IBDataSetPERSONELEKIPKODU: TIntegerField;
PERSONEL_IBDataSetPERSONELGRUPKODU: TIntegerField;
PERSONEL_IBDataSetPERSONELKOD: TIntegerField;
PERSONEL_IBDataSetPERSONELUNVAN: TIBStringField;
MASRAFLAR_IBDataSet: TIBDataSet;
MASRAFLAR_DataSource: TDataSource;
MASRAFLAR_IBDataSetMASRAFAD: TIBStringField;
MASRAFLAR_IBDataSetMASRAFKOD: TIntegerField;
EKIP_IBDataSetEKIPAD: TIBStringField;
EKIP_IBDataSetEKIPKODU: TIntegerField;
EKIP_IBDataSetEKIPSBASI: TIntegerField;
EKIP_IBDataSetPERSONELADSOYAD: TIBStringField;
AVANSLAR_IBDataSet: TIBDataSet;
AVANSLAR_DataSource: TDataSource;
AVANSLAR_IBDataSetAVANSLAR_EKIPKOD: TIntegerField;
AVANSLAR_IBDataSetAVANSLAR_KOD: TIntegerField;
AVANSLAR_IBDataSetAVANSLAR_MUSTERIKOD: TIntegerField;
AVANSLAR_IBDataSetAVANSLAR_TARIH: TDateField;
EKIPLIST_IBQuery: TIBQuery;
EKIPLIST_DataSource: TDataSource;
MUSTERI_IBDataSet: TIBDataSet;
MUSTERI_DataSource: TDataSource;
MUSTERI_IBDataSetMUSTERI_AD: TIBStringField;
MUSTERI_IBDataSetMUSTERI_ADRES: TIBStringField;
MUSTERI_IBDataSetMUSTERI_GRUPKODU: TIntegerField;
MUSTERI_IBDataSetMUSTERI_KOD: TIntegerField;
MUSTERI_IBDataSetMUSTERI_VERGIDAIRESI: TIBStringField;
MUSTERI_IBDataSetMUSTERI_VERGINO: TIBStringField;
MUSTERILIST_IBQuery: TIBQuery;
MUSTERILIST_DataSource: TDataSource;
MUSTERILIST_IBQueryMUSTERI_AD: TIBStringField;
MUSTERILIST_IBQueryMUSTERI_KOD: TIntegerField;
EKIPLIST_IBQueryEKIPAD: TIBStringField;
EKIPLIST_IBQueryEKIPKODU: TIntegerField;
AVANSLAR_IBDataSetEKIPAD: TIBStringField;
AVANSLAR_IBDataSetAVANSLAR_MIKTAR: TFloatField;
AVANSLAR_IBDataSetMUSTERININADI: TIBStringField;
PERSONEL_IBDataSetEKIPAD: TIBStringField;
HARCAMALAR_DataSource: TDataSource;
HARCAMALAR_IBDataSet: TIBDataSet;
FIS_IBDataSetFIS_KOD: TIntegerField;
FIS_IBDataSetFIS_MUSTERIKODU: TIntegerField;
FIS_IBDataSetFIS_SIPARISLER: TIBStringField;
FIS_IBDataSetFIS_TARIH: TDateField;
HARCAMALAR_IBDataSetHARCAMALAR_ACIKLAMA: TIBStringField;
HARCAMALAR_IBDataSetHARCAMALAR_FISKOD: TIntegerField;
HARCAMALAR_IBDataSetHARCAMALAR_KOD: TIntegerField;
HARCAMALAR_IBDataSetHARCAMALAR_MASRAFKODU: TIntegerField;
HARCAMALAR_IBDataSetHARCAMALAR_MIKTAR: TFloatField;
HARCAMALAR_IBDataSetHARCAMALAR_TARIH: TDateField;
HARCIRAHLAR_DataSource: TDataSource;
HARCIRAHLAR_IBDataSet: TIBDataSet;
HARCIRAHLAR_IBDataSetHARCIRAH_BASLANGICDATE: TDateField;
HARCIRAHLAR_IBDataSetHARCIRAH_BITISDATE: TDateField;
HARCIRAHLAR_IBDataSetHARCIRAH_FISKOD: TIntegerField;
HARCIRAHLAR_IBDataSetHARCIRAH_KOD: TIntegerField;
HARCIRAHLAR_IBDataSetHARCIRAH_PERSONELKODU: TIntegerField;
HARCIRAHLAR_IBDataSetPERSONELADSOYAD: TIBStringField;
HARCIRAHLAR_IBDataSetGUNSAYISI: TIntegerField;
HARCIRAHLAR_IBDataSetHARCIRAH_GUNLUKBEDEL: TFloatField;
HARCIRAHLAR_IBDataSetTOPLAM: TFloatField;
HARCAMALAR_IBDataSetMASRAFAD: TIBStringField;
AVANSLAR_IBDataSetAVANSLAR_ACIKLAMA: TIBStringField;
AVANSLAR_IBDataSetAVANSLAR_ODENDIMI: TIBStringField;
FIS_IBDataSetFIS_EKIPKODU: TIntegerField;
TANIMLAR_DataSource: TDataSource;
TANIMLAR_IBDataSet: TIBDataSet;
TANIMLAR_IBDataSetDEGER: TIBStringField;
TANIMLAR_IBDataSetTANIMAD: TIBStringField;
GBEDEL_IBQuery: TIBQuery;
GBEDEL_DataSource: TDataSource;
GBEDEL_IBQueryDEGER: TIBStringField;
procedure DataModuleCreate(Sender: TObject);
procedure AfterPost(DataSet: TDataSet);
procedure BeforeOpen(DataSet: TDataSet);
procedure AfterOpen(DataSet: TDataSet);
procedure HARCAMALAR_IBDataSetAfterInsert(DataSet: TDataSet);
procedure HARCIRAHLAR_IBDataSetAfterInsert(DataSet: TDataSet);
procedure FIS_IBDataSetAfterInsert(DataSet: TDataSet);
procedure AVANSLAR_IBDataSetAfterInsert(DataSet: TDataSet);
procedure FIS_IB_BrowseMU(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
function Get_Gunluk_Bedel : string;
end;
var
ARI_DM: TARI_DM;
implementation
uses MainDef;
{$R *.dfm}
function TARI_DM.Get_Gunluk_Bedel : string;
begin
GBEDEL_IBQuery.Close;
GBEDEL_IBQuery.Open;
Result := GBEDEL_IBQueryDEGER.AsString;
end;
procedure TARI_DM.DataModuleCreate(Sender: TObject);
begin
with ARI_IBDatabase do
begin
Close;
DatabaseName := CheckServer;
end;
try
ARI_IBDatabase.Connected := True;
FIS_IBDataSet.Open;
EKIP_IBDataSet.Open;
PERSONEL_IBDataSet.Open;
MASRAFLAR_IBDataSet.Open;
MUSTERI_IBDataSet.Open;
HARCAMALAR_IBDataSet.Open;
HARCIRAHLAR_IBDataSet.Open;
except
ShowMessage('Veritabanina erisim saglanamadi'+#13#10
+'Kontrol Panelinden Firebird servisinin calistigina emin olunuz'+#13#10
+'Server kurulumu yapilmamis'
+' ise /E parametresi ile calistirdiginizdan emin olunuz...');
Application.Terminate;
end;
end;
procedure TARI_DM.AfterPost(DataSet: TDataSet);
begin
Screen.Cursor := crSQLWait;
Application.ProcessMessages;
IBTransaction1.CommitRetaining;
Dataset.Refresh;
Screen.Cursor := crDefault;
end;
procedure TARI_DM.BeforeOpen(DataSet: TDataSet);
begin
Screen.Cursor := crSQLWait;
Application.ProcessMessages;
end;
procedure TARI_DM.AfterOpen(DataSet: TDataSet);
begin
Screen.Cursor := crDefault;
end;
procedure TARI_DM.HARCAMALAR_IBDataSetAfterInsert(DataSet: TDataSet);
begin
(DataSet as TIBDataset).FieldByName('HARCAMALAR_FISKOD').AsString := FIS_IBDataSetFIS_KOD.AsString;
(DataSet as TIBDataset).FieldByName('HARCAMALAR_TARIH').AsDateTime := Today;
end;
procedure TARI_DM.HARCIRAHLAR_IBDataSetAfterInsert(DataSet: TDataSet);
begin
(DataSet as TIBDataset).FieldByName('HARCIRAH_FISKOD').AsString := FIS_IBDataSetFIS_KOD.AsString;
(DataSet as TIBDataset).FieldByName('HARCIRAH_GUNLUKBEDEL').AsString := Get_Gunluk_Bedel;
end;
procedure TARI_DM.FIS_IBDataSetAfterInsert(DataSet: TDataSet);
begin
(DataSet as TIBDataset).FieldByName('FIS_TARIH').AsDateTime := Today;
end;
procedure TARI_DM.AVANSLAR_IBDataSetAfterInsert(DataSet: TDataSet);
begin
(DataSet as TIBDataset).FieldByName('AVANSLAR_TARIH').AsDateTime := Today;
(DataSet as TIBDataset).FieldByName('AVANSLAR_ODENDIMI').AsString := 'N';
end;
procedure TARI_DM.FIS_IB_BrowseMU(DataSet: TDataSet);
begin
if (FIS_IBDataSet.State in [dsInsert]) then
begin
ShowMessage('Gerceklestirmekte oldugunuz fis kaydini tamamlamalisiniz....');
Abort;
end;
end;
end.