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

1224 lines
38 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_MaDanManageSTBAK;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ToolWin, StdCtrls, ExtCtrls, cxStyles, cxCustomData,
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData,
cxCalendar, cxGridLevel, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid,
cxCheckBox, cxButtonEdit, cxDropDownEdit, BtnEdit, cxGridBandedTableView,
cxGridDBBandedTableView, cxContainer, cxTextEdit, cxMemo, cxRichEdit,
DBClient, ADODB, cxGridCustomPopupMenu, cxGridPopupMenu;
type
TfrmMaDanManageSTBAK = class(TForm)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBFind: TToolButton;
TBClose: TToolButton;
Panel1: TPanel;
Label3: TLabel;
OrderNo: TEdit;
ScrollBox3: TScrollBox;
ScrollBox4: TScrollBox;
ScrollBox6: TScrollBox;
Panel7: TPanel;
Label13: TLabel;
cxGrid5: TcxGrid;
Tv5: TcxGridDBTableView;
cxGridDBColumn8: TcxGridDBColumn;
cxGridDBColumn9: TcxGridDBColumn;
cxGridLevel4: TcxGridLevel;
v5Column1: TcxGridDBColumn;
v5Column2: TcxGridDBColumn;
v5Column3: TcxGridDBColumn;
v5Column4: TcxGridDBColumn;
v5Column5: TcxGridDBColumn;
v5Column7: TcxGridDBColumn;
Panel2: TPanel;
Label1: TLabel;
v5Column8: TcxGridDBColumn;
Panel3: TPanel;
Label2: TLabel;
Panel5: TPanel;
Label9: TLabel;
cxGrid2: TcxGrid;
Tv2: TcxGridDBTableView;
cxGridDBColumn4: TcxGridDBColumn;
cxGridDBColumn5: TcxGridDBColumn;
v2Column1: TcxGridDBColumn;
cxGridDBColumn6: TcxGridDBColumn;
cxGridLevel2: TcxGridLevel;
v2Column2: TcxGridDBColumn;
Panel4: TPanel;
Label12: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label25: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
DLYDate: TDateTimePicker;
MPRTCodeName: TEdit;
MPRTSpec: TEdit;
MPRTCF: TEdit;
MPRTMF: TEdit;
MPRTKZ: TEdit;
MPRTKZNote: TEdit;
ScrollBox1: TScrollBox;
Panel8: TPanel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Panel6: TPanel;
cxGrid4: TcxGrid;
Tv6: TcxGridDBBandedTableView;
cxGridDBBandedColumn1: TcxGridDBBandedColumn;
cxGridDBBandedColumn2: TcxGridDBBandedColumn;
cxGridLevel3: TcxGridLevel;
Tv6Column1: TcxGridDBBandedColumn;
Tv6Column2: TcxGridDBBandedColumn;
v6Column1: TcxGridDBBandedColumn;
v6Column2: TcxGridDBBandedColumn;
v6Column3: TcxGridDBBandedColumn;
v6Column4: TcxGridDBBandedColumn;
v6Column5: TcxGridDBBandedColumn;
v6Column6: TcxGridDBBandedColumn;
v6Column8: TcxGridDBBandedColumn;
v6Column9: TcxGridDBBandedColumn;
v6Column10: TcxGridDBBandedColumn;
Edit1: TEdit;
CDS_OrderNo: TClientDataSet;
DS_OrderNo: TDataSource;
cxGrid6: TcxGrid;
TvOrdeNo: TcxGridDBTableView;
cxGridDBColumn1: TcxGridDBColumn;
cxGridDBColumn10: TcxGridDBColumn;
cxGrid4Level1: TcxGridLevel;
ADOQuery1: TADOQuery;
ADOQueryTemp: TADOQuery;
ADOQueryCmd: TADOQuery;
ClientDataSet1: TClientDataSet;
DataSource1: TDataSource;
ClientDataSet2: TClientDataSet;
DataSource2: TDataSource;
ClientDataSet5: TClientDataSet;
DataSource5: TDataSource;
ClientDataSet3: TClientDataSet;
DataSource3: TDataSource;
v5Column9: TcxGridDBColumn;
Button4: TButton;
Button5: TButton;
Button6: TButton;
v6Column11: TcxGridDBBandedColumn;
v6Column12: TcxGridDBBandedColumn;
v6Column14: TcxGridDBBandedColumn;
ClientDataSet6: TClientDataSet;
DataSource6: TDataSource;
v6Column7: TcxGridDBBandedColumn;
ScrollBox5: TScrollBox;
ScrollBox2: TScrollBox;
cxGrid3: TcxGrid;
Tv3: TcxGridDBTableView;
v3Column1: TcxGridDBColumn;
cxGridDBColumn2: TcxGridDBColumn;
cxGridDBColumn3: TcxGridDBColumn;
cxGridDBColumn7: TcxGridDBColumn;
cxGridDBColumn11: TcxGridDBColumn;
cxGridDBColumn14: TcxGridDBColumn;
cxGridDBColumn12: TcxGridDBColumn;
Tv3Column1: TcxGridDBColumn;
Tv3Column2: TcxGridDBColumn;
Tv3Column3: TcxGridDBColumn;
v3Column2: TcxGridDBColumn;
v3Column3: TcxGridDBColumn;
cxGridLevel1: TcxGridLevel;
v3Column5: TcxGridDBColumn;
ScrollBox7: TScrollBox;
Label4: TLabel;
Label5: TLabel;
Label10: TLabel;
Label11: TLabel;
Label14: TLabel;
Label19: TLabel;
Label20: TLabel;
Label22: TLabel;
ChkNote: TcxRichEdit;
Button7: TButton;
MFChk: TComboBox;
KZChk: TComboBox;
SLDChk: TComboBox;
SGChk: TComboBox;
TSYQChk: TComboBox;
ChkResult: TComboBox;
Button8: TButton;
MPRTCode: TEdit;
MPRTGY: TEdit;
PFGenDanPerson: TEdit;
Label18: TLabel;
Label21: TLabel;
LiDanPerson: TEdit;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
v1Column2: TcxGridDBColumn;
v1Column7: TcxGridDBColumn;
v1Column4: TcxGridDBColumn;
v1SOrddefstr1: TcxGridDBColumn;
v1PRTColor: TcxGridDBColumn;
v1Column1: TcxGridDBColumn;
v1Column3: TcxGridDBColumn;
v1PRTOrderQty: TcxGridDBColumn;
v1Column5: TcxGridDBColumn;
v1OrderUnit: TcxGridDBColumn;
v1Column6: TcxGridDBColumn;
cxGrid1Level1: TcxGridLevel;
v3Column4: TcxGridDBColumn;
v3Column6: TcxGridDBColumn;
v6Column13: TcxGridDBBandedColumn;
v6Column15: TcxGridDBBandedColumn;
cxGridPopupMenu2: TcxGridPopupMenu;
cxGridPopupMenu1: TcxGridPopupMenu;
cxGridPopupMenu4: TcxGridPopupMenu;
cxGridPopupMenu3: TcxGridPopupMenu;
cxGridPopupMenu5: TcxGridPopupMenu;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);
procedure OrderNoChange(Sender: TObject);
procedure TvOrdeNoDblClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure v2Column2PropertiesEditValueChanged(Sender: TObject);
procedure v5Column8PropertiesEditValueChanged(Sender: TObject);
procedure Tv3Column1PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure Button3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure v6Column8PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure v6Column2PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure v6Column14PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
procedure Button8Click(Sender: TObject);
procedure Tv3FocusedRecordChanged(Sender: TcxCustomGridTableView;
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
ANewItemRecordFocusingChanged: Boolean);
procedure v1Column2PropertiesEditValueChanged(Sender: TObject);
procedure Tv6MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Tv3MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
FMainId,SParameters1:String;
procedure InitGrid();
public
{ Public declarations }
end;
var
frmMaDanManageSTBAK: TfrmMaDanManageSTBAK;
implementation
uses
U_DataLink,U_RTFun, U_GYSList;
{$R *.dfm}
procedure TfrmMaDanManageSTBAK.FormDestroy(Sender: TObject);
begin
frmMaDanManageSTBAK:=nil;
end;
procedure TfrmMaDanManageSTBAK.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action:=caFree;
end;
procedure TfrmMaDanManageSTBAK.TBCloseClick(Sender: TObject);
begin
WriteCxGrid('Tv1',Tv1,<><CAB5><EFBFBD>뵥');
WriteCxGrid('Tv2',Tv2,<><CAB5><EFBFBD>뵥');
WriteCxGrid('Tv3',Tv3,<><CAB5><EFBFBD>뵥');
WriteCxGrid('Tv5',Tv5,<><CAB5><EFBFBD>뵥');
WriteCxBandedGrid('Tv6',Tv6,<><CAB5><EFBFBD>뵥');
close;
end;
procedure TfrmMaDanManageSTBAK.OrderNoChange(Sender: TObject);
var
mvalue:String;
begin
mvalue:=Trim(OrderNo.Text);
if Length(Trim(mvalue))<2 then
begin
cxGrid6.Visible:=False;
Exit;
end;
mvalue:='%'+Trim(mvalue)+'%';
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select OrderNo,MPRTCodeName,A.MainId from JYOrder_Main A');
sql.Add(' where A.orderno like :orderno ');
//sql.Add(' and A.MainId in(select MainId from JYOrder_Sub B where B.Mainid=A.MainId and B.subId in(select OrdSubId from Contract_Cloth_LL))');
Parameters.ParamByName('orderno').Value:=mvalue;
Open;
end;
SCreateCDS20(ADOQuery1,CDS_OrderNo);
SInitCDSData20(ADOQuery1,CDS_OrderNo);
if CDS_OrderNo.IsEmpty then cxGrid6.Visible:=False else cxGrid6.Visible:=True;
end;
procedure TfrmMaDanManageSTBAK.TvOrdeNoDblClick(Sender: TObject);
var
fsj:string;
begin
OrderNo.Text:=CDS_OrderNo.fieldbyname('OrderNo').AsString;
cxGrid6.Visible:=False;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select A.* ');
sql.Add(',PFGenDanPerson=dbo.F_Get_Order_SubStr(A.MainId,''PFGenDanPerson'')');
sql.Add(' from JYOrder_Main A');
sql.Add(' where Orderno='''+Trim(OrderNo.Text)+'''');
Open;
end;
SCSHData(ADOQueryTemp,Panel4,2);
MPRTCode.Text:=Trim(ADOQueryTemp.fieldbyname('MPRTCode').AsString);
FMainId:=Trim(ADOQueryTemp.fieldbyname('MainId').AsString);
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Process where MainId='''+Trim(FMainId)+'''');
Open;
end;
with ADOQueryTemp do
begin
First;
while not Eof do
begin
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select AA=dbo.F_Get_Order_SubStr(:PSID,''PFGenDanPerson'')');
Parameters.ParamByName('PSID').Value:=Trim(ADOQueryTemp.fieldbyname('PSID').AsString);
open;
end;
if Trim(fsj)='' then
begin
fsj:=Trim(ADOQueryTemp.fieldbyname('PSName').AsString)+':'+Trim(ADOQuery1.fieldbyname('AA').AsString);
end else
fsj:=fsj+' '+Trim(ADOQueryTemp.fieldbyname('PSName').AsString)+':'+Trim(ADOQuery1.fieldbyname('AA').AsString);
Next;
end;
end;
PFGenDanPerson.Text:=Trim(fsj);
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.PRTHX,B.PRTColorNo,B.PRTColor,B.PRTOrdQty,B.OrderUnit,B.ColorNote,JP.PSName ');
sql.Add(' from JYOrder_PCS_Sub A');
sql.Add(' inner join JYOrder_Process JP on A.PSID=JP.PSID');
sql.Add(' left join JYOrder_Sub B on A.SubId=B.SubId');
sql.Add(' where A.MainId='''+Trim(FMainId)+'''');
Open;
end;
SCreateCDS20(ADOQueryTemp,ClientDataSet1);
SInitCDSData20(ADOQueryTemp,ClientDataSet1);
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from Contract_Main A inner join Contract_Sub B on A.MainId=B.MainId ');
sql.Add(' where A.ConNo like '''+'%'+Trim(OrderNo.Text)+'%'+'''');
Open;
end;
SCreateCDS20(ADOQueryTemp,ClientDataSet5);
SInitCDSData20(ADOQueryTemp,ClientDataSet5);
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Process where MainId='''+Trim(FMainId)+'''');
Open;
end;
SCreateCDS20(ADOQueryTemp,ClientDataSet2);
SInitCDSData20(ADOQueryTemp,ClientDataSet2);
InitGrid();
end;
procedure TfrmMaDanManageSTBAK.InitGrid();
var
FPSID,FOrdSubId,FConSubId,FPFID:String;
begin
if ClientDataSet2.Locate('SSel',True,[])=True then
begin
FPSID:=Trim(ClientDataSet2.fieldbyname('PSID').AsString);
end else
begin
FPSID:='';
end;
if ClientDataSet5.Locate('SSel',True,[])=True then
begin
FConSubId:=Trim(ClientDataSet5.fieldbyname('SubId').AsString);
end else
begin
FConSubId:='';
end;
if ClientDataSet1.Locate('SSel',True,[])=True then
begin
FOrdSubId:=Trim(ClientDataSet1.fieldbyname('SubId').AsString);
FPFID:=Trim(ClientDataSet1.fieldbyname('PFID').AsString);
end else
begin
FOrdSubId:='';
FPFID:='';
end;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.PSName OrdPSName,C.ConNo,C.FactoryNoName,D.Price,JS.PRTHX,JS.PRTColor,JS.PRTColorNo,JS.ColorNote ');
sql.Add(' from JYOrder_Main_MD A');
sql.Add(' inner join JYOrder_Process B on A.PSID=B.PSID');
sql.Add(' inner join JYOrder_PCS_Sub JPS on A.PFID=JPS.PFID ');
sql.Add(' left join JYOrder_Sub JS on A.OrdSubId=JS.SubId');
sql.Add(' inner join Contract_Main C on A.ConMainid=C.MainID');
sql.Add(' inner join Contract_Sub D on A.ConSubid=D.SubID');
sql.Add(' where A.ORDMainId='''+Trim(FMainId)+'''');
if Trim(FPSID)<>'' then
begin
sql.Add(' and A.PSID='''+Trim(FPSID)+'''');
end;
if Trim(FConSubId)<>'' then
begin
sql.Add(' and A.ConSubID='''+Trim(FConSubId)+'''');
end;
if Trim(FOrdSubId)<>'' then
begin
sql.Add(' and A.OrdSubID='''+Trim(FOrdSubId)+'''');
end;
if Trim(FPFID)<>'' then
begin
sql.Add(' and A.PFID='''+Trim(FPFID)+'''');
end;
if Trim(SParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
begin
SQL.Add(' and A.Filler='''+Trim(DName)+'''');
end;
sql.Add(' and A.MDType='<><CAB5>'' ');
SQL.Add(' and isnull(CKName,'''')<>''<27><><EFBFBD>ڲֿ<DAB2>'' ');
Open;
end;
SCreateCDS20(ADOQueryTemp,ClientDataSet3);
SInitCDSData20(ADOQueryTemp,ClientDataSet3);
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.PSName OrdPSName,C.ConNo,C.FactoryNoName,D.Price,JS.PRTHX,JS.PRTColor,JS.PRTColorNo,JS.ColorNote ');
sql.Add(' from JYOrder_Main_MD A');
sql.Add(' inner join JYOrder_Process B on A.PSID=B.PSID');
sql.Add(' inner join JYOrder_PCS_Sub JPS on A.PFID=JPS.PFID ');
sql.Add(' left join JYOrder_Sub JS on A.OrdSubId=JS.SubId');
sql.Add(' inner join Contract_Main C on A.ConMainid=C.MainID');
sql.Add(' inner join Contract_Sub D on A.ConSubid=D.SubID');
sql.Add(' where A.ORDMainId='''+Trim(FMainId)+'''');
if Trim(FPSID)<>'' then
begin
sql.Add(' and A.PSID='''+Trim(FPSID)+'''');
end;
if Trim(FConSubId)<>'' then
begin
sql.Add(' and A.ConSubID='''+Trim(FConSubId)+'''');
end;
if Trim(FOrdSubId)<>'' then
begin
sql.Add(' and A.OrdSubID='''+Trim(FOrdSubId)+'''');
end;
if Trim(FPFID)<>'' then
begin
sql.Add(' and A.PFID='''+Trim(FPFID)+'''');
end;
if Trim(SParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
begin
SQL.Add(' and A.Filler='''+Trim(DName)+'''');
end;
sql.Add(' and A.MDType='<><CAB5>'' ');
SQL.Add(' and isnull(CKName,'''')=''<27><><EFBFBD>ڲֿ<DAB2>'' ');
Open;
end;
SCreateCDS20(ADOQuery1,ClientDataSet6);
SInitCDSData20(ADOQuery1,ClientDataSet6);
end;
procedure TfrmMaDanManageSTBAK.Button1Click(Sender: TObject);
begin
if Trim(FMainId)='' then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD>񶩵<EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet5.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>ͬ!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet2.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet1.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ!','<27><>ʾ',0);
Exit;
end;
with ClientDataSet3 do
begin
Append;
ClientDataSet5.Locate('SSel',True,[]);
ClientDataSet2.Locate('SSel',True,[]);
ClientDataSet1.Locate('SSel',True,[]);
FieldByName('ConNo').Value:=ClientDataSet5.fieldbyname('ConNo').Value;
FieldByName('FactoryNo').Value:=ClientDataSet5.fieldbyname('FactoryNoName').Value;
FieldByName('FactoryName').Value:=ClientDataSet5.fieldbyname('FactoryNoName').Value;
FieldByName('FactoryNoName').Value:=ClientDataSet5.fieldbyname('FactoryNoName').Value;
FieldByName('Price').Value:=ClientDataSet5.fieldbyname('Price').Value;
FieldByName('PSName').Value:=ClientDataSet2.fieldbyname('PSName').Value;
FieldByName('QtyUnit').Value:=ClientDataSet5.fieldbyname('C_Unit').Value;
FieldByName('Filler').Value:=Trim(DName);
FieldByName('FillTime').Value:=SGetServerDateTime(ADOQueryTemp);
FieldByName('PRTHX').Value:=ClientDataSet1.fieldbyname('PRTHX').Value;
FieldByName('PRTColorNo').Value:=ClientDataSet1.fieldbyname('PRTColorNo').Value;
Post;
end;
end;
procedure TfrmMaDanManageSTBAK.v2Column2PropertiesEditValueChanged(
Sender: TObject);
var
PSID:String;
Mvalue:Boolean;
begin
Mvalue:=TcxCheckBox(Sender).EditingValue;
PSID:=Trim(ClientDataSet2.fieldbyname('PSID').AsString);
with ClientDataSet2 do
begin
while ClientDataSet2.Locate('SSel',True,[])=True do
begin
Edit;
FieldByName('SSel').Value:=False;
Post;
end;
ClientDataSet2.Locate('PSID',PSID,[]);
Edit;
FieldByName('SSel').Value:=Mvalue;
Post;
end;
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.PRTHX,B.PRTColorNo,B.PRTColor,B.PRTOrdQty,B.OrderUnit,B.ColorNote,JP.PSName ');
sql.Add(' from JYOrder_PCS_Sub A');
sql.Add(' inner join JYOrder_Process JP on A.PSID=JP.PSID');
sql.Add(' left join JYOrder_Sub B on A.SubId=B.SubId');
if Mvalue=True then
sql.Add('where A.PSID='''+Trim(ClientDataSet2.fieldbyname('PSID').AsString)+'''')
else
sql.Add(' where A.MainId='''+Trim(FMainId)+'''');
Open;
end;
SCreateCDS20(ADOQuery1,ClientDataSet1);
SInitCDSData20(ADOQuery1,ClientDataSet1);
InitGrid();
end;
procedure TfrmMaDanManageSTBAK.v5Column8PropertiesEditValueChanged(
Sender: TObject);
var
PSID:String;
Mvalue:Boolean;
begin
Mvalue:=TcxCheckBox(Sender).EditingValue;
PSID:=Trim(ClientDataSet5.fieldbyname('SubID').AsString);
with ClientDataSet5 do
begin
while ClientDataSet5.Locate('SSel',True,[])=True do
begin
Edit;
FieldByName('SSel').Value:=False;
Post;
end;
ClientDataSet5.Locate('SubID',PSID,[]);
Edit;
FieldByName('SSel').Value:=Mvalue;
Post;
end;
InitGrid();
end;
procedure TfrmMaDanManageSTBAK.Tv3Column1PropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
begin
try
frmGYSList:=TfrmGYSList.Create(Application);
with frmGYSList do
begin
if ShowModal=1 then
begin
with Self.ClientDataSet3 do
begin
Edit;
FieldByName('FromFactoryNo').Value:=Trim(frmGYSList.Order_Main.fieldbyname('ZKID').AsString) ;
FieldByName('FromFactoryName').Value:=Trim(frmGYSList.Order_Main.fieldbyname('KHNameJC').AsString);
//Post;
end;
end;
end;
finally
frmGYSList.Free;
end;
end;
procedure TfrmMaDanManageSTBAK.Button3Click(Sender: TObject);
var
maxno,ConMainId,ConSubId,PSID,OrdSubId,PFID:string;
begin
if ClientDataSet3.IsEmpty then Exit;
if Trim(ClientDataSet3.FieldByName('MDId').AsString)='' then
begin
if ClientDataSet5.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>ͬ!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet2.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
end;
if Trim(SParameters1)='<27><>Ȩ<EFBFBD><C8A8>' then
begin
if Application.MessageBox(<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
end else
begin
if Application.MessageBox(<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?<3F><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD>󽫲<EFBFBD><F3BDABB2><EFBFBD><EFBFBD>޸ģ<DEB8>','<27><>ʾ',32+4)<>IDYES then Exit;
end;
ClientDataSet1.Locate('SSel',True,[]);
ConMainId:=Trim(ClientDataSet5.fieldbyname('MainId').AsString);
ConSubId:=Trim(ClientDataSet5.fieldbyname('SubId').AsString);
PSID:=Trim(ClientDataSet2.fieldbyname('PSID').AsString);
OrdSubId:=Trim(ClientDataSet1.fieldbyname('SubId').AsString);
PFID:=Trim(ClientDataSet1.fieldbyname('PFID').AsString);
if Trim(ClientDataSet3.fieldbyname('ConMainId').AsString)<>'' then
begin
ConMainId:=Trim(ClientDataSet3.fieldbyname('ConMainId').AsString);
end;
if Trim(ClientDataSet3.fieldbyname('ConSubId').AsString)<>'' then
begin
ConSubId:=Trim(ClientDataSet3.fieldbyname('ConSubId').AsString);
end;
if Trim(ClientDataSet3.fieldbyname('OrdSubId').AsString)<>'' then
begin
OrdSubId:=Trim(ClientDataSet3.fieldbyname('OrdSubId').AsString);
end;
if Trim(ClientDataSet3.fieldbyname('PSID').AsString)<>'' then
begin
PSID:=Trim(ClientDataSet3.fieldbyname('PSID').AsString);
end;
if Trim(ClientDataSet3.fieldbyname('PFID').AsString)<>'' then
begin
PFID:=Trim(ClientDataSet3.fieldbyname('PFID').AsString);
end;
try
ADOQueryCmd.Connection.BeginTrans;
ClientDataSet3.DisableControls;
with ClientDataSet3 do
begin
First;
while not Eof do
begin
if Trim(SParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
begin
if Trim(ClientDataSet3.fieldbyname('MDID').AsString)<>'' then
begin
Next;
Continue;
end;
end;
if Trim(ClientDataSet3.fieldbyname('MDId').AsString)='' then
begin
if GetLSNo(ADOQueryCmd,maxno,'','JYOrder_Main_MD',4,1)=False then
begin
ClientDataSet3.EnableControls;
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><EFBFBD><EBB5A5>ˮ<EFBFBD><CBAE>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
Exit;
end;
end else
begin
maxno:=Trim(ClientDataSet3.fieldbyname('MDId').AsString);
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(ClientDataSet3.fieldbyname('MDId').AsString)+'''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(ClientDataSet3.fieldbyname('MDId').AsString)='' then
begin
Append;
FieldByName('Filler').Value:=Trim(DName);
end else
begin
Edit;
FieldByName('Editer').Value:=Trim(DName);
FieldByName('EditTime').Value:=SGetServerDateTime(ADOQueryTemp);
end;
FieldByName('MDID').Value:=Trim(maxno);
FieldByName('OrdMainID').Value:=Trim(FMainId);
FieldByName('ConMainID').Value:=Trim(ConMainId);
FieldByName('ConSubID').Value:=Trim(ConSubId);
FieldByName('OrdSubId').Value:=Trim(OrdSubId);
FieldByName('PSID').Value:=Trim(PSID);
FieldByName('PFID').Value:=Trim(PFID);
FieldByName('MDType').Value:=<><CAB5>';
RTSetSaveDataCDS(ADOQueryCmd,Tv3,ClientDataSet3,'JYOrder_Main_MD',2);
FieldByName('MDNO').Value:='MD'+Trim(maxno);
FieldByName('FactoryNo').Value:=Trim(ClientDataSet3.fieldbyname('FactoryNo').AsString);
FieldByName('FromFactoryNo').Value:=Trim(ClientDataSet3.fieldbyname('FromFactoryNo').AsString);
Post;
end;
Edit;
FieldByName('MDID').Value:=Trim(maxno);
FieldByName('MDNO').Value:='MD'+Trim(maxno);
FieldByName('OrdMainID').Value:=Trim(FMainId);
FieldByName('ConMainID').Value:=Trim(ConMainId);
FieldByName('ConSubID').Value:=Trim(ConSubId);
FieldByName('OrdSubId').Value:=Trim(OrdSubId);
FieldByName('PSID').Value:=Trim(PSID);
FieldByName('PFID').Value:=Trim(PFID);
Post;
Next;
end;
end;
ADOQueryCmd.Connection.CommitTrans;
ClientDataSet3.EnableControls;
except
ClientDataSet3.EnableControls;
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!','<27><>ʾ',0);
end;
end;
procedure TfrmMaDanManageSTBAK.FormCreate(Sender: TObject);
begin
SParameters1:=Trim(DParameters1);
end;
procedure TfrmMaDanManageSTBAK.Button2Click(Sender: TObject);
begin
if ClientDataSet3.IsEmpty then Exit;
if Trim(ClientDataSet3.fieldbyname('MDID').AsString)<>'' then
begin
if Trim(SParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
begin
Application.MessageBox('<27>ѱ<EFBFBD><D1B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><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 ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete JYOrder_Main_MD where MDID='''+Trim(ClientDataSet3.fieldbyname('MDID').AsString)+'''');
ExecSQL;
end;
end;
ClientDataSet3.Delete;
end;
procedure TfrmMaDanManageSTBAK.Button4Click(Sender: TObject);
begin
if Trim(FMainId)='' then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD>񶩵<EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet5.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>ͬ!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet2.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet1.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ!','<27><>ʾ',0);
Exit;
end;
with ClientDataSet6 do
begin
Append;
ClientDataSet5.Locate('SSel',True,[]);
ClientDataSet2.Locate('SSel',True,[]);
ClientDataSet1.Locate('SSel',True,[]);
FieldByName('ConNo').Value:=ClientDataSet5.fieldbyname('ConNo').Value;
FieldByName('FactoryNo').Value:=ClientDataSet5.fieldbyname('FactoryNoName').Value;
FieldByName('FactoryName').Value:=ClientDataSet5.fieldbyname('FactoryNoName').Value;
FieldByName('FactoryNoName').Value:=ClientDataSet5.fieldbyname('FactoryNoName').Value;
FieldByName('Price').Value:=ClientDataSet5.fieldbyname('Price').Value;
FieldByName('PSName').Value:=ClientDataSet2.fieldbyname('PSName').Value;
FieldByName('QtyUnit').Value:=ClientDataSet5.fieldbyname('C_Unit').Value;
FieldByName('Filler').Value:=Trim(DName);
FieldByName('FillTime').Value:=SGetServerDateTime(ADOQueryTemp);
FieldByName('PRTHX').Value:=ClientDataSet1.fieldbyname('PRTHX').Value;
FieldByName('PRTColorNo').Value:=ClientDataSet1.fieldbyname('PRTColorNo').Value;
Post;
end;
end;
procedure TfrmMaDanManageSTBAK.Button5Click(Sender: TObject);
begin
if ClientDataSet6.IsEmpty then Exit;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(ClientDataSet6.fieldbyname('MDID').AsString)+'''');
Open;
end;
if Trim(ADOQueryTemp.fieldbyname('CRFlag').asstring)='<27><><EFBFBD><EFBFBD>' then
begin
Application.MessageBox('<27>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><E2B2BB>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if Trim(ClientDataSet6.fieldbyname('MDID').AsString)<>'' then
begin
if Trim(SParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
begin
Application.MessageBox('<27>ѱ<EFBFBD><D1B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2><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 ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete JYOrder_Main_MD where MDID='''+Trim(ClientDataSet6.fieldbyname('MDID').AsString)+'''');
ExecSQL;
end;
end;
ClientDataSet6.Delete;
end;
procedure TfrmMaDanManageSTBAK.Button6Click(Sender: TObject);
var
maxno,ConMainId,ConSubId,PSID,OrdSubId,PFID:string;
begin
if ClientDataSet6.IsEmpty then Exit;
if Trim(ClientDataSet6.FieldByName('MDId').AsString)='' then
begin
if ClientDataSet5.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD>ӹ<EFBFBD><D3B9><EFBFBD>ͬ!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet2.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if ClientDataSet1.Locate('SSel',True,[])=False then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ!','<27><>ʾ',0);
Exit;
end;
end;
if Trim(SParameters1)='<27><>Ȩ<EFBFBD><C8A8>' then
begin
if Application.MessageBox(<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
end else
begin
if Application.MessageBox(<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?<3F><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD>󽫲<EFBFBD><F3BDABB2><EFBFBD><EFBFBD>޸ģ<DEB8>','<27><>ʾ',32+4)<>IDYES then Exit;
end;
//if Application.MessageBox('ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
//ClientDataSet1.Locate('SSel',True,[]);
ConMainId:=Trim(ClientDataSet5.fieldbyname('MainId').AsString);
ConSubId:=Trim(ClientDataSet5.fieldbyname('SubId').AsString);
PSID:=Trim(ClientDataSet2.fieldbyname('PSID').AsString);
OrdSubId:=Trim(ClientDataSet1.fieldbyname('SubId').AsString);
PFID:=Trim(ClientDataSet1.fieldbyname('PFID').AsString);
if Trim(ClientDataSet6.fieldbyname('ConMainId').AsString)<>'' then
begin
ConMainId:=Trim(ClientDataSet6.fieldbyname('ConMainId').AsString);
end;
if Trim(ClientDataSet6.fieldbyname('ConSubId').AsString)<>'' then
begin
ConSubId:=Trim(ClientDataSet6.fieldbyname('ConSubId').AsString);
end;
if Trim(ClientDataSet6.fieldbyname('OrdSubId').AsString)<>'' then
begin
OrdSubId:=Trim(ClientDataSet6.fieldbyname('OrdSubId').AsString);
end;
if Trim(ClientDataSet6.fieldbyname('PSID').AsString)<>'' then
begin
PSID:=Trim(ClientDataSet6.fieldbyname('PSID').AsString);
end;
if Trim(ClientDataSet6.fieldbyname('PFID').AsString)<>'' then
begin
PFID:=Trim(ClientDataSet6.fieldbyname('PFID').AsString);
end;
try
ADOQueryCmd.Connection.BeginTrans;
ClientDataSet6.DisableControls;
with ClientDataSet6 do
begin
First;
while not Eof do
begin
if Trim(SParameters1)<>'<27><>Ȩ<EFBFBD><C8A8>' then
begin
if Trim(ClientDataSet6.fieldbyname('MDID').AsString)<>'' then
begin
Next;
Continue;
end;
end;
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(ClientDataSet6.fieldbyname('MDID').AsString)+'''');
Open;
end;
if Trim(ADOQueryTemp.fieldbyname('CRFlag').AsString)='<27><><EFBFBD><EFBFBD>' then
begin
Next;
Continue;
end;
if Trim(ClientDataSet6.fieldbyname('MDId').AsString)='' then
begin
if GetLSNo(ADOQueryCmd,maxno,'','JYOrder_Main_MD',4,1)=False then
begin
ClientDataSet6.EnableControls;
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><EFBFBD><EBB5A5>ˮ<EFBFBD><CBAE>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
Exit;
end;
end else
begin
maxno:=Trim(ClientDataSet6.fieldbyname('MDId').AsString);
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(ClientDataSet6.fieldbyname('MDId').AsString)+'''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(ClientDataSet6.fieldbyname('MDId').AsString)='' then
begin
Append;
FieldByName('Filler').Value:=Trim(DName);
end else
begin
Edit;
FieldByName('Editer').Value:=Trim(DName);
FieldByName('EditTime').Value:=SGetServerDateTime(ADOQueryTemp);
end;
FieldByName('MDID').Value:=Trim(maxno);
FieldByName('OrdMainID').Value:=Trim(FMainId);
FieldByName('ConMainID').Value:=Trim(ConMainId);
FieldByName('ConSubID').Value:=Trim(ConSubId);
FieldByName('OrdSubId').Value:=Trim(OrdSubId);
FieldByName('PSID').Value:=Trim(PSID);
FieldByName('PSID').Value:=Trim(PFID);
FieldByName('MDType').Value:=<><CAB5>';
RTSetSaveDataCDSBand(ADOQueryCmd,Tv6,ClientDataSet6,'JYOrder_Main_MD',2);
FieldByName('MDNO').Value:='MD'+Trim(maxno);
FieldByName('FactoryNo').Value:=Trim(ClientDataSet6.fieldbyname('FactoryNo').AsString);
FieldByName('FromFactoryNo').Value:=Trim(ClientDataSet6.fieldbyname('FromFactoryNo').AsString);
FieldByName('ToFactoryNo').Value:=Trim(ClientDataSet6.fieldbyname('FromFactoryNo').AsString);
FieldByName('DutyFactoryNo').Value:=Trim(ClientDataSet6.fieldbyname('FromFactoryNo').AsString);
FieldByName('CKName').Value:='<27><><EFBFBD>ڲֿ<DAB2>';
Post;
end;
Edit;
FieldByName('MDID').Value:=Trim(maxno);
FieldByName('MDNO').Value:='MD'+Trim(maxno);
FieldByName('OrdMainID').Value:=Trim(FMainId);
FieldByName('ConMainID').Value:=Trim(ConMainId);
FieldByName('ConSubID').Value:=Trim(ConSubId);
FieldByName('OrdSubId').Value:=Trim(OrdSubId);
FieldByName('PSID').Value:=Trim(PSID);
FieldByName('PFID').Value:=Trim(PFID);
Post;
Next;
end;
end;
ADOQueryCmd.Connection.CommitTrans;
ClientDataSet6.EnableControls;
except
ClientDataSet6.EnableControls;
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>쳣!','<27><>ʾ',0);
end;
end;
procedure TfrmMaDanManageSTBAK.v6Column8PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmGYSList:=TfrmGYSList.Create(Application);
with frmGYSList do
begin
if ShowModal=1 then
begin
with Self.ClientDataSet6 do
begin
Edit;
FieldByName('FromFactoryNo').Value:=Trim(frmGYSList.Order_Main.fieldbyname('ZKID').AsString) ;
FieldByName('FromFactoryName').Value:=Trim(frmGYSList.Order_Main.fieldbyname('KHNameJC').AsString);
//Post;
end;
end;
end;
finally
frmGYSList.Free;
end;
end;
procedure TfrmMaDanManageSTBAK.v6Column2PropertiesButtonClick(Sender: TObject;
AButtonIndex: Integer);
begin
try
frmGYSList:=TfrmGYSList.Create(Application);
with frmGYSList do
begin
if ShowModal=1 then
begin
with Self.ClientDataSet6 do
begin
Edit;
FieldByName('DutyFactoryNo').Value:=Trim(frmGYSList.Order_Main.fieldbyname('ZKID').AsString) ;
FieldByName('DutyFactoryName').Value:=Trim(frmGYSList.Order_Main.fieldbyname('KHNameJC').AsString);
//Post;
end;
end;
end;
finally
frmGYSList.Free;
end;
end;
procedure TfrmMaDanManageSTBAK.v6Column14PropertiesButtonClick(
Sender: TObject; AButtonIndex: Integer);
begin
try
frmGYSList:=TfrmGYSList.Create(Application);
with frmGYSList do
begin
if ShowModal=1 then
begin
with Self.ClientDataSet6 do
begin
Edit;
FieldByName('ToFactoryNo').Value:=Trim(frmGYSList.Order_Main.fieldbyname('ZKID').AsString) ;
FieldByName('ToFactoryName').Value:=Trim(frmGYSList.Order_Main.fieldbyname('KHNameJC').AsString);
//Post;
end;
end;
end;
finally
frmGYSList.Free;
end;
end;
procedure TfrmMaDanManageSTBAK.Button8Click(Sender: TObject);
begin
if ClientDataSet3.IsEmpty then Exit;
if Trim(ClientDataSet3.fieldbyname('MDID').AsString)='' then
begin
Application.MessageBox('<27><EFBFBD><EBB5A5><EFBFBD><EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD>!','<27><>ʾ',0);
Exit;
end;
if Application.MessageBox(<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
try
ADOQueryCmd.Connection.BeginTrans;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(ClientDataSet3.fieldbyname('MDID').AsString)+'''');
Open;
end;
with ADOQueryCmd do
begin
Edit;
RTSetsavedata(ADOQueryCmd,'JYOrder_Main_MD',ScrollBox7,2);
FieldByName('ChkResultPerson').Value:=Trim(DName);
FieldByName('ChkResultDateTime').Value:=SGetServerDateTime(ADOQueryTemp);
FieldByName('ChkNote').Value:=Trim(ChkNote.Text);
Post;
end;
ADOQueryCmd.Connection.CommitTrans;
except
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD><EFBFBD>쳣!','<27><>ʾ',0);
end;
end;
procedure TfrmMaDanManageSTBAK.Tv3FocusedRecordChanged(
Sender: TcxCustomGridTableView; APrevFocusedRecord,
AFocusedRecord: TcxCustomGridRecord;
ANewItemRecordFocusingChanged: Boolean);
var
i:Integer;
begin
with ADOQuery1 do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD');
sql.Add(' where MDID='''+Trim(ClientDataSet3.fieldbyname('MDId').AsString)+'''');
Open;
end;
SCSHDataNew(ADOQuery1,ScrollBox7,2);
with ScrollBox7 do
begin
for i:=0 to ControlCount-1 do
begin
if Controls[i] is TComboBox then
begin
if Trim(ADOQuery1.fieldbyname(TComboBox(Controls[i]).Name).AsString)<>'' then
begin
TComboBox(Controls[i]).ItemIndex:=TComboBox(Controls[i]).Items.IndexOf(ADOQuery1.fieldbyname(TComboBox(Controls[i]).Name).AsString)
end else
begin
TComboBox(Controls[i]).ItemIndex:=-1;
end;
end;
end;
end;
{ if Trim(ADOQuery1.fieldbyname('MFChk').AsString)<>'' then
begin
MFChk.ItemIndex:=MFChk.Items.IndexOf(ADOQuery1.fieldbyname('MFChk').AsString)
end else
begin
MFChk.ItemIndex:=-1;
end; }
ChkNote.Text:=Trim(ADOQuery1.fieldbyname('ChkNote').AsString);
end;
procedure TfrmMaDanManageSTBAK.v1Column2PropertiesEditValueChanged(
Sender: TObject);
var
PFID:String;
Mvalue:Boolean;
begin
Mvalue:=TcxCheckBox(Sender).EditingValue;
PFID:=Trim(ClientDataSet1.fieldbyname('PFID').AsString);
with ClientDataSet1 do
begin
while ClientDataSet1.Locate('SSel',True,[])=True do
begin
Edit;
FieldByName('SSel').Value:=False;
Post;
end;
ClientDataSet1.Locate('PFID',PFID,[]);
Edit;
FieldByName('SSel').Value:=Mvalue;
Post;
end;
InitGrid();
end;
procedure TfrmMaDanManageSTBAK.Tv6MouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
{ with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.Add('select * from JYOrder_Main_MD where MDID='''+Trim(ClientDataSet6.fieldbyname('MDID').AsString)+'''');
Open;
end; }
if ClientDataSet6.IsEmpty then Exit;
if Trim(ClientDataSet6.fieldbyname('CRFlag').AsString)='<27><><EFBFBD><EFBFBD>' then
begin
Tv6.OptionsSelection.CellSelect:=False;
end else
begin
Tv6.OptionsSelection.CellSelect:=True;
end;
if Trim(SParameters1)='<27><>Ȩ<EFBFBD><C8A8>' then Exit;
if Trim(ClientDataSet6.fieldbyname('MDID').asstring)<>'' then
begin
Tv6.OptionsSelection.CellSelect:=False;
end else
begin
Tv6.OptionsSelection.CellSelect:=True;
end;
end;
procedure TfrmMaDanManageSTBAK.Tv3MouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if Trim(SParameters1)='<27><>Ȩ<EFBFBD><C8A8>' then Exit;
if ClientDataSet3.IsEmpty then Exit;
if Trim(ClientDataSet3.fieldbyname('MDID').asstring)<>'' then
begin
Tv3.OptionsSelection.CellSelect:=False;
end else
begin
Tv3.OptionsSelection.CellSelect:=True;
end;
end;
procedure TfrmMaDanManageSTBAK.FormShow(Sender: TObject);
begin
ReadCxGrid('Tv1',Tv1,<><CAB5><EFBFBD>뵥');
ReadCxGrid('Tv2',Tv2,<><CAB5><EFBFBD>뵥');
ReadCxGrid('Tv3',Tv3,<><CAB5><EFBFBD>뵥');
ReadCxGrid('Tv5',Tv5,<><CAB5><EFBFBD>뵥');
ReadCxBandedGrid('Tv6',Tv6,<><CAB5><EFBFBD>뵥');
end;
end.