Develop and Download Open Source Software

Browse Subversion Repository

Diff of /Unit5.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 12 by yamat0jp, Sun Jul 24 06:09:44 2016 UTC
# Line 6  uses Line 6  uses
6    Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, IWVCLComponent,    Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, IWVCLComponent,
7    IWBaseLayoutComponent, IWBaseContainerLayout, IWContainerLayout,    IWBaseLayoutComponent, IWBaseContainerLayout, IWContainerLayout,
8    IWTemplateProcessorHTML, Vcl.Controls, IWVCLBaseControl, IWBaseControl,    IWTemplateProcessorHTML, Vcl.Controls, IWVCLBaseControl, IWBaseControl,
9    IWBaseHTMLControl, IWControl, IWCompButton;    IWBaseHTMLControl, IWControl, IWCompButton, IWCompGrids, IWCompListbox,
10      IWCompLabel, IWDBStdCtrls, IWCompCheckbox, System.Variants;
11    
12  type  type
13    TIWForm3 = class(TIWAppForm)    TAdminPage = class(TIWAppForm)
     IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;  
14      IWButton1: TIWButton;      IWButton1: TIWButton;
15      IWButton2: TIWButton;      IWButton2: TIWButton;
16      IWButton3: TIWButton;      IWButton3: TIWButton;
17      IWButton4: TIWButton;      IWButton4: TIWButton;
18        IWGrid1: TIWGrid;
19        IWTemplateProcessorHTML1: TIWTemplateProcessorHTML;
20        IWLabel1: TIWLabel;
21        IWLabel2: TIWLabel;
22        IWCheckBox1: TIWCheckBox;
23        IWListbox1: TIWListbox;
24        procedure IWButton1Click(Sender: TObject);
25        procedure IWButton4Click(Sender: TObject);
26        procedure IWAppFormCreate(Sender: TObject);
27        procedure IWGrid1Render(Sender: TObject);
28        procedure IWCheckBox1Change(Sender: TObject);
29        procedure IWListbox1Change(Sender: TObject);
30    public    public
31    end;    end;
32    
# Line 22  implementation Line 34  implementation
34    
35  {$R *.dfm}  {$R *.dfm}
36    
37    uses Unit3;
38    
39    procedure TAdminPage.IWAppFormCreate(Sender: TObject);
40    begin
41      IWListbox1.Items.Clear;
42      IWListbox1.Items.Add(' -- ALL --');
43      IWListbox1.ItemIndex := 0;
44      DM.FDTable6.First;
45      while DM.FDTable6.Eof = false do
46      begin
47        IWListbox1.Items.Add('注文 '+DM.FDTable6.FieldByName('ORDER').AsString);
48        DM.FDTable6.Next;
49      end;
50    end;
51    
52    procedure TAdminPage.IWButton1Click(Sender: TObject);
53    begin
54      IWGrid1Render(nil);
55    end;
56    
57    procedure TAdminPage.IWButton4Click(Sender: TObject);
58    begin
59      Release;
60    end;
61    
62    procedure TAdminPage.IWCheckBox1Change(Sender: TObject);
63    begin
64      with Sender as TIWCheckBox do
65        if (Checked = true) and (DM.FDTable5.Locate('KEYFIELD', Tag, []) = true)
66        then
67        begin
68          DM.FDTable5.Edit;
69          DM.FDTable5.FieldByName('CHECKVALUE').AsBoolean := true;
70          // DM.FDTable6.FieldByName('DATE').AsDateTime := Date;
71          DM.FDTable5.Post;
72        end;
73    end;
74    
75    procedure TAdminPage.IWGrid1Render(Sender: TObject);
76    var
77      i: integer;
78      j: integer;
79      s: TIWCheckBox;
80    begin
81      for i := 1 to IWGrid1.RowCount - 1 do
82        IWGrid1.Cell[i, 4].Control.Free;
83      IWGrid1.RowCount := DM.FDQuery1.RecordCount + 1;
84      with IWGrid1 do
85      begin
86        Cell[0, 0].Text := '日付';
87        Cell[0, 1].Text := 'ご注文';
88        Cell[0, 2].Text := 'メーカー';
89        Cell[0, 3].Text := '個数';
90        Cell[0, 4].Text := '発送済み';
91      end;
92      DM.FDTable6.First;
93      while DM.FDTable6.Eof = false do
94      begin
95        DM.FDTable5.First;
96        while DM.FDTable5.Eof = false do
97        begin
98          IWGrid1.Cell[i, 0].Text := DM.FDTable6.FieldByName('DATE').AsString;
99          IWGrid1.Cell[i, 1].Text := DM.FDTable5.FieldByName('NAME').AsString;
100          IWGrid1.Cell[i, 2].Text := DM.FDTable5.FieldByName('MAKER').AsString;
101          IWGrid1.Cell[i, 3].Text := DM.FDTable5.FieldByName('VOLUME').AsString;
102          s := TIWCheckBox.Create(IWGrid1);
103          s.Checked := DM.FDTable5.FieldByName('CHECKVALUE').AsBoolean;
104          s.Tag := DM.FDTable5.FieldByName('KEYFIELD').AsInteger;
105          s.OnChange := IWCheckBox1Change;
106          IWGrid1.Cell[i, 4].Control := s;
107          DM.FDTable5.Next;
108        end;
109        DM.FDTable6.Next;
110      end;
111    end;
112    
113    procedure TAdminPage.IWListbox1Change(Sender: TObject);
114    var
115      s: string;
116    begin
117      if IWListbox1.ItemIndex = 0 then
118      begin
119        DM.FDQuery1.Filtered := false;
120        IWLabel1.Text := '';
121        IWLabel2.Text := '';
122      end
123      else
124      begin
125        s := IWListbox1.Items.ValueFromIndex[IWListbox1.ItemIndex];
126    
127        DM.FDQuery1.Filtered := true;;
128        IWLabel1.Text := DM.FDQuery1.FieldByName('ADDRESS').AsString;
129        IWLabel2.Text := DM.FDQuery1.FieldByName('ID').AsString;
130      end;
131      IWGrid1Render(nil);
132    end;
133    
134  end.  end.

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

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