Develop and Download Open Source Software

Browse Subversion Repository

Contents of /Unit7.pas

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download) (as text)
Sun Nov 22 11:18:44 2015 UTC (8 years, 3 months ago) by yamat0jp
File MIME type: text/x-pascal
File size: 2124 byte(s)
方向性はあってますが技術的に行き詰っています.IntraWebの情報・経験が不足しています.
ボタンでフォームを切り替えることさえうまくいきませんがセッションの問題でしょうか?
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 IWTemplateProcessorHTML;
11
12 type
13 TCartForm = class(TIWAppForm)
14 IWDBGrid1: TIWDBGrid;
15 IWButton1: TIWButton;
16 IWButton2: TIWButton;
17 IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;
18 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 uses Unit4, Unit1, Unit8, ServerController;
29
30 procedure TCartForm.IWAppFormCreate(Sender: TObject);
31 var
32 i: integer;
33 s, t: TIWDBGridColumn;
34 j: integer;
35 begin
36 with DM.FDQuery1 do
37 begin
38 SQL.Clear;
39 SQL.Add('select name,maker,image,volume,price');
40 SQL.Add(' from item_data join cart_data');
41 SQL.Add(' on (item_data.serial = cart_data.serial) where number = :num;');
42 Params.ParamByName('num').AsInteger := UserSession.user_number;
43 Open;
44 end;
45 for i := 0 to DM.FDQuery1.Fields.Count - 1 do
46 begin
47 s := IWDBGrid1.Columns.Add as TIWDBGridColumn;
48 if i = 2 then
49 begin
50 s.Title.Text := 'IMAGE';
51 for j := 1 to s.Collection.Count - 1 do
52 begin
53 t := s.Collection.Items[j] as TIWDBGridColumn;
54 t.Control := TIWImageFile.Create(IWDBGrid1);
55 end;
56 end
57 else
58 s.DataField := DM.FDQuery1.Fields[i].FieldName;
59 end;
60 end;
61
62 procedure TCartForm.IWAppFormDestroy(Sender: TObject);
63 var
64 i: integer;
65 s: TIWDBGridColumn;
66 begin
67 DM.FDQuery1.Close;
68 s := IWDBGrid1.Columns.Items[2] as TIWDBGridColumn;
69 for i := 0 to s.Collection.Count - 1 do
70 s.Control.Free;
71 end;
72
73 procedure TCartForm.IWButton1Click(Sender: TObject);
74 begin
75 Release;
76 if Sender = IWButton1 then
77 TPayForm.Create(WebApplication).Show
78 else
79 TTopForm.Create(WebApplication).Show;
80 end;
81
82 end.

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