📄 gf_pfxjh.pas
字号:
{*******************************************************}
{ }
{ 邮票发行计划和发行量计划 }
{ }
{ 中软金马公司版权所有。2002.12前 }
{ }
{ 编制:中软金马项目开发组 }
{ }
{ }
{*******************************************************}
(*
本模块在省级系统管理、省级综合查询两个模块调用
*)
unit GF_pfxjh;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBTables, ComCtrls, Menus, ActnList, ImgList, ToolWin, StdCtrls,
DBCtrls, Mask, DBCGrids, ExtCtrls, Buttons, Grids, DBGrids, ToolEdit,
RXDBCtrl, Spin, RXCtrls, FieldComboBox, DBGridExport;
type
old_tu = record
old_tu_jhh: string;
old_tu_tx: string;
end;
type
curr_con = record
taoname: string;
taolsname: string;
taocaconame: string;
tuname: string;
tulsname: string;
tucaconame: string;
titlestr: string;
end;
TFrmf_pfxjh = class(TForm)
ActionList1: TActionList;
Act_add: TAction;
Act_delete: TAction;
Act_modify: TAction;
Act_save: TAction;
Act_cancel: TAction;
Act_exit: TAction;
Act_print: TAction;
ImageList1: TImageList;
Panel1: TPanel;
BBt_add: TBitBtn;
BBt_dte: TBitBtn;
BBt_mfy: TBitBtn;
BBt_sve: TBitBtn;
BBt_cel: TBitBtn;
BBt_rrn: TBitBtn;
BBt_pnt: TBitBtn;
Act_select: TAction;
BitBtn2: TBitBtn;
Pel_dbgrid: TPanel;
DBGid_tu: TDBGrid;
Splitter1: TSplitter;
DBGid_tao: TDBGrid;
Act_send_fx: TAction;
Act_send_fxl: TAction;
DS_pfxjhtao: TDataSource;
Qry_pfxjhtao: TQuery;
Qry_pfxjhtaoJHH: TStringField;
Qry_pfxjhtaoBBH: TFloatField;
Qry_pfxjhtaoQXBZ: TStringField;
Qry_pfxjhtaoND: TStringField;
Qry_pfxjhtaoXH: TStringField;
Qry_pfxjhtaoPPLB: TStringField;
Qry_pfxjhtaoTZDM: TStringField;
Qry_pfxjhtaoTMC: TStringField;
Qry_pfxjhtaoQTMS: TFloatField;
Qry_pfxjhtaoQTMZ: TFloatField;
Qry_pfxjhtaoFXRQ: TDateTimeField;
Qry_pfxjhtaoPZR: TStringField;
Qry_pfxjhtaoZBR: TStringField;
Qry_pfxjhtaoZBRQ: TDateTimeField;
Qry_pfxjhtaoBZ: TStringField;
Qry_pfxjhtaoSDATEFX: TDateTimeField;
Qry_pfxjhtaoSDATEFXL: TDateTimeField;
Qry_pfxjhtaoPPLBMC: TStringField;
Qry_pfxjhtaoTZDMMC: TStringField;
Qry_pfxjhtaoXGZT: TStringField;
Qry_pfxjhtaoZT: TStringField;
Upd_pfxjhtao: TUpdateSQL;
Qry_tzdm: TQuery;
DS_tzdm: TDataSource;
DS_pplb: TDataSource;
Qry_pplb: TQuery;
Upd_pfxjhtu: TUpdateSQL;
DS_pfxjhtu: TDataSource;
Qry_pfxjhtu: TQuery;
Qry_pfxjhtuJHH: TStringField;
Qry_pfxjhtuBBH: TFloatField;
Qry_pfxjhtuTZDM: TStringField;
Qry_pfxjhtuTX: TFloatField;
Qry_pfxjhtuTBBH: TFloatField;
Qry_pfxjhtuQXBZ: TStringField;
Qry_pfxjhtuPPLB: TStringField;
Qry_pfxjhtuTUMC: TStringField;
Qry_pfxjhtuMZ: TFloatField;
Qry_pfxjhtuSJ: TFloatField;
Qry_pfxjhtuGG: TStringField;
Qry_pfxjhtuWXGG: TStringField;
Qry_pfxjhtuBZ: TStringField;
Qry_pfxjhtuXGZT: TStringField;
Qry_pfxjhtuFXL: TFloatField;
Qry_pfxjhtuZT: TStringField;
Qry_pfxjhtaoTPSJ: TFloatField;
Qry_pfxjhtaoFXL: TFloatField;
Qry_pfxjhtuFXRQ: TDateTimeField;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
PopupMenu1: TPopupMenu;
Act_fs_all: TAction;
Act_fs_any: TAction;
Act_fxl_all: TAction;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
Act_fxl_any: TAction;
N6: TMenuItem;
N7: TMenuItem;
Act_fx_all: TAction;
Act_fx_any: TAction;
Panel2: TPanel;
XttxTitle: TRxLabel;
Label11: TLabel;
SpinEdit1: TSpinEdit;
GBo_tao: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label13: TLabel;
Label28: TLabel;
Label29: TLabel;
DBEit_tao_nd: TDBEdit;
DBEit_tao_xh: TDBEdit;
DBEit_tao_mc: TDBEdit;
DBEit_tao_qtms: TDBEdit;
DBEit_tao_qtmz: TDBEdit;
DBLCB_tao_pplb: TDBLookupComboBox;
DBLCB_tao_tz: TDBLookupComboBox;
DBDEit_tao_fxrq: TDBDateEdit;
DBEit_tao_bz: TDBMemo;
DBEit_tao_tpsj: TDBEdit;
DBEit_tao_fxl: TDBEdit;
GBo_tu: TGroupBox;
Label26: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label25: TLabel;
Label15: TLabel;
Label3: TLabel;
DBEit_tu_bz: TDBMemo;
DBEit_tu_tumc: TDBEdit;
DBEit_tu_sj: TDBEdit;
DBEit_tu_mz: TDBEdit;
DBEit_tu_wxgg: TDBEdit;
DBEit_tu_tx: TDBEdit;
DBEit_tu_fxl: TDBEdit;
DBEit_tu_gg: TDBEdit;
DBDEit_tu_fxrq: TDBDateEdit;
Label12: TLabel;
CBo_mzdwtao: TComboBox;
Label14: TLabel;
CBo_mzdwtu: TComboBox;
Query1: TQuery;
Qry_pfxjhtaoZH: TStringField;
Qry_pfxjhtuZH: TStringField;
CBo_ta: TCheckBox;
DBEdit1: TDBEdit;
Label16: TLabel;
Qry_pfxjhtuYZBB: TStringField;
Qry_pfxjhtuTUDM: TStringField;
BitBtn1: TBitBtn;
DBLCBo_tao_pzr: TDBEdit;
DWMC: TLabel;
procedure Act_addExecute(Sender: TObject);
procedure Act_deleteExecute(Sender: TObject);
procedure Act_modifyExecute(Sender: TObject);
procedure Act_saveExecute(Sender: TObject);
procedure Act_cancelExecute(Sender: TObject);
procedure Act_exitExecute(Sender: TObject);
procedure Act_printExecute(Sender: TObject);
procedure Act_selectExecute(Sender: TObject);
procedure Act_fs_allExecute(Sender: TObject);
procedure Act_fs_anyExecute(Sender: TObject);
procedure Act_fxl_allExecute(Sender: TObject);
procedure Act_fxl_anyExecute(Sender: TObject);
procedure Act_fx_allExecute(Sender: TObject);
procedure Act_fx_anyExecute(Sender: TObject);
procedure DBGid_taoEnter(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure DBGid_taoMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure SpinEdit1Change(Sender: TObject);
procedure Qry_pfxjhtaoTPSJGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
procedure Qry_pfxjhtaoTPSJSetText(Sender: TField; const Text: String);
procedure Qry_pfxjhtaoQTMZGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
procedure Qry_pfxjhtaoQTMZSetText(Sender: TField; const Text: String);
procedure Qry_pfxjhtuFXLGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
procedure Qry_pfxjhtuFXLSetText(Sender: TField; const Text: String);
procedure Qry_pfxjhtuMZGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
procedure Qry_pfxjhtuMZSetText(Sender: TField; const Text: String);
procedure Qry_pfxjhtuSJGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
procedure Qry_pfxjhtuSJSetText(Sender: TField; const Text: String);
procedure Qry_pfxjhtaoAfterScroll(DataSet: TDataSet);
procedure Qry_pfxjhtuAfterScroll(DataSet: TDataSet);
procedure DBGid_taoTitleClick(Column: TColumn);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure CBo_taClick(Sender: TObject);
procedure DBEit_tu_txKeyPress(Sender: TObject; var Key: Char);
procedure DBEit_tao_xhKeyPress(Sender: TObject; var Key: Char);
procedure DBGid_tuTitleClick(Column: TColumn);
procedure CBo_mzdwtuChange(Sender: TObject);
procedure CBo_mzdwtaoChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
VLp_status: integer;
//0......初始状态(浏览)
//1......add编辑状态
//2......查询结果浏览状态
//3......edit编辑状态
VLp_FocusGrid: TDBGrid;
//.tag=0......套
//.tag=1......图
vlp_stao_jhh: String[10];
vlp_itu_tx: integer;
vlp_oldtuval: old_tu;
vlp_b_isfxl: boolean;///act_fx_all、act_fx_any——发送发行信息 or 发行量信息
procedure SetEditStatus(SubMod: integer; SelectedRowsCount: integer=1);
//0......初始状态(浏览)
//1......add编辑状态
//2......查询结果浏览状态
//3......edit编辑状态
//4......multiselected
function CheckChanged: boolean;
procedure SumTao(P_S_TX: string='');
function CheckTAOField(): boolean;
function CheckTUField() : boolean;
function SaveAftAddTao(): boolean;
function SaveAftAddTu(var pv_i_xgzt: integer): boolean;
procedure SaveAftModTao(var pv_i_xgzt: integer);
function CheckExistedTu(): boolean;
procedure AddTaoInTrans();
procedure AddTuInTrans(p_i_xgzt: integer);
procedure EditTuInTrans;
{ Private declarations }
public
{ Public declarations }
function pfxjhExec(DB: TDataBase): boolean;
end;
var
Frmf_pfxjh: TFrmf_pfxjh;
implementation
uses datas,pub, GF_select, GF_pub, GF_print, GF_img;
{$R *.DFM}
function TFrmf_pfxjh.CheckChanged: boolean;
begin
result := true;
if (VLp_status = 1) or (VLp_status = 3) then
case CHQMsgBox('数据已经发生改变,是否保存所做修改?', 3) of
IDYes:
begin
Act_saveExecute(nil);
if (VLp_status = 0) then
begin
Qry_pfxjhtao.Close;
Qry_pfxjhtu.Close;
Qry_pplb.Close;
Qry_tzdm.Close;
// Qry_pzr.Close;
data.Qry_send.Close;
data.Qry_super.Close;
data.Qry_sub.Close;
DS_pfxjhtao.DataSet := Qry_pfxjhtao;
DS_pfxjhtu.DataSet := Qry_pfxjhtu;
end else
result := false;
end;
IDNo:
begin
Act_cancelExecute(nil);
Qry_pfxjhtao.Close;
Qry_pfxjhtu.Close;
Qry_pplb.Close;
Qry_tzdm.Close;
// Qry_pzr.Close;
data.Qry_send.Close;
data.Qry_super.Close;
data.Qry_sub.Close;
DS_pfxjhtao.DataSet := Qry_pfxjhtao;
DS_pfxjhtu.DataSet := Qry_pfxjhtu;
end;
IDCancel:
result := false;
end
else
begin
Qry_pfxjhtao.Close;
Qry_pfxjhtu.Close;
Qry_pplb.Close;
Qry_tzdm.Close;
// Qry_pzr.Close;
data.Qry_send.Close;
data.Qry_super.Close;
data.Qry_sub.Close;
DS_pfxjhtao.DataSet := Qry_pfxjhtao;
DS_pfxjhtu.DataSet := Qry_pfxjhtu;
end;
end;
function TFrmf_pfxjh.pfxjhExec(DB: TDataBase): boolean;
begin
Result := true;
try
Caption := CYZPPTIT;
DWMC.Caption := '使用单位:' + VG_UnitName;
vlp_stao_jhh := '';
vlp_itu_tx := 0;
vlp_FocusGrid := DBGid_tao;
Qry_pfxjhtao.Close;
Qry_pfxjhtao.DataBaseName := DB.DatabaseName;
Qry_pfxjhtu.Close;
Qry_pfxjhtu.DataBaseName := DB.DatabaseName;
Qry_pplb.Close;
Qry_pplb.DataBaseName := DB.DatabaseName;
Qry_pplb.Open;
Qry_tzdm.Close;
Qry_tzdm.DataBaseName := DB.DatabaseName;
Qry_tzdm.Open;
// Qry_pzr.Close;
// Qry_pzr.DataBaseName := DB.DatabaseName;
// qry_pzr.Open;
Query1.Close;
Query1.DataBaseName := DB.DatabaseName;
DS_pfxjhtao.DataSet := Qry_pfxjhtao;
DS_pfxjhtu.DataSet := Qry_pfxjhtu;
data.Qry_super.Close;
data.Qry_sub.Close;
SetEditStatus(0,-3);
SpinEdit1.Text := VG_s_Year;
Qry_pfxjhtu.Open;
except
Result := false;
CHQMsgBox('不能打开<邮票发行计划>表!');
end;
end;
procedure TFrmf_pfxjh.SetEditStatus(SubMod: integer; SelectedRowsCount: integer=1);
//submod:
//0......初始状态(浏览)
//1......add编辑状态
//2......查询结果浏览状态
//3......edit编辑状态
//4......multiselected
var
vl_b_tao, vl_b_tu: boolean;
i: integer;
begin
//设置button状态
SpinEdit1.Enabled := (SubMod = 0) or (SubMod = 4);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -