Develop and Download Open Source Software

Browse Subversion Repository

Diff of /Unit7.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1 by yamat0jp, Sun Nov 22 11:18:44 2015 UTC revision 7 by yamat0jp, Wed Dec 30 09:56:24 2015 UTC
# Line 7  uses Line 7  uses
7    IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompGrids,    IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompGrids,
8    IWDBGrids, IWCompButton, IWCompExtCtrls, IWVCLComponent,    IWDBGrids, IWCompButton, IWCompExtCtrls, IWVCLComponent,
9    IWBaseLayoutComponent, IWBaseContainerLayout, IWContainerLayout,    IWBaseLayoutComponent, IWBaseContainerLayout, IWContainerLayout,
10    IWTemplateProcessorHTML;    IWTemplateProcessorHTML, PngImage, Data.DB, IWCompLabel, IWDBStdCtrls,
11      FireDAC.Comp.Client;
12    
13  type  type
14    TCartForm = class(TIWAppForm)    TPayForm = class(TIWAppForm)
     IWDBGrid1: TIWDBGrid;  
15      IWButton1: TIWButton;      IWButton1: TIWButton;
16      IWButton2: TIWButton;      IWButton2: TIWButton;
17      IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;      IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;
18      procedure IWAppFormCreate(Sender: TObject);      IWDBLabel1: TIWDBLabel;
19      procedure IWAppFormDestroy(Sender: TObject);      procedure IWButton2Click(Sender: TObject);
20      procedure IWButton1Click(Sender: TObject);      procedure IWButton1Click(Sender: TObject);
21    public    public
22    end;    end;
# Line 25  implementation Line 25  implementation
25    
26  {$R *.dfm}  {$R *.dfm}
27    
28  uses Unit4, Unit1, Unit8, ServerController;  uses Unit3;
29    
30  procedure TCartForm.IWAppFormCreate(Sender: TObject);  procedure TPayForm.IWButton1Click(Sender: TObject);
31  var  var
32    i: integer;    s: TFDQuery;
   s, t: TIWDBGridColumn;  
   j: integer;  
33  begin  begin
34    with DM.FDQuery1 do    with DM.FDQuery1 do
35    begin    begin
36      SQL.Clear;      Open('select number,serial from cart_data;');
37      SQL.Add('select name,maker,image,volume,price');      s := TFDQuery.Create(nil);
38      SQL.Add(' from item_data join cart_data');      try
39      SQL.Add(' on (item_data.serial = cart_data.serial) where number = :num;');        s.Connection := DM.FDConnection1;
40      Params.ParamByName('num').AsInteger := UserSession.user_number;        s.Open('select * from recent_data;');
41      Open;        while Eof = false do
   end;  
   for i := 0 to DM.FDQuery1.Fields.Count - 1 do  
   begin  
     s := IWDBGrid1.Columns.Add as TIWDBGridColumn;  
     if i = 2 then  
     begin  
       s.Title.Text := 'IMAGE';  
       for j := 1 to s.Collection.Count - 1 do  
42        begin        begin
43          t := s.Collection.Items[j] as TIWDBGridColumn;          s.AppendRecord([Fields.Fields[0].AsInteger,
44          t.Control := TIWImageFile.Create(IWDBGrid1);            Fields.Fields[1].AsInteger]);
45            Delete;
46        end;        end;
47      end      finally
48      else        s.Free;
49        s.DataField := DM.FDQuery1.Fields[i].FieldName;      end;
50    end;    end;
51      WebApplication.ShowMessage('お買い上げありがとうございました');
52      Release;
53  end;  end;
54    
55  procedure TCartForm.IWAppFormDestroy(Sender: TObject);  procedure TPayForm.IWButton2Click(Sender: TObject);
 var  
   i: integer;  
   s: TIWDBGridColumn;  
 begin  
   DM.FDQuery1.Close;  
   s := IWDBGrid1.Columns.Items[2] as TIWDBGridColumn;  
   for i := 0 to s.Collection.Count - 1 do  
     s.Control.Free;  
 end;  
   
 procedure TCartForm.IWButton1Click(Sender: TObject);  
56  begin  begin
57    Release;    Release;
   if Sender = IWButton1 then  
     TPayForm.Create(WebApplication).Show  
   else  
     TTopForm.Create(WebApplication).Show;  
58  end;  end;
59    
60  end.  end.

Legend:
Removed from v.1  
changed lines
  Added in v.7

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