📄 jgyhsearch.pas
字号:
{-----------------------------------------------------------------------------
文件: JGYhSearch
功能:
接口: uDMFunc,uConstUtils,uVarUtils
关联:
备注:
编码: 乔永齐
日期: 2003.07.21
-----------------------------------------------------------------------------}
unit JGYhSearch;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls, ImgList, ToolWin, CheckLst,DateUtils,
Types;
type
TJGYhSearchGL = class(TForm)
CoolBar1: TCoolBar;
ToolBar1: TToolBar;
ImageList1: TImageList;
ImageList2: TImageList;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
StatusBar1: TStatusBar;
Panel1: TPanel;
Dt1: TDateTimePicker;
Label1: TLabel;
LblYf: TLabel;
Dt2: TDateTimePicker;
Label3: TLabel;
CboFs: TComboBox;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
PanelCbwd: TPanel;
Label2: TLabel;
ClbCbwd: TCheckListBox;
PanelYhZh: TPanel;
Label4: TLabel;
ClbYhZh: TCheckListBox;
PanelGjd: TPanel;
Label5: TLabel;
ClbGjd: TCheckListBox;
PanelZh: TPanel;
Label6: TLabel;
ClbZh: TCheckListBox;
PanelYh: TPanel;
Label7: TLabel;
ClbYh: TCheckListBox;
PanelDs: TPanel;
Label8: TLabel;
ClbDs: TCheckListBox;
procedure CboFsChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure ClbDsClickCheck(Sender: TObject);
procedure ClbYhClickCheck(Sender: TObject);
procedure ClbZhClickCheck(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
JGYhSearchGL: TJGYhSearchGL;
implementation
{$R *.dfm}
//uses DataModule, JGYhSearchYe;
uses uDMFunc, uVarUtils, uConstUtils, JGYhSearchYe, uUserFunc, uSystemIni;
procedure TJGYhSearchGL.CboFsChange(Sender: TObject);
var
i: smallint;
begin
LblYf.Visible := true;
Dt2.Visible := true;
ToolButton1.Enabled := True;
PanelDs.Visible := True;
PanelGjd.Visible := False;
PanelZh.Visible := False;
PanelYh.Visible := False;
PanelYhZh.Visible := False;
PanelCbwd.Visible := False;
case CboFs.ItemIndex of
0: begin
;
end;
1: begin
PanelYh.Visible := True;
end;
2: begin
LblYf.Visible := false;
Dt2.Visible := false;
PanelYh.Visible := True;
end;
3: begin
LblYf.Visible := false;
Dt2.Visible := false;
PanelZh.Visible := True;
end;
4,7: begin
PanelZh.Visible := True;
end;
5: begin
PanelGjd.Visible := True;
end;
6: begin
PanelYh.Visible := True;
end;
8: begin
PanelYh.Visible := True;
PanelYhZh.Visible := True;
end;
9: begin
PanelYh.Visible := True;
PanelCbwd.Visible := True;
end;
10:begin
PanelDs.Visible := False;
PanelYh.Visible := True;
end;
else
ToolButton1.Enabled := False;
end;
case CboFs.ItemIndex of
5..10:
begin
for i:=0 to ClbDs.Count-1 do
ClbDs.Checked[i] := False;
end;
end;
case CboFs.ItemIndex of
1,8,9:
begin
for i:=0 to ClbYh.Count-1 do
ClbYh.Checked[i] := False;
end;
end;
case CboFs.ItemIndex of
4:
begin
for i:=0 to ClbZh.Count-1 do
ClbZh.Checked[i] := False;
end;
end;
end;
procedure TJGYhSearchGL.FormCreate(Sender: TObject);
var
i,j:smallint;
aCity: TString2Array;
aKhyh: TKhyhDynArray;
aAccount: TBankAccountDynArray;
begin
Dt1.Date := StartOfTheMonth(Date());
Dt2.Date := EndOfTheMonth(date());
DsInfo(aCity);
i:=0;
for i := 0 to High(aCity) do
begin
ClbDs.Items.Add(aCity[i,0]+' .. '+aCity[i,1]);
if copy(pubLoginSsds,i,1)='0' then
CLBDS.ItemEnabled[i]:= false;
end;
KhyhInfo(aKhyh);
for i := 0 to High(aKhyh) do
ClbYh.Items.Add(aKhyh[i].bh +' .. '+ aKhyh[i].mc);
BankAccountInfo(aAccount);
for i := 0 to High(aAccount) do
ClbZh.Items.Add(aAccount[i].bh +' .. '+aAccount[i].mc );
{ Dm.P_GjdInfo;
Dm.P_YhInfo;
Dm.P_FlInfo;
}
end;
procedure TJGYhSearchGL.ToolButton3Click(Sender: TObject);
begin
Close;
end;
procedure TJGYhSearchGL.ClbDsClickCheck(Sender: TObject);
var
i,nPos: smallint;
sDs,sYh:string;
aSumUp: TSumUpDynArray;
aSubBank: TSubBankDynArray;
aBankOffice: TBankOfficeDynArray;
begin
if CboFs.ItemIndex >4 then
begin
for i:=0 to ClbDs.Count-1 do
begin
ClbDs.Checked[i] := False;
end;
ClbDs.Checked[ClbDs.ItemIndex]:=True;
end;
if CboFs.ItemIndex = 5 then
begin
sDs := '';
for i:=0 to ClbDs.Count -1 do
begin
if ClbDs.Checked[i] then
begin
nPos := pos('..',ClbDs.Items.Strings[i])-1;
sDs := trim(copy(ClbDs.Items.Strings[i],1,nPos));
break;
end;
end;
SumUpInfo(sDs,aSumUp);
ClbGjd.Items.Clear;
for i := 0 to high(aSumUp) do
ClbGjd.Items.Add(aSumUp[i].bh +' .. '+ aSumUp[i].mc);
if ClbGjd.Count >1 then
begin
for i:=0 to ClbGjd.Count -1 do
if copy(ClbGjd.Items.Strings[i],1,2)='00' then
begin
ClbGjd.Items.Delete(i);
break;
end;
end;
end;
if CboFs.ItemIndex = 8 then
begin
for i:=0 to ClbDs.Count -1 do
begin
if ClbDs.Checked[i] then
begin
nPos := pos('..',ClbDs.Items.Strings[i])-1;
sDs := trim(copy(ClbDs.Items.Strings[i],1,nPos));
break;
end;
end;
for i:=0 to ClbYh.Count -1 do
begin
if ClbYh.Checked[i] then
begin
nPos := pos('..',ClbYh.Items.Strings[i])-1;
sYh := trim(copy(ClbYh.Items.Strings[i],1,nPos));
break;
end;
end;
if (sDs<>'') and (sYh<>'') then
begin
SubBankInfo(sDs,sYh,aSubBank);
ClbYhZh.Items.Clear;
for i:=0 to high(aSubBank) do
ClbYhZh.Items.Add(aSubBank[i].bh +' .. '+aSubBank[i].mc );
end
else
ClbYhZh.Items.Clear;
end;
if CboFs.ItemIndex = 9 then
begin
for i:=0 to ClbDs.Count -1 do
begin
if ClbDs.Checked[i] then
begin
nPos := pos('..',ClbDs.Items.Strings[i])-1;
sDs := trim(copy(ClbDs.Items.Strings[i],1,nPos));
break;
end;
end;
for i:=0 to ClbYh.Count -1 do
begin
if ClbYh.Checked[i] then
begin
nPos := pos('..',ClbYh.Items.Strings[i])-1;
sYh := trim(copy(ClbYh.Items.Strings[i],1,nPos));
break;
end;
end;
if (sDs<>'') and (sYh<>'') then
begin
BankOfficeInfo(sDs,sYh,'',aBankOffice);
ClbCbwd.Items.Clear;
for i:=0 to high(aBankOffice) do
ClbCbwd.Items.Add(aBankOffice[i].bh +' .. '+aBankOffice[i].mc);
end
else
ClbCbwd.Items.Clear;
end;
end;
procedure TJGYhSearchGL.ClbYhClickCheck(Sender: TObject);
var
i, nPos: smallint;
sDs,sYh:string;
aSumUp: TSumUpDynArray;
aSubBank: TSubBankDynArray;
aBankOffice: TBankOfficeDynArray;
begin
case CboFs.ItemIndex of
1,8,9:
begin
for i:=0 to ClbYh.Count-1 do
ClbYh.Checked[i] := False;
ClbYh.Checked[ClbYh.ItemIndex]:=True;
end;
end;
if CboFs.ItemIndex = 8 then
begin
for i:=0 to ClbDs.Count -1 do
begin
if ClbDs.Checked[i] then
begin
nPos := pos('..',ClbDs.Items.Strings[i])-1;
sDs := trim(copy(ClbDs.Items.Strings[i],1,nPos));
break;
end;
end;
for i:=0 to ClbYh.Count -1 do
begin
if ClbYh.Checked[i] then
begin
nPos := pos('..',ClbYh.Items.Strings[i])-1;
sYh := trim(copy(ClbYh.Items.Strings[i],1,nPos));
break;
end;
end;
if (sDs<>'') and (sYh<>'') then
begin
SubBankInfo(sDs,sYh,aSubBank);
ClbYhZh.Items.Clear;
for i:=0 to high(aSubBank) do
ClbYhZh.Items.Add(aSubBank[i].bh +' .. '+aSubBank[i].mc );
end
else
ClbYhZh.Items.Clear;
end;
if CboFs.ItemIndex = 9 then
begin
for i:=0 to ClbDs.Count -1 do
begin
if ClbDs.Checked[i] then
begin
nPos := pos('..',ClbDs.Items.Strings[i])-1;
sDs := trim(copy(ClbDs.Items.Strings[i],1,nPos));
break;
end;
end;
for i:=0 to ClbYh.Count -1 do
begin
if ClbYh.Checked[i] then
begin
nPos := pos('..',ClbYh.Items.Strings[i])-1;
sYh := trim(copy(ClbYh.Items.Strings[i],1,nPos));
break;
end;
end;
if (sDs<>'') and (sYh<>'') then
begin
BankOfficeInfo(sDs,sYh,'',aBankOffice);
ClbCbwd.Items.Clear;
for i:=0 to high(aBankOffice) do
ClbCbwd.Items.Add(aBankOffice[i].bh +' .. '+aBankOffice[i].mc);
end
else
ClbCbwd.Items.Clear;
end;
end;
procedure TJGYhSearchGL.ClbZhClickCheck(Sender: TObject);
var
i: smallint;
begin
case CboFs.ItemIndex of
4:
begin
for i:=0 to ClbZh.Count-1 do
begin
ClbZh.Checked[i] := False;
end;
ClbZh.Checked[ClbZh.ItemIndex]:=True;
end;
end;
end;
procedure TJGYhSearchGL.ToolButton1Click(Sender: TObject);
var
JGYhYe: TJGYhSearchYeGL;
i,j,l,npos: smallint;
dD1,dD2:TDate;
sTxSrv, sTxDB: String;
nTxType: smallint;
begin
ReadDBMSInfo(pCommunicationSystem,sTxSrv,sTxDB,nTxType);
JGYhYe := TJGYhSearchYeGL.Create(application);
JGYhYe.iItem := CboFs.ItemIndex ;
JGYhYe.sComDataBase := sTxDB;
j:=0;
for i:=0 to ClbDs.Count-1 do
begin
if ClbDs.Checked[i] then
begin
inc(j);
setlength(JGYhYe.aDs,j);
setlength(JGyhYe.aCity,j);
npos := pos('..',ClbDs.Items.Strings[i])-1;
JGYhYe.aDs[j-1]:= trim(copy(ClbDs.Items.Strings[i],npos+3,60));
JGYhYe.aCity[j-1] := trim(copy(ClbDs.Items.Strings[i],1,npos));
end;
end;
dD1 := Dt1.Date;
dD2 := Dt2.Date;
case CboFs.ItemIndex of
2,3: dD2 := dD1;
end;
if dD1>dD2 then
begin
dD1 := Dt2.Date;
dD2 := Dt1.Date;
end;
j := 0;
repeat
inc(j);
SetLength(JGYhYe.aYd,j);
JGYhYe.aYd[j-1] := DToS(dD1,6);
dD1:=incMonth(dD1,1);
until dD1>dD2;
j:=0;
for i:=0 to ClbYh.Count-1 do
begin
if ClbYh.Checked[i] then
begin
inc(j);
setlength(JGYhYe.aYh,j);
setlength(JGYhYe.aBank,j);
npos := pos('..',ClbYh.Items.Strings[i])-1;
JGYhYe.aYh[j-1]:= trim(copy(ClbYh.Items.Strings[i],npos+3,60));
JGYhYe.aBank[j-1] := trim(copy(ClbYh.Items.Strings[i],1,npos));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -