243 lines
5.6 KiB
ObjectPascal
243 lines
5.6 KiB
ObjectPascal
|
|
unit U_SCPersonColor2;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, Buttons, DB, ADODB, StdCtrls;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmSCPersonColor2 = class(TForm)
|
|||
|
|
ScrollBox1: TScrollBox;
|
|||
|
|
btn58: TSpeedButton;
|
|||
|
|
btn9: TSpeedButton;
|
|||
|
|
btn10: TSpeedButton;
|
|||
|
|
btn11: TSpeedButton;
|
|||
|
|
btn12: TSpeedButton;
|
|||
|
|
btn59: TSpeedButton;
|
|||
|
|
btn16: TSpeedButton;
|
|||
|
|
btn17: TSpeedButton;
|
|||
|
|
btn18: TSpeedButton;
|
|||
|
|
btn19: TSpeedButton;
|
|||
|
|
btn60: TSpeedButton;
|
|||
|
|
btn23: TSpeedButton;
|
|||
|
|
btn24: TSpeedButton;
|
|||
|
|
btn25: TSpeedButton;
|
|||
|
|
btn26: TSpeedButton;
|
|||
|
|
btn61: TSpeedButton;
|
|||
|
|
btn31: TSpeedButton;
|
|||
|
|
btn32: TSpeedButton;
|
|||
|
|
btn33: TSpeedButton;
|
|||
|
|
ADOTmp: TADOQuery;
|
|||
|
|
Label27: TLabel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Button3: TButton;
|
|||
|
|
Button1: TButton;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure btn1Click(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure Button3Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
CPage: Integer;
|
|||
|
|
procedure InitPerson(page: Integer);
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
FlagStr: string;
|
|||
|
|
FName, FSJZL, FType, FBCIOID, FHINT: string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmSCPersonColor2: TfrmSCPersonColor2;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmSCPersonColor2.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmSCPersonColor2 := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmSCPersonColor2.InitPerson(page: Integer);
|
|||
|
|
type
|
|||
|
|
FdDy = record
|
|||
|
|
inc: integer;
|
|||
|
|
FDdys: string[32];
|
|||
|
|
FdDysName: string[32];
|
|||
|
|
end;
|
|||
|
|
var
|
|||
|
|
BB: array[0..500] of FdDy;
|
|||
|
|
i, j: Integer;
|
|||
|
|
begin
|
|||
|
|
if ftype = '<27><>̨<EFBFBD><CCA8>' then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
if ftype = 'Ա<><D4B1>' then
|
|||
|
|
begin
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT eename as name from SY_Employee ');
|
|||
|
|
|
|||
|
|
SQL.Add(')AA');
|
|||
|
|
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if ftype = '<27><><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT ZDYNAME as name from KH_ZDY A WHERE TYPE=''seal'' ');
|
|||
|
|
SQL.Add(')AA');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if ftype = '<27><>װ<EFBFBD><D7B0>' then
|
|||
|
|
begin
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT ZDYNAME as name from KH_ZDY A WHERE TYPE=''Packaging'' ');
|
|||
|
|
SQL.Add(')AA');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if ftype = 'ֽ<><D6BD>' then
|
|||
|
|
begin
|
|||
|
|
with ADOTmp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select AA.*,row_number () over (order by name) as keyNo from(select DISTINCT ZDYNAME as name from KH_ZDY A WHERE TYPE=''tube'' ');
|
|||
|
|
SQL.Add(')AA');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if ADOTmp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
j := (StrToInt(Label1.Caption) - 1) * 20 + 1;
|
|||
|
|
for i := 0 to 19 do
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
with ScrollBox1 do
|
|||
|
|
begin
|
|||
|
|
if ADOTmp.locate('keyNo', j + i, []) then
|
|||
|
|
begin
|
|||
|
|
// application.MessageBox(pchar(CDS_Kuang.FieldByName('ZDYName').AsString), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
TSpeedButton(Controls[i]).Visible := True;
|
|||
|
|
TSpeedButton(Controls[i]).Caption := Trim(ADOTmp.FieldByName('name').AsString);
|
|||
|
|
// TSpeedButton(Controls[i]).Caption := TSpeedButton(Controls[i]).Caption + #13 + 'ֽ<>ܣ<EFBFBD>' + Trim(ADOTmp.FieldByName('tube').AsString);
|
|||
|
|
// TSpeedButton(Controls[i]).Caption := TSpeedButton(Controls[i]).Caption + #13 + '<27><>װ<EFBFBD><D7B0><EFBFBD><EFBFBD>' + Trim(ADOTmp.FieldByName('Packaging').AsString);
|
|||
|
|
// TSpeedButton(Controls[i]).Caption := TSpeedButton(Controls[i]).Caption + #13 + '<27><><EFBFBD>⣺' + Trim(ADOTmp.FieldByName('Seal').AsString);
|
|||
|
|
|
|||
|
|
// TSpeedButton(Controls[i]).HINT := Trim(ADOTmp.FieldByName('MXID').AsString);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
TSpeedButton(Controls[i]).Visible := False;
|
|||
|
|
|
|||
|
|
// application.MessageBox(pchar('û<>ҵ<EFBFBD>' + inttostr(i)), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
// with ADOTmp do
|
|||
|
|
// begin
|
|||
|
|
// First;
|
|||
|
|
// i := 0;
|
|||
|
|
// while not Eof do
|
|||
|
|
// begin
|
|||
|
|
// BB[i].inc := i;
|
|||
|
|
// BB[i].FdDysName := Trim(fieldbyname('name').AsString);
|
|||
|
|
// i := i + 1;
|
|||
|
|
// Next;
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
// i := i - 1;
|
|||
|
|
// if i > 19 then
|
|||
|
|
// begin
|
|||
|
|
// i := 19;
|
|||
|
|
// end;
|
|||
|
|
// for j := 0 to 19 do
|
|||
|
|
// begin
|
|||
|
|
// with ScrollBox1 do
|
|||
|
|
// begin
|
|||
|
|
// TSpeedButton(Controls[j]).Visible := false;
|
|||
|
|
// TSpeedButton(Controls[j]).Caption := '';
|
|||
|
|
// TSpeedButton(Controls[j]).Hint := '';
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
// for j := 0 to i do
|
|||
|
|
// begin
|
|||
|
|
// with ScrollBox1 do
|
|||
|
|
// begin
|
|||
|
|
// TSpeedButton(Controls[j]).Visible := True;
|
|||
|
|
// TSpeedButton(Controls[j]).Caption := BB[j].FdDysName;
|
|||
|
|
// end;
|
|||
|
|
// end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmSCPersonColor2.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitPerson(1);
|
|||
|
|
CPage := 1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmSCPersonColor2.btn1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
FName := Trim(TSpeedButton(Sender).Caption);
|
|||
|
|
FHINT := Trim(TSpeedButton(Sender).HINT);
|
|||
|
|
ModalResult := 1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmSCPersonColor2.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action := caHide;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmSCPersonColor2.Button1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CPage <= 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
Label1.Caption := '1';
|
|||
|
|
InitPerson(1);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
CPage := CPage - 1;
|
|||
|
|
|
|||
|
|
Label1.Caption := IntToStr(CPage);
|
|||
|
|
InitPerson(CPage);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmSCPersonColor2.Button3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
CPage := CPage + 1;
|
|||
|
|
Label1.Caption := IntToStr(CPage);
|
|||
|
|
InitPerson(CPage);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|