root / UFRapSeqAliT.pas
Historique | Voir | Annoter | Télécharger (3,331 ko)
1 | 3 | avalancogn | unit UFRapSeqAliT ;
|
---|---|---|---|
2 | |||
3 | interface
|
||
4 | |||
5 | uses
|
||
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, |
||
7 | Dialogs, OleCtrls, StdCtrls, ComCtrls, DB, DBClient, ExtCtrls, QRCtrls, |
||
8 | QuickRpt, QRPrntr, MidasLib, UVariables, gnugettext; |
||
9 | |||
10 | type
|
||
11 | TFRapSeqAliT = class(TForm)
|
||
12 | QRRapport: TQuickRep; |
||
13 | PHBRapport: TQRBand; |
||
14 | DBRapport: TQRBand; |
||
15 | QRLTitre: TQRLabel; |
||
16 | CDSRapport: TClientDataSet; |
||
17 | SFSeqAli: TStringField; |
||
18 | PFBRapport: TQRBand; |
||
19 | QRLUser: TQRLabel; |
||
20 | QRLWarning: TQRLabel; |
||
21 | QRLSeqAli: TQRLabel; |
||
22 | QRDBTSeqAli: TQRDBText; |
||
23 | QRLMemo: TQRLabel; |
||
24 | QRMMemo: TQRMemo; |
||
25 | QRSDDate: TQRSysData; |
||
26 | QRSEntete: TQRShape; |
||
27 | DSRelation: TDataSource; |
||
28 | CDSRegles: TClientDataSet; |
||
29 | SFIndex: TStringField; |
||
30 | IFNo: TIntegerField; |
||
31 | SFModeFin: TStringField; |
||
32 | SFAliment: TStringField; |
||
33 | QRLRegles: TQRLabel; |
||
34 | QRLNo: TQRLabel; |
||
35 | QRDBTNo: TQRDBText; |
||
36 | QRShape2: TQRShape; |
||
37 | QRLModeFin: TQRLabel; |
||
38 | QRDBTModeFin: TQRDBText; |
||
39 | QRLAliment: TQRLabel; |
||
40 | QRDBTAliment: TQRDBText; |
||
41 | QRSDRegles: TQRSubDetail; |
||
42 | TBRapport: TQRBand; |
||
43 | QRDBTEtat: TQRDBText; |
||
44 | IFEtat: TIntegerField; |
||
45 | CDSRapport_Etat_: TIntegerField; |
||
46 | SFStrEtat: TStringField; |
||
47 | QRIInraPorc: TQRImage; |
||
48 | QRLInraPorc: TQRLabel; |
||
49 | procedure FormCreate(Sender: TObject);
|
||
50 | private
|
||
51 | { D?clarations priv?es }
|
||
52 | public
|
||
53 | { D?clarations publiques }
|
||
54 | end;
|
||
55 | |||
56 | var
|
||
57 | FRapSeqAliT: TFRapSeqAliT; |
||
58 | |||
59 | implementation
|
||
60 | |||
61 | uses
|
||
62 | UStrings, UUtil, UFSeqAliT, UFPrevRap ; |
||
63 | |||
64 | {$R *.dfm}
|
||
65 | |||
66 | { TFRapSeqAliT }
|
||
67 | |||
68 | procedure TFRapSeqAliT.FormCreate(Sender: TObject);
|
||
69 | var
|
||
70 | etat, regle, nb : integer; |
||
71 | begin
|
||
72 | if Screen.Fonts.IndexOf('Arial Unicode MS') <> -1 |
||
73 | then
|
||
74 | Font.Name := 'Arial Unicode MS';
|
||
75 | TranslateComponent(Self); |
||
76 | // Licence
|
||
77 | if IsEducation and (Length (Course) > 0) |
||
78 | then
|
||
79 | QRLUSer.Caption := Format('%s (%s)', [Course, Company])
|
||
80 | else
|
||
81 | if IsComplete or IsEducation |
||
82 | then
|
||
83 | QRLUSer.Caption := Format('%s %s (%s)', [FirstName, LastName, Company])
|
||
84 | else
|
||
85 | if IsEvaluation
|
||
86 | then
|
||
87 | QRLUSer.Caption := StrEvaluation |
||
88 | else
|
||
89 | begin
|
||
90 | QRLUSer.Caption := StrReadOnly; |
||
91 | QRLUser.Font.Color := clRed; |
||
92 | end;
|
||
93 | with CDSRapport do |
||
94 | begin
|
||
95 | CreateDataSet; |
||
96 | for etat := 0 to 2 do |
||
97 | begin
|
||
98 | Append; |
||
99 | FieldValues['_SeqAli_'] := FSeqAliT.CBSeqAli.Text;
|
||
100 | FieldValues['_Etat_'] := etat;
|
||
101 | FieldValues['_StrEtat_'] := FSeqAliT.TC.Tabs[etat];
|
||
102 | Post; |
||
103 | end;
|
||
104 | end;
|
||
105 | QRMMemo.Lines.Add(FSeqAliT.CBSeqAli.Hint); |
||
106 | with CDSRegles do |
||
107 | begin
|
||
108 | CreateDataSet; |
||
109 | for etat := 0 to 2 do |
||
110 | begin
|
||
111 | case etat of |
||
112 | 0 : // Gestation |
||
113 | nb := PSeqAliT.NbRuleGest; |
||
114 | 1 : // Lactation |
||
115 | nb := PSeqAliT.NbRuleLact; |
||
116 | else // I.S.S.F. |
||
117 | nb := PSeqAliT.NbRuleISSF; |
||
118 | end;
|
||
119 | for regle := 1 to nb do |
||
120 | begin
|
||
121 | Append; |
||
122 | FieldValues['_SeqAli_'] := FSeqAliT.CBSeqAli.Text;
|
||
123 | FieldValues['_Etat_'] := etat;
|
||
124 | FieldValues['_No_'] := regle;
|
||
125 | FieldValues['_ModeFin_'] := FSeqAliT.StrModeFin(etat, regle);
|
||
126 | FieldValues['_Aliment_'] := FSeqAliT.StrAliment(etat, regle);
|
||
127 | Post; |
||
128 | end;
|
||
129 | end;
|
||
130 | end;
|
||
131 | RegisterPreviewClass(TQRPrevRapInterface); |
||
132 | // QRRapport.PreviewModal;
|
||
133 | // RegisterPreviewClass(TQRStandardPreviewInterface);
|
||
134 | end;
|
||
135 | |||
136 | end. |