root / UnitIngredientDetail.pas @ 3
Historique | Voir | Annoter | Télécharger (36,479 ko)
1 |
unit UnitIngredientDetail;
|
---|---|
2 |
|
3 |
{$WARN SYMBOL_PLATFORM OFF}
|
4 |
|
5 |
interface
|
6 |
|
7 |
uses
|
8 |
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, |
9 |
Dialogs, gnugettext, StdCtrls, ComCtrls, ExtCtrls, Mask, DB, DBCtrls, |
10 |
ActnList, ImgList, ToolWin, JvExStdCtrls, JvEdit, JvValidateEdit, RpBase, |
11 |
RpSystem, RpRender, RpRenderPDF, RpRave, RpDefine, RpCon, RpConDS, JvCsvData, |
12 |
RvClass, RvCsStd, RvCsData, JvButton, JvCtrls, XMLIntf, XMLDoc, RpDevice; |
13 |
|
14 |
type
|
15 |
TFormIngredientDetail = class(TForm)
|
16 |
RvDataSetConnectionIngredients: TRvDataSetConnection; |
17 |
RvProjectReport: TRvProject; |
18 |
RvSystemReport: TRvSystem; |
19 |
SaveDialogExport: TSaveDialog; |
20 |
ActionListButtons: TActionList; |
21 |
ActionHelp: TAction; |
22 |
ActionClose: TAction; |
23 |
ImageListIcons: TImageList; |
24 |
ActionModify: TAction; |
25 |
ActionDelete: TAction; |
26 |
ActionPrint: TAction; |
27 |
ActionXML: TAction; |
28 |
PanelButtons: TPanel; |
29 |
PanelMain: TPanel; |
30 |
LabelClass: TLabel; |
31 |
LabelDefinition: TLabel; |
32 |
LabelMS: TLabel; |
33 |
LabelName: TLabel; |
34 |
LabelSource: TLabel; |
35 |
DBEditClass: TDBEdit; |
36 |
DBEditMS: TDBEdit; |
37 |
DBEditName: TDBEdit; |
38 |
DBEditSource: TDBEdit; |
39 |
DBMemoDefinition: TDBMemo; |
40 |
GroupBoxAA: TGroupBox; |
41 |
LabelAADig: TLabel; |
42 |
LabelAATot: TLabel; |
43 |
LabelLys: TLabel; |
44 |
LabelTyr: TLabel; |
45 |
LabelThr: TLabel; |
46 |
LabelPheTyr: TLabel; |
47 |
LabelMet: TLabel; |
48 |
LabelHis: TLabel; |
49 |
LabelCys: TLabel; |
50 |
LabelArg: TLabel; |
51 |
LabelMetCys: TLabel; |
52 |
LabelAla: TLabel; |
53 |
LabelTrp: TLabel; |
54 |
LabelAsp: TLabel; |
55 |
LabelIle: TLabel; |
56 |
LabelGlu: TLabel; |
57 |
LabelVal: TLabel; |
58 |
LabelGly: TLabel; |
59 |
LabelLeu: TLabel; |
60 |
LabelSer: TLabel; |
61 |
LabelPhe: TLabel; |
62 |
LabelPro: TLabel; |
63 |
LabeldAA: TLabel; |
64 |
DBEditLys: TDBEdit; |
65 |
DBEditLysd: TDBEdit; |
66 |
DBEditTyr: TDBEdit; |
67 |
DBEditTyrd: TDBEdit; |
68 |
DBEditThr: TDBEdit; |
69 |
DBEditThrd: TDBEdit; |
70 |
DBEditPheTyr: TDBEdit; |
71 |
DBEditPheTyrd: TDBEdit; |
72 |
DBEditMet: TDBEdit; |
73 |
DBEditMetd: TDBEdit; |
74 |
DBEditHis: TDBEdit; |
75 |
DBEditHisd: TDBEdit; |
76 |
DBEditCys: TDBEdit; |
77 |
DBEditCysd: TDBEdit; |
78 |
DBEditArg: TDBEdit; |
79 |
DBEditArgd: TDBEdit; |
80 |
DBEditMetCys: TDBEdit; |
81 |
DBEditMetCysd: TDBEdit; |
82 |
DBEditAla: TDBEdit; |
83 |
DBEditAlad: TDBEdit; |
84 |
DBEditTrp: TDBEdit; |
85 |
DBEditTrpd: TDBEdit; |
86 |
DBEditAsp: TDBEdit; |
87 |
DBEditAspd: TDBEdit; |
88 |
DBEditIle: TDBEdit; |
89 |
DBEditIled: TDBEdit; |
90 |
DBEditGlu: TDBEdit; |
91 |
DBEditGlud: TDBEdit; |
92 |
DBEditVal: TDBEdit; |
93 |
DBEditVald: TDBEdit; |
94 |
DBEditGly: TDBEdit; |
95 |
DBEditGlyd: TDBEdit; |
96 |
DBEditLeu: TDBEdit; |
97 |
DBEditLeud: TDBEdit; |
98 |
DBEditSer: TDBEdit; |
99 |
DBEditSerd: TDBEdit; |
100 |
DBEditPhe: TDBEdit; |
101 |
DBEditPhed: TDBEdit; |
102 |
DBEditPro: TDBEdit; |
103 |
DBEditProd: TDBEdit; |
104 |
DEditdLys: TDBEdit; |
105 |
DBEditdTyr: TDBEdit; |
106 |
DBEditdThr: TDBEdit; |
107 |
DBEditdPheTyr: TDBEdit; |
108 |
DBEditdMet: TDBEdit; |
109 |
DBEditdHis: TDBEdit; |
110 |
DBEditdCys: TDBEdit; |
111 |
DBEditdArg: TDBEdit; |
112 |
DBEditdMetCys: TDBEdit; |
113 |
DBEditdAla: TDBEdit; |
114 |
DBEditdTrp: TDBEdit; |
115 |
DBEditdAsp: TDBEdit; |
116 |
DBEditdIle: TDBEdit; |
117 |
DBEditdGlu: TDBEdit; |
118 |
DBEditdVal: TDBEdit; |
119 |
DBEditdGly: TDBEdit; |
120 |
DBEditdLeu: TDBEdit; |
121 |
DBEditdSer: TDBEdit; |
122 |
DBEditdPhe: TDBEdit; |
123 |
DBEditdPro: TDBEdit; |
124 |
GroupBoxAzote: TGroupBox; |
125 |
LabelCrois3: TLabel; |
126 |
LabelTruie3: TLabel; |
127 |
LabeldN: TLabel; |
128 |
DBEditdNc: TDBEdit; |
129 |
DBEditdNt: TDBEdit; |
130 |
GroupBoxEnergy: TGroupBox; |
131 |
LabelEB: TLabel; |
132 |
LabelED: TLabel; |
133 |
LabelEM: TLabel; |
134 |
LabelEN: TLabel; |
135 |
LabelCrois1: TLabel; |
136 |
LabelTruie1: TLabel; |
137 |
LabelRatio: TLabel; |
138 |
DBEditEBc: TDBEdit; |
139 |
DBEditEBt: TDBEdit; |
140 |
DBEditEDc: TDBEdit; |
141 |
DBEditEDt: TDBEdit; |
142 |
DBEditEMc: TDBEdit; |
143 |
DBEditEMt: TDBEdit; |
144 |
DBEditENc: TDBEdit; |
145 |
DBEditENt: TDBEdit; |
146 |
DBEditEDt_EDc: TDBEdit; |
147 |
DBEditEMt_EMc: TDBEdit; |
148 |
DBEditENt_ENc: TDBEdit; |
149 |
ValidateEditEBt_EBc: TJvValidateEdit; |
150 |
GroupBoxEnergyUtilization: TGroupBox; |
151 |
LabeldE: TLabel; |
152 |
LabelEM_ED: TLabel; |
153 |
LabelEN_EM: TLabel; |
154 |
LabelCrois2: TLabel; |
155 |
LabelTruie2: TLabel; |
156 |
LabelBonus: TLabel; |
157 |
LabelLysd_EN: TLabel; |
158 |
DBEditdEc: TDBEdit; |
159 |
DBEditdEt: TDBEdit; |
160 |
DBEditEMc_EDc: TDBEdit; |
161 |
DBEditEMt_EDt: TDBEdit; |
162 |
DBEditENc_EMc: TDBEdit; |
163 |
DBEditENt_EMt: TDBEdit; |
164 |
DBEditBonus: TDBEdit; |
165 |
DBEditLysd_ENc: TDBEdit; |
166 |
DBEditLysd_ENt: TDBEdit; |
167 |
GroupBoxMinerals: TGroupBox; |
168 |
LabelCa: TLabel; |
169 |
LabelP: TLabel; |
170 |
LabelDigP: TLabel; |
171 |
LabelFarine: TLabel; |
172 |
LabelGranule: TLabel; |
173 |
LabeldP: TLabel; |
174 |
DBEditCa: TDBEdit; |
175 |
DBEditP: TDBEdit; |
176 |
DBEditdPphy: TDBEdit; |
177 |
DBEditdP: TDBEdit; |
178 |
GroupBoxProximal: TGroupBox; |
179 |
LabelMAT: TLabel; |
180 |
LabelCB: TLabel; |
181 |
LabelMG: TLabel; |
182 |
LabelMM: TLabel; |
183 |
LabelNDF: TLabel; |
184 |
LabelADF: TLabel; |
185 |
LabelADL: TLabel; |
186 |
LabelAmidon: TLabel; |
187 |
LabelSucres: TLabel; |
188 |
DBEditMAT: TDBEdit; |
189 |
DBEditCB: TDBEdit; |
190 |
DBEditMG: TDBEdit; |
191 |
DBEditMM: TDBEdit; |
192 |
DBEditNDF: TDBEdit; |
193 |
DBEditADF: TDBEdit; |
194 |
DBEditADL: TDBEdit; |
195 |
DBEditAmidon: TDBEdit; |
196 |
DBEditSucres: TDBEdit; |
197 |
JvImgBtnModify: TJvImgBtn; |
198 |
JvImgBtnDelete: TJvImgBtn; |
199 |
JvImgBtnPrint: TJvImgBtn; |
200 |
JvImgBtnXML: TJvImgBtn; |
201 |
JvImgBtnHelp: TJvImgBtn; |
202 |
JvImgBtnClose: TJvImgBtn; |
203 |
PanelHead: TPanel; |
204 |
DBEditNa: TDBEdit; |
205 |
LabelNa: TLabel; |
206 |
DBEditK: TDBEdit; |
207 |
LabelK: TLabel; |
208 |
DBEditCl: TDBEdit; |
209 |
LabelCl: TLabel; |
210 |
DBEditBE: TDBEdit; |
211 |
LabelBE: TLabel; |
212 |
procedure FormCreate(Sender: TObject);
|
213 |
procedure FormShow(Sender: TObject);
|
214 |
procedure ActionModifyExecute(Sender: TObject);
|
215 |
procedure ActionDeleteExecute(Sender: TObject);
|
216 |
procedure ActionPrintExecute(Sender: TObject);
|
217 |
procedure ActionXMLExecute(Sender: TObject);
|
218 |
procedure ActionHelpExecute(Sender: TObject);
|
219 |
procedure ActionCloseExecute(Sender: TObject);
|
220 |
private
|
221 |
{ D?clarations priv?es }
|
222 |
procedure BuildReport;
|
223 |
procedure EditEmpty(Edit: TJvValidateEdit);
|
224 |
procedure EditShadow(Edit: TDBEdit);
|
225 |
public
|
226 |
{ D?clarations publiques }
|
227 |
end;
|
228 |
|
229 |
var
|
230 |
FormIngredientDetail: TFormIngredientDetail; |
231 |
|
232 |
implementation
|
233 |
|
234 |
{$R *.dfm}
|
235 |
|
236 |
uses
|
237 |
UnitDeclaration, UnitOptions, UnitIngredientEditionCopy, UnitIngredientEditionOriginal; |
238 |
|
239 |
procedure TFormIngredientDetail.ActionCloseExecute(Sender: TObject);
|
240 |
begin
|
241 |
ModalResult := mrClose; |
242 |
end;
|
243 |
|
244 |
procedure TFormIngredientDetail.ActionXMLExecute(Sender: TObject);
|
245 |
var
|
246 |
i: Integer; |
247 |
USFormatSettings: TFormatSettings; |
248 |
XMLDoc: IXMLDocument; |
249 |
Workbook, Worksheet, Table, Row: IXMLNode; |
250 |
|
251 |
procedure CellData(Row: IXMLNode; Value, Format: string); |
252 |
var
|
253 |
Cell, Data: IXMLNode; |
254 |
begin
|
255 |
Cell := Row.AddChild('Cell');
|
256 |
Data := Cell.AddChild('Data');
|
257 |
Data.Attributes['ss:Type'] := Format;
|
258 |
Data.Text := Value; |
259 |
end;
|
260 |
|
261 |
begin
|
262 |
if SaveDialogExport.Execute
|
263 |
then
|
264 |
begin
|
265 |
GetLocaleFormatSettings(1033, USFormatSettings);
|
266 |
XMLDoc := TXMLDocument.Create(nil);
|
267 |
try
|
268 |
XMLDoc.XML.Clear; |
269 |
XMLDoc.XML.Add('<?xml version="1.0" encoding="UTF-8"?>');
|
270 |
XMLDoc.XML.Add('<?mso-application progid="Excel.Sheet"?>');
|
271 |
XMLDoc.XML.Add('<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet">');
|
272 |
XMLDoc.XML.Add('</Workbook>');
|
273 |
XMLDoc.Active := True; |
274 |
Workbook := XMLDoc.DocumentElement; |
275 |
Workbook.DeclareNamespace('o', 'urn:schemas-microsoft-com:office:office'); |
276 |
Workbook.DeclareNamespace('x', 'urn:schemas-microsoft-com:office:excel'); |
277 |
Workbook.DeclareNamespace('ss', 'urn:schemas-microsoft-com:office:spreadsheet'); |
278 |
Workbook.DeclareNamespace('html', 'http://www.w3.org/TR/REC-html40'); |
279 |
Worksheet := Workbook.AddChild('Worksheet');
|
280 |
Worksheet.SetAttributeNS('ss:Name', Workbook.FindNamespaceURI('ss'), Caption); |
281 |
Table := Worksheet.AddChild('Table');
|
282 |
// Titre
|
283 |
Row := Table.AddChild('Row');
|
284 |
CellData(Row, _('Label'), 'String'); |
285 |
CellData(Row, _('Value'), 'String'); |
286 |
CellData(Row, _('Unit'), 'String'); |
287 |
// Donn?es
|
288 |
with DataModuleDeclaration do |
289 |
for i := 0 to ClientDataSetIngredients.FieldCount - 1 do |
290 |
if not (i in [0, 2, 3, 5, 6, 9, 58..77, 78..97]) |
291 |
then // Champs export?s |
292 |
begin
|
293 |
Row := Table.AddChild('Row');
|
294 |
// Label
|
295 |
CellData(Row, _(ClientDataSetIngredients.Fields[i].DisplayLabel), 'String');
|
296 |
// Value
|
297 |
case i of |
298 |
1, 4, 7: |
299 |
CellData(Row, ClientDataSetIngredients.Fields[i].AsWideString, 'String');
|
300 |
8, 10..18: |
301 |
if not ClientDataSetIngredients.Fields[i].IsNull |
302 |
then
|
303 |
CellData(Row, FloatToStrF(ClientDataSetIngredients.Fields[i].AsFloat, ffFixed, 15, FormOptions.ProximalDecimals, USFormatSettings), 'Number') |
304 |
else
|
305 |
CellData(Row, '', 'String'); |
306 |
19, 22, 24, 26, 28, 30, 32: |
307 |
if not ClientDataSetIngredients.Fields[i].IsNull |
308 |
then
|
309 |
CellData(Row, FloatToStrF(ClientDataSetIngredients.Fields[i].AsFloat, ffFixed, 15, FormOptions.EnergyDecimals, USFormatSettings), 'Number') |
310 |
else
|
311 |
CellData(Row, '', 'String'); |
312 |
20, 21, 23, 25, 27, 29, 31, 33..37, 122..123: |
313 |
if not ClientDataSetIngredients.Fields[i].IsNull |
314 |
then
|
315 |
CellData(Row, FloatToStrF(ClientDataSetIngredients.Fields[i].AsFloat, ffFixed, 15, 1, USFormatSettings), 'Number') |
316 |
else
|
317 |
CellData(Row, '', 'String'); |
318 |
38..57, 98..117: |
319 |
if not ClientDataSetIngredients.Fields[i].IsNull |
320 |
then
|
321 |
CellData(Row, FloatToStrF(ClientDataSetIngredients.Fields[i].AsFloat, ffFixed, 15, FormOptions.AADecimals, USFormatSettings), 'Number') |
322 |
else
|
323 |
CellData(Row, '', 'String'); |
324 |
118..119: |
325 |
if not ClientDataSetIngredients.Fields[i].IsNull |
326 |
then
|
327 |
CellData(Row, FloatToStrF(ClientDataSetIngredients.Fields[i].AsFloat, ffFixed, 15, 2, USFormatSettings), 'Number') |
328 |
else
|
329 |
CellData(Row, '', 'String'); |
330 |
120..121: |
331 |
if not ClientDataSetIngredients.Fields[i].IsNull |
332 |
then
|
333 |
CellData(Row, FloatToStrF(ClientDataSetIngredients.Fields[i].AsFloat, ffFixed, 15, FormOptions.MineralsDecimals, USFormatSettings), 'Number') |
334 |
else
|
335 |
CellData(Row, '', 'String'); |
336 |
end;
|
337 |
// Unit
|
338 |
case i of |
339 |
8: // MS |
340 |
CellData(Row, FormOptions.ComboBoxProximal.Items[FormOptions.Proximal], 'String');
|
341 |
10..18: // Analyse proximale |
342 |
if FormOptions.Expression = 0 |
343 |
then // sur frais |
344 |
CellData(Row, FormOptions.ComboBoxProximal.Items[FormOptions.Proximal], 'String')
|
345 |
else // sur mati?re s?che |
346 |
CellData(Row, Format('%s %s', [FormOptions.ComboBoxProximal.Items[FormOptions.Proximal], _('DM')]), 'String'); |
347 |
19, 22, 24, 26, 28, 30, 32: // Energie |
348 |
if FormOptions.Expression = 0 |
349 |
then // sur frais |
350 |
CellData(Row, FormOptions.ComboBoxEnergy.Items[FormOptions.Energy], 'String')
|
351 |
else // sur mati?re s?che |
352 |
CellData(Row, Format('%s %s', [FormOptions.ComboBoxEnergy.Items[FormOptions.Energy], _('DM')]), 'String'); |
353 |
20, 21, 23, 25, 27, 29, 31, 33..37, 122..123: // % |
354 |
CellData(Row, '%', 'String'); |
355 |
38..57, 98..117: // AA |
356 |
if FormOptions.Expression = 0 |
357 |
then // sur frais |
358 |
CellData(Row, FormOptions.ComboBoxAA.Items[FormOptions.AA], 'String')
|
359 |
else // sur mati?re s?che |
360 |
CellData(Row, Format('%s %s', [FormOptions.ComboBoxAA.Items[FormOptions.AA], _('DM')]), 'String'); |
361 |
118..119: // Lysd/EN |
362 |
if FormOptions.Energy = 0 |
363 |
then // MJ |
364 |
CellData(Row, _('g/MJ'), 'String') |
365 |
else // kcal |
366 |
CellData(Row, _('g/1000kcal'), 'String'); |
367 |
120..121: // Min?raux |
368 |
if FormOptions.Expression = 0 |
369 |
then // sur frais |
370 |
CellData(Row, FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals], 'String')
|
371 |
else // sur mati?re s?che |
372 |
CellData(Row, Format('%s %s', [FormOptions.ComboBoxMinerals.Items[FormOptions.Minerals], _('DM')]), 'String'); |
373 |
end;
|
374 |
end;
|
375 |
XMLDoc.SaveToFile(SaveDialogExport.FileName); |
376 |
XmlDoc.Active := False; |
377 |
finally
|
378 |
XMLDoc := nil;
|
379 |
end;
|
380 |
end;
|
381 |
end;
|
382 |
|
383 |
procedure TFormIngredientDetail.ActionDeleteExecute(Sender: TObject);
|
384 |
var
|
385 |
UserName: String;
|
386 |
begin
|
387 |
with DataModuleDeclaration do |
388 |
begin
|
389 |
ClientDataSetComposition.Filter := Format('Ingredient = %d and User', [ClientDataSetIngredientsId.Value]);
|
390 |
ClientDataSetComposition.Filtered := True; |
391 |
try
|
392 |
if ClientDataSetComposition.RecordCount > 0 |
393 |
then
|
394 |
MessageDlg(_('This ingredient is used in a diet.') + sLineBreak + _('You cannot delete it.'), mtError, [mbOK], 0) |
395 |
else
|
396 |
if MessageDlg(_('Are sure you want to delete this record?') + sLineBreak + _('This action could not be canceled.'), mtConfirmation, [mbYes, mbNo], 0) = mrYes |
397 |
then
|
398 |
begin
|
399 |
ClientDataSetIngredients.DisableControls; |
400 |
try
|
401 |
UserName := ClientDataSetIngredientsName.Value; |
402 |
// Suprimer la mati?re premi?re
|
403 |
DBUser.BeginTransaction; |
404 |
try
|
405 |
DBUser.ExecSQL('DELETE FROM Ingredients '
|
406 |
+ Format('WHERE Id = %d', [ClientDataSetIngredientsId.Value]));
|
407 |
DBUser.Commit; |
408 |
except
|
409 |
DBUser.RollBack; |
410 |
MessageDlg(Format(_('Unknown error: %s %s %s'), ['UnitIngredientDetail', 'ActionDeleteExecute', 'DBUser (DELETE FROM Ingredients)']), mtError, [mbOK], 0); |
411 |
Exit; |
412 |
end;
|
413 |
// Suprimer de ClientDataSetIngredients
|
414 |
ClientDataSetIngredients.Delete; |
415 |
// Suprimer le nom de la liste des mati?res premi?res utilisateur
|
416 |
UserList.Delete(UserList.IndexOf(UserName)); |
417 |
// Fermer la fen?tre
|
418 |
Close; |
419 |
finally
|
420 |
ClientDataSetIngredients.EnableControls; |
421 |
end;
|
422 |
end;
|
423 |
finally
|
424 |
ClientDataSetComposition.Filtered := False; |
425 |
ClientDataSetComposition.Filter := '';
|
426 |
end;
|
427 |
end;
|
428 |
end;
|
429 |
|
430 |
procedure TFormIngredientDetail.ActionHelpExecute(Sender: TObject);
|
431 |
begin
|
432 |
Application.HelpContext(HelpContext); |
433 |
end;
|
434 |
|
435 |
procedure TFormIngredientDetail.ActionModifyExecute(Sender: TObject);
|
436 |
begin
|
437 |
if DataModuleDeclaration.ClientDataSetIngredientsModel.IsNull
|
438 |
then // Cr?ation originale |
439 |
begin
|
440 |
FormIngredientEditionOriginal := TFormIngredientEditionOriginal.Create(nil);
|
441 |
try
|
442 |
FormIngredientEditionOriginal.ShowModal; |
443 |
finally
|
444 |
FormIngredientEditionOriginal.Release; |
445 |
end;
|
446 |
end
|
447 |
else // Copie des tables de r?f?rence |
448 |
begin
|
449 |
FormIngredientEditionCopy := TFormIngredientEditionCopy.Create(nil);
|
450 |
try
|
451 |
FormIngredientEditionCopy.ShowModal; |
452 |
finally
|
453 |
FormIngredientEditionCopy.Release; |
454 |
end;
|
455 |
end;
|
456 |
// with DataModuleDeclaration do
|
457 |
// Hint := ClientDataSetIngredientsDefinition.Value;
|
458 |
end;
|
459 |
|
460 |
procedure TFormIngredientDetail.ActionPrintExecute(Sender: TObject);
|
461 |
begin
|
462 |
if RpDev.PrinterSetupDialog
|
463 |
then
|
464 |
begin
|
465 |
RvSystemReport.DoNativeOutput := False; |
466 |
RvSystemReport.DefaultDest := rdPrinter; |
467 |
RvSystemReport.RenderObject := nil;
|
468 |
RvSystemReport.OutputFileName := '';
|
469 |
RvProjectReport.Open; |
470 |
BuildReport; |
471 |
with DataModuleDeclaration do |
472 |
if ClientDataSetIngredientsUser.Value
|
473 |
then // User |
474 |
TableIngredients.Free; |
475 |
RvProjectReport.Execute; |
476 |
Application.ProcessMessages; |
477 |
RvProjectReport.Close; |
478 |
end;
|
479 |
end;
|
480 |
|
481 |
procedure TFormIngredientDetail.BuildReport;
|
482 |
var
|
483 |
i: Integer; |
484 |
Page: TRavePage; |
485 |
begin
|
486 |
with DataModuleDeclaration do |
487 |
if ClientDataSetIngredientsUser.Value
|
488 |
then // User |
489 |
TableIngredients := DBUser.GetTable('SELECT * FROM Ingredients '
|
490 |
+ Format('WHERE Id = %d', [ClientDataSetIngredientsId.Value]));
|
491 |
with DataModuleDeclaration do |
492 |
if ClientDataSetIngredients.Eof
|
493 |
then // Bug : seconde page blanche |
494 |
if ClientDataSetIngredients.RecordCount > 1 |
495 |
then
|
496 |
begin
|
497 |
ClientDataSetIngredients.Prior; |
498 |
ClientDataSetIngredients.Next; |
499 |
end
|
500 |
else
|
501 |
ClientDataSetIngredients.First; |
502 |
Page := RvProjectReport.ProjMan.FindRaveComponent('ReportIngredient.PageIngredient1', nil) as TRavePage; |
503 |
for i := 0 to Page.ComponentCount - 1 do |
504 |
begin
|
505 |
if Page.Components[i].ClassNameIs('TRaveText') |
506 |
then // Traduire |
507 |
begin
|
508 |
if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
509 |
then
|
510 |
(Page.Components[i] as TRaveText).Font.Name := 'Arial Unicode MS'; |
511 |
TranslateComponent(Page.Components[i]); |
512 |
if (Page.Components[i] as TRaveText).Name = 'TextMS' |
513 |
then
|
514 |
with FormOptions do |
515 |
(Page.Components[i] as TRaveText).Text := Format('%s (%s)', [(Page.Components[i] as TRaveText).Text, ComboBoxProximal.Items[Proximal]]); |
516 |
if (Page.Components[i] as TRaveText).Name = 'TextUnitProximal' |
517 |
then
|
518 |
with FormOptions do |
519 |
if Expression = 0 |
520 |
then // sur frais |
521 |
(Page.Components[i] as TRaveText).Text := Format('(%s)', [ComboBoxProximal.Items[Proximal]]) |
522 |
else // sur mati?re s?che |
523 |
(Page.Components[i] as TRaveText).Text := Format('(%s %s)', [ComboBoxProximal.Items[Proximal], _('DM')]); |
524 |
if (Page.Components[i] as TRaveText).Name = 'TextUnitEnergyC' |
525 |
then
|
526 |
with FormOptions do |
527 |
if Expression = 0 |
528 |
then // sur frais |
529 |
(Page.Components[i] as TRaveText).Text := Format('(%s)', [ComboBoxEnergy.Items[Energy]]) |
530 |
else // sur mati?re s?che |
531 |
(Page.Components[i] as TRaveText).Text := Format('(%s %s)', [ComboBoxEnergy.Items[Energy], _('DM')]); |
532 |
if (Page.Components[i] as TRaveText).Name = 'TextUnitEnergyT' |
533 |
then
|
534 |
with FormOptions do |
535 |
if Expression = 0 |
536 |
then // sur frais |
537 |
(Page.Components[i] as TRaveText).Text := Format('(%s)', [ComboBoxEnergy.Items[Energy]]) |
538 |
else // sur mati?re s?che |
539 |
(Page.Components[i] as TRaveText).Text := Format('(%s %s)', [ComboBoxEnergy.Items[Energy], _('DM')]); |
540 |
if (Page.Components[i] as TRaveText).Name = 'TextUnitEnergyRatio' |
541 |
then
|
542 |
(Page.Components[i] as TRaveText).Text := '(%)'; |
543 |
if (Page.Components[i] as TRaveText).Name = 'TextEBt_EBc' |
544 |
then
|
545 |
(Page.Components[i] as TRaveText).Text := ValidateEditEBt_EBc.Text;
|
546 |
if (Page.Components[i] as TRaveText).Name = 'TextdE' |
547 |
then
|
548 |
(Page.Components[i] as TRaveText).Text := Format('%s (%%)', [(Page.Components[i] as TRaveText).Text]); |
549 |
if (Page.Components[i] as TRaveText).Name = 'TextME_DE' |
550 |
then
|
551 |
(Page.Components[i] as TRaveText).Text := Format('%s (%%)', [(Page.Components[i] as TRaveText).Text]); |
552 |
if (Page.Components[i] as TRaveText).Name = 'TextNE_ME' |
553 |
then
|
554 |
(Page.Components[i] as TRaveText).Text := Format('%s (%%)', [(Page.Components[i] as TRaveText).Text]); |
555 |
end;
|
556 |
if Page.Components[i].ClassNameIs('TRaveDataMemo') and (Screen.Fonts.IndexOf('Arial Unicode MS') <> -1) |
557 |
then
|
558 |
(Page.Components[i] as TRaveDataMemo).Font.Name := 'Arial Unicode MS'; |
559 |
if Page.Components[i].ClassNameIs('TRaveDataText') |
560 |
then
|
561 |
begin
|
562 |
if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
563 |
then
|
564 |
(Page.Components[i] as TRaveDataText).Font.Name := 'Arial Unicode MS'; |
565 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextMM' |
566 |
then
|
567 |
with DataModuleDeclaration do |
568 |
if ClientDataSetIngredientsUser.Value
|
569 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['MM']) |
570 |
then // Valeur h?rit?e du mod?le |
571 |
begin
|
572 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
573 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
574 |
end;
|
575 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextMAT' |
576 |
then
|
577 |
with DataModuleDeclaration do |
578 |
if ClientDataSetIngredientsUser.Value
|
579 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['MAT']) |
580 |
then // Valeur h?rit?e du mod?le |
581 |
begin
|
582 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
583 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
584 |
end;
|
585 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextMG' |
586 |
then
|
587 |
with DataModuleDeclaration do |
588 |
if ClientDataSetIngredientsUser.Value
|
589 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['MG']) |
590 |
then // Valeur h?rit?e du mod?le |
591 |
begin
|
592 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
593 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
594 |
end;
|
595 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextCB' |
596 |
then
|
597 |
with DataModuleDeclaration do |
598 |
if ClientDataSetIngredientsUser.Value
|
599 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['CB']) |
600 |
then // Valeur h?rit?e du mod?le |
601 |
begin
|
602 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
603 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
604 |
end;
|
605 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextNDF' |
606 |
then
|
607 |
with DataModuleDeclaration do |
608 |
if ClientDataSetIngredientsUser.Value
|
609 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['NDF']) |
610 |
then // Valeur h?rit?e du mod?le |
611 |
begin
|
612 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
613 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
614 |
end;
|
615 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextADF' |
616 |
then
|
617 |
with DataModuleDeclaration do |
618 |
if ClientDataSetIngredientsUser.Value
|
619 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['ADF']) |
620 |
then // Valeur h?rit?e du mod?le |
621 |
begin
|
622 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
623 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
624 |
end;
|
625 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextADL' |
626 |
then
|
627 |
with DataModuleDeclaration do |
628 |
if ClientDataSetIngredientsUser.Value
|
629 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['ADL']) |
630 |
then // Valeur h?rit?e du mod?le |
631 |
begin
|
632 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
633 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
634 |
end;
|
635 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextAmidon' |
636 |
then
|
637 |
with DataModuleDeclaration do |
638 |
if ClientDataSetIngredientsUser.Value
|
639 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['Amidon']) |
640 |
then // Valeur h?rit?e du mod?le |
641 |
begin
|
642 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
643 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
644 |
end;
|
645 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextSucres' |
646 |
then
|
647 |
with DataModuleDeclaration do |
648 |
if ClientDataSetIngredientsUser.Value
|
649 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['Sucres']) |
650 |
then // Valeur h?rit?e du mod?le |
651 |
begin
|
652 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
653 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
654 |
end;
|
655 |
end;
|
656 |
end;
|
657 |
Page := RvProjectReport.ProjMan.FindRaveComponent('ReportIngredient.PageIngredient2', nil) as TRavePage; |
658 |
for i := 0 to Page.ComponentCount - 1 do |
659 |
begin
|
660 |
if Page.Components[i].ClassNameIs('TRaveText') |
661 |
then // Traduire |
662 |
begin
|
663 |
if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
664 |
then
|
665 |
(Page.Components[i] as TRaveText).Font.Name := 'Arial Unicode MS'; |
666 |
TranslateComponent(Page.Components[i]); |
667 |
if (Page.Components[i] as TRaveText).Name = 'TextdN' |
668 |
then
|
669 |
(Page.Components[i] as TRaveText).Text := Format('%s (%%)', [(Page.Components[i] as TRaveText).Text]); |
670 |
if (Page.Components[i] as TRaveText).Name = 'TextUnitAATot' |
671 |
then
|
672 |
with FormOptions do |
673 |
if Expression = 0 |
674 |
then // sur frais |
675 |
(Page.Components[i] as TRaveText).Text := Format('(%s)', [ComboBoxAA.Items[AA]]) |
676 |
else // sur mati?re s?che |
677 |
(Page.Components[i] as TRaveText).Text := Format('(%s %s)', [ComboBoxAA.Items[AA], _('DM')]); |
678 |
if (Page.Components[i] as TRaveText).Name = 'TextUnitAADig' |
679 |
then
|
680 |
with FormOptions do |
681 |
if Expression = 0 |
682 |
then // sur frais |
683 |
(Page.Components[i] as TRaveText).Text := Format('(%s)', [ComboBoxAA.Items[AA]]) |
684 |
else // sur mati?re s?che |
685 |
(Page.Components[i] as TRaveText).Text := Format('(%s %s)', [ComboBoxAA.Items[AA], _('DM')]); |
686 |
if (Page.Components[i] as TRaveText).Name = 'TextUnitLysd_EN' |
687 |
then
|
688 |
if FormOptions.Energy = 0 |
689 |
then // MJ |
690 |
(Page.Components[i] as TRaveText).Text := Format('%s (%s)', [(Page.Components[i] as TRaveText).Text, _('g/MJ')]) |
691 |
else // kcal |
692 |
(Page.Components[i] as TRaveText).Text := Format('%s (%s)', [(Page.Components[i] as TRaveText).Text, _('g/1000kcal')]); |
693 |
if (Page.Components[i] as TRaveText).Name = 'TextUnitMinerals' |
694 |
then
|
695 |
with FormOptions do |
696 |
if Expression = 0 |
697 |
then // sur frais |
698 |
(Page.Components[i] as TRaveText).Text := Format('(%s)', [ComboBoxMinerals.Items[Minerals]]) |
699 |
else // sur mati?re s?che |
700 |
(Page.Components[i] as TRaveText).Text := Format('(%s %s)', [ComboBoxMinerals.Items[Minerals], _('DM')]); |
701 |
if (Page.Components[i] as TRaveText).Name = 'TextdP' |
702 |
then
|
703 |
(Page.Components[i] as TRaveText).Text := Format('%s (%%)', [(Page.Components[i] as TRaveText).Text]); |
704 |
end;
|
705 |
if Page.Components[i].ClassNameIs('TRaveDataText') |
706 |
then
|
707 |
begin
|
708 |
if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
709 |
then
|
710 |
(Page.Components[i] as TRaveDataText).Font.Name := 'Arial Unicode MS'; |
711 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextCa' |
712 |
then
|
713 |
with DataModuleDeclaration do |
714 |
if ClientDataSetIngredientsUser.Value
|
715 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['Ca']) |
716 |
then // Valeur h?rit?e du mod?le |
717 |
begin
|
718 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
719 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
720 |
end;
|
721 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextP' |
722 |
then
|
723 |
with DataModuleDeclaration do |
724 |
if ClientDataSetIngredientsUser.Value
|
725 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['P']) |
726 |
then // Valeur h?rit?e du mod?le |
727 |
begin
|
728 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
729 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
730 |
end;
|
731 |
(*
|
732 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextNa'
|
733 |
then
|
734 |
with DataModuleDeclaration do
|
735 |
if ClientDataSetIngredientsUser.Value
|
736 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['Na'])
|
737 |
then // Valeur h?rit?e du mod?le
|
738 |
begin
|
739 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic];
|
740 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
741 |
end;
|
742 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextK'
|
743 |
then
|
744 |
with DataModuleDeclaration do
|
745 |
if ClientDataSetIngredientsUser.Value
|
746 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['K'])
|
747 |
then // Valeur h?rit?e du mod?le
|
748 |
begin
|
749 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic];
|
750 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
751 |
end;
|
752 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextCl'
|
753 |
then
|
754 |
with DataModuleDeclaration do
|
755 |
if ClientDataSetIngredientsUser.Value
|
756 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['Cl'])
|
757 |
then // Valeur h?rit?e du mod?le
|
758 |
begin
|
759 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic];
|
760 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
761 |
end;
|
762 |
*)
|
763 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextdP' |
764 |
then
|
765 |
with DataModuleDeclaration do |
766 |
if ClientDataSetIngredientsUser.Value
|
767 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['dP']) |
768 |
then // Valeur h?rit?e du mod?le |
769 |
begin
|
770 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
771 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
772 |
end;
|
773 |
if (Page.Components[i] as TRaveDataText).Name = 'DataTextdPphy' |
774 |
then
|
775 |
with DataModuleDeclaration do |
776 |
if ClientDataSetIngredientsUser.Value
|
777 |
and TableIngredients.FieldIsNull(TableIngredients.FieldIndex['dPphy']) |
778 |
then // Valeur h?rit?e du mod?le |
779 |
begin
|
780 |
(Page.Components[i] as TRaveDataText).Font.Style := (Page.Components[i] as TRaveDataText).Font.Style + [fsItalic]; |
781 |
(Page.Components[i] as TRaveDataText).Font.Color := clGray;
|
782 |
end;
|
783 |
end;
|
784 |
end;
|
785 |
end;
|
786 |
|
787 |
procedure TFormIngredientDetail.EditEmpty(Edit: TJvValidateEdit);
|
788 |
begin
|
789 |
Edit.DisplayFormat := dfNone; |
790 |
Edit.Value := '';
|
791 |
end;
|
792 |
|
793 |
procedure TFormIngredientDetail.EditShadow(Edit: TDBEdit);
|
794 |
begin
|
795 |
Edit.Font.Style := Edit.Font.Style + [fsItalic]; |
796 |
Edit.Font.Color := cl3DDkShadow; |
797 |
end;
|
798 |
|
799 |
procedure TFormIngredientDetail.FormCreate(Sender: TObject);
|
800 |
var
|
801 |
ProximalUnit, EnergyUnit, AAUnit, MineralsUnit: String;
|
802 |
begin
|
803 |
if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
804 |
then
|
805 |
Font.Name := 'Arial Unicode MS';
|
806 |
// PanelButtons.Font.Size := PanelButtons.Font.Size + 2;
|
807 |
PanelButtons.Font.Style := [fsBold]; |
808 |
LabelName.Font.Style := [fsBold]; |
809 |
DBEditName.Font.Style := [fsBold]; |
810 |
TranslateComponent(Self); |
811 |
with FormOptions do |
812 |
LabelMS.Caption := Format('%s (%s)', [LabelMS.Caption, ComboBoxProximal.Items[Proximal]]);
|
813 |
with FormOptions do |
814 |
if Expression = 0 |
815 |
then // sur frais |
816 |
begin
|
817 |
ProximalUnit := ComboBoxProximal.Items[Proximal]; |
818 |
EnergyUnit := ComboBoxEnergy.Items[Energy]; |
819 |
AAUnit := ComboBoxAA.Items[AA]; |
820 |
MineralsUnit := ComboBoxMinerals.Items[Minerals]; |
821 |
end
|
822 |
else // sur mati?re s?che |
823 |
begin
|
824 |
ProximalUnit := Format('%s %s', [ComboBoxProximal.Items[Proximal], _('DM')]); |
825 |
EnergyUnit := Format('%s %s', [ComboBoxEnergy.Items[Energy], _('DM')]); |
826 |
AAUnit := Format('%s %s', [ComboBoxAA.Items[AA], _('DM')]); |
827 |
MineralsUnit := Format('%s %s', [ComboBoxMinerals.Items[Minerals], _('DM')]); |
828 |
end;
|
829 |
GroupBoxProximal.Caption := Format('%s (%s)', [GroupBoxProximal.Caption, ProximalUnit]);
|
830 |
GroupBoxMinerals.Caption := Format('%s (%s)', [GroupBoxMinerals.Caption, MineralsUnit]);
|
831 |
if FormOptions.Expression = 0 |
832 |
then // sur frais |
833 |
LabelBE.Caption := Format('%s (%s)', [LabelBE.Caption, _('mEq/kg')]) |
834 |
else // sur mati?re s?che |
835 |
LabelBE.Caption := Format('%s (%s %s)', [LabelBE.Caption, _('mEq/kg'), _('DM')]); |
836 |
LabelDigP.Caption := Format('%s (%%)', [LabelDigP.Caption]);
|
837 |
GroupBoxEnergy.Caption := Format('%s (%s)', [GroupBoxEnergy.Caption, EnergyUnit]);
|
838 |
LabelRatio.Caption := Format('%s (%%)', [LabelRatio.Caption]);
|
839 |
GroupBoxEnergyUtilization.Caption := Format('%s (%%)', [GroupBoxEnergyUtilization.Caption]);
|
840 |
// GroupBoxAzote.Caption := Format('%s (%%)', [GroupBoxAzote.Caption]);
|
841 |
LabeldN.Caption := Format('%s (%%)', [LabeldN.Caption]);
|
842 |
if FormOptions.Energy = 0 |
843 |
then // MJ |
844 |
LabelLysd_EN.Caption := Format('%s (%s)', [LabelLysd_EN.Caption, _('g/MJ')]) |
845 |
else // kcal |
846 |
LabelLysd_EN.Caption := Format('%s (%s)', [LabelLysd_EN.Caption, _('g/1000kcal')]); |
847 |
GroupBoxAA.Caption := Format('%s (%s)', [GroupBoxAA.Caption, AAUnit]);
|
848 |
LabeldAA.Caption := Format('%s (%%)', [LabeldAA.Caption]);
|
849 |
end;
|
850 |
|
851 |
procedure TFormIngredientDetail.FormShow(Sender: TObject);
|
852 |
begin
|
853 |
with DataModuleDeclaration do |
854 |
begin
|
855 |
if ClientDataSetIngredientsEB.IsNull
|
856 |
then
|
857 |
EditEmpty(ValidateEditEBt_EBc) |
858 |
else
|
859 |
ValidateEditEBt_EBc.Value := 100;
|
860 |
if ClientDataSetIngredientsUser.Value
|
861 |
then // Mati?re premi?re utilisateur |
862 |
begin
|
863 |
TableIngredients := DBUser.GetTable('SELECT * FROM Ingredients '
|
864 |
+ Format('WHERE Id = %d', [ClientDataSetIngredientsId.Value]));
|
865 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['MM']) |
866 |
then // Valeur h?rit?e du mod?le |
867 |
EditShadow(DBEditMM); |
868 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['MAT']) |
869 |
then // Valeur h?rit?e du mod?le |
870 |
EditShadow(DBEditMAT); |
871 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['MG']) |
872 |
then // Valeur h?rit?e du mod?le |
873 |
EditShadow(DBEditMG); |
874 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['CB']) |
875 |
then // Valeur h?rit?e du mod?le |
876 |
EditShadow(DBEditCB); |
877 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['NDF']) |
878 |
then // Valeur h?rit?e du mod?le |
879 |
EditShadow(DBEditNDF); |
880 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['ADF']) |
881 |
then // Valeur h?rit?e du mod?le |
882 |
EditShadow(DBEditADF); |
883 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['ADL']) |
884 |
then // Valeur h?rit?e du mod?le |
885 |
EditShadow(DBEditADL); |
886 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['Amidon']) |
887 |
then // Valeur h?rit?e du mod?le |
888 |
EditShadow(DBEditAmidon); |
889 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['Sucres']) |
890 |
then // Valeur h?rit?e du mod?le |
891 |
EditShadow(DBEditSucres); |
892 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['Ca']) |
893 |
then // Valeur h?rit?e du mod?le |
894 |
EditShadow(DBEditCa); |
895 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['P']) |
896 |
then // Valeur h?rit?e du mod?le |
897 |
EditShadow(DBEditP); |
898 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['Na']) |
899 |
then // Valeur h?rit?e du mod?le |
900 |
EditShadow(DBEditNa); |
901 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['K']) |
902 |
then // Valeur h?rit?e du mod?le |
903 |
EditShadow(DBEditK); |
904 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['Cl']) |
905 |
then // Valeur h?rit?e du mod?le |
906 |
EditShadow(DBEditCl); |
907 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['dPphy']) |
908 |
then // Valeur h?rit?e du mod?le |
909 |
EditShadow(DBEditdPphy); |
910 |
if TableIngredients.FieldIsNull(TableIngredients.FieldIndex['dP']) |
911 |
then // Valeur h?rit?e du mod?le |
912 |
EditShadow(DBEditdP); |
913 |
TableIngredients.Free; |
914 |
end
|
915 |
else // Mati?re premi?re de r?f?rence |
916 |
begin
|
917 |
JvImgBtnModify.Enabled := False; |
918 |
JvImgBtnDelete.Enabled := False; |
919 |
end;
|
920 |
end;
|
921 |
end;
|
922 |
|
923 |
end.
|