?? sz_ndfpjh.pas
字號:
{*******************************************************}
{ }
{ 郵票分配計劃查詢統計 }
{ }
{ 中軟金馬公司版權所有。2002.12前 }
{ }
{ 編制:中軟金馬郵資票品項目開發組 }
{ }
{ }
{*******************************************************}
(*
省級綜合查詢
*)
unit sz_NDFPJH;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBTables, ComCtrls, StdCtrls, Buttons, ExtCtrls, Grids, DBGrids, Spin,
Mask, ToolEdit, CurrEdit, ActnList, DBCtrls, RXCtrls, ComboBoxDB;
type
TFrmz_ndfpjh = class(TForm)
Panel1: TPanel;
Panel3: TPanel;
BBt_Quit: TBitBtn;
Label3: TLabel;
BBt_Find: TBitBtn;
BBt_Print: TBitBtn;
ND: TSpinEdit;
BBt_Send: TBitBtn;
Qry_JJNFPJHTJ: TQuery;
DS_JJNFPJHTJ: TDataSource;
Qry_JJNFPJH: TQuery;
DS_JJNFPJH: TDataSource;
StatusBar1: TStatusBar;
Panel2: TPanel;
Panel5: TPanel;
Panel7: TPanel;
Label4: TLabel;
Label1: TLabel;
Frmz_ndfpjh: TDBGrid;
DBGrid1: TDBGrid;
CB_DW: TComboBoxDB;
CB_Ppmc: TComboBoxDB;
RxLabel_Title: TRxLabel;
procedure BBt_SendClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure BBt_FindClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frmz_ndfpjh: TFrmz_ndfpjh;
implementation
uses
pub,sz_NDFPJHTJFX;
{$R *.DFM}
procedure TFrmz_ndfpjh.BBt_SendClick(Sender: TObject);
begin
with TFrmz_ndfpjhtjfx.Create(application) do
try
ShowModal;
finally
Release;
end;
end;
procedure TFrmz_ndfpjh.FormCreate(Sender: TObject);
begin
GetAllColWidth(Self);
ND.Value := VG_Year;
if CB_DW.Open and ( CB_DW.Items.Count > 0 ) then
begin
CB_DW.Items.Insert(0, '全部');
CB_DW.ItemIndex := 0;
end;
CB_Ppmc.Open;
if CB_Ppmc.Open and ( CB_Ppmc.Items.Count > 0 ) then
CB_Ppmc.ItemIndex := 0;
end;
procedure TFrmz_ndfpjh.BBt_FindClick(Sender: TObject);
const
QuerySQL = 'select B.DWMC,A.JHFPZTS,A.YDTS,A.LSTS,A.NCTS,A.YPTS from TY_JJNFPJH A, TGS_GXDWSJB B'#13#10 +
'where B.DWDM(+)=A.DWDM and A.ND=''%d''';
TotalSQL = 'select ''合計'' HJ,sum(JHFPZTS) JHFPZTS,sum(YDTS) YDTS,sum(LSTS) LSTS,sum(NCTS) NCTS,sum(YPTS) YPTS from TY_JJNFPJH'#13#10 +
'where ND=''%d''';
begin
with Qry_JJNFPJH do
begin
Close;
SQL.Clear;
SQL.Add(Format(QuerySQL, [ND.Value]));
{ if CB_Ppmc.ItemIndex > 0 then}
SQL.Add(Format('and A.JHH=''%s''', [CB_Ppmc.Values[CB_Ppmc.ItemIndex]]));
if CB_DW.ItemIndex > 0 then
SQL.Add(Format('and A.DWDM=''%s''', [CB_DW.Values[CB_DW.ItemIndex]]));
Open;
end;
with Qry_JJNFPJHTJ do
begin
Close;
SQL.Clear;
SQL.Add(Format(TotalSQL, [ND.Value]));
SQL.Add(Format('and JHH=''%s''', [CB_Ppmc.Values[CB_Ppmc.ItemIndex]]));
if CB_DW.ItemIndex > 0 then
SQL.Add(Format('and DWDM=''%s''', [CB_DW.Values[CB_DW.ItemIndex]]));
Open;
end;
end;
procedure TFrmz_ndfpjh.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
SaveAllColWidth(Self);
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -