sz_dmgls.~pas
资源名称:挡案管理系统.rar [点击查看]
上传用户:szruida
上传日期:2007-06-01
资源大小:6518k
文件大小:21k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit sz_dmgls;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, DB, Grids, DBGridEh, ExtCtrls, StdCtrls, Buttons, Mask, DBCtrls,
- ComCtrls;
- type
- Tsz_dmgl = class(TForm)
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- TabSheet2: TTabSheet;
- Label5: TLabel;
- Label6: TLabel;
- Label7: TLabel;
- Label8: TLabel;
- DBEdit4: TDBEdit;
- DBEdit5: TDBEdit;
- DBEdit6: TDBEdit;
- Edit2: TEdit;
- DataSource1: TDataSource;
- DBEdit1: TDBEdit;
- DBEdit2: TDBEdit;
- DBEdit3: TDBEdit;
- Edit1: TEdit;
- Panel1: TPanel;
- DBGridEh1: TDBGridEh;
- Add: TBitBtn;
- Delete: TBitBtn;
- Quit: TBitBtn;
- BitBtn1: TBitBtn;
- BitBtn3: TBitBtn;
- BitBtn4: TBitBtn;
- Panel2: TPanel;
- DBGridEh2: TDBGridEh;
- DataSource2: TDataSource;
- Label9: TLabel;
- Label10: TLabel;
- Label11: TLabel;
- SpeedButton1: TSpeedButton;
- Label12: TLabel;
- Label13: TLabel;
- SpeedButton2: TSpeedButton;
- SpeedButton3: TSpeedButton;
- SpeedButton4: TSpeedButton;
- Refresh: TSpeedButton;
- Refresh2: TSpeedButton;
- TabSheet3: TTabSheet;
- Label15: TLabel;
- DBEdit7: TDBEdit;
- DataSource3: TDataSource;
- Label16: TLabel;
- DBEdit8: TDBEdit;
- Label17: TLabel;
- DBEdit9: TDBEdit;
- Panel3: TPanel;
- DBGridEh3: TDBGridEh;
- SpeedButton5: TSpeedButton;
- SpeedButton6: TSpeedButton;
- SpeedButton7: TSpeedButton;
- SpeedButton8: TSpeedButton;
- Refresh3: TSpeedButton;
- SpeedButton10: TSpeedButton;
- Label18: TLabel;
- Label19: TLabel;
- Label21: TLabel;
- Edit3: TEdit;
- TabSheet4: TTabSheet;
- Label22: TLabel;
- DBEdit10: TDBEdit;
- Label23: TLabel;
- DBEdit11: TDBEdit;
- Label24: TLabel;
- DBEdit12: TDBEdit;
- Label25: TLabel;
- Edit4: TEdit;
- Label20: TLabel;
- Label26: TLabel;
- Panel4: TPanel;
- DBGridEh4: TDBGridEh;
- SpeedButton9: TSpeedButton;
- SpeedButton11: TSpeedButton;
- SpeedButton12: TSpeedButton;
- SpeedButton13: TSpeedButton;
- Refresh4: TSpeedButton;
- SpeedButton15: TSpeedButton;
- DataSource4: TDataSource;
- TabSheet5: TTabSheet;
- Label14: TLabel;
- DBEdit13: TDBEdit;
- DataSource5: TDataSource;
- Label27: TLabel;
- DBEdit14: TDBEdit;
- Label28: TLabel;
- DBEdit15: TDBEdit;
- Label29: TLabel;
- Edit5: TEdit;
- Label30: TLabel;
- Label31: TLabel;
- Panel5: TPanel;
- DBGridEh5: TDBGridEh;
- SpeedButton14: TSpeedButton;
- SpeedButton16: TSpeedButton;
- SpeedButton17: TSpeedButton;
- SpeedButton18: TSpeedButton;
- Refresh5: TSpeedButton;
- SpeedButton20: TSpeedButton;
- TabSheet6: TTabSheet;
- Label32: TLabel;
- DBEdit16: TDBEdit;
- DataSource6: TDataSource;
- Label33: TLabel;
- DBEdit17: TDBEdit;
- Label34: TLabel;
- DBEdit18: TDBEdit;
- Label35: TLabel;
- Edit6: TEdit;
- Label36: TLabel;
- Label37: TLabel;
- Panel6: TPanel;
- DBGridEh6: TDBGridEh;
- SpeedButton19: TSpeedButton;
- SpeedButton21: TSpeedButton;
- SpeedButton22: TSpeedButton;
- SpeedButton23: TSpeedButton;
- Refresh6: TSpeedButton;
- SpeedButton25: TSpeedButton;
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure SpeedButton1Click(Sender: TObject);
- procedure AddClick(Sender: TObject);
- procedure DeleteClick(Sender: TObject);
- procedure BitBtn1Click(Sender: TObject);
- procedure SpeedButton4Click(Sender: TObject);
- procedure BitBtn3Click(Sender: TObject);
- procedure SpeedButton2Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure RefreshClick(Sender: TObject);
- procedure Refresh2Click(Sender: TObject);
- procedure SpeedButton10Click(Sender: TObject);
- procedure Refresh3Click(Sender: TObject);
- procedure SpeedButton5Click(Sender: TObject);
- procedure SpeedButton6Click(Sender: TObject);
- procedure SpeedButton7Click(Sender: TObject);
- procedure SpeedButton8Click(Sender: TObject);
- procedure SpeedButton15Click(Sender: TObject);
- procedure SpeedButton9Click(Sender: TObject);
- procedure SpeedButton11Click(Sender: TObject);
- procedure SpeedButton12Click(Sender: TObject);
- procedure SpeedButton13Click(Sender: TObject);
- procedure Refresh4Click(Sender: TObject);
- procedure SpeedButton3Click(Sender: TObject);
- procedure SpeedButton20Click(Sender: TObject);
- procedure SpeedButton14Click(Sender: TObject);
- procedure SpeedButton16Click(Sender: TObject);
- procedure SpeedButton17Click(Sender: TObject);
- procedure SpeedButton18Click(Sender: TObject);
- procedure Refresh5Click(Sender: TObject);
- procedure SpeedButton25Click(Sender: TObject);
- procedure SpeedButton19Click(Sender: TObject);
- procedure SpeedButton21Click(Sender: TObject);
- procedure SpeedButton22Click(Sender: TObject);
- procedure SpeedButton23Click(Sender: TObject);
- procedure Refresh6Click(Sender: TObject);
- procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit5KeyPress(Sender: TObject; var Key: Char);
- procedure BitBtn4Click(Sender: TObject);
- procedure QuitClick(Sender: TObject);
- procedure DBEdit2KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit4KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit7KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit8KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit10KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit11KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit13KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit14KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit16KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit17KeyPress(Sender: TObject; var Key: Char);
- procedure DBEdit3KeyPress(Sender: TObject; var Key: Char);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- sz_dmgl: Tsz_dmgl;
- implementation
- uses DMs,mainfrms;
- {$R *.dfm}
- procedure Tsz_dmgl.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- action:=cafree;
- sz_dmgl:=nil;
- //释放数据集
- dm.sz_bgqx.Active:=false;
- dm.sz_mj.Active:=false;
- dm.sz_jyfs.Active:=false;
- dm.sz_jymd.Active:=false;
- dm.sz_ztlb.Active:=false;
- dm.sz_zjlb.Active:=false;
- end;
- procedure Tsz_dmgl.SpeedButton1Click(Sender: TObject);
- var i:integer;
- begin
- if DbEdit1.Text='' then
- begin
- application.MessageBox('保管期限代码不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if DbEdit2.Text='' then
- begin
- application.MessageBox('保管期限名称不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if DbEdit3.Text='' then
- begin
- application.MessageBox('保管年限不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if length(trim(DbEdit1.Text))<>length(Edit1.Text) then
- begin
- application.MessageBox('编码规则不对','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- //------------以上为判断不符合条件的情况
- dm.sz_bgqx.ApplyUpdates(0);
- i:=dm.sz_bgqx.ApplyUpdates(0);
- if i=0 then
- begin
- application.MessageBox('数据保存成功','提示',mb_ok+mb_iconinformation);
- Refresh.Click;
- end
- else
- application.MessageBox('数据保存失败','提示',mb_ok+mb_iconinformation)
- end;
- procedure Tsz_dmgl.AddClick(Sender: TObject);
- begin
- dm.sz_bgqx.Close;
- dm.sz_bgqx.CommandText:='select * from sz_bgqx where bgqx_dm='+''''+''''+'';
- dm.sz_bgqx.Open;
- DbEdit1.SetFocus;
- end;
- procedure Tsz_dmgl.DeleteClick(Sender: TObject);
- begin
- if datasource1.DataSet.RecordCount=0 then
- begin
- application.MessageBox('表中没有数据,不能删除','提示',mb_ok+mb_iconinformation);
- exit;
- end
- else
- if application.MessageBox('您确定要删除当前纪录吗?','警告',mb_okcancel+mb_iconquestion)=idok then
- begin
- dm.sz_bgqx.Delete;
- dm.sz_bgqx.ApplyUpdates(0);
- end
- else
- datasource1.DataSet.Cancel;
- end;
- procedure Tsz_dmgl.BitBtn1Click(Sender: TObject);
- begin
- dm.sz_mj.Close;
- dm.sz_mj.CommandText:='select * from sz_mj where mj_dm='+''''+''''+'';
- dm.sz_mj.Open;
- DbEdit4.SetFocus;
- end;
- procedure Tsz_dmgl.SpeedButton4Click(Sender: TObject);
- begin
- datasource2.DataSet.edit;
- DbEdit4.SetFocus;
- end;
- procedure Tsz_dmgl.BitBtn3Click(Sender: TObject);
- begin
- if datasource2.DataSet.RecordCount=0 then
- begin
- application.MessageBox('表中没有数据,不能删除','提示',mb_ok+mb_iconinformation);
- exit;
- end
- else
- if application.MessageBox('您确定要删除当前纪录吗?','警告',mb_okcancel+mb_iconquestion)=idok then
- begin
- datasource2.DataSet.Delete;
- dm.sz_mj.ApplyUpdates(0);
- end
- else
- datasource2.DataSet.Cancel;
- end;
- procedure Tsz_dmgl.SpeedButton2Click(Sender: TObject);
- var i:integer;
- begin
- if DbEdit4.Text='' then
- begin
- application.MessageBox('密级代码不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if DbEdit5.Text='' then
- begin
- application.MessageBox('密级名称不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if length(trim(DbEdit4.Text))<>length(Edit2.Text) then
- begin
- application.MessageBox('编码规则不对','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- //------------以上为判断不符合条件的情况
- dm.sz_mj.ApplyUpdates(0);
- i:=dm.sz_mj.ApplyUpdates(0);
- if i=0 then
- begin
- application.MessageBox('数据保存成功','提示',mb_ok+mb_iconinformation);
- Refresh2.click;
- end
- else
- application.MessageBox('数据保存失败','提示',mb_ok+mb_iconinformation)
- end;
- procedure Tsz_dmgl.FormCreate(Sender: TObject);
- begin
- dm.sz_bgqx.Active:=true;
- dm.sz_mj.Active:=true;
- dm.sz_jyfs.Active:=true;
- dm.sz_jymd.Active:=true;
- dm.sz_ztlb.Active:=true;
- dm.sz_zjlb.Active:=true;
- //-------------保管期限
- Dm.xt_lbjs.Close;
- Dm.xt_lbjs.CommandText:='Select lb_dmgz,lbjs_sm from xt_lbjs where lb_dm='+''''+'sz_bgqx'+''''+'';
- Dm.xt_lbjs.Open;
- edit1.Text:=dm.xt_lbjs.fieldbyname('lb_dmgz').asstring;
- //-------------密级
- Dm.xt_lbjs.Close;
- Dm.xt_lbjs.CommandText:='Select lb_dmgz,lbjs_sm from xt_lbjs where lb_dm='+''''+'sz_mj'+''''+'';
- Dm.xt_lbjs.Open;
- edit2.Text:=dm.xt_lbjs.fieldbyname('lb_dmgz').asstring;
- //-------------借阅方式
- Dm.xt_lbjs.Close;
- Dm.xt_lbjs.CommandText:='Select lb_dmgz,lbjs_sm from xt_lbjs where lb_dm='+''''+'sz_jyfs'+''''+'';
- Dm.xt_lbjs.Open;
- edit3.Text:=dm.xt_lbjs.fieldbyname('lb_dmgz').asstring;
- //---------------借阅目的
- Dm.xt_lbjs.Close;
- Dm.xt_lbjs.CommandText:='Select lb_dmgz,lbjs_sm from xt_lbjs where lb_dm='+''''+'sz_jymd'+''''+'';
- Dm.xt_lbjs.Open;
- edit4.Text:=dm.xt_lbjs.fieldbyname('lb_dmgz').asstring;
- //---------------载体类别
- Dm.xt_lbjs.Close;
- Dm.xt_lbjs.CommandText:='Select lb_dmgz,lbjs_sm from xt_lbjs where lb_dm='+''''+'sz_ztlb'+''''+'';
- Dm.xt_lbjs.Open;
- edit5.Text:=dm.xt_lbjs.fieldbyname('lb_dmgz').asstring;
- //------------证件类别
- Dm.xt_lbjs.Close;
- Dm.xt_lbjs.CommandText:='Select lb_dmgz,lbjs_sm from xt_lbjs where lb_dm='+''''+'sz_zjlb'+''''+'';
- Dm.xt_lbjs.Open;
- edit6.Text:=dm.xt_lbjs.fieldbyname('lb_dmgz').asstring;
- end;
- procedure Tsz_dmgl.RefreshClick(Sender: TObject);
- begin
- dm.sz_bgqx.Close;
- dm.sz_bgqx.CommandText:='select * from sz_bgqx';
- dm.sz_bgqx.Open;
- end;
- procedure Tsz_dmgl.Refresh2Click(Sender: TObject);
- begin
- dm.sz_mj.Close;
- dm.sz_mj.CommandText:='select * from sz_mj';
- dm.sz_mj.Open;
- end;
- procedure Tsz_dmgl.SpeedButton10Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tsz_dmgl.Refresh3Click(Sender: TObject);
- begin
- dm.sz_jyfs.Close;
- dm.sz_jyfs.CommandText:='Select * from sz_jyfs';
- dm.sz_jyfs.Open;
- end;
- procedure Tsz_dmgl.SpeedButton5Click(Sender: TObject);
- begin
- dm.sz_jyfs.Close;
- dm.sz_jyfs.CommandText:='select * from sz_jyfs where jyfs_dm='+''''+''''+'';
- dm.sz_jyfs.Open;
- DbEdit7.SetFocus;
- end;
- procedure Tsz_dmgl.SpeedButton6Click(Sender: TObject);
- begin
- dm.sz_jyfs.Edit;
- DBEdit7.SetFocus;
- end;
- procedure Tsz_dmgl.SpeedButton7Click(Sender: TObject);
- begin
- if datasource3.DataSet.RecordCount=0 then
- begin
- application.MessageBox('表中没有数据,不能删除','提示',mb_ok+mb_iconinformation);
- exit;
- end
- else
- if application.MessageBox('您确定要删除当前纪录吗?','警告',mb_okcancel+mb_iconquestion)=idok then
- begin
- datasource3.DataSet.Delete;
- dm.sz_jyfs.ApplyUpdates(0);
- end
- else
- datasource3.DataSet.Cancel;
- end;
- procedure Tsz_dmgl.SpeedButton8Click(Sender: TObject);
- var i:integer;
- begin
- if DbEdit7.Text='' then
- begin
- application.MessageBox('借阅方式代码不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if DbEdit8.Text='' then
- begin
- application.MessageBox('借阅方式名称不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if length(trim(DbEdit7.Text))<>length(Edit3.Text) then
- begin
- application.MessageBox('编码规则不对','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- //------------以上为判断不符合条件的情况
- dm.sz_jyfs.ApplyUpdates(0);
- i:=dm.sz_jyfs.ApplyUpdates(0);
- if i=0 then
- begin
- application.MessageBox('数据保存成功','提示',mb_ok+mb_iconinformation);
- Refresh3.Click;
- end
- else
- application.MessageBox('数据保存失败','提示',mb_ok+mb_iconinformation)
- end;
- procedure Tsz_dmgl.SpeedButton15Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tsz_dmgl.SpeedButton9Click(Sender: TObject);
- begin
- dm.sz_jymd.Close;
- dm.sz_jymd.CommandText:='select * from sz_jymd where jymd_dm='+''''+''''+'';
- dm.sz_jymd.Open;
- DbEdit10.SetFocus;
- end;
- procedure Tsz_dmgl.SpeedButton11Click(Sender: TObject);
- begin
- dm.sz_jymd.Edit;
- DbEDit10.SetFocus;
- end;
- procedure Tsz_dmgl.SpeedButton12Click(Sender: TObject);
- begin
- if datasource4.DataSet.RecordCount=0 then
- begin
- application.MessageBox('表中没有数据,不能删除','提示',mb_ok+mb_iconinformation);
- exit;
- end
- else
- if application.MessageBox('您确定要删除当前纪录吗?','警告',mb_okcancel+mb_iconquestion)=idok then
- begin
- datasource4.DataSet.Delete;
- dm.sz_jymd.ApplyUpdates(0);
- end
- else
- datasource4.DataSet.Cancel;
- end;
- procedure Tsz_dmgl.SpeedButton13Click(Sender: TObject);
- var i:integer;
- begin
- if DbEdit10.Text='' then
- begin
- application.MessageBox('借阅目的代码不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if DbEdit11.Text='' then
- begin
- application.MessageBox('借阅目的名称不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if length(trim(DbEdit10.Text))<>length(Edit4.Text) then
- begin
- application.MessageBox('编码规则不对','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- //------------以上为判断不符合条件的情况
- dm.sz_jymd.ApplyUpdates(0);
- i:=dm.sz_jymd.ApplyUpdates(0);
- if i=0 then
- begin
- application.MessageBox('数据保存成功','提示',mb_ok+mb_iconinformation);
- Refresh4.Click;
- end
- else
- application.MessageBox('数据保存失败','提示',mb_ok+mb_iconinformation);
- end;
- procedure Tsz_dmgl.Refresh4Click(Sender: TObject);
- begin
- dm.sz_jymd.Close;
- dm.sz_jymd.CommandText:='Select * from sz_jymd';
- dm.sz_jymd.Open;
- end;
- procedure Tsz_dmgl.SpeedButton3Click(Sender: TObject);
- begin
- dm.sz_bgqx.Edit;
- DbEdit1.SetFocus;
- end;
- procedure Tsz_dmgl.SpeedButton20Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tsz_dmgl.SpeedButton14Click(Sender: TObject);
- begin
- dm.sz_ztlb.Close;
- dm.sz_ztlb.CommandText:='select * from sz_ztlb where ztlb_dm='+''''+''''+'';
- dm.sz_ztlb.Open;
- DbEdit13.SetFocus;
- end;
- procedure Tsz_dmgl.SpeedButton16Click(Sender: TObject);
- begin
- dm.sz_ztlb.Edit;
- DbEDit13.SetFocus;
- end;
- procedure Tsz_dmgl.SpeedButton17Click(Sender: TObject);
- begin
- if datasource5.DataSet.RecordCount=0 then
- begin
- application.MessageBox('表中没有数据,不能删除','提示',mb_ok+mb_iconinformation);
- exit;
- end
- else
- if application.MessageBox('您确定要删除当前纪录吗?','警告',mb_okcancel+mb_iconquestion)=idok then
- begin
- dm.sz_ztlb.Delete;
- dm.sz_ztlb.ApplyUpdates(0);
- end
- else
- datasource5.DataSet.Cancel;
- end;
- procedure Tsz_dmgl.SpeedButton18Click(Sender: TObject);
- var i:integer;
- begin
- if DbEdit13.Text='' then
- begin
- application.MessageBox('载体类别代码不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if DbEdit14.Text='' then
- begin
- application.MessageBox('载体类别名称不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if length(trim(DbEdit13.Text))<>length(Edit5.Text) then
- begin
- application.MessageBox('编码规则不对','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- //------------以上为判断不符合条件的情况
- dm.sz_ztlb.ApplyUpdates(0);
- i:=dm.sz_ztlb.ApplyUpdates(0);
- if i=0 then
- begin
- application.MessageBox('数据保存成功','提示',mb_ok+mb_iconinformation);
- Refresh5.Click;
- end
- else
- application.MessageBox('数据保存失败','提示',mb_ok+mb_iconinformation);
- end;
- procedure Tsz_dmgl.Refresh5Click(Sender: TObject);
- begin
- dm.sz_ztlb.Close;
- dm.sz_ztlb.CommandText:='Select * from sz_ztlb';
- dm.sz_ztlb.Open;
- end;
- procedure Tsz_dmgl.SpeedButton25Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tsz_dmgl.SpeedButton19Click(Sender: TObject);
- begin
- dm.sz_zjlb.Close;
- dm.sz_zjlb.CommandText:='select * from sz_zjlb where zjlb_dm='+''''+''''+'';
- dm.sz_zjlb.Open;
- DbEdit16.SetFocus;
- end;
- procedure Tsz_dmgl.SpeedButton21Click(Sender: TObject);
- begin
- dm.sz_zjlb.Edit;
- DbEDit16.SetFocus;
- end;
- procedure Tsz_dmgl.SpeedButton22Click(Sender: TObject);
- begin
- if datasource6.DataSet.RecordCount=0 then
- begin
- application.MessageBox('表中没有数据,不能删除','提示',mb_ok+mb_iconinformation);
- exit;
- end
- else
- if application.MessageBox('您确定要删除当前纪录吗?','警告',mb_okcancel+mb_iconquestion)=idok then
- begin
- dm.sz_zjlb.Delete;
- dm.sz_zjlb.ApplyUpdates(0);
- dm.sz_zjlb.Close;
- dm.sz_zjlb.CommandText:='select * from sz_zjlb';
- dm.sz_zjlb.Open;
- end
- else
- datasource6.DataSet.Cancel;
- end;
- procedure Tsz_dmgl.SpeedButton23Click(Sender: TObject);
- var i:integer;
- begin
- if DbEdit16.Text='' then
- begin
- application.MessageBox('证件类别代码不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if DbEdit17.Text='' then
- begin
- application.MessageBox('证件类别名称不可为空','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- if length(trim(DbEdit13.Text))<>length(Edit6.Text) then
- begin
- application.MessageBox('编码规则不对','提示',mb_ok+mb_iconinformation);
- exit;
- end;
- //------------以上为判断不符合条件的情况
- dm.sz_zjlb.ApplyUpdates(0);
- i:=dm.sz_zjlb.ApplyUpdates(0);
- if i=0 then
- begin
- application.MessageBox('数据保存成功','提示',mb_ok+mb_iconinformation);
- Refresh6.Click;
- end
- else
- application.MessageBox('数据保存失败','提示',mb_ok+mb_iconinformation);
- end;
- procedure Tsz_dmgl.Refresh6Click(Sender: TObject);
- begin
- dm.sz_zjlb.Close;
- dm.sz_zjlb.CommandText:='Select * from sz_zjlb';
- dm.sz_zjlb.Open;
- end;
- procedure Tsz_dmgl.DBEdit1KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DBEDit2.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit5KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit6.SetFocus;
- end;
- procedure Tsz_dmgl.BitBtn4Click(Sender: TObject);
- begin
- close;
- end;
- procedure Tsz_dmgl.QuitClick(Sender: TObject);
- begin
- close;
- end;
- procedure Tsz_dmgl.DBEdit2KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit3.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit4KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit5.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit7KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit8.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit8KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit9.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit10KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit11.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit11KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit12.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit13KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit14.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit14KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit15.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit16KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit17.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit17KeyPress(Sender: TObject; var Key: Char);
- begin
- if key=#13 then
- DbEdit18.SetFocus;
- end;
- procedure Tsz_dmgl.DBEdit3KeyPress(Sender: TObject; var Key: Char);
- begin
- mainfrm.DbInputNum(dbedit3,key);
- end;
- end.