528 lines
14 KiB
ObjectPascal
528 lines
14 KiB
ObjectPascal
|
|
unit U_PlanScanInEdit2;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, strUtils, SysUtils, Variants, Classes, Graphics, Controls,
|
|||
|
|
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
|||
|
|
cxDataStorage, cxEdit, DB, cxDBData, StdCtrls, ExtCtrls, ADODB, DBClient,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, MMSystem,
|
|||
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
|||
|
|
cxControls, cxGridCustomView, cxGrid, MovePanel, cxCheckBox, Menus, ComCtrls,
|
|||
|
|
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, U_BaseList, dxSkinsCore,
|
|||
|
|
dxSkinsDefaultPainters, dxDateRanges, dxBarBuiltInMenu, RM_Common, RM_Class,
|
|||
|
|
RM_GridReport, RM_Dataset, Vcl.ToolWin, 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, cxContainer, cxProgressBar,
|
|||
|
|
BtnEdit;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmPlanScanInEdit2 = class(TfrmBaseList)
|
|||
|
|
GPM_1: TcxGridPopupMenu;
|
|||
|
|
CDS_1: TClientDataSet;
|
|||
|
|
DS_1: TDataSource;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
CDS_2: TClientDataSet;
|
|||
|
|
DS_2: TDataSource;
|
|||
|
|
GPM_2: TcxGridPopupMenu;
|
|||
|
|
DS_3: TDataSource;
|
|||
|
|
CDS_3: TClientDataSet;
|
|||
|
|
GPM_3: TcxGridPopupMenu;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
cxGrid3: TcxGrid;
|
|||
|
|
Tv3: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
ToolBar3: TToolBar;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
btnGetOutNo: TToolButton;
|
|||
|
|
ToolButton7: TToolButton;
|
|||
|
|
ToolButton8: TToolButton;
|
|||
|
|
edtScan: TEdit;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
wlCompany: TBtnEditA;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
InNo: TEdit;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
CRTime: TDateTimePicker;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
CRType: TComboBox;
|
|||
|
|
carPlate: TBtnEditA;
|
|||
|
|
Tv3Column1: TcxGridDBColumn;
|
|||
|
|
Tqueren: TButton;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Driver: TBtnEditA;
|
|||
|
|
Driverid: TEdit;
|
|||
|
|
GroupBox1: TGroupBox;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
TV1: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure btnGetOutNoClick(Sender: TObject);
|
|||
|
|
procedure ToolButton7Click(Sender: TObject);
|
|||
|
|
procedure ToolButton8Click(Sender: TObject);
|
|||
|
|
procedure edtScanKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure wlCompanyBtnClick(Sender: TObject);
|
|||
|
|
procedure carPlateBtnClick(Sender: TObject);
|
|||
|
|
procedure TquerenClick(Sender: TObject);
|
|||
|
|
procedure DriverBtnClick(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
FScan, FSubIds, FZCID: string;
|
|||
|
|
procedure PlayWav(MWav: string);
|
|||
|
|
procedure InitKC();
|
|||
|
|
|
|||
|
|
procedure InitZCD();
|
|||
|
|
procedure InitStatus(ZCID: string);
|
|||
|
|
procedure ScanKW();
|
|||
|
|
procedure ScanCIID();
|
|||
|
|
function SaveData(): Boolean;
|
|||
|
|
public
|
|||
|
|
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmPlanScanInEdit2: TfrmPlanScanInEdit2;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_RTFun, U_LabelPrint, U_ZDYHelp, U_MachineManageSel, U_UserSel; //U_TradeClothWaitStorage, U_PositionSel
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.PlayWav(MWav: string);
|
|||
|
|
begin
|
|||
|
|
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\' + MWav + '.wav')) then
|
|||
|
|
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\' + MWav + '.wav'), 0, SND_ASYNC);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.InitZCD();
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
// if carPlate.Text = '' then
|
|||
|
|
// exit;
|
|||
|
|
|
|||
|
|
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Trade_Market_CarTransport A WHERE STATUS=''0'' ');
|
|||
|
|
|
|||
|
|
sql.Add('AND EXISTS (SELECT * FROM Trade_Market_CarTransportSUB B WHERE B.ZCID=A.ZCID) ');
|
|||
|
|
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS(ADOQueryTemp, CDS_1);
|
|||
|
|
SInitCDSData(ADOQueryTemp, CDS_1);
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.InitKC();
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
// if carPlate.Text = '' then
|
|||
|
|
// exit;
|
|||
|
|
|
|||
|
|
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Trade_Market_Main A ');
|
|||
|
|
|
|||
|
|
sql.Add('where ');
|
|||
|
|
sql.add(' ZCID =(select zcid from Trade_Market_Main b where b.tmmid=' + QuotedStr(TRIm(FScan)));
|
|||
|
|
sql.add(')');
|
|||
|
|
SQL.Add('AND cctime IS NULL ');
|
|||
|
|
sql.Add('and ISNULL(stATUS,''0'')=''9''');
|
|||
|
|
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѳ<EFBFBD><D1B3><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
SCreateCDS(ADOQueryTemp, CDS_3);
|
|||
|
|
SInitCDSData(ADOQueryTemp, CDS_3);
|
|||
|
|
Driver.Text := ADOQueryTemp.FieldByName('Driver').AsString;
|
|||
|
|
carPlate.Text := ADOQueryTemp.FieldByName('carPlate').AsString;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.ScanKW();
|
|||
|
|
var
|
|||
|
|
MStkIds: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from Bs_Position where POSID =''' + trim(FScan) + ''' ');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
wlCompany.Text := ADOQueryTemp.FieldByName('posno').AsString;
|
|||
|
|
|
|||
|
|
btnGetOutNo.Click;
|
|||
|
|
except
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.ScanCIID();
|
|||
|
|
var
|
|||
|
|
MStkIds: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
if Trim(wlCompany.Text) = '' then
|
|||
|
|
raise Exception.Create('<27><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|||
|
|
if Trim(InNo.Text) = '' then
|
|||
|
|
raise Exception.Create('<27><><EFBFBD>ⵥ<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!');
|
|||
|
|
|
|||
|
|
MStkIds := FScan;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
Sql.Clear;
|
|||
|
|
Sql.Add('exec P_Market_Position_In ');
|
|||
|
|
Sql.Add('@StkIds=' + quotedstr(trim(MStkIds)));
|
|||
|
|
Sql.Add(',@IOTime=' + Quotedstr(FormatDateTime('yyyy-MM-dd', CRTime.DateTime)));
|
|||
|
|
Sql.Add(',@IOType=' + Quotedstr(crtype.Text));
|
|||
|
|
Sql.Add(',@IONO=' + Quotedstr(InNo.Text));
|
|||
|
|
Sql.Add(',@StkPosition=' + Quotedstr(wlCompany.Text));
|
|||
|
|
Sql.Add(',@FillId=' + Quotedstr(DCode));
|
|||
|
|
Sql.Add(',@Filler=' + Quotedstr(DName));
|
|||
|
|
// ShowMessage(sql.Text);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryCmd.FieldByName('intReturn').AsInteger = -1 then
|
|||
|
|
begin
|
|||
|
|
raise Exception.Create(pchar(trim(ADOQueryCmd.FieldByName('ShowMsg').AsString)));
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
PlayWav('<27><>ȷ');
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
raise Exception.Create(PChar(Exception(ExceptObject).Message));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
except
|
|||
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
// PlayWav('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
frmPlanScanInEdit2 := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
ReadCxGrid(self.caption + 'Tv3', Tv3, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|||
|
|
// InitKC();
|
|||
|
|
CRTime.DateTime := SGetServerDate(ADOQueryTemp);
|
|||
|
|
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Trade_Market_Main A ');
|
|||
|
|
|
|||
|
|
sql.Add('where 1<>1 ');
|
|||
|
|
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS(ADOQueryTemp, CDS_3);
|
|||
|
|
SInitCDSData(ADOQueryTemp, CDS_3);
|
|||
|
|
initzcd();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.edtScanKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
var
|
|||
|
|
maxno, SMFlag, KYCKFlag, FMainId, ff: string;
|
|||
|
|
FFQty: Integer;
|
|||
|
|
begin
|
|||
|
|
// <20><><EFBFBD><EFBFBD> =13 ʱ<><CAB1><EFBFBD>Զ<EFBFBD>ģ<EFBFBD>ⰴ<EFBFBD>س<EFBFBD>
|
|||
|
|
if Length(edtScan.Text) = 12 then
|
|||
|
|
begin
|
|||
|
|
Key := #13; // ǿ<>ưѵ<C6B0>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɻس<C9BB>
|
|||
|
|
edtScan.SelectAll; // <20><>ѡ<EFBFBD><D1A1>ѡ<EFBFBD><D1A1>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>´θ<C2B4><CEB8><EFBFBD>ɨ<EFBFBD><C9A8>
|
|||
|
|
end;
|
|||
|
|
if Key = #13 then
|
|||
|
|
begin
|
|||
|
|
if edtScan.Text = '' then
|
|||
|
|
EXIT;
|
|||
|
|
FScan := TRIM(edtScan.Text);
|
|||
|
|
edtScan.Text := '';
|
|||
|
|
// if Copy(FScan, 1, 2) = 'KW' then
|
|||
|
|
// begin
|
|||
|
|
// ScanKW();
|
|||
|
|
// end
|
|||
|
|
// else
|
|||
|
|
// begin
|
|||
|
|
// ScanCIID();
|
|||
|
|
// end;
|
|||
|
|
InitKC();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.ToolButton3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Trim(InNo.Text) = '' then
|
|||
|
|
Exit;
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmLabelPrint := TfrmLabelPrint.Create(Application);
|
|||
|
|
with frmLabelPrint do
|
|||
|
|
begin
|
|||
|
|
FLMType := 'TradeClothIn1';
|
|||
|
|
FFiltration1 := Trim(CDS_1.FieldByName('zcid').AsString);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmLabelPrint.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.wlCompanyBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
MainType := 'Cust';
|
|||
|
|
flag := 'AREA';
|
|||
|
|
flagname := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
wlCompany.text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.carPlateBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inherited;
|
|||
|
|
try
|
|||
|
|
frmMachineManageSel := TfrmMachineManageSel.Create(Application);
|
|||
|
|
with frmMachineManageSel do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
carPlate.text := Trim(CDS_1.fieldbyname('VNO').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmMachineManageSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.DriverBtnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
try
|
|||
|
|
frmUserSel := TfrmUserSel.Create(Application);
|
|||
|
|
with frmUserSel do
|
|||
|
|
begin
|
|||
|
|
Fdept := '<27>ͻ<EFBFBD><CDBB><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
self.Driverid.Text := Trim(CDS_1.fieldbyname('EECode').AsString);
|
|||
|
|
self.Driver.Text := Trim(CDS_1.fieldbyname('EEName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmUserSel.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.btnGetOutNoClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
maxNo: string;
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOQueryCmd, maxNo, 'RK', 'Trade_Cloth_IO', 3, 1) = False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD>ⵥ<EFBFBD><E2B5A5>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
InNo.Text := Trim(maxNo);
|
|||
|
|
CRTime.DateTime := SGetServerDate(ADOQueryTemp);
|
|||
|
|
InitKC();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.ToolButton7Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
tv3.Controller.EditingController.ShowEdit();
|
|||
|
|
Close;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.ToolButton8Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid(self.caption + 'Tv3', Tv3, '<27><>Ʒ<EFBFBD>ֿ<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.TquerenClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Driver.Text = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('˾<><CBBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if carPlate.Text = '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from Trade_Market_Main A ');
|
|||
|
|
|
|||
|
|
sql.Add('where 1<>1 ');
|
|||
|
|
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS(ADOQueryTemp, CDS_3);
|
|||
|
|
SInitCDSData(ADOQueryTemp, CDS_3);
|
|||
|
|
initzcd();
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
//procedure TfrmPlanScanInEdit.TquerenClick(Sender: TObject);
|
|||
|
|
|
|||
|
|
function TfrmPlanScanInEdit2.SaveData(): Boolean;
|
|||
|
|
var
|
|||
|
|
MaxMid, MaxSid: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update Trade_Market_Main ');
|
|||
|
|
SQL.Add('set Cctime=GETDATE()');
|
|||
|
|
SQL.Add(',Driver=' + QuotedStr(Driver.Text));
|
|||
|
|
SQL.Add(',carPlate= ' + QuotedStr(carPlate.Text));
|
|||
|
|
|
|||
|
|
sql.Add('where ZCID=' + quotedstr(trim(CDS_3.fieldbyname('ZCID').AsString)));
|
|||
|
|
|
|||
|
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
|
sql.Add(' ' + quotedstr(trim(DName)));
|
|||
|
|
sql.Add(',getdate() ');
|
|||
|
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>' + trim(CDS_3.FieldByName('ZCID').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox(PChar(Exception(ExceptObject).Message), '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
Result := False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmPlanScanInEdit2.InitStatus(ZCID: string);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update Trade_Market_Main SET status=''9'' ');
|
|||
|
|
SQL.Add(',zctime=GETDATE()');
|
|||
|
|
SQL.Add(',Driver=' + QuotedStr(Driver.Text));
|
|||
|
|
SQL.Add(',carPlate= ' + QuotedStr(carPlate.Text));
|
|||
|
|
SQL.Add(',zcid= ' + QuotedStr(ZCID));
|
|||
|
|
sql.Add('where TMMId=' + quotedstr(trim(CDS_3.fieldbyname('TMMId').AsString)));
|
|||
|
|
|
|||
|
|
sql.Add('insert into Finance_Need_Up(UType,UDataId,UOperation,UOperator,UModule,UDetails) ');
|
|||
|
|
sql.Add('values(''ó<>ײ<EFBFBD><D7B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(',' + quotedstr(trim(CDS_3.fieldbyname('TMMId').AsString)));
|
|||
|
|
sql.Add(',''<27><><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(',' + quotedstr(DName));
|
|||
|
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
|
sql.Add(',' + quotedstr(trim(CDS_3.fieldbyname('TMMId').AsString)));
|
|||
|
|
sql.Add(') ');
|
|||
|
|
|
|||
|
|
sql.Add('insert into SY_SysLog(operor,opertime,Model,acction,opevent,result) values( ');
|
|||
|
|
sql.Add(' ' + quotedstr(trim(DName)));
|
|||
|
|
sql.Add(',getdate() ');
|
|||
|
|
sql.Add(',' + quotedstr(trim(self.Caption)));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ţ<EFBFBD>' + trim(CDS_3.FieldByName('TMMNO').AsString))));
|
|||
|
|
sql.Add(',' + quotedstr(trim('<27>ɹ<EFBFBD>')));
|
|||
|
|
sql.Add(')');
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|