Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /Unit7.pas

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2 - (hide annotations) (download) (as text)
Sat Dec 19 14:35:42 2015 UTC (8 years, 3 months ago) by yamat0jp
File MIME type: text/x-pascal
File size: 2625 byte(s)
IntraWebをバージョンアップしてから、コンパイルが可能になりました。お見苦しいところをお見せしていました。
まだまだ未完成です。
1 yamat0jp 1 unit Unit7;
2    
3     interface
4    
5     uses
6     Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, Vcl.Controls,
7     IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompGrids,
8     IWDBGrids, IWCompButton, IWCompExtCtrls, IWVCLComponent,
9     IWBaseLayoutComponent, IWBaseContainerLayout, IWContainerLayout,
10 yamat0jp 2 IWTemplateProcessorHTML, PngImage, Data.DB;
11 yamat0jp 1
12     type
13     TCartForm = class(TIWAppForm)
14     IWButton1: TIWButton;
15     IWButton2: TIWButton;
16     IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;
17 yamat0jp 2 IWGrid1: TIWGrid;
18 yamat0jp 1 procedure IWAppFormCreate(Sender: TObject);
19     procedure IWAppFormDestroy(Sender: TObject);
20     procedure IWButton1Click(Sender: TObject);
21     public
22     end;
23    
24     implementation
25    
26     {$R *.dfm}
27    
28 yamat0jp 2 uses Unit3, Unit1, ServerController, Unit4;
29 yamat0jp 1
30     procedure TCartForm.IWAppFormCreate(Sender: TObject);
31     var
32     i: integer;
33 yamat0jp 2 s: TStream;
34     png: TPngImage;
35     img: TIWImageFile;
36 yamat0jp 1 j: integer;
37     begin
38     with DM.FDQuery1 do
39     begin
40     SQL.Clear;
41 yamat0jp 2 SQL.Add('select name,maker,thumbnail,volume,price');
42 yamat0jp 1 SQL.Add(' from item_data join cart_data');
43     SQL.Add(' on (item_data.serial = cart_data.serial) where number = :num;');
44     Params.ParamByName('num').AsInteger := UserSession.user_number;
45     Open;
46     end;
47 yamat0jp 2 IWGrid1.ColumnCount := DM.FDQuery1.Fields.Count;
48     IWGrid1.RowCount := DM.FDQuery1.RecordCount;
49     for i := 0 to IWGrid1.RowCount - 1 do
50 yamat0jp 1 begin
51 yamat0jp 2 png := TPngImage.Create;
52     try
53     for j := 0 to IWGrid1.ColumnCount - 1 do
54 yamat0jp 1 begin
55 yamat0jp 2 case j of
56     2:
57     begin
58     s := DM.FDQuery1.CreateBlobStream
59     (DM.FDQuery1.FieldByName('THUMBNAIL'), bmRead);
60     try
61     png.LoadFromStream(s);
62     img:=TIWImageFile.Create(IWGrid1);
63     img.Picture.Assign(png);
64     IWGrid1.Cell[i, j].Control :=img;
65     finally
66     s.Free;
67     end;
68     end;
69     4:
70     IWGrid1.Cell[i, j].Text :=
71     (DM.FDQuery1.Fields[3].AsInteger * DM.FDQuery1.Fields[4]
72     .AsInteger).ToString;
73     else
74     IWGrid1.Cell[i, j].Text := DM.FDQuery1.Fields[j].AsString;
75     end;
76 yamat0jp 1 end;
77 yamat0jp 2 finally
78     png.Free;
79     end;
80     DM.FDQuery1.Next;
81 yamat0jp 1 end;
82     end;
83    
84     procedure TCartForm.IWAppFormDestroy(Sender: TObject);
85     begin
86     DM.FDQuery1.Close;
87     end;
88    
89     procedure TCartForm.IWButton1Click(Sender: TObject);
90     begin
91     Release;
92     if Sender = IWButton1 then
93     TPayForm.Create(WebApplication).Show
94     else
95 yamat0jp 2 TIWForm1.Create(WebApplication).Show;
96 yamat0jp 1 end;
97    
98     end.

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26