485 lines
13 KiB
ObjectPascal
485 lines
13 KiB
ObjectPascal
![]() |
unit U_LCKInput;
|
|||
|
|
|||
|
interface
|
|||
|
|
|||
|
uses
|
|||
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
|||
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls,
|
|||
|
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
|||
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
|||
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
|||
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
|||
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
|||
|
IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit,
|
|||
|
cxTextEdit, cxDropDownEdit, BtnEdit, cxLookAndFeels, cxLookAndFeelPainters,
|
|||
|
cxNavigator, dxSkinsCore, dxSkinsDefaultPainters, dxDateRanges,
|
|||
|
dxBarBuiltInMenu, U_BaseList, dxSkinBasic, dxSkinBlack, dxSkinBlue,
|
|||
|
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkroom, dxSkinDarkSide,
|
|||
|
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
|
|||
|
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
|
|||
|
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
|
|||
|
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
|
|||
|
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
|
|||
|
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
|
|||
|
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
|
|||
|
dxSkinOffice2013White, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
|
|||
|
dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray,
|
|||
|
dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
|
|||
|
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
|
|||
|
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine,
|
|||
|
dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark,
|
|||
|
dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint, dxSkinWXI,
|
|||
|
dxSkinXmas2008Blue, dxScrollbarAnnotations;
|
|||
|
|
|||
|
type
|
|||
|
TfrmLCKInput = class(TForm)
|
|||
|
ToolBar1: TToolBar;
|
|||
|
TBClose: TToolButton;
|
|||
|
ADOQueryTemp: TADOQuery;
|
|||
|
ADOQueryCmd: TADOQuery;
|
|||
|
ADOQueryMain: TADOQuery;
|
|||
|
ToolButton3: TToolButton;
|
|||
|
CDS_LXR: TClientDataSet;
|
|||
|
DSLXR: TDataSource;
|
|||
|
ScrollBox1: TScrollBox;
|
|||
|
Label2: TLabel;
|
|||
|
Label6: TLabel;
|
|||
|
Label7: TLabel;
|
|||
|
Label19: TLabel;
|
|||
|
C_Name: TEdit;
|
|||
|
Note: TMemo;
|
|||
|
C_Code: TEdit;
|
|||
|
GPM_2: TcxGridPopupMenu;
|
|||
|
Label4: TLabel;
|
|||
|
HCLNote: TMemo;
|
|||
|
HCLType: TBtnEditC;
|
|||
|
ToolButton2: TToolButton;
|
|||
|
Label1: TLabel;
|
|||
|
KKDate: TDateTimePicker;
|
|||
|
Label3: TLabel;
|
|||
|
KKPS: TEdit;
|
|||
|
Label5: TLabel;
|
|||
|
Label9: TLabel;
|
|||
|
Label10: TLabel;
|
|||
|
LCKID: TEdit;
|
|||
|
MainID: TEdit;
|
|||
|
SubID: TEdit;
|
|||
|
lbl1: TLabel;
|
|||
|
KKGS: TEdit;
|
|||
|
lbl2: TLabel;
|
|||
|
PBKC: TEdit;
|
|||
|
lbl3: TLabel;
|
|||
|
Craft: TBtnEditC;
|
|||
|
lbl4: TLabel;
|
|||
|
BQXS: TEdit;
|
|||
|
Label8: TLabel;
|
|||
|
DXNOTE: TMemo;
|
|||
|
Label11: TLabel;
|
|||
|
JGNO: TBtnEditC;
|
|||
|
Label12: TLabel;
|
|||
|
jiano: TBtnEditC;
|
|||
|
Label13: TLabel;
|
|||
|
Label14: TLabel;
|
|||
|
C_Composition: TEdit;
|
|||
|
C_COLORNO: TEdit;
|
|||
|
Panel1: TPanel;
|
|||
|
ToolBar2: TToolBar;
|
|||
|
ToolButton1: TToolButton;
|
|||
|
ToolButton4: TToolButton;
|
|||
|
cxGrid1: TcxGrid;
|
|||
|
Tv1: TcxGridDBTableView;
|
|||
|
Tv1Column1: TcxGridDBColumn;
|
|||
|
v1SOrddefstr1: TcxGridDBColumn;
|
|||
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
DS_GX: TDataSource;
|
|||
|
CDS_GX: TClientDataSet;
|
|||
|
procedure FormDestroy(Sender: TObject);
|
|||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
procedure FormShow(Sender: TObject);
|
|||
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
procedure COGdyBtnDnClick(Sender: TObject);
|
|||
|
procedure COGdyBtnUpClick(Sender: TObject);
|
|||
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
private
|
|||
|
{ Private declarations }
|
|||
|
procedure InitGrid();
|
|||
|
function SaveData(flag: boolean): Boolean;
|
|||
|
public
|
|||
|
fkhType: string;
|
|||
|
{ Public declarations }
|
|||
|
FLCKID, FFSubId: string;
|
|||
|
PState: Integer;
|
|||
|
end;
|
|||
|
|
|||
|
var
|
|||
|
frmLCKInput: TfrmLCKInput;
|
|||
|
|
|||
|
implementation
|
|||
|
|
|||
|
uses
|
|||
|
U_DataLink, U_RTFun, U_ZDYHelp;
|
|||
|
|
|||
|
{$R *.dfm}
|
|||
|
|
|||
|
procedure TfrmLCKInput.InitGrid();
|
|||
|
begin
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmLCKInput.FormDestroy(Sender: TObject);
|
|||
|
begin
|
|||
|
|
|||
|
frmLCKInput := nil;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmLCKInput.COGdyBtnDnClick(Sender: TObject);
|
|||
|
begin
|
|||
|
TBtnEditC(Sender).Text := '';
|
|||
|
TBtnEditC(Sender).TxtCode := '';
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmLCKInput.COGdyBtnUpClick(Sender: TObject);
|
|||
|
var
|
|||
|
fsj: string;
|
|||
|
FWZ: Integer;
|
|||
|
begin
|
|||
|
fsj := Trim(TEdit(Sender).Hint);
|
|||
|
FWZ := Pos('/', fsj);
|
|||
|
try
|
|||
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
with frmZDYHelp do
|
|||
|
begin
|
|||
|
flag := Copy(fsj, 1, FWZ - 1);
|
|||
|
flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ);
|
|||
|
if ShowModal = 1 then
|
|||
|
begin
|
|||
|
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
end;
|
|||
|
end;
|
|||
|
finally
|
|||
|
frmZDYHelp.Free;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmLCKInput.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
begin
|
|||
|
|
|||
|
Action := caFree;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmLCKInput.TBCloseClick(Sender: TObject);
|
|||
|
begin
|
|||
|
|
|||
|
close;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmLCKInput.FormShow(Sender: TObject);
|
|||
|
var
|
|||
|
FPBKC: string;
|
|||
|
begin
|
|||
|
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' select count(*) Piece from V_Knit_Cloth_Stk where SubID=''' + Trim(FFSubId) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
|
|||
|
FPBKC := Trim(self.ADOQueryTemp.fieldbyname('Piece').AsString);
|
|||
|
|
|||
|
if PState = 0 then
|
|||
|
begin
|
|||
|
KKDate.DateTime := SGetServerDate(ADOQueryTemp);
|
|||
|
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' select A.*,B.* ');
|
|||
|
sql.Add(' from Knit_Plan_Main A INNER JOIN Knit_Plan_Sub B on A.MainId =B.MainID ');
|
|||
|
sql.Add(' where B.SubID=''' + Trim(FFSubId) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
|
|||
|
MainID.text := Trim(self.ADOQueryTemp.fieldbyname('MainID').AsString);
|
|||
|
SubID.text := Trim(self.ADOQueryTemp.fieldbyname('SubID').AsString);
|
|||
|
|
|||
|
C_Code.text := Trim(self.ADOQueryTemp.fieldbyname('C_Code').AsString);
|
|||
|
C_Name.text := Trim(self.ADOQueryTemp.fieldbyname('C_Name').AsString);
|
|||
|
|
|||
|
HclNote.text := Trim(self.ADOQueryTemp.fieldbyname('C_Deal').AsString);
|
|||
|
PBKC.Text := FPBKC;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' select A.* ');
|
|||
|
sql.Add(' from Dye_Plan_Glide A ');
|
|||
|
sql.Add(' where 1<>1');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS(ADOQueryTemp, CDS_GX);
|
|||
|
SInitCDSData(ADOQueryTemp, CDS_GX);
|
|||
|
with CDS_GX do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
CDS_GX.FieldByName('glideno').Value := 1;
|
|||
|
CDS_GX.FieldByName('GlideName').Value := '<27><><EFBFBD><EFBFBD>';
|
|||
|
Append;
|
|||
|
CDS_GX.FieldByName('glideno').Value := 2;
|
|||
|
CDS_GX.FieldByName('GlideName').Value := '<27><><EFBFBD><EFBFBD>';
|
|||
|
post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
if PState = 1 then
|
|||
|
begin
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' select * from PB_LCK ');
|
|||
|
sql.Add(' where LCKID=''' + Trim(FLCKID) + '''');
|
|||
|
|
|||
|
Open;
|
|||
|
end;
|
|||
|
|
|||
|
LCKID.text := Trim(self.ADOQueryTemp.fieldbyname('LCKID').AsString);
|
|||
|
MainID.text := Trim(self.ADOQueryTemp.fieldbyname('MainID').AsString);
|
|||
|
SubID.text := Trim(self.ADOQueryTemp.fieldbyname('SubID').AsString);
|
|||
|
|
|||
|
C_Code.text := Trim(self.ADOQueryTemp.fieldbyname('C_Code').AsString);
|
|||
|
C_Name.text := Trim(self.ADOQueryTemp.fieldbyname('C_Name').AsString);
|
|||
|
BQXS.text := Trim(self.ADOQueryTemp.fieldbyname('BQXS').AsString);
|
|||
|
HclType.text := Trim(self.ADOQueryTemp.fieldbyname('HclType').AsString);
|
|||
|
HclNote.text := Trim(self.ADOQueryTemp.fieldbyname('HclNote').AsString);
|
|||
|
|
|||
|
Note.text := Trim(self.ADOQueryTemp.fieldbyname('Note').AsString);
|
|||
|
|
|||
|
KKPS.text := Trim(self.ADOQueryTemp.fieldbyname('KKPS').AsString);
|
|||
|
Craft.text := Trim(self.ADOQueryTemp.fieldbyname('Craft').AsString);
|
|||
|
KKDate.DateTime := self.ADOQueryTemp.fieldbyname('KKDate').asdatetime;
|
|||
|
|
|||
|
JGNO.text := Trim(self.ADOQueryTemp.fieldbyname('JGNO').AsString);
|
|||
|
jiano.text := Trim(self.ADOQueryTemp.fieldbyname('jiano').AsString);
|
|||
|
C_COLORNO.text := Trim(self.ADOQueryTemp.fieldbyname('C_COLORNO').AsString);
|
|||
|
C_Composition.text := Trim(self.ADOQueryTemp.fieldbyname('C_Composition').AsString);
|
|||
|
DXNOTE.text := Trim(self.ADOQueryTemp.fieldbyname('DXNOTE').AsString);
|
|||
|
|
|||
|
PBKC.Text := FPBKC;
|
|||
|
with ADOQueryTemp do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add(' select A.* ');
|
|||
|
sql.Add(' from Dye_Plan_Glide A ');
|
|||
|
sql.Add(' where pcid=''' + Trim(FLCKID) + '''');
|
|||
|
SQL.Add('ORDER BY GLIDENO');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
SCreateCDS(ADOQueryTemp, CDS_GX);
|
|||
|
SInitCDSData(ADOQueryTemp, CDS_GX);
|
|||
|
if CDS_GX.IsEmpty then
|
|||
|
begin
|
|||
|
with CDS_GX do
|
|||
|
begin
|
|||
|
Append;
|
|||
|
CDS_GX.FieldByName('glideno').Value := 1;
|
|||
|
CDS_GX.FieldByName('GlideName').Value := '<27><><EFBFBD><EFBFBD>';
|
|||
|
Append;
|
|||
|
CDS_GX.FieldByName('glideno').Value := 2;
|
|||
|
CDS_GX.FieldByName('GlideName').Value := '<27><><EFBFBD><EFBFBD>';
|
|||
|
post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmLCKInput.TBRafreshClick(Sender: TObject);
|
|||
|
begin
|
|||
|
InitGrid();
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmLCKInput.ToolButton1Click(Sender: TObject);
|
|||
|
var
|
|||
|
i: Integer;
|
|||
|
begin
|
|||
|
i := CDS_GX.RecordCount;
|
|||
|
i := i + 1;
|
|||
|
|
|||
|
with CDS_GX do
|
|||
|
begin
|
|||
|
APPEND;
|
|||
|
FieldByName('GLIDENO').Value := IntToStr(i);
|
|||
|
|
|||
|
Post;
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmLCKInput.ToolButton3Click(Sender: TObject);
|
|||
|
var
|
|||
|
i: Integer;
|
|||
|
fRoll: Tstringlist;
|
|||
|
flag: Boolean;
|
|||
|
begin
|
|||
|
if Trim(KKPS.Text) = '' then
|
|||
|
raise Exception.Create('<27><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|||
|
if Trim(KKPS.Text) = '0' then
|
|||
|
raise Exception.Create('<27><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ0!');
|
|||
|
fRoll := Tstringlist.Create;
|
|||
|
// if (StrToFloat(KKPS.Text)) > (StrToFloatDef(PBKC.Text, 0)) then
|
|||
|
// raise Exception.Create('<27><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD><DCB4>ڿ<EFBFBD><DABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!');
|
|||
|
// if (StrToFloat(KKPS.Text) * StrtoFloatDef(KKGS.Text, 0)) > StrToFloatDef(PBKC.Text, 0) then
|
|||
|
// flag := false;
|
|||
|
|
|||
|
for i := 1 to strtointdef(KKGS.Text, 1) do
|
|||
|
begin
|
|||
|
if SaveData(flag) then
|
|||
|
begin
|
|||
|
//fRoll.Add(CDS_MJID.FieldByName('MJID').AsString);
|
|||
|
// BTAdd.Click;
|
|||
|
end;
|
|||
|
|
|||
|
end;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
ModalResult := 1;
|
|||
|
end;
|
|||
|
|
|||
|
procedure TfrmLCKInput.ToolButton4Click(Sender: TObject);
|
|||
|
begin
|
|||
|
if CDS_GX.IsEmpty then
|
|||
|
Exit;
|
|||
|
|
|||
|
if Trim(CDS_GX.fieldbyname('GLIDEID').AsString) <> '' then
|
|||
|
begin
|
|||
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
Exit;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
sql.Clear;
|
|||
|
sql.Add('delete Dye_Plan_Glide where GLIDEID=''' + Trim(CDS_GX.fieldbyname('GLIDEID').AsString) + '''');
|
|||
|
ExecSQL;
|
|||
|
end;
|
|||
|
end;
|
|||
|
CDS_GX.Delete;
|
|||
|
end;
|
|||
|
|
|||
|
function TfrmLCKInput.SaveData(flag: boolean): Boolean;
|
|||
|
var
|
|||
|
MaxId, MAXNO: string;
|
|||
|
begin
|
|||
|
try
|
|||
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
if Trim(FLCKID) = '' then
|
|||
|
begin
|
|||
|
if GetLSNo(ADOQueryCmd, MaxId, 'LCK', 'PB_LCK', 4, 1) = False then
|
|||
|
begin
|
|||
|
Result := False;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
Exit;
|
|||
|
end;
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
MaxId := Trim(FLCKID);
|
|||
|
end;
|
|||
|
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from PB_LCK where LCKID=''' + Trim(FLCKID) + '''');
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
if Trim(FLCKID) = '' then
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('FillId').Value := Trim(DCode);
|
|||
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('EditId').Value := Trim(DCode);
|
|||
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp);
|
|||
|
end;
|
|||
|
FieldByName('LCKID').Value := Trim(MaxId);
|
|||
|
RTSetsavedata(ADOQueryCmd, 'PB_LCK', ScrollBox1, 2);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
with CDS_GX do
|
|||
|
begin
|
|||
|
First;
|
|||
|
while not Eof do
|
|||
|
begin
|
|||
|
if Trim(CDS_GX.fieldbyname('GLIDEID').AsString) = '' then
|
|||
|
begin
|
|||
|
if not GetLSNo(ADOQueryCmd, MAXNO, 'GX', 'Dye_Plan_Glide', 4, 1) then
|
|||
|
raise Exception.Create('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD>');
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
MAXNO := Trim(CDS_GX.fieldbyname('GLIDEID').AsString);
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
Close;
|
|||
|
SQL.Clear;
|
|||
|
sql.Add('select * from Dye_Plan_Glide A ');
|
|||
|
sql.Add(' where GLIDEID=''' + Trim(MaxNO) + '''');
|
|||
|
|
|||
|
Open;
|
|||
|
end;
|
|||
|
with ADOQueryCmd do
|
|||
|
begin
|
|||
|
if ADOQueryCmd.IsEmpty then
|
|||
|
begin
|
|||
|
Append;
|
|||
|
FieldByName('FillId').Value := Trim(DCode);
|
|||
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
FieldByName('FILLtime').Value := SGetServerDateTime(ADOQueryTemp);
|
|||
|
end
|
|||
|
else
|
|||
|
begin
|
|||
|
Edit;
|
|||
|
FieldByName('EditId').Value := Trim(DCode);
|
|||
|
FieldByName('Editer').Value := Trim(DName);
|
|||
|
FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp);
|
|||
|
end;
|
|||
|
|
|||
|
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_GX, 'Dye_Plan_Glide', 0);
|
|||
|
FieldByName('PCID').Value := Trim(MaxId);
|
|||
|
FieldByName('GlideID').Value := Trim(MAXNO);
|
|||
|
Post;
|
|||
|
end;
|
|||
|
// CDS_GX.Edit;
|
|||
|
// CDS_GX.FieldByName('GlideID').Value := Trim(MAXNO);
|
|||
|
Next;
|
|||
|
end;
|
|||
|
end;
|
|||
|
//FLCKID := Trim(MaxId);
|
|||
|
|
|||
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
Result := True;
|
|||
|
except
|
|||
|
Result := false;
|
|||
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
|||
|
end;
|
|||
|
end;
|
|||
|
|
|||
|
end.
|
|||
|
|