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 6 by yamat0jp, Tue Dec 29 10:58:29 2015 UTC revision 8 by yamat0jp, Thu Dec 31 08:51:02 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, PngImage, Data.DB, IWCompLabel, IWDBStdCtrls;    IWTemplateProcessorHTML, PngImage, Data.DB, IWCompLabel, IWDBStdCtrls,
11      FireDAC.Comp.Client;
12    
13  type  type
14    TPayForm = class(TIWAppForm)    TPayForm = class(TIWAppForm)
# Line 16  type Line 17  type
17      IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;      IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;
18      IWDBLabel1: TIWDBLabel;      IWDBLabel1: TIWDBLabel;
19      procedure IWButton2Click(Sender: TObject);      procedure IWButton2Click(Sender: TObject);
20        procedure IWButton1Click(Sender: TObject);
21    public    public
22    end;    end;
23    
# Line 23  implementation Line 25  implementation
25    
26  {$R *.dfm}  {$R *.dfm}
27    
28  uses Unit3, Unit1, ServerController, Unit4;  uses Unit3, Unit1;
29    
30    procedure TPayForm.IWButton1Click(Sender: TObject);
31    var
32      s: TFDQuery;
33    begin
34      with DM.FDQuery1 do
35      begin
36        Open('select number,serial from cart_data where number = :num;',
37          [DM.FDTable1.FieldByName('NUMBER').AsInteger]);
38        s := TFDQuery.Create(nil);
39        try
40          s.Connection := DM.FDConnection1;
41          s.Open('select * from recent_data;');
42          while s.Eof = false do
43            if Date + 30 < s.FieldByName('DATE').AsDateTime then
44              s.Delete
45            else
46              s.Next;
47          while Eof = false do
48          begin
49            if s.Locate('SERIAL', s.FieldByName('SERIAL').AsInteger, []) = false
50            then
51              s.AppendRecord([Fields.Fields[0].AsInteger,
52                Fields.Fields[1].AsInteger, Date]);
53            Delete;
54          end;
55        finally
56          s.Free;
57        end;
58      end;
59      WebApplication.ShowMessage('お買い上げありがとうございました');
60      Release;
61      IWForm1.Page := true;
62    end;
63    
64  procedure TPayForm.IWButton2Click(Sender: TObject);  procedure TPayForm.IWButton2Click(Sender: TObject);
65  begin  begin

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

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