?? gp32.~pas
字號(hào):
unit GP32;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls, DB, ADODB;
type
TAttachInfo = class(TForm)
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Label3: TLabel;
Edit2: TEdit;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
AttachInfo: TAttachInfo;
implementation
uses Code2, GP31Code;
{$R *.dfm}
procedure TAttachInfo.BitBtn2Click(Sender: TObject);
begin
GP3Form.cocode := '';
GP3Form.coname := '';
GP3Form.coyear := '';
GP3Form.refreshform();
attachInfo.Close;
end;
procedure TAttachInfo.BitBtn1Click(Sender: TObject);
var
sqlstr : string;
year : integer;
i : longint;
begin
if (length(Edit2.Text)<>12)
then
begin
ShowMessage('單位代碼長(zhǎng)度規(guī)定為12位!');
exit;
end;
year := strToInt(copy(DateToStr(Date),1,4));
if ((Edit1.Text <> '') and (Edit2.Text <> ''))
then
begin
sqlstr := 'select * from 公用事業(yè)單位基本情況表 where 單位代碼='+''''+Edit2.Text+''''+ ' and 統(tǒng)計(jì)年份='+inttostr(year);
GP3Form.AdoQuery1.Close;
GP3Form.AdoQuery1.SQL.Clear;
GP3Form.AdoQuery1.SQL.Add(sqlstr);
GP3Form.AdoQuery1.Open;
if (GP3Form.AdoQuery1.RecordCount <>0)
then
begin
ShowMessage('輸入企業(yè)代碼信息重復(fù),無(wú)法存儲(chǔ)!');
exit;
end;
sqlstr := 'insert into 公用事業(yè)單位基本情況表 (單位名稱,單位代碼,統(tǒng)計(jì)年份) values ('+''''+Edit1.Text+''''+','+''''+Edit2.Text+''''+','+inttostr(year)+')';
GP3Form.AdoQuery1.Close;
GP3Form.AdoQuery1.SQL.Clear;
GP3Form.AdoQuery1.SQL.Add(sqlstr);
GP3Form.AdoQuery1.ExecSQL;
GP3Form.cocode := Edit2.Text;
GP3Form.coname := Edit1.Text;
GP3Form.coyear := inttostr(year);
GP3Form.refreshform();
attachinfo.Close;
end
else
ShowMessage('請(qǐng)先輸入企業(yè)代碼和企業(yè)名稱!');
end;
procedure TAttachInfo.FormShow(Sender: TObject);
begin
Edit1.Text := '';
Edit2.Text := GP3Form.ComboBox2.Text;
end;
end.
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -