📄 pm_enter_newsspoinfo4_c.pas
字号:
unit Pm_Enter_NewSsPoInfo4_C;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, Db, AdODB, StdCtrls;
Type
TFrm_Pm_Enter_NewSsPoInfo4_C = Class(TFrm_Base_Condition)
Label1: TLabel;
Edit1: TEdit;
procedure btn_okClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
procedure InitForm(AdOConnection:TAdOConnection;FormStatus:String;
AdoQuery:TAdoQuery);
{ Public declarations }
end;
var
Frm_Pm_Enter_NewSsPoInfo4_C: TFrm_Pm_Enter_NewSsPoInfo4_C;
implementation
uses Sys_Global, Pm_Enter_NewSsPoInfo4;
{$R *.DFM}
{ TFrm_Pm_Enter_SsPoInfo4_C }
{ TFrm_Pm_Enter_SsPoInfo4_C }
procedure TFrm_Pm_Enter_NewSsPoInfo4_C.InitForm(AdOConnection: TAdOConnection;
FormStatus: String; AdoQuery: TAdoQuery);
var
SqlText:String;
I:Integer;
begin
AdoQry_Tmp.Connection := AdOConnection;
try
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.Text :=' Drop table #C_SS1'
+' Drop table #C_SS2'
+' Drop table #C_SS3'
+' Drop table #C_SS4' ;
AdoQry_Tmp.ExecSQL;
except
end;
// SqlText:='Select Top 0 * into #C_Ss1 from #ss';
{ ssid,ItemCode,ssSysInfoflag, Orderno,Orderlineno,ssdate, PmType,
sScheck,OrderLineStatus,DeptVendorCode,
duedate,ssqty,GrossRequireQty,PlanInvQty,ReMainQty,ssreMainqty}
SqlText:=' CREATE TABLE [#C_Ss1] ('
+' [SSid] [int] ,'
+' [ItemCode] [varchAr] (50) ,'
+' [ssdate] [datetime] ,'
+' [duedate] [datetime] ,'
+' [SSQty] [float] ,'
+' [ReMainQty] [float] ,'
+' [ssreMainqty] [float] )'
+' CREATE TABLE [#C_Ss2] ('
+' [SSid] [int] ,'
+' [ItemCode] [varchAr] (50) ,'
+' [ssdate] [datetime] ,'
+' [duedate] [datetime] ,'
+' [SSQty] [float] ,'
+' [ReMainQty] [float] ,'
+' [ssreMainqty] [float] )' ;
AdoQry_tmp.Close;
AdoQry_Tmp.SQL.Text:=SqlText;
AdoQry_Tmp.ExecSQL;
AdoQuery.First;
While Not AdoQuery.Eof Do
begin
If (AdoQuery.fieldbyname('PcNo').AsString<>'') and(AdoQuery.fieldbyname('SSSysInfoFlag').Asinteger=1)
and (AdoQuery.fieldbyname('PcNo').AsString<>'待分配') Then
begin
{ ssid,ItemCode,ssSysInfoflag, Orderno,Orderlineno,ssdate, PmType,
sScheck,OrderLineStatus,DeptVendorCode,
duedate,ssqty,GrossRequireQty,PlanInvQty,ReMainQty,ssreMainqty}
SqlText:='insert #C_Ss1(SSid,ItemCode,ssdate, '
+' duedate,ssqty,ReMainQty,ssreMainqty )'
+' Values '
+' ('''+inttostr(AdoQuery.fieldbyname('ssid').AsInteger)+''','
+' '''+AdoQuery.fieldbyname('ItemCode').AsString+''','
+' '''+AdoQuery.fieldbyname('ssdate').AsString+''','
+' '''+AdoQuery.fieldbyname('duedate').AsString+''','
+' '''+AdoQuery.fieldbyname('ssqty').AsString+''','
+' '''+AdoQuery.fieldbyname('ReMainQty').AsString+''','
+' '''+AdoQuery.fieldbyname('ssreMainqty').AsString+''')'
+ 'insert #C_Ss2(SSid,ItemCode,ssdate, '
+' duedate,ssqty,ReMainQty,ssreMainqty )'
+' Values '
+' ('''+inttostr(AdoQuery.fieldbyname('ssid').AsInteger)+''','
+' '''+AdoQuery.fieldbyname('ItemCode').AsString+''','
+' '''+AdoQuery.fieldbyname('ssdate').AsString+''','
+' '''+AdoQuery.fieldbyname('duedate').AsString+''','
+' '''+AdoQuery.fieldbyname('ssqty').AsString+''','
+' '''+AdoQuery.fieldbyname('ReMainQty').AsString+''','
+' '''+AdoQuery.fieldbyname('ssreMainqty').AsString+''')';
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.Text:= SqlText;
AdoQry_Tmp.ExecSQL;
end;
AdoQuery.next;
end;
end;
procedure TFrm_Pm_Enter_NewSsPoInfo4_C.btn_okClick(Sender: TObject);
begin
inherited;
try
Frm_Pm_Enter_NewSsPoInfo4.LDdate:=-strtoint(edit1.Text);
except
DispInfo('汇总天数输入错误!',3);
edit1.setfocus;
abort;
end;
ModalResult:=mrOk;
end;
procedure TFrm_Pm_Enter_NewSsPoInfo4_C.FormShow(Sender: TObject);
begin
inherited;
edit1.SetFocus ;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -