📄 pm_enter_simplesureno.pas
字号:
unit Pm_Enter_SimpleSureNo;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Outer, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
StdCtrls, ExtCtrls, ComCtrls, ToolWin, jpeg;
Type
TFrm_Pm_Enter_SimpleSureNo = Class(TFrm_Base_Outer)
AdoQry_MainItemCode: TStringField;
AdoQry_MainItemName: TStringField;
AdoQry_MaInvendorCode: TStringField;
AdoQry_MaInvendorName: TStringField;
AdoQry_MainstArtdate: TDateTimeField;
AdoQry_Mainenddate: TDateTimeField;
AdoQry_MainItemsampleno: TStringField;
AdoQry_MainItemsampleid: TFloatField;
procedure FormDestroy(Sender: TObject);
procedure Act_FilterExecute(Sender: TObject);
procedure FormShow(Sender: TObject);
private
sqltext:string;
{ Private declarations }
public
function SetDeleteSql:String;Override;
procedure initform(AdOConnection:TAdOConnection;ReadOnly:boolean);
{ Public declarations }
end;
var
Frm_Pm_Enter_SimpleSureNo: TFrm_Pm_Enter_SimpleSureNo;
implementation
uses Pm_Enter_SimpleSureNo_D,Sys_Global;
{$R *.DFM}
procedure TFrm_Pm_Enter_SimpleSureNo.initform(AdOConnection:TAdOConnection;ReadOnly:boolean);
var
i,j,k:integer;
begin
Application.ProcessMessages;
CreatePanel(1,dbgrideh);
inherited;
sqltext:='select Itemsampleno.Itemsampleid,Itemsampleno.Itemsampleno,Itemsampleno.ItemCode,Item.ItemName,Itemsampleno.VendorCode,Vendor.VendorName,Itemsampleno.stArtdate,Itemsampleno.enddate'+
' from Itemsampleno left join Item on Itemsampleno.ItemCode=Item.ItemCode left join Vendor on Itemsampleno.VendorCode=Vendor.VendorCode ';
//当前排序字段
OrderByFields:='VendorCode ASc,ItemCode ASc,Itemsampleno ASc';
lbl_Order.Caption:='供应商代码;物料代码;样品确认单号';
selectfromsql:='select Itemsampleno.Itemsampleid,Itemsampleno.Itemsampleno,Itemsampleno.ItemCode,Item.ItemName,Itemsampleno.VendorCode,Vendor.VendorName,Itemsampleno.stArtdate,Itemsampleno.enddate'+
' from Itemsampleno left join Item on Itemsampleno.ItemCode=Item.ItemCode left join Vendor on Itemsampleno.VendorCode=Vendor.VendorCode ';
GetData;
Caption:='样品确认单号维护';
Frm_Sys_Detail:=TFrm_Pm_Enter_SimpleSureNo_D.Create(Application);
If Assigned(ShowAnimate) then ShowAnimate.free;
If Assigned(ShowPanel) then ShowPanel.free;
end;
procedure TFrm_Pm_Enter_SimpleSureNo.FormDestroy(Sender: TObject);
begin
inherited;
Frm_Pm_Enter_SimpleSureNo:=nil;
end;
procedure TFrm_Pm_Enter_SimpleSureNo.Act_FilterExecute(Sender: TObject);
var
i:integer;
begin
for i:=0 to dbgrideh.Columns.Count-1 do
begin
if (uppercase(dbgrideh.Columns[i].FieldName)='ItemName')or(uppercase(dbgrideh.Columns[i].FieldName)='ItemCode') then
dbgrideh.Columns[i].Field.Origin:='Item'
else if (uppercase(dbgrideh.Columns[i].FieldName)='VendorName')or(uppercase(dbgrideh.Columns[i].FieldName)='VendorCode') then
dbgrideh.Columns[i].Field.Origin:='Vendor'
else
dbgrideh.Columns[i].Field.Origin:='Itemsampleno'
end;
with AdoQry_tmp do
begin
Close;
sql.Text:='drop table #'+self.Name+',#'+self.Name+'chb';
try
execsql;
except
end;
end;
inherited;
end;
function TFrm_Pm_Enter_SimpleSureNo.SetDeleteSql:String;
begin
Result:='Delete Itemsampleno Where Itemsampleno='''+AdoQry_Main.fieldbyname('Itemsampleno').AsString+'''';
end;
procedure TFrm_Pm_Enter_SimpleSureNo.FormShow(Sender: TObject);
begin
inherited;
Pnl_Title.Caption :='样品确认单号维护';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -