D7wmguihua/坯布码单待检(PBMDDJ.dll)/U_OrderInPutAnPai.pas
DESKTOP-E401PHE\Administrator b4b5840f18 1
2025-01-18 16:22:10 +08:00

3250 lines
90 KiB
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

unit U_OrderInPutAnPai;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer,
cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB,
ExtCtrls, BtnEdit, cxCalendar,StrUtils, cxPC, cxGridCustomPopupMenu,
cxGridPopupMenu, cxDropDownEdit,jpeg,IdGlobal;
type
TfrmOrderInPutAnPai = class(TForm)
ToolBar1: TToolBar;
TBSave: TToolButton;
TBClose: TToolButton;
ADOTemp: TADOQuery;
ADOCmd: TADOQuery;
DataSource1: TDataSource;
Order_Sub: TClientDataSet;
ADOQuery1: TADOQuery;
cxPageControl1: TcxPageControl;
cxTabSheet1: TcxTabSheet;
ToolBar2: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
v1SOrddefstr1: TcxGridDBColumn;
v1PRTColor: TcxGridDBColumn;
v1Column3: TcxGridDBColumn;
v1Column4: TcxGridDBColumn;
v1PRTOrderQty: TcxGridDBColumn;
v1OrderUnit: TcxGridDBColumn;
cxGrid1Level1: TcxGridLevel;
cxTabSheet2: TcxTabSheet;
cxTabSheet3: TcxTabSheet;
v1Column1: TcxGridDBColumn;
Panel1: TPanel;
Label1: TLabel;
Label10: TLabel;
Label3: TLabel;
Label14: TLabel;
Label12: TLabel;
Label13: TLabel;
Label2: TLabel;
Label6: TLabel;
Label21: TLabel;
Label25: TLabel;
Label43: TLabel;
OrderNo: TEdit;
ConNo: TEdit;
OrdDate: TDateTimePicker;
ChuanY: TBtnEditC;
DLYDate: TDateTimePicker;
YWY: TBtnEditC;
Label4: TLabel;
Note: TMemo;
Label5: TLabel;
CDS_JGLC: TClientDataSet;
DataSource2: TDataSource;
CDS_JGC: TClientDataSet;
DataSource3: TDataSource;
cxGridPopupMenu1: TcxGridPopupMenu;
cxGridPopupMenu2: TcxGridPopupMenu;
cxGridPopupMenu3: TcxGridPopupMenu;
MPRTCodeName: TEdit;
MPRTSpec: TEdit;
Label7: TLabel;
MPRTCF: TEdit;
MPRTMF: TEdit;
MPRTKZ: TEdit;
CustomerNoName: TBtnEditA;
MPRTCode: TBtnEditA;
Label8: TLabel;
MPRTGY: TEdit;
Label11: TLabel;
Label15: TLabel;
Label9: TLabel;
MPRTGYHZ: TEdit;
ClientDataSet5: TClientDataSet;
DataSource5: TDataSource;
cxGridPopupMenu5: TcxGridPopupMenu;
ClientDataSet6: TClientDataSet;
DataSource6: TDataSource;
cxGridPopupMenu6: TcxGridPopupMenu;
v1Column2: TcxGridDBColumn;
ComTaiTou: TBtnEditA;
Label18: TLabel;
LiDanPerson: TBtnEditA;
ToolBar4: TToolBar;
ToolButton6: TToolButton;
ToolButton7: TToolButton;
cxGrid2: TcxGrid;
Tv2: TcxGridDBTableView;
cxGridDBColumn4: TcxGridDBColumn;
cxGridDBColumn5: TcxGridDBColumn;
v2Column1: TcxGridDBColumn;
v2Column2: TcxGridDBColumn;
v2Column3: TcxGridDBColumn;
v2Column4: TcxGridDBColumn;
cxGridDBColumn6: TcxGridDBColumn;
cxGridLevel2: TcxGridLevel;
ScrollBox2: TScrollBox;
cxGrid5: TcxGrid;
Tv5: TcxGridDBTableView;
cxGridDBColumn1: TcxGridDBColumn;
cxGridDBColumn2: TcxGridDBColumn;
cxGridDBColumn7: TcxGridDBColumn;
cxGridDBColumn8: TcxGridDBColumn;
cxGridDBColumn9: TcxGridDBColumn;
cxGridDBColumn10: TcxGridDBColumn;
cxGridDBColumn11: TcxGridDBColumn;
cxGridLevel3: TcxGridLevel;
cxGrid6: TcxGrid;
Tv6: TcxGridDBTableView;
v6Column1: TcxGridDBColumn;
v6Column3: TcxGridDBColumn;
v6Column2: TcxGridDBColumn;
cxGridDBColumn12: TcxGridDBColumn;
cxGridDBColumn15: TcxGridDBColumn;
cxGridDBColumn13: TcxGridDBColumn;
cxGridDBColumn17: TcxGridDBColumn;
cxGridLevel4: TcxGridLevel;
ToolBar5: TToolBar;
ToolButton9: TToolButton;
ToolButton12: TToolButton;
Panel2: TPanel;
ScrollBox3: TScrollBox;
ToolBar3: TToolBar;
ToolButton8: TToolButton;
ToolButton10: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
ToolButton11: TToolButton;
cxGrid3: TcxGrid;
Tv3: TcxGridDBTableView;
cxGridDBColumn3: TcxGridDBColumn;
v3Column1: TcxGridDBColumn;
Tv3Column1: TcxGridDBColumn;
v3Column2: TcxGridDBColumn;
v3Column3: TcxGridDBColumn;
v3Column5: TcxGridDBColumn;
v3Column4: TcxGridDBColumn;
v3Column6: TcxGridDBColumn;
v3Column7: TcxGridDBColumn;
v3Column8: TcxGridDBColumn;
v3Column9: TcxGridDBColumn;
cxGridLevel1: TcxGridLevel;
ScrollBox1: TScrollBox;
GroupBox1: TGroupBox;
Label16: TLabel;
Label17: TLabel;
MPRTMFNote: TEdit;
MPRTKZNote: TEdit;
CJNote: TcxMemo;
GroupBox2: TGroupBox;
DHNote: TcxMemo;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
CHNote: TcxMemo;
Label19: TLabel;
ZGLen: TEdit;
Label20: TLabel;
ZGHd: TEdit;
Label22: TLabel;
ZGKg: TEdit;
Label23: TLabel;
Label24: TLabel;
NRDHD: TEdit;
Label26: TLabel;
Label27: TLabel;
ZGNote: TEdit;
Label28: TLabel;
PiZhong: TEdit;
ToolButton13: TToolButton;
v1Column5: TcxGridDBColumn;
v1Column6: TcxGridDBColumn;
v1Column7: TcxGridDBColumn;
v1Column8: TcxGridDBColumn;
v1Column9: TcxGridDBColumn;
v1Column10: TcxGridDBColumn;
v1Column11: TcxGridDBColumn;
v1Column12: TcxGridDBColumn;
v1Column13: TcxGridDBColumn;
v1Column15: TcxGridDBColumn;
v1Column16: TcxGridDBColumn;
v1Column17: TcxGridDBColumn;
v1Column18: TcxGridDBColumn;
cxTabSheet4: TcxTabSheet;
cxGrid7: TcxGrid;
Tv7: TcxGridDBTableView;
cxGridDBColumn34: TcxGridDBColumn;
cxGridDBColumn30: TcxGridDBColumn;
cxGridDBColumn31: TcxGridDBColumn;
cxGridDBColumn32: TcxGridDBColumn;
cxGridDBColumn33: TcxGridDBColumn;
cxGridDBColumn36: TcxGridDBColumn;
cxGridLevel5: TcxGridLevel;
ToolBar6: TToolBar;
ToolButton14: TToolButton;
ToolButton15: TToolButton;
ClientDataSet7: TClientDataSet;
DataSource7: TDataSource;
cxGridPopupMenu7: TcxGridPopupMenu;
Panel3: TPanel;
Label30: TLabel;
Label29: TLabel;
Label31: TLabel;
ClothOneQty: TEdit;
OneQtyUnit: TComboBox;
MPRTOneQty: TEdit;
cxPageControl2: TcxPageControl;
cxTabSheet5: TcxTabSheet;
cxTabSheet6: TcxTabSheet;
BZNote: TcxMemo;
ToolBar7: TToolBar;
ToolButton16: TToolButton;
ToolButton17: TToolButton;
Image2: TImage;
OpenDialog2: TOpenDialog;
Panel4: TPanel;
CheckBox1: TCheckBox;
ToolButton18: TToolButton;
ToolButton19: TToolButton;
v2Column5: TcxGridDBColumn;
v5Column1: TcxGridDBColumn;
v5Column2: TcxGridDBColumn;
cxTabSheet7: TcxTabSheet;
ToolBar8: TToolBar;
ToolButton20: TToolButton;
ToolButton21: TToolButton;
cxGrid8: TcxGrid;
Tv8: TcxGridDBTableView;
cxGridDBColumn21: TcxGridDBColumn;
cxGridLevel6: TcxGridLevel;
DataSource8: TDataSource;
cxGridPopupMenu8: TcxGridPopupMenu;
ClientDataSet8: TClientDataSet;
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBSaveClick(Sender: TObject);
procedure v1PRTColorPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure RanFactoryBtnUpClick(Sender: TObject);
procedure CustomerNoNameBtnDnClick(Sender: TObject);
procedure NoteDblClick(Sender: TObject);
procedure v1OrderUnitPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure v1PriceUnitPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure OrdDefStr2BtnUpClick(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure YCLFactoryBtnUpClick(Sender: TObject);
procedure MPRTSCTeBieNoteBtnUpClick(Sender: TObject);
procedure ToolButton6Click(Sender: TObject);
procedure ToolButton4Click(Sender: TObject);
procedure ToolButton8Click(Sender: TObject);
procedure cxGridDBColumn6PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure CustomerNoNameBtnClick(Sender: TObject);
procedure MPRTCodeBtnClick(Sender: TObject);
procedure ToolButton7Click(Sender: TObject);
procedure Tv2CellClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure ToolButton10Click(Sender: TObject);
procedure ToolButton11Click(Sender: TObject);
procedure cxGridDBColumn3PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure ToolButton5Click(Sender: TObject);
procedure v2Column2PropertiesEditValueChanged(Sender: TObject);
procedure BZNoteDblClick(Sender: TObject);
procedure CHNoteDblClick(Sender: TObject);
procedure DHNoteDblClick(Sender: TObject);
procedure CJNoteDblClick(Sender: TObject);
procedure ToolButton12Click(Sender: TObject);
procedure Tv5CellClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure cxGridDBColumn1PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure cxGridDBColumn15PropertiesEditValueChanged(Sender: TObject);
procedure ToolButton9Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Tv6CellClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure Tv5CellDblClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure v1Column2PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure ComTaiTouBtnClick(Sender: TObject);
procedure LiDanPersonBtnClick(Sender: TObject);
procedure v3Column1PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure ToolButton13Click(Sender: TObject);
procedure v3Column2PropertiesEditValueChanged(Sender: TObject);
procedure ToolButton14Click(Sender: TObject);
procedure cxGridDBColumn30PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure ToolButton15Click(Sender: TObject);
procedure cxGridDBColumn31PropertiesEditValueChanged(Sender: TObject);
procedure cxGridDBColumn32PropertiesEditValueChanged(Sender: TObject);
procedure ToolButton16Click(Sender: TObject);
procedure ToolButton17Click(Sender: TObject);
procedure ToolButton18Click(Sender: TObject);
procedure ToolButton19Click(Sender: TObject);
procedure v5Column1PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure ToolButton20Click(Sender: TObject);
procedure ToolButton21Click(Sender: TObject);
private
CanShu1,CanShu2:String;
procedure InitData();
procedure ZDYHelp(FButn:TcxButtonEdit;LType:string);
function SaveData():Boolean;
function SaveDataSubOne():Boolean;
function SaveDataMain():Boolean;
function SaveDataSubMore():Boolean;
procedure SaveImageOther();
procedure CreThumb(AJPeg:TJPEGImage;Image1:TImage;Width, Height: Integer);
procedure InitImage();
{ Private declarations }
public
PState,CopyInt,PriceFlag:Integer;
FMainId,FFMainId,FOrderNo,ConSubId:String;
FXS:Integer;
{ Public declarations }
end;
var
frmOrderInPutAnPai: TfrmOrderInPutAnPai;
newh:hwnd;
implementation
uses
U_DataLink,U_ZDYHelp,U_RTFun,U_ZDYHelpSel,U_CPManageTPCX,U_ZHKHListNewCX
,U_GYSList,U_OrderSubSel,U_TJCKKC,U_LabelList, U_ModuleNote,U_OrderSubSelMX;
{$R *.dfm}
procedure TfrmOrderInPutAnPai.TBCloseClick(Sender: TObject);
begin
Close;
WriteCxGrid(ʾ<D6B8><CABE>¼<EFBFBD><C2BC>',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
WriteCxGrid('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>',Tv2,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
WriteCxGrid('<27>ӹ<EFBFBD><D3B9><EFBFBD>¼<EFBFBD><C2BC>',Tv3,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
WriteCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',Tv7,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure TfrmOrderInPutAnPai.InitData();
var
fsj:string;
begin
fsj:='select ZdyName Name,ZdyNo Code from KH_Zdy where Type=''PFGenDanPerson'' ';
SInitCxGridComboBoxBySql(ADOTemp,cxGridDBColumn2,fsj,0,False,'');
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD where ORDMainId='''+Trim(FMainId)+'''');
Open;
end;
if ADOTemp.IsEmpty=false then
begin
OrderNo.ReadOnly:=True;
end else
begin
OrderNo.ReadOnly:=False;
end;
ReadCxGrid(ʾ<D6B8><CABE>¼<EFBFBD><C2BC>',Tv1,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
ReadCxGrid('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>',Tv2,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
ReadCxGrid('<27>ӹ<EFBFBD><D3B9><EFBFBD>¼<EFBFBD><C2BC>',Tv3,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
ReadCxGrid('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',Tv7,'<27><><EFBFBD><EFBFBD>ָʾ<D6B8><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
cxPageControl1.ActivePageIndex:=0;
with ADOQuery1 do
begin
Close;
SQL.Clear;
sql.Add(' select * from JYOrder_Sub where 1=1 ');
//sql.Add('exec P_View_OrderSub :begdate,:enddate,:WSQl');
//Parameters.ParamByName('begdate').Value:='2010-10-10';
// Parameters.ParamByName('enddate').Value:='2050-12-24';
if PState=1 then
begin
sql.Add(' and MainId='''+Trim(FMainId)+'''');
end;
if PState=0 then
begin
sql.Add(' and 1<>1');
end;
//ShowMessage(SQL.Text);
Open;
end;
SCreateCDS20(ADOQuery1,Order_Sub);
SInitCDSData20(ADOQuery1,Order_Sub);
with ADOQuery1 do
begin
Close;
SQL.Clear;
sql.Add(' select * from JYOrder_Main_Fee where 1=1 ');
if PState=1 then
begin
sql.Add(' and MainId='''+Trim(FMainId)+'''');
end;
if PState=0 then
begin
sql.Add(' and 1<>1');
end;
Open;
end;
SCreateCDS20(ADOQuery1,ClientDataSet7);
SInitCDSData20(ADOQuery1,ClientDataSet7);
with ADOQuery1 do
begin
Close;
SQL.Clear;
sql.Add(' select * from JYOrder_CD where 1=1 ');
if PState=1 then
begin
sql.Add(' and MainId='''+Trim(FMainId)+'''');
end;
if PState=0 then
begin
sql.Add(' and 1<>1');
end;
Open;
end;
SCreateCDS20(ADOQuery1,ClientDataSet8);
SInitCDSData20(ADOQuery1,ClientDataSet8);
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main where MainId='''+Trim(FMainId)+'''');
Open;
end;
SCSHDataNew(ADOQuery1,Panel1,2);
SCSHDataNew(ADOQuery1,Panel3,2);
SCSHDataNew(ADOQuery1,ScrollBox1,2);
SCSHDataNew(ADOQuery1,GroupBox3,2);
BZNote.Text:=Trim(ADOQuery1.fieldbyname('BZNote').AsString);
DHNote.Text:=Trim(ADOQuery1.fieldbyname('DHNote').AsString);
CJNote.Text:=Trim(ADOQuery1.fieldbyname('CJNote').AsString);
CHNote.Text:=Trim(ADOQuery1.fieldbyname('CHNote').AsString);
MPRTMFNote.Text:=Trim(ADOQuery1.fieldbyname('MPRTMFNote').AsString);
MPRTKZNote.Text:=Trim(ADOQuery1.fieldbyname('MPRTKZNote').AsString);
//ConSubId:=Trim(ADOQuery1.fieldbyname('ConSubId').AsString);
with ADOQuery1 do
begin
Close;
sql.Clear;
if CopyInt<>99 then
sql.Add('select * from JYOrder_Process where MainId='''+Trim(FMainId)+'''')
else
sql.Add('select * from JYOrder_Process where 1<>1');
Open;
end;
SCreateCDS20(ADOQuery1,CDS_JGLC);
SInitCDSData20(ADOQuery1,CDS_JGLC);
if PState=0 then
begin
OrdDate.DateTime:=SGetServerDateTime(ADOTemp);
DlyDate.DateTime:=OrdDate.DateTime;
LiDanPerson.Text:=Trim(DName);
YWY.Text:=Trim(DName);
end else
begin
end;
if CopyInt=99 then
begin
PState:=0;
FMainId:='';
//OrdPerson1.Text:=Trim(DName);
OrderNo.Text:='';
OrderNo.ReadOnly:=False;
with Order_Sub do
begin
First;
while not Eof do
begin
Edit;
FieldByName('MainId').Value:='';
FieldByName('SubId').Value:='';
Post;
Next;
end;
end;
end;
InitImage();
cxPageControl1.ActivePageIndex:=2;
cxPageControl1.Pages[0].TabVisible:=False;
cxPageControl1.Pages[1].TabVisible:=False;
cxPageControl1.Pages[3].TabVisible:=False;
cxPageControl1.Pages[4].TabVisible:=False;
end;
procedure TfrmOrderInPutAnPai.ZDYHelp(FButn:TcxButtonEdit;LType:string);
var
FType,ZDYName,FText:String;
begin
end;
procedure TfrmOrderInPutAnPai.FormShow(Sender: TObject);
begin
InitData();
end;
function TfrmOrderInPutAnPai.SaveData():Boolean;
var
maxno,maxsubno,maxJDNo,JDMainId,maxjfno,maxjcno:String;
begin
try
ADOCmd.Connection.BeginTrans;
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if Trim(FMainId)='' then
begin
if GetLSNo(ADOCmd,maxno,'JM','JYOrder_Main',3,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
Exit;
end;
end else
begin
maxno:=Trim(FMainId);
end;
with ADOCmd do
begin
Close;
sql.Clear;
SQL.Add('select * from JYOrder_Main where MainId='''+Trim(FMainId)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(FMainId)='' then
begin
Append;
end
else begin
Edit;
end;
FieldByName('MainId').Value:=Trim(maxno);
RTSetsavedata(ADOCmd,'JYOrder_Main',Panel1,2);
RTSetsavedata(ADOCmd,'JYOrder_Main',GroupBox3,2);
RTSetsavedata(ADOCmd,'JYOrder_Main',Panel3,2);
FieldByName('CJNote').Value:=Trim(CJNote.Text);
FieldByName('DHNote').Value:=Trim(DHNote.Text);
FieldByName('BZNote').Value:=Trim(BZNote.Text);
FieldByName('CHNote').Value:=Trim(CHNote.Text);
FieldByName('MPRTMFNote').Value:=Trim(MPRTMFNote.Text);
FieldByName('MPRTKZNote').Value:=Trim(MPRTKZNote.Text);
FieldByName('CustomerNo').Value:=Trim(CustomerNoName.TxtCode);
if Trim(FMainId)='' then
begin
FieldByName('Filler').Value:=Trim(DName);
end else
begin
FieldByName('Editer').Value:=Trim(DName);
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
end;
FieldByName('Note').Value:=Trim(Note.Text);
FieldByName('BZNote').Value:=Trim(BZNote.Text);
//FieldByName('ConSubId').Value:=Trim(ConSubId);
Post;
end;
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main where orderno='''+Trim(OrderNo.Text)+'''');
Open;
end;
if ADOTemp.RecordCount>1 then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD>!','<27><>ʾ',0);
Exit;
end;
///<2F><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>
with Order_Sub do
begin
First;
while not Eof do
begin
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
begin
if GetLSNo(ADOCmd,maxsubno,'JS','JYOrder_Sub',4,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
Exit;
end;
end else
begin
maxsubno:=Trim(Order_Sub.fieldbyname('SubId').AsString);
end;
with ADOCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from JYOrder_Sub where SubId='''+Trim(maxsubno)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
Append
else
Edit;
FieldByName('MainId').Value:=Trim(maxno);
FieldByName('SubId').Value:=Trim(maxsubno);
RTSetSaveDataCDS(ADOCmd,Tv1,Order_Sub,'JYOrder_Sub',0);
Post;
end;
Order_Sub.Edit;
Order_Sub.FieldByName('SubId').Value:=Trim(maxsubno);
//Order_Sub.Post;
Next;
end;
end;
///<2F><><EFBFBD>ñ<EFBFBD>
with ClientDataSet7 do
begin
First;
while not Eof do
begin
if Trim(ClientDataSet7.fieldbyname('JFId').AsString)='' then
begin
if GetLSNo(ADOCmd,maxjfno,'JF','JYOrder_Main_Fee',4,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
Exit;
end;
end else
begin
maxjfno:=Trim(ClientDataSet7.fieldbyname('JFId').AsString);
end;
with ADOCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from JYOrder_Main_Fee where JFId='''+Trim(maxjfno)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(ClientDataSet7.fieldbyname('JFId').AsString)='' then
begin
Append;
FieldByName('Filler').Value:=Trim(DName);
end
else
begin
Edit;
FieldByName('Editer').Value:=Trim(DName);
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
end;
FieldByName('MainId').Value:=Trim(maxno);
FieldByName('JFID').Value:=Trim(maxjfno);
//FieldByName('SubId').Value:=Trim(maxsubno);
RTSetSaveDataCDS(ADOCmd,Tv7,ClientDataSet7,'JYOrder_Main_Fee',0);
Post;
end;
ClientDataSet7.Edit;
ClientDataSet7.FieldByName('JFId').Value:=Trim(maxjfno);
//Order_Sub.Post;
Next;
end;
end;
///<2F>õ<EFBFBD><C3B5><EFBFBD>
with ClientDataSet8 do
begin
First;
while not Eof do
begin
if Trim(ClientDataSet8.fieldbyname('JCId').AsString)='' then
begin
if GetLSNo(ADOCmd,maxjcno,'JC','JYOrder_CD',4,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox(<>õ<EFBFBD><C3B5><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
Exit;
end;
end else
begin
maxjcno:=Trim(ClientDataSet8.fieldbyname('JCId').AsString);
end;
with ADOCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from JYOrder_CD where JCId='''+Trim(maxjcno)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(ClientDataSet8.fieldbyname('JCId').AsString)='' then
begin
Append;
//FieldByName('Filler').Value:=Trim(DName);
end
else
begin
Edit;
//FieldByName('Editer').Value:=Trim(DName);
//FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
end;
FieldByName('MainId').Value:=Trim(maxno);
FieldByName('JCId').Value:=Trim(maxjcno);
//FieldByName('SubId').Value:=Trim(maxsubno);
RTSetSaveDataCDS(ADOCmd,Tv8,ClientDataSet8,'JYOrder_CD',0);
Post;
end;
ClientDataSet8.Edit;
ClientDataSet8.FieldByName('JCId').Value:=Trim(maxjcno);
//Order_Sub.Post;
Next;
end;
end;
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̱<EFBFBD>
with CDS_JGLC do
begin
First;
while not Eof do
begin
if Trim(CDS_JGLC.fieldbyname('PSId').AsString)='' then
begin
if GetLSNo(ADOCmd,maxsubno,'PS','JYOrder_Process',4,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
Exit;
end;
end else
begin
maxsubno:=Trim(CDS_JGLC.fieldbyname('PSId').AsString);
end;
with ADOCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from JYOrder_Process where PSId='''+Trim(maxsubno)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(CDS_JGLC.fieldbyname('PSId').AsString)='' then
Append
else
Edit;
FieldByName('MainId').Value:=Trim(maxno);
FieldByName('PSId').Value:=Trim(maxsubno);
RTSetSaveDataCDS(ADOCmd,Tv2,CDS_JGLC,'JYOrder_Process',0);
Post;
end;
CDS_JGLC.Edit;
CDS_JGLC.FieldByName('PSId').Value:=Trim(maxsubno);
//Order_Sub.Post;
Next;
end;
end;
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrderJD_Main where OrderNo='''+Trim(OrderNo.Text)+'''');
Open;
end;
if ADOTemp.IsEmpty then
begin
JDMainId:='';
end else
begin
JDMainId:=Trim(ADOTemp.fieldbyname('MainId').AsString);
end;
if Trim(JDMainId)='' then
begin
if GetLSNo(ADOCmd,maxJDNo,'JD','JYOrderJD_Main',3,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
Exit;
end;
end else
begin
maxJDNo:=Trim(JDMainId);
end;
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main where OrderNo='''+Trim(OrderNo.Text)+'''');
Open;
end;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrderJD_Main where MainId='''+Trim(JDMainId)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(JDMainId)='' then
begin
Append;
FieldByName('Filler').Value:=ADOTemp.fieldbyname('Filler').Value;
FieldByName('Status').Value:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
end else
begin
Edit;
FieldByName('Editer').Value:=Trim(DName);
FieldByName('EditTime').Value:=SGetServerDateTime(ADOQuery1);
end;
FieldByName('MainId').Value:=Trim(maxJDNo);
FieldByName('orderno').Value:=ADOTemp.fieldbyname('orderno').Value;
FieldByName('LiDanPerson').Value:=ADOTemp.fieldbyname('LiDanPerson').Value;
FieldByName('CustomerNoName').Value:=ADOTemp.fieldbyname('CustomerNoName').Value;
FieldByName('CustomerNo').Value:=ADOTemp.fieldbyname('CustomerNo').Value;
FieldByName('MPRTCode').Value:=ADOTemp.fieldbyname('MPRTCode').Value;
FieldByName('MPRTCodeName').Value:=ADOTemp.fieldbyname('MPRTCodeName').Value;
FieldByName('MPRTSpec').Value:=ADOTemp.fieldbyname('MPRTSpec').Value;
FieldByName('MPRTCF').Value:=ADOTemp.fieldbyname('MPRTCF').Value;
FieldByName('MPRTMF').Value:=ADOTemp.fieldbyname('MPRTMF').Value;
FieldByName('MPRTKZ').Value:=ADOTemp.fieldbyname('MPRTKZ').Value;
FieldByName('ORDQty').Value:=Tv1.DataController.Summary.FooterSummaryTexts[0];
FieldByName('QtyUnit').Value:=Order_Sub.fieldbyname('OrderUnit').Value;
Post;
end;
ADOCmd.Connection.CommitTrans;
Result:=True;
FMainId:=Trim(maxno);
except
Result:=False;
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
end;
end;
function TfrmOrderInPutAnPai.SaveDataMain():Boolean;
var
maxno:String;
begin
try
ADOCmd.Connection.BeginTrans;
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
with ADOCmd do
begin
Close;
sql.Clear;
SQL.Add('select * from JYOrder_Main where MainId='''+Trim(FMainId)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(FMainId)='' then
begin
Append;
maxno:=Trim(FFMainId);
end
else begin
maxno:=Trim(FMainId);
Edit;
end;
FieldByName('MainId').Value:=Trim(maxno);
//SSetsaveSqlNew(ADOCmd,'JYOrder_Main',ScrollBox1,2);
if PState=1 then
begin
FieldByName('OrdUpDate').Value:=SGetServerDateTime(ADOTemp);
end;
if Trim(FMainId)='' then
begin
FieldByName('Filler').Value:=Trim(DName);
end else
begin
FieldByName('Editer').Value:=Trim(DName);
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
end;
Post;
end;
FMainId:=Trim(maxno);
ADOCmd.Connection.CommitTrans;
Result:=True;
except
Result:=False;
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
end;
end;
function TfrmOrderInPutAnPai.SaveDataSubOne():Boolean;
var
maxno:String;
begin
try
ADOCmd.Connection.BeginTrans;
///<2F><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>
with Order_Sub do
begin
//First;
//while not Eof do
begin
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
begin
if GetLSNo(ADOTemp,maxno,'JS','JYOrder_Sub',4,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
Exit;
end;
end else
begin
maxno:=Trim(Order_Sub.fieldbyname('SubId').AsString);
end;
with ADOCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from JYOrder_Sub where MainId='''+Trim(FMainId)+'''');
sql.Add(' and SubId='''+Trim(maxno)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
Append
else
Edit;
FieldByName('MainId').Value:=Trim(FMainId);
FieldByName('SubId').Value:=Trim(maxno);
RTSetSaveDataCDS(ADOCmd,Tv1,Order_Sub,'JYOrder_Sub',0);
Post;
end;
Order_Sub.Edit;
Order_Sub.FieldByName('SubId').Value:=Trim(maxno);
//Order_Sub.Post;
//Next;
end;
end;
ADOCmd.Connection.CommitTrans;
Result:=True;
except
Result:=False;
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><ECB3A3>','<27><>ʾ',0);
end;
end;
function TfrmOrderInPutAnPai.SaveDataSubMore():Boolean;
var
maxno:String;
begin
try
ADOCmd.Connection.BeginTrans;
///<2F><><EFBFBD><EFBFBD><EFBFBD>ӱ<EFBFBD>
with Order_Sub do
begin
First;
while not Eof do
begin
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
begin
if GetLSNo(ADOTemp,maxno,'JS','JYOrder_Sub',4,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
Exit;
end;
end else
begin
maxno:=Trim(Order_Sub.fieldbyname('SubId').AsString);
end;
with ADOCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from JYOrder_Sub where MainId='''+Trim(FMainId)+'''');
sql.Add(' and SubId='''+Trim(maxno)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(Order_Sub.fieldbyname('SubId').AsString)='' then
Append
else
Edit;
FieldByName('MainId').Value:=Trim(FMainId);
FieldByName('SubId').Value:=Trim(maxno);
RTSetSaveDataCDS(ADOCmd,Tv1,Order_Sub,'JYOrder_Sub',0);
Post;
end;
Order_Sub.Edit;
Order_Sub.FieldByName('SubId').Value:=Trim(maxno);
//Order_Sub.Post;
Next;
end;
end;
ADOCmd.Connection.CommitTrans;
Result:=True;
except
Result:=False;
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><ECB3A3>','<27><>ʾ',0);
end;
end;
procedure TfrmOrderInPutAnPai.TBSaveClick(Sender: TObject);
var
FReal:Double;
begin
ToolBar1.SetFocus;
if Trim(OrderNo.Text)='' then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
Exit;
end;
if Trim(MPRTMF.Text)<>'' then
begin
if TryStrToFloat(MPRTMF.Text,FReal)=False then
begin
Application.MessageBox('<27>ŷ<EFBFBD><C5B7>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
end;
if Trim(MPRTKZ.Text)<>'' then
begin
if TryStrToFloat(MPRTKZ.Text,FReal)=False then
begin
Application.MessageBox('<27><><EFBFBD>طǷ<D8B7><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
end;
if Trim(ClothOneQty.Text)<>'' then
begin
if TryStrToFloat(ClothOneQty.Text,FReal)=False then
begin
Application.MessageBox('ÿƥ<C3BF><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
end;
if Trim(MPRTOneQty.Text)<>'' then
begin
if TryStrToFloat(MPRTOneQty.Text,FReal)=False then
begin
Application.MessageBox('ÿƥ<C3BF><C6A5>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
end;
if ClientDataSet7.Locate('JFDate',Null,[])=True then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><DAB2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet7.Locate('JFName',Null,[])=True then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
if Order_Sub.Locate('PRTOrdQty',Null,[])=True then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
{if Trim(OrdDefStr1.Text)='' then
begin
Application.MessageBox('<27><>˾<EFBFBD><CBBE><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
Exit;
end; }
{if Order_Sub.Locate('PRTColor',null,[])=True then
begin
Application.MessageBox('<27><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
if Order_Sub.Locate('SOrddefstr4',null,[])=True then
begin
Application.MessageBox('Ӣ<><D3A2><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
if Order_Sub.Locate('SOrddefstr1',null,[])=True then
begin
Application.MessageBox('ɫ<>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;}
if Order_Sub.IsEmpty then
begin
Application.MessageBox('<27><>ϸ<EFBFBD><CFB8><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
if CDS_JGLC.IsEmpty=False then
begin
if CDS_JGLC.Locate('KgZM',null,[])=True then
begin
Application.MessageBox('ÿ<><C3BF><EFBFBD><EFBFBD>/<2F>ײ<EFBFBD><D7B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
end;
if CDS_JGLC.IsEmpty=False then
begin
if CDS_JGLC.Locate('PSName','<27><><EFBFBD><EFBFBD>',[])=False then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',0);
Exit;
end;
end;
{if PState=1 then
begin
if Trim(OrderNo.Text)<>Trim(FOrderNo) then
begin
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from YF_Money_CR where MainId='''+Trim(FMainId)+'''');
Open;
end;
if ADOTemp.IsEmpty=False then
begin
Application.MessageBox('<27>Ѳ<EFBFBD><D1B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>ܸ<EFBFBD><DCB8>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
end;
end; }
{ if Trim(ConSubId)='' then
begin
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>ͬ!','<27><>ʾ',0);
Exit;
end; }
if cxPageControl1.ActivePageIndex=2 then
begin
if CDS_JGC.Locate('PFID',null,[])=True then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣδȷ<CEB4><C8B7>!','<27><>ʾ',0);
Exit;
end;
end;
if SaveData() then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ',0);
end;
// if cxPageControl1.ActivePageIndex=2 then
begin
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.PRTHX,B.PRTColorNo,B.PRTOrdQty,B.OrderUnit from JYOrder_PCS_Sub A ');
sql.Add(' left join JYOrder_Sub B on A.SubId=B.SubId');
sql.Add('where A.PSID='''+Trim(CDS_JGLC.fieldbyname('PSID').AsString)+'''');
SQL.Add(' and isnull(A.CKName,'''')<>''<27><><EFBFBD>ڲֿ<DAB2>'' ');
Open;
end;
SCreateCDS20(ADOQuery1,CDS_JGC);
SInitCDSData20(ADOQuery1,CDS_JGC);
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.PRTHX,B.PRTColorNo,B.PRTOrdQty,B.OrderUnit from JYOrder_PCS_Sub A ');
sql.Add(' left join JYOrder_Sub B on A.SubId=B.SubId');
sql.Add('where A.PSID='''+Trim(CDS_JGLC.fieldbyname('PSID').AsString)+'''');
SQL.Add(' and isnull(A.CKName,'''')=''<27><><EFBFBD>ڲֿ<DAB2>'' ');
Open;
end;
SCreateCDS20(ADOQuery1,ClientDataSet5);
SInitCDSData20(ADOQuery1,ClientDataSet5);
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,C.OrderNo,D.C_Code,D.C_CodeName,B.ToFactoryName,B.RKQtyUnit from JYOrder_Main_MD_Out A ');
sql.Add(' inner join JYOrder_Main_MD B on A.MDId=B.MDId');
sql.Add(' inner join JYOrder_Main C on B.OrdMainId=C.MainId');
sql.Add(' inner join Contract_Sub D on B.ConSubId=D.SubId');
sql.Add('where A.PFID='''+Trim(ClientDataSet5.fieldbyname('PFID').AsString)+'''');
Open;
end;
SCreateCDS20(ADOQuery1,ClientDataSet6);
SInitCDSData20(ADOQuery1,ClientDataSet6);
end;
end;
procedure TfrmOrderInPutAnPai.v1PRTColorPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmZDYHelp:=TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag:='OrdColor';
flagname:='<27><>ɫ';
V1Name.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
V1Note.Caption:=<><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
MainType:=Trim(DName);
fnote:=True;
if ShowModal=1 then
begin
Self.Order_Sub.Edit;
Self.Order_Sub.FieldByName('PRTColor').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
Self.Order_Sub.FieldByName('PRTColorEng').Value:=Trim(ClientDataSet1.fieldbyname('Note').AsString);
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton1Click(Sender: TObject);
var
FReal:Double;
i,j,z:Integer;
jstr:string;
begin
ToolBar1.SetFocus;
if Trim(OrderNo.Text)='' then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
if CheckBox1.Checked then
begin
if Order_Sub.IsEmpty then
begin
j:=1;
end else
begin
z:=Pos('#',Trim(Order_Sub.fieldbyname('PRTColorNo').AsString));
jstr:=Copy(Trim(Order_Sub.fieldbyname('PRTColorNo').AsString),2,z-2);
if Trim(jstr)<>'' then
begin
if TryStrToFloat(jstr,FReal)=True then
begin
j:=StrToInt(jstr)+1;
end;
end else
begin
j:=1;
end;
end;
end;
CopyAddRow(Tv1,Order_Sub);
with Order_Sub do
begin
Edit;
//FieldByName('PRTColor').Value:='';
//FieldByName('PRTOrdQty').Value:=null;
//FieldByName('PRTColorNo').Value:=null;
//FieldByName('PRTColorEng').Value:=null;
//FieldByName('PRTHX').Value:=null;
FieldByName('SubId').Value:='';
if CheckBox1.Checked then
begin
FieldByName('PRTColorNo').Value:='C'+Trim(IntToStr(j))+'#';
end;
Post;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton2Click(Sender: TObject);
begin
if Order_Sub.IsEmpty then Exit;
{ with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from Contract_Cloth_LLMX where OrdSubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
Open;
end;
if ADOTemp.IsEmpty=False then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Sub_AnPai where SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
Open;
end;
if ADOTemp.IsEmpty=False then
begin
Application.MessageBox('<27>ѻزֲ<D8B2><D6B2><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end; }
if Trim(Order_Sub.fieldbyname('SubId').AsString)<>'' then
begin
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD where ORDSubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
Open;
end;
if ADOTemp.IsEmpty=false then
begin
Application.MessageBox('<27>Ѿ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EBB5A5><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('delete JYOrder_Sub where SubId='''+Trim(Order_Sub.fieldbyname('SubId').AsString)+'''');
ExecSQL;
end;
end;
Order_Sub.Delete;
{ if Order_Sub.IsEmpty then
begin
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('delete JYOrder_Main where MainId='''+Trim(FMainId)+'''');
ExecSQL;
end;
end; }
end;
procedure TfrmOrderInPutAnPai.RanFactoryBtnUpClick(Sender: TObject);
begin
{try
frmZDYHelp:=TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag:='RKPlace';
flagname:='Ⱦ<><C8BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
if ShowModal=1 then
begin
JGFactoryName.Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
JGFactoryName.TxtCode:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
end;
end;
finally
frmZDYHelp.Free;
end; }
end;
procedure TfrmOrderInPutAnPai.CustomerNoNameBtnDnClick(Sender: TObject);
begin
TBtnEditC(Sender).Text:='';
TBtnEditC(Sender).TxtCode:='';
end;
procedure TfrmOrderInPutAnPai.NoteDblClick(Sender: TObject);
begin
{try
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
with frmZDYHelpSel do
begin
flag:='OrdNote';
flagname:='<27><>ע<EFBFBD><D7A2>Ҫ<EFBFBD><D2AA>';
if ShowModal=1 then
begin
Note.Text:=Note.Text+frmZDYHelpSel.ReturnStr;
end;
end;
finally
frmZDYHelpSel.Free;
end;}
end;
procedure TfrmOrderInPutAnPai.v1OrderUnitPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmZDYHelp:=TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag:='OrderUnit';
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ';
if ShowModal=1 then
begin
Self.Order_Sub.Edit;
Self.Order_Sub.FieldByName('OrderUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmOrderInPutAnPai.v1PriceUnitPropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmZDYHelp:=TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag:='PriceUnit';
flagname:='<27>۸<EFBFBD><DBB8><EFBFBD>λ';
if Trim(DParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
begin
TBAdd.Visible:=False;
TBEdit.Visible:=False;
TBDel.Visible:=False;
end;
if ShowModal=1 then
begin
Self.Order_Sub.Edit;
Self.Order_Sub.FieldByName('PriceUnit').Value:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmOrderInPutAnPai.OrdDefStr2BtnUpClick(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 Trim(flag)='OrdDefStr2' then
begin
//flag:='OrdDefStr2';
V1Name.Caption:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
V1Note.Caption:=<><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
fnote:=True;
end;
if ShowModal=1 then
begin
TEdit(Sender).Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
if Trim(flag)='MPRTCode' then
begin
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select Top 1 * from JYOrder_Main where MPRTCode='''+Trim(ClientDataSet1.fieldbyname('ZDYName').AsString)+'''');
sql.Add(' order by FillTime desc');
Open;
end;
MPRTCodeName.Text:=ADOTemp.fieldbyname('MPRTCodeName').Value;
MPRTMF.Text:=ADOTemp.fieldbyname('MPRTMF').Value;
MPRTKZ.Text:=ADOTemp.fieldbyname('MPRTKZ').Value;
MPRTSpec.Text:=ADOTemp.fieldbyname('MPRTSpec').Value;
end;
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton3Click(Sender: TObject);
begin
if Order_Sub.IsEmpty then Exit;
ToolBar1.SetFocus;
OneKeyPost(Tv1,Order_Sub);
end;
procedure TfrmOrderInPutAnPai.YCLFactoryBtnUpClick(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);
MainType:=TEdit(Sender).Name;
if ShowModal=1 then
begin
TEdit(Sender).Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmOrderInPutAnPai.MPRTSCTeBieNoteBtnUpClick(Sender: TObject);
var
fsj:string;
FWZ:Integer;
begin
fsj:=Trim(TEdit(Sender).Hint);
FWZ:=Pos('/',fsj);
try
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
with frmZDYHelpSel do
begin
flag:=Copy(fsj,1,FWZ-1);
flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz);
if ShowModal=1 then
begin
TEdit(Sender).Text:=ReturnStr;
end;
end;
finally
frmZDYHelpSel.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton6Click(Sender: TObject);
var
Fint:Integer;
FReal,FMF,FKZ:Double;
begin
{if Trim(FMainId)='' then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣδ<CFA2><CEB4><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end; }
Fint:=CDS_JGLC.RecordCount;
try
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
with frmZDYHelpSel do
begin
flag:='JGGX';
flagname:='<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD><EFBFBD>';
if ShowModal=1 then
begin
with ClientDataSet1 do
begin
First;
while not eof do
begin
if ClientDataSet1.FieldByName('SSel').AsBoolean=True then
begin
with CDS_JGLC do
begin
Append;
FieldByName('PSXH').Value:=Fint+1;
FieldByName('PSName').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
if Trim(MPRTMF.Text)<>'' then
begin
if TryStrToFloat(MPRTMF.Text,FReal)=True then
begin
FieldByName('MFQty').Value:=MPRTMF.Text;
FMF:=StrToFloat(MPRTMF.Text);
end else
begin
FMF:=0;
end;
end else
begin
FMF:=0;
end;
if Trim(MPRTKZ.Text)<>'' then
begin
if TryStrToFloat(MPRTKZ.Text,FReal)=True then
begin
FieldByName('KZQty').Value:=MPRTKZ.Text;
FKZ:=StrToFloat(MPRTKZ.Text);
end else
begin
FKZ:=0;
end;
end else
begin
FKZ:=0;
end;
if FMF*FKZ<>0 then
begin
FieldByName('KgZM').Value:=100000*1.0000/(FMF*FKZ);
end else
begin
FieldByName('KgZM').Value:=0;
end;
Fint:=Fint+1;
Post;
end;
end;
Next;
end;
end;
end;
end;
finally
frmZDYHelpSel.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton4Click(Sender: TObject);
begin
if CDS_JGLC.IsEmpty then
begin
Application.MessageBox('<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
if Trim(CDS_JGLC.fieldbyname('PSID').AsString)='' then
begin
Application.MessageBox('<27><>Ϣδ<CFA2><CEB4><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
try
frmGYSList:=TfrmGYSList.Create(Application);
with frmGYSList do
begin
if ShowModal=1 then
begin
with CDS_JGC do
begin
Append;
FieldByName('FactoryNo').Value:=Trim(frmGYSList.Order_Main.fieldbyname('ZKID').AsString) ;
FieldByName('FactoryName').Value:=Trim(frmGYSList.Order_Main.fieldbyname('KHNameJC').AsString);
FieldByName('PFTPUnit').Value:=Trim(OneQtyUnit.Text);
Post;
end;
end;
end;
finally
frmGYSList.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton8Click(Sender: TObject);
var
maxno:string;
begin
{if Trim(CDS_JGLC.fieldbyname('PSID').AsString)='' then
begin
Application.MessageBox('<27><>Ϣδ<CFA2><CEB4><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;}
if CDS_JGC.IsEmpty then Exit;
ToolBar1.SetFocus;
try
ADOCmd.Connection.BeginTrans;
CDS_JGC.DisableControls;
with CDS_JGC do
begin
First;
while not Eof do
begin
if Trim(CDS_JGC.fieldbyname('PFID').AsString)='' then
begin
if GetLSNo(ADOCmd,maxno,'PF','JYOrder_PCS_Sub',3,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
CDS_JGC.EnableControls;
Application.MessageBox(<><C8A1><EFBFBD>̼ӹ<CCBC><D3B9><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
Exit;
end;
end else
begin
maxno:=Trim(CDS_JGC.fieldbyname('PFID').AsString);
end;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_PCS_Sub where PFID='''+Trim(CDS_JGC.fieldbyname('PFID').AsString)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(CDS_JGC.fieldbyname('PFID').AsString)='' then
begin
Append;
end else
begin
Edit;
end;
FieldByName('MainID').Value:=Trim(FMainId);
FieldByName('PSID').Value:=Trim(CDS_JGLC.fieldbyname('PSID').AsString);
FieldByName('SubID').Value:=Trim(CDS_JGC.fieldbyname('SubID').AsString);
FieldByName('PFID').Value:=Trim(maxno);
FieldByName('FactoryNo').Value:=Trim(CDS_JGC.fieldbyname('FactoryNo').AsString);
FieldByName('FactoryName').Value:=Trim(CDS_JGC.fieldbyname('FactoryName').AsString);
FieldByName('PFDlyDate').Value:=CDS_JGC.fieldbyname('PFDlyDate').Value;
RTSetSaveDataCDS(ADOCmd,Tv3,CDS_JGC,'JYOrder_PCS_Sub',0);
Post;
end;
if Trim(CDS_JGC.fieldbyname('PFTPUnit').AsString)<>'M' then
begin
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('Update JYOrder_PCS_Sub Set PFTPMQty=PFTPQty*');
sql.Add('(select KgZM from JYOrder_Process A where A.PSID=JYOrder_PCS_Sub.PSID)');
sql.Add(' where PFID='''+Trim(maxno)+'''');
ExecSQL;
end;
end else
begin
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('Update JYOrder_PCS_Sub Set PFTPMQty=PFTPQty');
sql.Add(' where PFID='''+Trim(maxno)+'''');
ExecSQL;
end;
end;
Next;
end;
end;
ADOCmd.Connection.CommitTrans;
CDS_JGC.EnableControls;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!','<27><>ʾ',0);
Exit;
except
ADOCmd.Connection.RollbackTrans;
CDS_JGC.EnableControls;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!','<27><>ʾ',0);
Exit;
end;
end;
procedure TfrmOrderInPutAnPai.cxGridDBColumn6PropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
var
fsj:string;
begin
{try
frmZDYHelp:=TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag:='PSNote';
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>';
if ShowModal=1 then
begin
with CDS_JGLC do
begin
Edit;
FieldByName('PSNote').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
//Post;
end;
end;
end;
finally
frmZDYHelp.Free;
end; }
fsj:=Trim(CDS_JGLC.fieldbyname('PSNote').AsString);
try
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
with frmZDYHelpSel do
begin
flag:='PSNote';
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>';
MainType:=Trim(CDS_JGLC.fieldbyname('PSName').AsString);
if ShowModal=1 then
begin
with ClientDataSet1 do
begin
First;
while not Eof do
begin
if ClientDataSet1.FieldByName('SSel').AsBoolean=True then
begin
fsj:=fsj+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
Next;
end;
end;
with CDS_JGLC do
begin
Edit;
FieldByName('PSNote').Value:=Trim(fsj);
//Post;
end;
end;
end;
finally
frmZDYHelpSel.Free;
end;
end;
procedure TfrmOrderInPutAnPai.CustomerNoNameBtnClick(Sender: TObject);
begin
try
frmZHKHListNewCX:=TfrmZHKHListNewCX.Create(Application);
with frmZHKHListNewCX do
begin
if ShowModal=1 then
begin
CustomerNoName.Text:=Trim(frmZHKHListNewCX.Order_Main.fieldbyname('KHNameJC').AsString);
CustomerNoName.TxtCode:=Trim(frmZHKHListNewCX.Order_Main.fieldbyname('ZKID').AsString);
end;
end;
finally
frmZHKHListNewCX.Free;
end;
end;
procedure TfrmOrderInPutAnPai.MPRTCodeBtnClick(Sender: TObject);
var
fsj:string;
begin
try
frmCPManageTPCX:=TfrmCPManageTPCX.Create(Application);
with frmCPManageTPCX do
begin
if ShowModal=1 then
begin
MPRTCode.Text:=Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYNO').AsString);
MPRTCodeName.Text:=Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYName').AsString);
MPRTSpec.Text:=Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYSpec').AsString);
MPRTCF.Text:=Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYCF').AsString);
MPRTMF.Text:=Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYMF').AsString);
MPRTKZ.Text:=Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYKZ').AsString);
MPRTGY.Text:=Trim(frmCPManageTPCX.CDS_Main.fieldbyname('GYStr').AsString);
if Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYHX').AsString)<>'' then
begin
fsj:=Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYHX').AsString);
end else
begin
fsj:='';
end;
if Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYHX2').AsString)<>'' then
begin
if Trim(Fsj)<>'' then
begin
fsj:=fsj+'+'+Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYHX2').AsString);
end else
begin
fsj:=Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYHX2').AsString);
end;
end;
if Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYHX3').AsString)<>'' then
begin
if Trim(Fsj)<>'' then
begin
fsj:=fsj+'+'+Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYHX3').AsString);
end else
begin
fsj:=Trim(frmCPManageTPCX.CDS_Main.fieldbyname('CYHX3').AsString);
end;
end;
MPRTGYHZ.Text:=Trim(fsj);
end;
end;
finally
frmCPManageTPCX.Free;
end;
if Trim(MPRTMF.Text)<>'' then
begin
MPRTMF.Text:=Copy(Trim(MPRTMF.Text),1,Pos('c',Trim(MPRTMF.Text))-1);
end;
if Trim(MPRTKZ.Text)<>'' then
begin
MPRTKZ.Text:=Copy(Trim(MPRTKZ.Text),1,Pos('g',Trim(MPRTKZ.Text))-1);
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton7Click(Sender: TObject);
begin
if CDS_JGC.IsEmpty=False then
begin
Application.MessageBox('<27>Ѳ<EFBFBD><D1B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if Trim(CDS_JGLC.fieldbyname('PSId').AsString)<>'' then
begin
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('delete JYOrder_Process where PSId='''+Trim(CDS_JGLC.fieldbyname('PSId').AsString)+'''');
ExecSQL;
end;
end;
CDS_JGLC.Delete;
end;
procedure TfrmOrderInPutAnPai.Tv2CellClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
begin
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.PRTHX,B.PRTColorNo,B.PRTOrdQty,B.OrderUnit from JYOrder_PCS_Sub A ');
sql.Add(' left join JYOrder_Sub B on A.SubId=B.SubId');
sql.Add('where A.PSID='''+Trim(CDS_JGLC.fieldbyname('PSID').AsString)+'''');
SQL.Add(' and isnull(A.CKName,'''')<>''<27><><EFBFBD>ڲֿ<DAB2>'' ');
Open;
end;
SCreateCDS20(ADOQuery1,CDS_JGC);
SInitCDSData20(ADOQuery1,CDS_JGC);
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.PRTHX,B.PRTColorNo,B.PRTOrdQty,B.OrderUnit from JYOrder_PCS_Sub A ');
sql.Add(' left join JYOrder_Sub B on A.SubId=B.SubId');
sql.Add('where A.PSID='''+Trim(CDS_JGLC.fieldbyname('PSID').AsString)+'''');
SQL.Add(' and isnull(A.CKName,'''')=''<27><><EFBFBD>ڲֿ<DAB2>'' ');
Open;
end;
SCreateCDS20(ADOQuery1,ClientDataSet5);
SInitCDSData20(ADOQuery1,ClientDataSet5);
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,C.OrderNo,D.C_Code,D.C_CodeName,B.ToFactoryName,B.RKQtyUnit from JYOrder_Main_MD_Out A ');
sql.Add(' inner join JYOrder_Main_MD B on A.MDId=B.MDId');
sql.Add(' inner join JYOrder_Main C on B.OrdMainId=C.MainId');
sql.Add(' inner join Contract_Sub D on B.ConSubId=D.SubId');
sql.Add('where A.PFID='''+Trim(ClientDataSet5.fieldbyname('PFID').AsString)+'''');
Open;
end;
SCreateCDS20(ADOQuery1,ClientDataSet6);
SInitCDSData20(ADOQuery1,ClientDataSet6);
end;
procedure TfrmOrderInPutAnPai.ToolButton10Click(Sender: TObject);
var
i:Integer;
FName:String;
begin
if CDS_JGLC.IsEmpty then
begin
Application.MessageBox('<27>ӹ<EFBFBD><D3B9><EFBFBD><EFBFBD>̲<EFBFBD><CCB2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
if Trim(CDS_JGLC.fieldbyname('PSID').AsString)='' then
begin
Application.MessageBox('<27><>Ϣδ<CFA2><CEB4><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if CDS_JGC.IsEmpty then
begin
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.PRTHX,B.PRTColorNo,B.PRTOrdQty,B.OrderUnit from JYOrder_PCS_Sub A ');
sql.Add(' left join JYOrder_Sub B on A.SubId=B.SubId');
sql.Add('where A.PSID='''+Trim(CDS_JGLC.fieldbyname('PSID').AsString)+'''');
SQL.Add(' and isnull(A.CKName,'''')<>''<27><><EFBFBD>ڲֿ<DAB2>'' ');
Open;
end;
SCreateCDS20(ADOQuery1,CDS_JGC);
SInitCDSData20(ADOQuery1,CDS_JGC);
end;
try
frmOrderSubSel:=TfrmOrderSubSel.Create(Application);
with frmOrderSubSel do
begin
FFFMainId:=Trim(Self.FMainId);
if ShowModal=1 then
begin
ClientDataSet1.DisableControls;
with frmOrderSubSel.ClientDataSet1 do
begin
First;
while not Eof do
begin
Self.CDS_JGC.Append;
Self.CDS_JGC.FieldByName('SubId').Value:=frmOrderSubSel.ClientDataSet1.FieldByName('SubId').Value;
for i:=0 to frmOrderSubSel.Tv3.ColumnCount-1 do
begin
FName:=frmOrderSubSel.Tv3.Columns[i].DataBinding.FilterFieldName;
Self.CDS_JGC.FieldByName(FName).Value:=frmOrderSubSel.ClientDataSet1.FieldByName(FName).Value;
end;
Self.CDS_JGC.FieldByName('FactoryNo').Value:=frmOrderSubSel.ClientDataSet1.FieldByName('FactoryNo').Value;
Self.CDS_JGC.Post;
Next;
end;
end;
ClientDataSet1.EnableControls;
end;
end;
finally
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton11Click(Sender: TObject);
begin
if CDS_JGC.IsEmpty then Exit;
ToolBar1.SetFocus;
OneKeyPost(Tv3,CDS_JGC);
end;
procedure TfrmOrderInPutAnPai.cxGridDBColumn3PropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
begin
try
frmGYSList:=TfrmGYSList.Create(Application);
with frmGYSList do
begin
if ShowModal=1 then
begin
with CDS_JGC do
begin
edit;
FieldByName('FactoryNo').Value:=Trim(frmGYSList.Order_Main.fieldbyname('ZKID').AsString) ;
FieldByName('FactoryName').Value:=Trim(frmGYSList.Order_Main.fieldbyname('KHNameJC').AsString);
//Post;
end;
end;
end;
finally
frmGYSList.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton5Click(Sender: TObject);
begin
if CDS_JGC.IsEmpty then Exit;
if Trim(CDS_JGC.fieldbyname('PFId').AsString)<>'' then
begin
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD where PFId='''+Trim(CDS_JGC.fieldbyname('PFId').AsString)+'''');
Open;
end;
if ADOTemp.IsEmpty=false then
begin
Application.MessageBox('<27>Ѿ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EBB5A5><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('delete JYOrder_PCS_Sub where PFId='''+Trim(CDS_JGC.fieldbyname('PFId').AsString)+'''');
ExecSQL;
end;
end;
CDS_JGC.Delete;
end;
procedure TfrmOrderInPutAnPai.v2Column2PropertiesEditValueChanged(
Sender: TObject);
var
mvalue,FName,FMF,FKZ:string;
begin
mvalue:=TcxTextEdit(Sender).EditingText;
if Trim(mvalue)='' then
begin
mvalue:='0';
end;
FName:=Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
with CDS_JGLC do
begin
Edit;
FieldByName(FName).Value:=Trim(mvalue);
Post;
end;
FMF:=Trim(CDS_JGLC.fieldbyname('MFQty').AsString);
FKZ:=Trim(CDS_JGLC.fieldbyname('KZQty').AsString);
if Trim(FMF)='' then Exit;
if Trim(FKZ)='' then Exit;
if StrToFloat(FMF)=0 then Exit;
if StrToFloat(FKZ)=0 then Exit;
with CDS_JGLC do
begin
Edit;
FieldByName('KgZM').Value:=100000*1.0000/(StrToFloat(FMF)*StrToFloat(FKZ));
Post;
end;
end;
procedure TfrmOrderInPutAnPai.BZNoteDblClick(Sender: TObject);
begin
try
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
with frmZDYHelpSel do
begin
flag:='BZNote';
flagname:='<27><>װҪ<D7B0><D2AA>';
frmZDYHelpSel.Align:=alClient;
if ShowModal=1 then
begin
with ClientDataSet1 do
begin
First;
while not Eof do
begin
if FieldByName('SSel').AsBoolean=True then
begin
if Trim(BZNote.Text)='' then
BZNote.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)
else
BZNote.Text:=BZNote.Text+#13+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
Next;
end;
end;
//JiaoHuoNote.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
end;
finally
frmZDYHelpSel.Free;
end;
end;
procedure TfrmOrderInPutAnPai.CHNoteDblClick(Sender: TObject);
begin
try
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
with frmZDYHelpSel do
begin
flag:='CHNote';
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>װ';
frmZDYHelpSel.Align:=alClient;
if ShowModal=1 then
begin
with ClientDataSet1 do
begin
First;
while not Eof do
begin
if FieldByName('SSel').AsBoolean=True then
begin
if Trim(CHNote.Text)='' then
CHNote.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)
else
CHNote.Text:=CHNote.Text+#13+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
Next;
end;
end;
//JiaoHuoNote.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
end;
finally
frmZDYHelpSel.Free;
end;
end;
procedure TfrmOrderInPutAnPai.DHNoteDblClick(Sender: TObject);
begin
try
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
with frmZDYHelpSel do
begin
flag:='DHNote';
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
frmZDYHelpSel.Align:=alClient;
if ShowModal=1 then
begin
with ClientDataSet1 do
begin
First;
while not Eof do
begin
if FieldByName('SSel').AsBoolean=True then
begin
if Trim(DHNote.Text)='' then
DHNote.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)
else
DHNote.Text:=DHNote.Text+#13+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
Next;
end;
end;
end;
end;
finally
frmZDYHelpSel.Free;
end;
end;
procedure TfrmOrderInPutAnPai.CJNoteDblClick(Sender: TObject);
begin
try
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
with frmZDYHelpSel do
begin
flag:='CJNote';
flagname:='<27><><EFBFBD><EFBFBD>';
frmZDYHelpSel.Align:=alClient;
if ShowModal=1 then
begin
with ClientDataSet1 do
begin
First;
while not Eof do
begin
if FieldByName('SSel').AsBoolean=True then
begin
if Trim(CJNote.Text)='' then
CJNote.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)
else
CJNote.Text:=CJNote.Text+#13+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
Next;
end;
end;
end;
end;
finally
frmZDYHelpSel.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton12Click(Sender: TObject);
begin
if CDS_JGLC.IsEmpty then Exit;
try
frmTJCKKC:=TfrmTJCKKC.Create(Application);
with frmTJCKKC do
begin
if ShowModal=1 then
begin
with frmTJCKKC.Order_Sub do
begin
Locate('SSel',True,[]);
with Self.ClientDataSet5 do
begin
Append;
FieldByName('FactoryName').Value:=frmTJCKKC.Order_Sub.fieldbyname('ToFactoryName').Value;
FieldByName('FactoryNo').Value:=frmTJCKKC.Order_Sub.fieldbyname('ToFactoryNo').Value;
FieldByName('PFTPUnit').Value:=frmTJCKKC.Order_Sub.fieldbyname('RKQtyUnit').Value;
Post;
end;
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,C.OrderNo,D.C_Code,D.C_CodeName,B.ToFactoryName,B.RKQtyUnit from JYOrder_Main_MD_Out A ');
sql.Add(' inner join JYOrder_Main_MD B on A.MDId=B.MDId');
sql.Add(' inner join JYOrder_Main C on B.OrdMainId=C.MainId');
sql.Add(' inner join Contract_Sub D on B.ConSubId=D.SubId');
sql.Add('where A.PFID='''+Trim(ClientDataSet5.fieldbyname('PFID').AsString)+'''');
Open;
end;
SCreateCDS20(ADOQuery1,ClientDataSet6);
SInitCDSData20(ADOQuery1,ClientDataSet6);
while Locate('SSel',True,[])=True do
begin
with Self.ClientDataSet6 do
begin
Append;
FieldByName('OrderNo').Value:=frmTJCKKC.Order_Sub.fieldbyname('OrderNo').Value;
FieldByName('C_Code').Value:=frmTJCKKC.Order_Sub.fieldbyname('C_Code').Value;
FieldByName('C_CodeName').Value:=frmTJCKKC.Order_Sub.fieldbyname('C_CodeName').Value;
FieldByName('ToFactoryName').Value:=frmTJCKKC.Order_Sub.fieldbyname('ToFactoryName').Value;
//FieldByName('ToFactoryNo').Value:=frmTJCKKC.Order_Sub.fieldbyname('ToFactoryNo').Value;
FieldByName('CKQtyUnit').Value:=frmTJCKKC.Order_Sub.fieldbyname('RKQtyUnit').Value;
FieldByName('CKPS').Value:=frmTJCKKC.Order_Sub.fieldbyname('JSKCPS').Value;
FieldByName('CKQty').Value:=frmTJCKKC.Order_Sub.fieldbyname('JSKCQty').Value;
FieldByName('MDID').Value:=frmTJCKKC.Order_Sub.fieldbyname('MDID').Value;
Post;
end;
Edit;
FieldByName('SSel').Value:=False;
Post;
end;
end;
end;
end;
finally
frmTJCKKC.Free;
end;
if ClientDataSet6.IsEmpty=False then
begin
with Self.ClientDataSet5 do
begin
Edit;
FieldByName('PFTPPS').Value:=Tv6.DataController.Summary.FooterSummaryTexts[0];
FieldByName('PFTPQty').Value:=Tv6.DataController.Summary.FooterSummaryTexts[1];
Post;
end;
end;
end;
procedure TfrmOrderInPutAnPai.Tv5CellClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
var
PFID,FPFID,Fsj:String;
begin
if Trim(CanShu1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
begin
if Trim(ClientDataSet5.fieldbyname('PFID').AsString)<>'' then
begin
Tv5.OptionsSelection.CellSelect:=False;
end else
begin
Tv5.OptionsSelection.CellSelect:=True;
end;
end;
if ClientDataSet5.IsEmpty=False then
begin
PFID:=Trim(ClientDataSet5.fieldbyname('PFID').AsString);
end else
begin
PFID:='';
end;
if Trim(PFID)='' then Exit;
if Trim(PFID)<>'' then
begin
{Fsj:='';
if Trim(PFID)='' then
begin
ClientDataSet6.DisableControls;
with ClientDataSet6 do
begin
First;
while not eof do
begin
if Trim(fieldbyname('PFID').AsString)<>Trim(PFID) then
begin
fsj:='99';
ClientDataSet6.Last;
end;
Next;
end;
end;
ClientDataSet6.EnableControls;
end else
begin
ClientDataSet6.DisableControls;
with ClientDataSet6 do
begin
First;
while not eof do
begin
if Trim(fieldbyname('PFID').AsString)<>Trim(PFID) then
begin
if Trim(fieldbyname('PFID').AsString)<>'' then
begin
fsj:='99';
ClientDataSet6.Last;
end;
end;
Next;
end;
end;
ClientDataSet6.EnableControls;
end;
if Trim(fsj)<>'99' then Exit; }
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,C.OrderNo,D.C_Code,D.C_CodeName,B.ToFactoryName,B.RKQtyUnit from JYOrder_Main_MD_Out A ');
sql.Add(' inner join JYOrder_Main_MD B on A.MDId=B.MDId');
sql.Add(' inner join JYOrder_Main C on B.OrdMainId=C.MainId');
sql.Add(' inner join Contract_Sub D on B.ConSubId=D.SubId');
sql.Add('where A.PFID='''+Trim(ClientDataSet5.fieldbyname('PFID').AsString)+'''');
Open;
end;
SCreateCDS20(ADOQuery1,ClientDataSet6);
SInitCDSData20(ADOQuery1,ClientDataSet6);
end;
end;
procedure TfrmOrderInPutAnPai.cxGridDBColumn1PropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
begin
try
frmGYSList:=TfrmGYSList.Create(Application);
with frmGYSList do
begin
if ShowModal=1 then
begin
with ClientDataSet5 do
begin
edit;
FieldByName('FactoryNo').Value:=Trim(frmGYSList.Order_Main.fieldbyname('ZKID').AsString) ;
FieldByName('FactoryName').Value:=Trim(frmGYSList.Order_Main.fieldbyname('KHNameJC').AsString);
//Post;
end;
end;
end;
finally
frmGYSList.Free;
end;
end;
procedure TfrmOrderInPutAnPai.cxGridDBColumn15PropertiesEditValueChanged(
Sender: TObject);
var
mvalue,FName:string;
begin
mvalue:=TcxTextEdit(Sender).EditingText;
if Trim(mvalue)='' then
begin
mvalue:='0';
end;
FName:=Trim(Tv6.Controller.FocusedColumn.DataBinding.FilterFieldName);
with ClientDataSet6 do
begin
Edit;
FieldByName(FName).Value:=mvalue;
Post;
end;
if ClientDataSet6.IsEmpty=False then
begin
with Self.ClientDataSet5 do
begin
Edit;
FieldByName('PFTPPS').Value:=Tv6.DataController.Summary.FooterSummaryTexts[0];
FieldByName('PFTPQty').Value:=Tv6.DataController.Summary.FooterSummaryTexts[1];
Post;
end;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton9Click(Sender: TObject);
var
maxno,maxsubno:string;
begin
if ClientDataSet5.IsEmpty then Exit;
if ClientDataSet6.IsEmpty then Exit;
ToolBar1.SetFocus;
if Trim(CDS_JGLC.FieldByName('PSName').AsString)<>'<27><><EFBFBD><EFBFBD>' then
begin
if ClientDataSet5.Locate('SubId',Null,[])=True then
begin
Application.MessageBox(<><C3BB>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>ɫ!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet5.Locate('SubId','',[])=True then
begin
Application.MessageBox(<><C3BB>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD>ɫ!','<27><>ʾ',0);
Exit;
end;
end;
if Trim(CanShu1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
begin
if Application.MessageBox(<><C8B7>Ҫִ<D2AA>д˲<D0B4><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD>д˲<D0B4><CBB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD><EFBFBD><EFBFBD>ܳ<EFBFBD><DCB3><EFBFBD>!','',32+4)<>IDYES then Exit;
end else
begin
if Application.MessageBox(<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','',32+4)<>IDYES then Exit;
end;
try
ADOCmd.Connection.BeginTrans;
if Trim(ClientDataSet5.fieldbyname('PFID').AsString)='' then
begin
if GetLSNo(ADOCmd,maxno,'PF','JYOrder_PCS_Sub',3,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD>̼ӹ<CCBC><D3B9><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
Exit;
end;
end else
begin
maxno:=Trim(ClientDataSet5.fieldbyname('PFID').AsString);
end;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_PCS_Sub where PFID='''+Trim(ClientDataSet5.fieldbyname('PFID').AsString)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(ClientDataSet5.fieldbyname('PFID').AsString)='' then
begin
Append;
FieldByName('Filler').Value:=Trim(DName);
end else
begin
Edit;
FieldByName('Editer').Value:=Trim(DName);
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
end;
FieldByName('MainID').Value:=Trim(FMainId);
FieldByName('PSID').Value:=Trim(CDS_JGLC.fieldbyname('PSID').AsString);
FieldByName('PFID').Value:=Trim(maxno);
FieldByName('FactoryNo').Value:=Trim(ClientDataSet5.fieldbyname('FactoryNo').AsString);
FieldByName('FactoryName').Value:=Trim(ClientDataSet5.fieldbyname('FactoryName').AsString);
FieldByName('PFDlyDate').Value:=ClientDataSet5.fieldbyname('PFDlyDate').Value;
FieldByName('SubId').Value:=ClientDataSet5.fieldbyname('SubId').Value;
RTSetSaveDataCDS(ADOCmd,Tv5,ClientDataSet5,'JYOrder_PCS_Sub',0);
FieldByName('CKName').Value:='<27><><EFBFBD>ڲֿ<DAB2>';
Post;
end;
if Trim(ClientDataSet5.fieldbyname('PFTPUnit').AsString)<>'M' then
begin
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('Update JYOrder_PCS_Sub Set PFTPMQty=PFTPQty*');
sql.Add('(select KgZM from JYOrder_Process A where A.PSID=JYOrder_PCS_Sub.PSID)');
sql.Add(' where PFID='''+Trim(maxno)+'''');
ExecSQL;
end;
end else
begin
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('Update JYOrder_PCS_Sub Set PFTPMQty=PFTPQty');
sql.Add(' where PFID='''+Trim(maxno)+'''');
ExecSQL;
end;
end;
with ClientDataSet5 do
begin
Edit;
FieldByName('PFID').Value:=Trim(maxno);
Post;
end;
with ClientDataSet6 do
begin
First;
while not Eof do
begin
if Trim(ClientDataSet6.fieldbyname('CKID').AsString)='' then
begin
if GetLSNo(ADOCmd,maxsubno,'CK','JYOrder_Main_MD_Out',3,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox(<><EFBFBD><EBB5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
Exit;
end;
end else
begin
maxsubno:=Trim(ClientDataSet6.fieldbyname('CKID').AsString);
end;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD_Out where CKID='''+Trim(ClientDataSet6.fieldbyname('CKID').AsString)+'''');
Open;
end;
with ADOCmd do
begin
if Trim(ClientDataSet6.fieldbyname('CKID').AsString)='' then
begin
Append;
FieldByName('Filler').Value:=Trim(DName);
end else
begin
Edit;
FieldByName('Editer').Value:=Trim(DName);
FieldByName('EditTime').Value:=SGetServerDateTime(ADOQuery1);
end;
FieldByName('CKID').Value:=Trim(maxsubno);
FieldByName('PFID').Value:=Trim(maxno);
FieldByName('MDID').Value:=Trim(ClientDataSet6.fieldbyname('MDID').AsString);
RTSetSaveDataCDS(ADOCmd,Tv6,ClientDataSet6,'JYOrder_Main_MD_Out',2);
Post;
end;
{with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('Update JYOrder_Main_MD Set CKPS=');
sql.Add('(select isnull(sum(CKPS),0) from JYOrder_Main_MD_Out A where A.MDID=JYOrder_Main_MD.MDID) ');
sql.Add(',CKQty=(select isnull(sum(CKQty),0) from JYOrder_Main_MD_Out A where A.MDID=JYOrder_Main_MD.MDID) ');
sql.Add(' where MDID='''+Trim(ClientDataSet6.fieldbyname('MDID').AsString)+'''');
ExecSQL;
end; }
Edit;
FieldByName('PFID').Value:=Trim(maxno);
FieldByName('CKID').Value:=Trim(maxsubno);
Post;
Next;
end;
end;
ADOCmd.Connection.CommitTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!','<27><>ʾ',0);
Exit;
except
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!','<27><>ʾ',0);
Exit;
end;
end;
procedure TfrmOrderInPutAnPai.FormCreate(Sender: TObject);
begin
{CanShu1:=Trim(DParameters1);
CanShu2:=Trim(DParameters2);
if Trim(CanShu2)='<27>ֿ<EFBFBD>' then
begin
TBSave.Visible:=false;
ToolBar2.Visible:=False;
ToolBar3.Visible:=False;
ToolBar4.Visible:=False;
end; }
end;
procedure TfrmOrderInPutAnPai.Tv6CellClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
begin
if Trim(CanShu1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
begin
if Trim(ClientDataSet6.fieldbyname('CKID').AsString)<>'' then
begin
Tv6.OptionsSelection.CellSelect:=False;
end;
end;
end;
procedure TfrmOrderInPutAnPai.Tv5CellDblClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
begin
if ClientDataSet5.IsEmpty then Exit;
if Trim(ClientDataSet5.fieldbyname('PFID').AsString)='' then
begin
ClientDataSet5.Delete;
end;
end;
procedure TfrmOrderInPutAnPai.v1Column2PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmLabelList:=TfrmLabelList.Create(Application);
with frmLabelList do
begin
SLBName:=Trim(Order_Sub.fieldbyname('SLBName').AsString);
if ShowModal=1 then
begin
with Self.Order_Sub do
begin
Edit;
FieldByName('SLBName').Value:=Trim(LBName);
end;
end;
end;
finally
frmLabelList.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ComTaiTouBtnClick(Sender: TObject);
begin
try
frmZDYHelp:=TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag:='GSTT';
flagname:='<27><>˾̧ͷ';
V1ZdyStr1.Visible:=True;
V1ZdyStr2.Visible:=True;
V1ZdyStr3.Visible:=True;
V1ZdyStr4.Visible:=True;
V1ZdyStr1.Caption:='<27><><EFBFBD><EFBFBD>';
V1ZdyStr2.Caption:='<27>绰';
V1ZdyStr3.Caption:='<27><><EFBFBD><EFBFBD>';
V1ZdyStr4.Caption:='<27><>ַ';
frmZDYHelp.Align:=alClient;
if ShowModal=1 then
begin
ComTaiTou.Text:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmOrderInPutAnPai.LiDanPersonBtnClick(Sender: TObject);
begin
try
frmZDYHelp:=TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag:='LiDanPerson';
flagname:='<27><><EFBFBD><EFBFBD>Ա';
fnote:=True;
V1Note.Caption:='<27>绰';
if ShowModal=1 then
begin
LiDanPerson.Text:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmOrderInPutAnPai.v3Column1PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmZDYHelp:=TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag:='PFGenDanPerson';
flagname:='<27><><EFBFBD><EFBFBD>Ա';
fnote:=True;
V1Note.Caption:='<27>绰';
if ShowModal=1 then
begin
with CDS_JGC do
begin
Edit;
FieldByName('PFGenDanPerson').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
end;
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton13Click(Sender: TObject);
begin
try
frmModuleNote:=TfrmModuleNote.Create(Application);
with frmModuleNote do
begin
flag:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
if ShowModal=1 then
begin
end;
end;
finally
frmModuleNote.Free;
end;
end;
procedure TfrmOrderInPutAnPai.v3Column2PropertiesEditValueChanged(
Sender: TObject);
var
FReal:Double;
mvalue:string;
begin
if Trim(ClothOneQty.Text)<>'' then
begin
if TryStrToFloat(Trim(ClothOneQty.Text),FReal)=False then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD>ÿƥ<C3BF><C6A5><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
end;
mvalue:=TcxTextEdit(Sender).EditingText;
if Trim(mvalue)='' then
begin
mvalue:='0';
end;
with CDS_JGC do
begin
Edit;
FieldByName('PFTPPS').Value:=mvalue;
FieldByName('PFTPQty').Value:=StrToFloat(mvalue)*StrToFloat(ClothOneQty.Text);
Post;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton14Click(Sender: TObject);
begin
try
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
with frmZDYHelpSel do
begin
flag:='JFName';
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
if ShowModal=1 then
begin
with frmZDYHelpSel.ClientDataSet1 do
begin
First;
while not Eof do
begin
if frmZDYHelpSel.ClientDataSet1.FieldByName('SSel').AsBoolean=True then
begin
with ClientDataSet7 do
begin
Append;
FieldByName('JFDate').Value:=Now;
FieldByName('JFName').Value:=Trim(frmZDYHelpSel.ClientDataSet1.fieldbyname('ZdyName').AsString);
Post;
end;
end;
Next;
end;
end;
end;
end;
finally
frmZDYHelpSel.Free;
end;
end;
procedure TfrmOrderInPutAnPai.cxGridDBColumn30PropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
begin
try
frmZDYHelp:=TfrmZDYHelp.Create(Application);
with frmZDYHelp do
begin
flag:='JFName';
flagname:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
if ShowModal=1 then
begin
with ClientDataSet7 do
begin
Edit;
FieldByName('JFName').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZdyName').AsString);
//Post;
end;
end;
end;
finally
frmZDYHelp.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton15Click(Sender: TObject);
begin
if ClientDataSet7.IsEmpty then Exit;
if Trim(ClientDataSet7.fieldbyname('JFID').AsString)<>'' then
begin
if Trim(ClientDataSet7.fieldbyname('Filler').AsString)<>Trim(DName) then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>','<27><>ʾ',0);
Exit;
end;
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
with ADOCmd do
begin
Close;
sql.Clear;
SQL.Add('delete JYOrder_Main_Fee where JFID='''+Trim(ClientDataSet7.fieldbyname('JFID').AsString)+'''');
ExecSQL;
end;
end;
ClientDataSet7.Delete;
end;
procedure TfrmOrderInPutAnPai.cxGridDBColumn31PropertiesEditValueChanged(
Sender: TObject);
var
mvalue,JFPrice,JFQty:string;
begin
mvalue:=TcxTextEdit(Sender).EditingText;
if Trim(mvalue)='' then
begin
mvalue:='0';
end;
with ClientDataSet7 do
begin
Edit;
FieldByName('JFPrice').Value:=mvalue;
Post;
end;
JFQty:=Trim(ClientDataSet7.fieldbyname('JFQty').AsString);
if Trim(JFQty)='' then JFQty:='0';
JFPrice:=Trim(ClientDataSet7.fieldbyname('JFPrice').AsString);
if Trim(JFPrice)='' then JFPrice:='0';
with ClientDataSet7 do
begin
Edit;
FieldByName('JFMoney').Value:=StrToFloat(JFQty)*StrToFloat(JFPrice);
Post;
end;
end;
procedure TfrmOrderInPutAnPai.cxGridDBColumn32PropertiesEditValueChanged(
Sender: TObject);
var
mvalue,JFPrice,JFQty:string;
begin
mvalue:=TcxTextEdit(Sender).EditingText;
if Trim(mvalue)='' then
begin
mvalue:='0';
end;
with ClientDataSet7 do
begin
Edit;
FieldByName('JFQty').Value:=mvalue;
Post;
end;
JFQty:=Trim(ClientDataSet7.fieldbyname('JFQty').AsString);
if Trim(JFQty)='' then JFQty:='0';
JFPrice:=Trim(ClientDataSet7.fieldbyname('JFPrice').AsString);
if Trim(JFPrice)='' then JFPrice:='0';
with ClientDataSet7 do
begin
Edit;
FieldByName('JFMoney').Value:=StrToFloat(JFQty)*StrToFloat(JFPrice);
Post;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton16Click(Sender: TObject);
var
AJpeg: TJPEGImage;
begin
if Trim(FMainId)='' then
begin
Application.MessageBox('<27><>Ϣδ<CFA2><CEB4><EFBFBD>棡','<27><>ʾ',0);
Exit;
end;
with ADOQuery1 do
begin
Close;
SQL.Clear;
sql.Add('select WBID from TP_File where WBID='''+Trim(FMainId)+'''');
sql.Add(' and TFType=''<27><>װ'' ');
Open;
end;
if ADOQuery1.RecordCount>0 then
begin
if Application.MessageBox(<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
end;
AJpeg:=TJpegImage.Create();
try
if self.OpenDialog2.Execute() then
begin
Image2.Picture.LoadFromFile(OpenDialog2.FileName);
AJpeg.Assign(Image2.Picture.Graphic);
if FileSizeByName(OpenDialog2.FileName)>300*1024 then
begin
CreThumb(AJpeg,Image2,418, 233);
end;
SaveImageOther();
end;
finally
AJpeg.Free;
end;
end;
procedure TfrmOrderInPutAnPai.InitImage();
var
jpg:TJpegImage;
myStream:TADOBlobStream;
begin
if Trim(FMainId)='' then Exit;
//if cxPageControl1.ActivePageIndex=6 then
begin
Image2.Picture.Assign(nil);
Image2.Picture:=nil;
try
with ADOQuery1 do
begin
close;
sql.Clear;
sql.Add(' select * from TP_File A where A.WBID='''+Trim(FMainId)+'''');
sql.Add(' and TFType=''<27><>װ'' ');
open;
if RecordCount>0 then
begin
if trim(ADOQuery1.fieldbyname('FilesOther').AsString)<>'' then
begin
myStream:=tadoblobstream.Create(tblobfield(ADOQuery1.fieldbyname('FilesOther')),bmread);
if myStream=nil then exit;
jpg:=TJPEGImage.Create;
jpg.LoadFromStream(myStream);
Image2.Picture.Assign(jpg);
end;
end;
end;
finally
jpg.Free;
myStream.Free;
end;
end;
end;
procedure TfrmOrderInPutAnPai.CreThumb(AJPeg:TJPEGImage;Image1:TImage;Width, Height: Integer);
var
Bitmap: TBitmap;
Ratio: Double;
ARect: TRect;
AHeight, AHeightOffset: Integer;
AWidth, AWidthOffset: Integer;
begin
Bitmap := TBitmap.Create;
try
Ratio := AJPeg.Width /AJPeg.Height;
if Ratio > 1.333 then
begin
AHeight := Round(Width / Ratio);
AHeightOffset := (Height - AHeight) div 2;
AWidth := Width;
AWidthOffset := 0;
end
else
begin
AWidth := Round(Height * Ratio);
AWidthOffset := (Width - AWidth) div 2;
AHeight := Height;
AHeightOffset := 0;
end;
Bitmap.Width := Width;
Bitmap.Height := Height;
Bitmap.Canvas.Brush.Color := clBtnFace;
Bitmap.Canvas.FillRect(Rect(0, 0, Width, Height));
ARect := Rect(AWidthOffset, AHeightOffset, AWidth + AWidthOffset, AHeight + AHeightOffset);
Bitmap.Canvas.StretchDraw(ARect, AJPeg);
Image1.Picture.Assign(BitMap);
finally
Bitmap.Free;
end;
end;
procedure TfrmOrderInPutAnPai.SaveImageOther();
var
AJpeg: TJPEGImage;
myStream: TADOBlobStream;
ImgMaxNo:String;
i,j: Integer;
PatFile: String;
FTPPath,FConNo,MaxNo,FTFID:string;
begin
if Image2.Picture=nil then Exit;
AJpeg:=TJpegImage.Create();
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from TP_File where WBID='''+Trim(FMainId)+'''');
sql.Add(' and TFType=''<27><>װ'' ');
Open;
end;
FTFID:=Trim(ADOTemp.fieldbyname('TFID').AsString);
if Trim(FTFID)='' then
begin
if GetLSNo(ADOCmd,ImgMaxNo,'TF','TP_File',3,1)=False then
begin
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('ȡͼƬ<CDBC><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
Exit;
end;
end else
begin
ImgMaxNo:=Trim(FTFID);
end;
with ADOCmd do
begin
close;
sql.Clear;
sql.Add( ' select * from TP_File where TFID='''+Trim(FTFID)+'''');
open;
end;
with ADOCmd do
begin
if Trim(FTFID)='' then
begin
Append;
FieldByName('Filler').Value:=Trim(DName);
end
else
begin
Edit;
FieldByName('Editer').Value:=Trim(DName);
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
end;
FieldByName('TFID').Value:=Trim(ImgMaxNo);
FieldByName('WBID').Value:=Trim(FMainId);
FieldByName('TFType').Value:='<27><>װ';
AJpeg.Assign(Image2.Picture.Graphic);
//CreThumb(AJpeg,Image1,160, 120);
myStream := TADOBlobStream.Create(TBlobField(ADOCmd.FieldByName('FilesOther')), bmWrite);
AJpeg.Assign(Image2.Picture.Graphic);
AJpeg.SaveToStream(myStream);
myStream.Free;
Post;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton17Click(Sender: TObject);
begin
if Image2.Picture=nil then Exit;
if Application.MessageBox(<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add(' delete TP_File where WBID='''+Trim(FMainId)+'''');
SQL.Add(' and TFType=''<27><>װ'' ');
ExecSQL;
end;
Image2.Picture.Assign(nil);
end;
procedure TfrmOrderInPutAnPai.ToolButton18Click(Sender: TObject);
begin
if Application.MessageBox(<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
if not Assigned(DataLink_DDMD) then
DataLink_DDMD:=TDataLink_DDMD.Create(Application);
Try
with DataLink_DDMD.ADOLink do
begin
//if not Connected then
begin
Connected:=false;
ConnectionString:=DConString;
LoginPrompt:=false;
Connected:=true;
end;
end;
Except
application.MessageBox('<27><><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><><EFBFBD><EFBFBD>',mb_Ok+ MB_ICONERROR);
end;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('UPdate SY_MaxBH Set BHNo=BHNo+1 where BHType=''JYOrder_Sub'' ');
sql.Add('UPdate SY_MaxBH Set BHNo=BHNo+1 where BHType=''JYOrder_Main'' ');
ExecSQL;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton19Click(Sender: TObject);
begin
if ClientDataSet5.IsEmpty then Exit;
if Trim(ClientDataSet5.fieldbyname('PFID').AsString)<>'' then
begin
with ADOTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD where PFID='''+Trim(ClientDataSet5.fieldbyname('PFID').AsString)+'''');
Open;
end;
if ADOTemp.IsEmpty=False then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD><D1B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>!','<27><>ʾ',0);
Exit;
end;
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('delete JYOrder_PCS_Sub where PFID='''+Trim(ClientDataSet5.fieldbyname('PFID').AsString)+'''');
sql.Add('delete JYOrder_Main_MD_Out where PFID='''+Trim(ClientDataSet5.fieldbyname('PFID').AsString)+'''');
ExecSQL;
end;
end;
ClientDataSet5.Delete;
end;
procedure TfrmOrderInPutAnPai.v5Column1PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmOrderSubSelMX:=TfrmOrderSubSelMX.Create(Application);
with frmOrderSubSelMX do
begin
FFFMainId:=Trim(Self.FMainId);
if ShowModal=1 then
begin
with Self.ClientDataSet5 do
begin
Edit;
FieldByName('SubId').Value:=frmOrderSubSelMX.Order_Sub.fieldbyname('SubId').Value;
FieldByName('PRTColorNo').Value:=frmOrderSubSelMX.Order_Sub.fieldbyname('PRTColorNo').Value;
FieldByName('PRTHX').Value:=frmOrderSubSelMX.Order_Sub.fieldbyname('PRTHX').Value;
//Post;
end;
end;
end;
finally
frmOrderSubSelMX.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton20Click(Sender: TObject);
begin
try
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
with frmZDYHelpSel do
begin
flag:='WFBCD';
flagname:='<27>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>';
fnote:=True;
V1Note.Caption:=<><D3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
if ShowModal=1 then
begin
with frmZDYHelpSel.ClientDataSet1 do
begin
First;
while not Eof do
begin
if frmZDYHelpSel.ClientDataSet1.FieldByName('SSel').AsBoolean=True then
begin
with ClientDataSet8 do
begin
Append;
FieldByName('ZDYCODE').Value:=Trim(frmZDYHelpSel.ClientDataSet1.fieldbyname('ZDYNo').AsString);
FieldByName('ZdyName').Value:=Trim(frmZDYHelpSel.ClientDataSet1.fieldbyname('ZdyName').AsString);
FieldByName('ZdyNameEng').Value:=Trim(frmZDYHelpSel.ClientDataSet1.fieldbyname('Note').AsString);
Post;
end;
end;
Next;
end;
end;
end;
end;
finally
frmZDYHelpSel.Free;
end;
end;
procedure TfrmOrderInPutAnPai.ToolButton21Click(Sender: TObject);
begin
if ClientDataSet8.IsEmpty then Exit;
if Trim(ClientDataSet8.fieldbyname('JCID').AsString)<>'' then
begin
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
with ADOCmd do
begin
Close;
sql.Clear;
SQL.Add('delete JYOrder_CD where JCID='''+Trim(ClientDataSet8.fieldbyname('JCID').AsString)+'''');
ExecSQL;
end;
end;
ClientDataSet8.Delete;
end;
end.