| 9 |
IWContainer, IWHTMLContainer, IWHTML40Container, IWRegion, IWDBStdCtrls, |
IWContainer, IWHTMLContainer, IWHTML40Container, IWRegion, IWDBStdCtrls, |
| 10 |
IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompLabel, |
IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompLabel, |
| 11 |
IWCompGrids, IWCompText, IWCompTabControl, IWCompButton, IWCompEdit, |
IWCompGrids, IWCompText, IWCompTabControl, IWCompButton, IWCompEdit, |
| 12 |
IWHTMLControls, IWCompExtCtrls, UserSessionUnit, PngImage, Data.DB; |
IWHTMLControls, IWCompExtCtrls, UserSessionUnit, PngImage, Data.DB, |
| 13 |
|
IWCompListbox, IWBaseComponent, IWBaseHTMLComponent, IWBaseHTML40Component, |
| 14 |
|
IWCompMenu, Vcl.Menus, System.Variants; |
| 15 |
|
|
| 16 |
type |
type |
| 17 |
TIWForm1 = class(TIWAppForm) |
TIWForm1 = class(TIWAppForm) |
| 81 |
end; |
end; |
| 82 |
|
|
| 83 |
procedure TIWForm1.IWAppFormCreate(Sender: TObject); |
procedure TIWForm1.IWAppFormCreate(Sender: TObject); |
| 84 |
|
const |
| 85 |
|
i = 120; |
| 86 |
|
var |
| 87 |
|
s: Integer; |
| 88 |
begin |
begin |
| 89 |
Page := UserSession.FPage; |
Page := UserSession.FPage; |
| 90 |
|
s := DM.FDTable3.FieldByName('BGCOLOR').AsInteger; |
| 91 |
|
IWLabel2.BGColor := s; |
| 92 |
|
IWLabel3.BGColor := s; |
| 93 |
|
IWLabel5.BGColor := s; |
| 94 |
|
IWRegion1.Width := i; |
| 95 |
|
IWRegion2.Width := i; |
| 96 |
|
IWRegion4.Width := i; |
| 97 |
|
IWRegion5.Width := i; |
| 98 |
|
IWRegion6.Width := i; |
| 99 |
|
IWRegion7.Width := i; |
| 100 |
end; |
end; |
| 101 |
|
|
| 102 |
procedure TIWForm1.IWAppFormRender(Sender: TObject); |
procedure TIWForm1.IWAppFormRender(Sender: TObject); |
| 107 |
IWList1.Items.Clear; |
IWList1.Items.Clear; |
| 108 |
with DM.FDTable2 do |
with DM.FDTable2 do |
| 109 |
begin |
begin |
| 110 |
First; |
if Filtered = true then |
|
while Eof = false do |
|
| 111 |
begin |
begin |
| 112 |
s := FieldByName('CATEGORY').AsString; |
FindFirst; |
| 113 |
if s = '' then |
while Found = true do |
|
begin |
|
|
Next; |
|
|
continue; |
|
|
end; |
|
|
if Filtered = true then |
|
| 114 |
begin |
begin |
| 115 |
|
s := FieldByName('CATEGORY').AsString; |
| 116 |
|
if s = '' then |
| 117 |
|
begin |
| 118 |
|
FindNext; |
| 119 |
|
continue; |
| 120 |
|
end; |
| 121 |
i := IWList1.Items.IndexOfName(s); |
i := IWList1.Items.IndexOfName(s); |
| 122 |
if i = -1 then |
if i = -1 then |
| 123 |
IWList1.Items.Add(s + '=1') |
IWList1.Items.Add(s + '=1') |
| 126 |
j := IWList1.Items.ValueFromIndex[i].ToInteger + 1; |
j := IWList1.Items.ValueFromIndex[i].ToInteger + 1; |
| 127 |
IWList1.Items[i] := s + '=' + j.ToString; |
IWList1.Items[i] := s + '=' + j.ToString; |
| 128 |
end; |
end; |
| 129 |
end |
FindNext; |
| 130 |
else |
end; |
| 131 |
|
end |
| 132 |
|
else |
| 133 |
|
begin |
| 134 |
|
First; |
| 135 |
|
while Eof = false do |
| 136 |
begin |
begin |
| 137 |
|
s := FieldByName('CATEGORY').AsString; |
| 138 |
|
if s = '' then |
| 139 |
|
begin |
| 140 |
|
Next; |
| 141 |
|
continue; |
| 142 |
|
end; |
| 143 |
i := IWList1.Items.IndexOf(s); |
i := IWList1.Items.IndexOf(s); |
| 144 |
if i = -1 then |
if i = -1 then |
| 145 |
IWList1.Items.Add(s); |
IWList1.Items.Add(s); |
| 146 |
|
Next; |
| 147 |
end; |
end; |
|
Next; |
|
| 148 |
end; |
end; |
| 149 |
end; |
end; |
| 150 |
if DM.FDTable2.Filtered = true then |
if DM.FDTable2.Filtered = true then |
| 198 |
end; |
end; |
| 199 |
|
|
| 200 |
procedure TIWForm1.IWButton1Click(Sender: TObject); |
procedure TIWForm1.IWButton1Click(Sender: TObject); |
|
const |
|
|
Filter = 'NAME like ''%s'''; |
|
| 201 |
begin |
begin |
| 202 |
if IWEdit1.Text = '' then |
DM.FDTable2.Filtered := false; |
| 203 |
DM.FDTable2.Filtered := false |
if IWEdit1.Text <> '' then |
|
else |
|
| 204 |
begin |
begin |
| 205 |
DM.FDTable2.Filter.Format(Filter, ['%' + IWEdit1.Text + '%']); |
DM.FDTable2.Filter := 'NAME like ' + QuotedStr('%'+IWEdit1.Text+'%'); |
| 206 |
DM.FDTable2.Filtered := true; |
DM.FDTable2.Filtered := true; |
| 207 |
IWLabel6.Caption := IWEdit1.Text + 'を検索しています'; |
IWLabel6.Caption := IWEdit1.Text + 'を検索しています'; |
| 208 |
end; |
end; |
| 212 |
procedure TIWForm1.IWLink1Click(Sender: TObject); |
procedure TIWForm1.IWLink1Click(Sender: TObject); |
| 213 |
begin |
begin |
| 214 |
TUserForm.Create(WebApplication).Show; |
TUserForm.Create(WebApplication).Show; |
|
Release; |
|
| 215 |
end; |
end; |
| 216 |
|
|
| 217 |
procedure TIWForm1.IWLink2Click(Sender: TObject); |
procedure TIWForm1.IWLink2Click(Sender: TObject); |
|
const |
|
|
Filter = 'EMAIL = ''%s'' and PASSWORD = ''%s'''; |
|
| 218 |
begin |
begin |
| 219 |
case Page of |
case Page of |
| 220 |
Main: |
Main: |
| 221 |
begin |
begin |
| 222 |
DM.FDTable1.Filter.Format(Filter, [IWEdit2.Text, IWEdit3.Text]); |
if DM.FDTable1.Locate('EMAIL;PASSWORD', |
| 223 |
DM.FDTable1.Filtered := true; |
VarArrayOf([IWEdit2.Text, IWEdit3.Text]), [loCaseInsensitive]) = true |
| 224 |
if DM.FDTable1.RecordCount = 1 then |
then |
| 225 |
begin |
begin |
| 226 |
Page := Info; |
Page := Info; |
| 227 |
UserSession.user_number := DM.FDTable1.FieldByName('NUMBER') |
UserSession.user_number := DM.FDTable1.FieldByName('NUMBER') |
| 236 |
Page := Main; |
Page := Main; |
| 237 |
end; |
end; |
| 238 |
end; |
end; |
|
IWLink1.Visible := UserSession.user_number = 0; |
|
| 239 |
end; |
end; |
| 240 |
|
|
| 241 |
procedure TIWForm1.LoadImage; |
procedure TIWForm1.LoadImage; |
| 246 |
i: Integer; |
i: Integer; |
| 247 |
j: Integer; |
j: Integer; |
| 248 |
k: Integer; |
k: Integer; |
| 249 |
|
label label1; |
| 250 |
begin |
begin |
| 251 |
ClearImage; |
ClearImage; |
| 252 |
png := TPngImage.Create; |
exit; |
| 253 |
|
png:=TPngImage.Create; |
| 254 |
try |
try |
| 255 |
IWGrid1.RowCount := DM.FDTable2.RecordCount div IWGrid1.ColumnCount; |
IWGrid1.RowCount := DM.FDTable2.RecordCount div IWGrid1.ColumnCount; |
| 256 |
k := 1; |
k := 1; |
| 269 |
finally |
finally |
| 270 |
s.Free; |
s.Free; |
| 271 |
end; |
end; |
| 272 |
|
if DM.FDTable2.Bof = true then |
| 273 |
|
goto label1; |
| 274 |
end; |
end; |
| 275 |
|
label1: |
| 276 |
|
finally |
| 277 |
|
png.Free; |
| 278 |
|
end; |
| 279 |
|
png := nil; |
| 280 |
|
s := nil; |
| 281 |
|
Randomize; |
| 282 |
|
DM.FDTable2.Last; |
| 283 |
|
DM.FDTable2.MoveBy(-Random(DM.FDTable2.RecordCount div 5)); |
| 284 |
|
s := DM.FDTable2.CreateBlobStream |
| 285 |
|
(DM.FDTable2.FieldByName('THUMBNAIL'), bmRead); |
| 286 |
|
png := TPngImage.Create; |
| 287 |
|
try |
| 288 |
|
png.LoadFromStream(s); |
| 289 |
|
IWImageFile1.Picture.Assign(png); |
| 290 |
finally |
finally |
| 291 |
png.Free; |
png.Free; |
| 292 |
|
s.Free; |
| 293 |
end; |
end; |
| 294 |
|
IWLabel4.Caption := DM.FDTable2.FieldByName('NAME').AsString; |
| 295 |
end; |
end; |
| 296 |
|
|
| 297 |
procedure TIWForm1.SetPage(const Value: TPage); |
procedure TIWForm1.SetPage(const Value: TPage); |