90 lines
1.8 KiB
ObjectPascal
90 lines
1.8 KiB
ObjectPascal
|
|
unit U_SKTP_DJ;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, StdCtrls, ExtCtrls, DB, ADODB;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TFrmSKTP_DJ = class(TForm)
|
|||
|
|
Panel0: TPanel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
WBID: TEdit;
|
|||
|
|
SKName: TEdit;
|
|||
|
|
SKWZ: TEdit;
|
|||
|
|
SKCode: TEdit;
|
|||
|
|
SKNote: TMemo;
|
|||
|
|
Button2: TButton;
|
|||
|
|
SKCodeOld: TEdit;
|
|||
|
|
SKID: TEdit;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
ADOQuery2: TADOQuery;
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
FCPID:String;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
FrmSKTP_DJ: TFrmSKTP_DJ;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_Fun;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TFrmSKTP_DJ.Button2Click(Sender: TObject);
|
|||
|
|
var maxno:string;
|
|||
|
|
begin
|
|||
|
|
if SKCode.Text='' then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('ɫ<><C9AB><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from SK_Base where SKID='''+Trim(SKID.Text)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
if IsEmpty then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOQuery2,MaxNo,'SK','SK_Base',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡͼƬ<CDBC><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Append;
|
|||
|
|
FieldByName('SKID').Value:=Trim(MaxNo);
|
|||
|
|
SKID.Text:=Trim(MaxNo);
|
|||
|
|
FieldByName('filler').Value:=Trim(DName);
|
|||
|
|
fieldbyname('CPID').Value:=trim(FCPID);
|
|||
|
|
FieldByName('Valid').Value:='Y';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('editer').Value:=Trim(DName);
|
|||
|
|
FieldByName('Edittime').Value:=now;
|
|||
|
|
end;
|
|||
|
|
RTSetsavedata(ADOQuery1,'SK_Base',Self.Panel0,2);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>','<27><>ʾ');
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|