📄 jgyhzjlxfx.pas
字号:
unit JGYhZjLxFx;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, ComCtrls, ImgList, ToolWin, Types, uConstUtils,DateUtils;
type
TFormJGYhZjLxFx = class(TForm)
CoolBar1: TCoolBar;
ToolBar1: TToolBar;
ImageList1: TImageList;
ImageList2: TImageList;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
ToolButton6: TToolButton;
SgYe: TStringGrid;
ToolButton7: TToolButton;
ToolButton8: TToolButton;
StatusBar1: TStatusBar;
procedure ToolButton6Click(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton7Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
aDs, aMc, aYd, aDw: TStringDynArray;
aData: TArray2D;
iItem: smallint;
sCommDB: String;
end;
var
FormJGYhZjLxFx: TFormJGYhZjLxFx;
implementation
{$R *.dfm}
//uses UserFace,DataModule,JGYhZjLxFxTx,JGYhZjLxFxMx,JGYhSjCx1;
uses JGYHZjLxFxTx, JGYhZjLxFxMx;
procedure TFormJGYhZjLxFx.ToolButton6Click(Sender: TObject);
begin
close;
end;
procedure TFormJGYhZjLxFx.ToolButton1Click(Sender: TObject);
var
CwFx : TFormJGYhZjLxFxTx;
// i:smallint;
begin
CwFx:=TFormJGYhZjLxFxTx.Create(application);
case iItem of
0:begin
{ SetLength(CwFx.aCol,high(aDw)+1);
for i:=0 to high(CwFx.aCol) do
CwFx.aCol[i]:= aDw[i];
SetLength(CwFx.aRow,high(aYd)+1);
for i:=0 to high(CwFx.aRow) do
CwFx.aRow[i]:= aYd[i];
}
CwFx.SetGraph1(aDw,aYd,aData);
end;
1:begin
{ SetLength(CwFx.aCol,high(aMc)+1);
for i:=0 to high(CwFx.aCol) do
CwFx.aCol[i]:= aMc[i];
SetLength(CwFx.aRow,high(aYd)+1);
for i:=0 to high(CwFx.aRow) do
CwFx.aRow[i]:= aYd[i];
}
CwFx.SetGraph1(aMc,aYd,aData);
end;
2:begin
{ SetLength(CwFx.aCol,high(aDw)+1);
for i:=0 to high(CwFx.aCol) do
CwFx.aCol[i]:= aDw[i];
SetLength(CwFx.aRow,high(aMc)+1);
for i:=0 to high(CwFx.aRow) do
CwFx.aRow[i]:= aMc[i];
}
CwFx.SetGraph1(aDw,aMc,aData);
end;
3:begin
{ SetLength(CwFx.aCol,high(aDw)+1);
for i:=0 to high(CwFx.aCol) do
CwFx.aCol[i]:= aDw[i];
SetLength(CwFx.aRow,high(aMc)+1);
for i:=0 to high(CwFx.aRow) do
CwFx.aRow[i]:= aMc[i];
}
CwFx.SetGraph1(aDw,aMc,aData);
end;
end;
{ SetLength(Cwfx.aData,high(aData)+1);
for i:=0 to high(aData) do
begin
CwFx.aData[i]:= aData[i];
end;
}
CwFx.ShowModal;
CwFx.Free;
end;
procedure TFormJGYhZjLxFx.ToolButton7Click(Sender: TObject);
var
sCity,sDpt:string;
JGMx: TFormJGYhZjLxFxMx;
dtBDate,dtEDate:Tdate;
begin
case iItem of
0:begin
dtBDate:= strtodate(copy(trim(SgYe.Cells[2,SgYe.Row]),1,4)+'-'+
inttostr(strtoint(copy(trim(SgYe.Cells[2,SgYe.Row]),5,2)))+'-1');
dtEDate := EndofTheMonth(dtBDate);
sCity:= trim(SgYe.Cells[0,SgYe.Row]);
sDpt:= trim(SgYe.Cells[3,SgYe.Row]);
end;
1:begin
dtBDate:= strtodate(copy(trim(SgYe.Cells[1,SgYe.Row]),1,4)+'-'+
inttostr(strtoint(copy(trim(SgYe.Cells[1,SgYe.Row]),5,2)))+'-1');
dtEDate := EndofTheMonth(dtBDate);
sCity:= trim(SgYe.Cells[3,SgYe.Row]);
sDpt:= trim(SgYe.Cells[0,SgYe.Row]);
end;
2,3:begin
dtBDate:=strtodate(copy(trim(SgYe.Cells[0,SgYe.Row]),1,4)+'-'+
inttostr(strtoint(copy(trim(SgYe.Cells[0,SgYe.Row]),5,2)))+'-1');
dtEDate:= EndOfTheMonth(strtodate(copy(trim(SgYe.Cells[0,SgYe.Row]),10,4)+'-'+
inttostr(strtoint(copy(trim(SgYe.Cells[0,SgYe.Row]),14,2)))+'-1'));
sCity:=trim(copy(SgYe.Cells[1,SgYe.Row],1,4));
sDpt:=trim(SgYe.Cells[3,SgYe.Row]);
end;
end;
if trim(sCity)<>'' then
begin
JGMx:= TFormJGYhZjLxFxMx.Create(application);
JGMx.LoadInfo(sCommDB,sCity,sDpt,dtBDate,dtEDate);
JGMx.ShowModal;
JGMx.Free;
end
else
application.MessageBox('请选择具体内容后再查询明细情况',PMsgCaption,64);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -