U_htglkp.pas
上传用户:psxgmh
上传日期:2013-04-08
资源大小:15112k
文件大小:3k
- unit U_htglkp;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, Mask, DBCtrls, ExtCtrls, Buttons, Db, DBClient;
- type
- TForm60 = class(TForm)
- Panel1: TPanel;
- Panel2: TPanel;
- Label1: TLabel;
- DBEdit1: TDBEdit;
- Label3: TLabel;
- DBEdit3: TDBEdit;
- Label2: TLabel;
- DBEdit2: TDBEdit;
- Label4: TLabel;
- Edit1: TEdit;
- Shape1: TShape;
- SpeedButton1: TSpeedButton;
- SpeedButton2: TSpeedButton;
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- ClientDataSet1: TClientDataSet;
- ClientDataSet1ID: TIntegerField;
- ClientDataSet1CDSDesigner: TStringField;
- ClientDataSet1CDSDesigner2: TStringField;
- ClientDataSet1CDSDesigner3: TStringField;
- procedure SpeedButton1Click(Sender: TObject);
- procedure SpeedButton2Click(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure BitBtn1Click(Sender: TObject);
- procedure BitBtn2Click(Sender: TObject);
- procedure FormShow(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form60: TForm60;
- implementation
- uses U_htgd, U_mainform;
- {$R *.DFM}
- procedure TForm60.SpeedButton1Click(Sender: TObject);
- begin
- if dbedit1.text = '' then
- begin
- application.messagebox('合同编号不能为空', '合同管理系统', mb_iconinformation + mb_defbutton1);
- dbedit1.SetFocus;
- exit;
- end;
- if dbedit2.text = '' then
- begin
- application.messagebox('归档编号不能为空', '合同管理系统', mb_iconinformation + mb_defbutton1);
- dbedit2.SetFocus;
- exit;
- end;
- form19.ClientDataSet1.Edit;
- form19.clientdataset1.post;
- form19.clientdataset1.ApplyUpdates(0);
- close;
- end;
- procedure TForm60.SpeedButton2Click(Sender: TObject);
- begin
- close;
- end;
- procedure TForm60.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- form19.ClientDataSet1.Cancel;
- end;
- procedure TForm60.BitBtn1Click(Sender: TObject);
- begin
- application.createform(tform62, form62);
- try
- form62.showmodal;
- finally
- form62.free;
- end;
- end;
- procedure TForm60.BitBtn2Click(Sender: TObject);
- begin
- application.createform(tform61, form61);
- try
- form61.showmodal;
- finally
- if clientdataset1.active = false then
- clientdataset1.open;
- clientdataset1.IndexFieldNames := '归档编号';
- if clientdataset1.FindKey([dbedit2.text]) then
- edit1.text := clientdataset1.fieldbyname('归档标题').asstring
- else
- edit1.text := '';
- end;
- form61.free;
- end;
- procedure TForm60.FormShow(Sender: TObject);
- begin
- if clientdataset1.active = false then
- clientdataset1.open;
- clientdataset1.IndexFieldNames := '归档编号';
- if clientdataset1.FindKey([dbedit2.text]) then
- edit1.text := clientdataset1.fieldbyname('归档标题').asstring
- else
- edit1.text := '';
- end;
- end.