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 6 by yamat0jp, Tue Dec 29 10:58:29 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    
12  type  type
13    TCartForm = class(TIWAppForm)    TPayForm = class(TIWAppForm)
     IWDBGrid1: TIWDBGrid;  
14      IWButton1: TIWButton;      IWButton1: TIWButton;
15      IWButton2: TIWButton;      IWButton2: TIWButton;
16      IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;      IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;
17      procedure IWAppFormCreate(Sender: TObject);      IWDBLabel1: TIWDBLabel;
18      procedure IWAppFormDestroy(Sender: TObject);      procedure IWButton2Click(Sender: TObject);
     procedure IWButton1Click(Sender: TObject);  
19    public    public
20    end;    end;
21    
# Line 25  implementation Line 23  implementation
23    
24  {$R *.dfm}  {$R *.dfm}
25    
26  uses Unit4, Unit1, Unit8, ServerController;  uses Unit3, Unit1, ServerController, Unit4;
27    
28  procedure TCartForm.IWAppFormCreate(Sender: TObject);  procedure TPayForm.IWButton2Click(Sender: TObject);
 var  
   i: integer;  
   s, t: TIWDBGridColumn;  
   j: integer;  
 begin  
   with DM.FDQuery1 do  
   begin  
     SQL.Clear;  
     SQL.Add('select name,maker,image,volume,price');  
     SQL.Add(' from item_data join cart_data');  
     SQL.Add(' on (item_data.serial = cart_data.serial) where number = :num;');  
     Params.ParamByName('num').AsInteger := UserSession.user_number;  
     Open;  
   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  
       begin  
         t := s.Collection.Items[j] as TIWDBGridColumn;  
         t.Control := TIWImageFile.Create(IWDBGrid1);  
       end;  
     end  
     else  
       s.DataField := DM.FDQuery1.Fields[i].FieldName;  
   end;  
 end;  
   
 procedure TCartForm.IWAppFormDestroy(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);  
29  begin  begin
30    Release;    Release;
   if Sender = IWButton1 then  
     TPayForm.Create(WebApplication).Show  
   else  
     TTopForm.Create(WebApplication).Show;  
31  end;  end;
32    
33  end.  end.

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

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