D10sxYilanbuyi/F02染色计划单/U_DyeSimpleTechnicsList.pas

1705 lines
52 KiB
ObjectPascal
Raw Normal View History

2025-09-30 17:22:54 +08:00
unit U_DyeSimpleTechnicsList;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls,
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit,
cxTextEdit, cxPC, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator,
dxBarBuiltInMenu, Menus, U_BaseList, dxSkinsCore, dxSkinsDefaultPainters,
dxDateRanges, dxScrollbarAnnotations, cxContainer, cxDropDownEdit, cxLabel,
2025-11-12 17:32:20 +08:00
cxButtons, cxMemo, U_frameFPList, U_frameGJList, U_frameGDXList, U_frameFSList,
U_frameCCQXList, U_frameJGQXList, U_frameRGQXList, U_frameYMList;
//U_frameJGQXList, U_frameRGQXList, U_frameCCQXList, U_frameYMList
2025-09-30 17:22:54 +08:00
type
TfrmDyeSimpleTechnicsList = class(TfrmBaseList)
ToolBar1: TToolBar;
TBRafresh: TToolButton;
TBDel: TToolButton;
TBClose: TToolButton;
ADOQueryTemp: TADOQuery;
ADOQueryCmd: TADOQuery;
Panel1: TPanel;
ToolButton2: TToolButton;
Label1: TLabel;
DTMName: TEdit;
ADOQueryMain: TADOQuery;
Label3: TLabel;
DTMNo: TEdit;
GPM_2: TcxGridPopupMenu;
DS_2: TDataSource;
CDS_2: TClientDataSet;
cxTabControl1: TcxTabControl;
Tchk: TToolButton;
TNochk: TToolButton;
DS_PsType: TDataSource;
CDS_PSType: TClientDataSet;
ADOQuery1: TADOQuery;
GPM_1: TcxGridPopupMenu;
ToolButton3: TToolButton;
ToolButton1: TToolButton;
ToolButton4: TToolButton;
2025-10-16 19:49:06 +08:00
TbSave: TToolButton;
2025-09-30 17:22:54 +08:00
Panel2: TPanel;
cxGrid2: TcxGrid;
Tv2: TcxGridDBTableView;
v2Ssel: TcxGridDBColumn;
v2GYNO: TcxGridDBColumn;
v2GYName: TcxGridDBColumn;
v2GYGX: TcxGridDBColumn;
cxGridLevel1: TcxGridLevel;
Splitter1: TSplitter;
ScrollBox1: TScrollBox;
Splitter2: TSplitter;
Panel3: TPanel;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid9: TcxGrid;
Tv3: TcxGridDBTableView;
cxGridLevel8: TcxGridLevel;
Tv1PSType: TcxGridDBColumn;
CDS_GX: TClientDataSet;
DS_GX: TDataSource;
Tv3PSNO: TcxGridDBColumn;
Tv3PSType: TcxGridDBColumn;
Tv3PSName: TcxGridDBColumn;
Tv3PSID: TcxGridDBColumn;
Tv2DTMID: TcxGridDBColumn;
2025-10-16 19:49:06 +08:00
ToolBar2: TToolBar;
ToolButton5: TToolButton;
Tv2Editer: TcxGridDBColumn;
Tv2Edittime: TcxGridDBColumn;
2025-11-12 17:32:20 +08:00
ToolButton6: TToolButton;
Tv3Page: TcxGridDBColumn;
GPM_3: TcxGridPopupMenu;
2025-09-30 17:22:54 +08:00
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);
procedure TBDelClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBRafreshClick(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
procedure DTMNoChange(Sender: TObject);
procedure TchkClick(Sender: TObject);
procedure TNochkClick(Sender: TObject);
procedure cxTabControl1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ToolButton3Click(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure ToolButton4Click(Sender: TObject);
procedure cxGridDBColumn1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure Tv2FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
procedure ButtonEdit(Sender: TObject; AButtonIndex: Integer);
procedure Tv1DblClick(Sender: TObject);
2025-10-16 19:49:06 +08:00
procedure TbSaveClick(Sender: TObject);
2025-11-12 17:32:20 +08:00
2025-10-16 19:49:06 +08:00
procedure ToolButton5Click(Sender: TObject);
2025-11-12 17:32:20 +08:00
procedure ToolButton6Click(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure DTMNameKeyPress(Sender: TObject; var Key: Char);
procedure DTMNoKeyPress(Sender: TObject; var Key: Char);
2025-09-30 17:22:54 +08:00
private
{ Private declarations }
procedure InitGrid();
procedure SetStatus();
procedure InitPSTypeGrid();
procedure InitGlide();
procedure InitGXDetails();
2025-11-12 17:32:20 +08:00
procedure CloseAllFrames();
2025-10-16 19:49:06 +08:00
function SaveData(): Boolean;
2025-11-12 17:32:20 +08:00
function GetNextFrameTop: Integer;
// function SaveData(): Boolean;
2025-10-16 19:49:06 +08:00
procedure FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil);
procedure ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
function FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
2025-11-12 17:32:20 +08:00
procedure SetXH();
2025-09-30 17:22:54 +08:00
public
2025-10-16 19:49:06 +08:00
fPSIDList: string;
2025-09-30 17:22:54 +08:00
fmanage: string;
end;
var
frmDyeSimpleTechnicsList: TfrmDyeSimpleTechnicsList;
2025-11-12 17:32:20 +08:00
frameFPList1, frameFPList2, frameFPList3: tframeFPList;
frameGJList1, frameGJList2, frameGJList3: tframeGJList;
frameFSList1, frameFSList2, frameFSList3: tframeFSList;
frameGDXList1, frameGDXList2, frameGDXList3: TframeGDXList;
frameJGQXList1, frameJGQXList2, frameJGQXList3: TframeJGQXList;
frameRGQXList1, frameRGQXList2, frameRGQXList3: TframeRGQXList;
frameCCQXList1, frameCCQXList2, frameCCQXList3: TframeCCQXList;
frameYMList1, frameYMList2, frameYMList3: TframeYMList;
2025-09-30 17:22:54 +08:00
implementation
uses
U_DataLink, U_RTFun, U_ZDYHelp, U_DyeTechnicsinput, U_DyeProcessDefin;
{$R *.dfm}
2025-11-12 17:32:20 +08:00
procedure TfrmDyeSimpleTechnicsList.SetXH();
var
i: Integer;
begin
with CDS_GX do
begin
First;
i := 1;
while not Eof do
begin
with CDS_GX do
begin
Edit;
FieldByName('XHNoTemp').Value := i;
Post;
end;
i := i + 1;
Next;
end;
end;
with CDS_GX do
begin
CDS_GX.IndexFieldNames := '';
First;
i := 1;
while not Eof do
begin
with CDS_GX do
begin
Edit;
FieldByName('PSNO').Value := FieldByName('XHNoTemp').AsInteger;
Post;
end;
i := i + 1;
Next;
end;
CDS_GX.IndexFieldNames := 'PSNO';
end;
end;
2025-09-30 17:22:54 +08:00
procedure TfrmDyeSimpleTechnicsList.SetStatus();
var
i: integer;
begin
Tchk.Visible := false;
TNochk.Visible := false;
TBDel.Visible := false;
2025-11-12 17:32:20 +08:00
// Panel_zm.Visible := False;
// Panel_ccqx.Visible := False;
// Panel_rgqx.Visible := False;
// Panel_jgqx.Visible := False;
// Panel_dx.Visible := False;
// Panel_FS.Visible := False;
// Panel_GJ.Visible := False;
// Panel_FP.Visible := False;
2025-09-30 17:22:54 +08:00
// for i := 0 to tv2.ColumnCount - 1 do
// begin
// if uppercase(tv2.Columns[i].DataBinding.FieldName) <> 'SSEL' then
// tv2.Columns[i].Options.Editing := false;
// end;
if cxTabControl1.TabIndex = 0 then
begin
Tchk.Visible := true;
TBDel.Visible := true;
end;
if cxTabControl1.TabIndex = 1 then
begin
TNochk.Visible := true;
end;
if cxTabControl1.TabIndex = 2 then
begin
end;
end;
procedure TfrmDyeSimpleTechnicsList.InitGrid();
begin
try
ADOQueryMain.DisableControls;
2025-11-12 17:32:20 +08:00
2025-09-30 17:22:54 +08:00
with ADOQueryMain do
begin
Close;
SQL.Clear;
sql.Add(' select * FROM Dye_Technics_Main');
if cxTabControl1.TabIndex < 2 then
sql.Add(' where isnull(status,''0'')=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
2025-10-16 19:49:06 +08:00
// ShowMessage(SQL.Text);
2025-09-30 17:22:54 +08:00
Open;
end;
SCreateCDS(ADOQueryMain, CDS_2);
SInitCDSData(ADOQueryMain, CDS_2);
2025-10-16 19:49:06 +08:00
// ShowMessage(ADOQueryMain.FieldByName('DTMID').AsString);
2025-09-30 17:22:54 +08:00
// ShowMessage(CDS_2.FieldByName('DTMID').AsString);
finally
ADOQueryMain.EnableControls;
//CDS_1.EmptyDataSet;
end;
end;
2025-11-12 17:32:20 +08:00
function TfrmDyeSimpleTechnicsList.SaveData(): Boolean;
var
MaxProcessID, MaxBCPID, MaxPSID, MaxDTMID, mDTMID, DTMPSlist: string;
maxsubid1, maxsubid2, maxsubid3, maxsubid4, maxsubid5, maxsubid6, mmaxgx, maxId, mPSID, mPSType: string;
2025-09-30 17:22:54 +08:00
begin
try
2025-11-12 17:32:20 +08:00
ADOQueryCmd.Connection.BeginTrans;
2025-09-30 17:22:54 +08:00
CDS_GX.First;
2025-11-12 17:32:20 +08:00
while not CDS_GX.Eof do
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
mPSID := CDS_GX.FieldByName('PSID').AsString;
mPSType := CDS_GX.FieldByName('PSType').AsString;
mDTMID := CDS_2.FieldByName('DTMID').AsString;
2025-09-30 17:22:54 +08:00
2025-11-12 17:32:20 +08:00
///////////////////////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dye_process////////////////////////////
with ADOQueryCmd do
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
Filtered := False;
2025-09-30 17:22:54 +08:00
Close;
SQL.Clear;
2025-11-12 17:32:20 +08:00
sql.Add(' select * from Dye_Process where PSID=''' + Trim(mPSID) + '''');
2025-09-30 17:22:54 +08:00
Open;
end;
2025-11-12 17:32:20 +08:00
2025-09-30 17:22:54 +08:00
with ADOQueryCmd do
begin
2025-11-12 17:32:20 +08:00
if Trim(CDS_GX.fieldbyname('PSID').AsString) = '' then
begin
if GetLSNo(ADOQueryCmd, maxId, 'JP', 'Dye_Process', 4, 1) = False then
begin
Result := False;
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
Exit;
end;
end
else
begin
maxId := Trim(mPSID);
end;
with CDS_GX do
begin
Edit;
FieldByName('PSID').Value := maxId;
Post;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Dye_Process where PSID=''' + Trim(maxId) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(mPSID) = '' then
begin
Append;
FieldByName('Filler').Value := Trim(DName);
end
else
begin
Edit;
FieldByName('Editer').Value := Trim(DName);
FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp);
end;
FieldByName('PSID').Value := Trim(maxId);
FieldByName('DTMID').Value := Trim(CDS_2.FieldByName('DTMID').AsString);
FieldByName('PSType').Value := Trim(mPSType);
FieldByName('PSName').Value := Trim(CDS_GX.FieldByName('PSName').AsString);
FieldByName('DTMName').Value := Trim(CDS_2.FieldByName('DTMName').AsString);
Post;
end;
2025-09-30 17:22:54 +08:00
end;
2025-11-12 17:32:20 +08:00
///////////////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dye_process////////////////////////////
if mPSType = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ' then
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
if CDS_GX.FieldByName('page').AsString = 'frameCCQXList1' then
begin
frameCCQXList1.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameCCQXList2' then
begin
frameCCQXList2.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameCCQXList3' then
begin
frameCCQXList3.SaveData(maxId);
end;
2025-09-30 17:22:54 +08:00
end
2025-11-12 17:32:20 +08:00
else if mPSType = '<27><>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD>ϴ' then
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
if CDS_GX.FieldByName('page').AsString = 'frameRGQXList1' then
begin
frameRGQXList1.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameRGQXList2' then
begin
frameRGQXList2.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameRGQXList3' then
begin
frameRGQXList3.SaveData(maxId);
end;
2025-09-30 17:22:54 +08:00
end
2025-11-12 17:32:20 +08:00
else if mPSType = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ' then
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
if CDS_GX.FieldByName('page').AsString = 'frameJGQXList1' then
begin
frameJGQXList1.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameJGQXList2' then
begin
frameJGQXList2.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameJGQXList3' then
begin
frameJGQXList3.SaveData(maxId);
end;
2025-09-30 17:22:54 +08:00
end
2025-11-12 17:32:20 +08:00
else if mPSType = '<27>ɶ<EFBFBD><C9B6><EFBFBD>' then
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
if CDS_GX.FieldByName('page').AsString = 'frameGDXList1' then
begin
frameGDXList1.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameGDXList2' then
begin
frameGDXList2.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameGDXList3' then
begin
frameGDXList3.SaveData(maxId);
end;
2025-09-30 17:22:54 +08:00
end
2025-11-12 17:32:20 +08:00
else if mPSType = '<27><>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>' then
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
if CDS_GX.FieldByName('page').AsString = 'frameFSList1' then
begin
frameFSList1.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameFSList2' then
begin
frameFSList2.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameFSList3' then
begin
frameFSList3.SaveData(maxId);
end;
2025-09-30 17:22:54 +08:00
end
2025-11-12 17:32:20 +08:00
else if mPSType = '<27><><EFBFBD><EFBFBD>' then
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
if CDS_GX.FieldByName('page').AsString = 'frameFPList1' then
begin
frameFPList1.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameFPList2' then
begin
frameFPList2.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameFPList3' then
begin
frameFPList3.SaveData(maxId);
end;
2025-09-30 17:22:54 +08:00
end
2025-11-12 17:32:20 +08:00
else if mPSType = '<27>ν<EFBFBD>' then
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
if CDS_GX.FieldByName('page').AsString = 'frameGJList1' then
begin
frameGJList1.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameGJList2' then
begin
frameGJList2.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameGJList3' then
begin
frameGJList3.SaveData(maxId);
end;
2025-09-30 17:22:54 +08:00
end
2025-11-12 17:32:20 +08:00
else if mPSType = '<27><>ë' then
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
if CDS_GX.FieldByName('page').AsString = 'frameYMList1' then
begin
frameYMList1.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameYMList2' then
begin
frameYMList2.SaveData(maxId);
end
else if CDS_GX.FieldByName('page').AsString = 'frameYMList3' then
begin
frameYMList3.SaveData(maxId);
end;
2025-09-30 17:22:54 +08:00
end;
2025-11-12 17:32:20 +08:00
2025-09-30 17:22:54 +08:00
CDS_GX.Next;
end;
2025-11-12 17:32:20 +08:00
if Trim(mDTMID) = '' then
begin
if GetLSNo(ADOQueryCmd, MaxDTMID, 'GY', 'Dye_Technics_Main', 3, 1) = False then
raise Exception.Create(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>');
end
else
begin
MaxDTMID := mDTMID;
end;
2025-09-30 17:22:54 +08:00
2025-11-12 17:32:20 +08:00
with ADOQueryCmd do
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
Close;
sql.Clear;
sql.Add('delete Dye_Technics_Sub where DTMID=' + quotedstr(trim(MaxDTMID)));
execsql;
2025-09-30 17:22:54 +08:00
end;
2025-10-16 19:49:06 +08:00
2025-11-12 17:32:20 +08:00
DTMPSlist := '';
with CDS_GX do
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
First;
while not Eof do
2025-10-16 19:49:06 +08:00
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
2025-11-12 17:32:20 +08:00
sql.Add('SELECT * FROM Dye_Technics_Sub WHERE 1=2');
Open;
2025-10-16 19:49:06 +08:00
end;
with ADOQueryCmd do
begin
2025-11-12 17:32:20 +08:00
Append;
FieldByName('PSNO').Value := Trim(CDS_GX.fieldbyname('PSNO').AsString);
FieldByName('DTMID').Value := Trim(MaxDTMID);
FieldByName('PSId').Value := Trim(CDS_GX.fieldbyname('PSId').AsString);
Post;
end;
if DTMPSlist = '' then
begin
DTMPSlist := Trim(CDS_GX.fieldbyname('PSNO').AsString) + '.' + Trim(CDS_GX.fieldbyname('PSName').AsString);
end
else
begin
DTMPSlist := DTMPSlist + '<27><>' + Trim(CDS_GX.fieldbyname('PSNO').AsString) + '.' + Trim(CDS_GX.fieldbyname('PSName').AsString);
2025-10-16 19:49:06 +08:00
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
2025-11-12 17:32:20 +08:00
sql.Add('SELECT * FROM Dye_Process WHERE PSID = ' + QuotedStr(Trim(CDS_GX.fieldbyname('PSId').AsString)));
Open;
end;
with ADOQueryCmd do
begin
Edit;
FieldByName('DTMName').Value := Trim(CDS_2.FieldByName('DTMName').AsString);
FieldByName('DTMID').Value := Trim(MaxDTMID);
Post;
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
Next;
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
end;
with ADOQueryCmd do
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
Close;
sql.Clear;
sql.Add('select * from Dye_Technics_Main where DTMID =' + quotedstr(Trim(MaxDTMID)));
Open;
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
with ADOQueryCmd do
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
if ADOQueryCmd.IsEmpty then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
Append;
FieldByName('Filler').Value := Trim(DName);
FieldByName('filltime').Value := SGetServerDateTime(ADOQueryTemp);
FieldByName('DTMID').Value := Trim(MaxDTMID);
end
else
begin
Edit;
FieldByName('Editer').Value := Trim(DName);
FieldByName('Edittime').Value := SGetServerDateTime(ADOQueryTemp);
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
FieldByName('DTMNo').Value := CDS_2.FieldByName('DTMNo').AsString;
FieldByName('DTMName').Value := CDS_2.FieldByName('DTMName').AsString;
FieldByName('DTMPSlist').Value := Trim(DTMPSlist);
Post;
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
ADOQueryCmd.Connection.CommitTrans;
// FPSID := maxId;
Result := True;
except
Result := False;
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
2025-10-16 19:49:06 +08:00
end;
end;
2025-11-12 17:32:20 +08:00
procedure TfrmDyeSimpleTechnicsList.InitPSTypeGrid();
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
try
ADOQueryCMD.DisableControls;
with ADOQueryCMD do
begin
// Filtered := False;
Close;
SQL.Clear;
sql.Add(' select *,PSXH=0 from Dye_Technics ');
Open;
end;
// SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS(ADOQueryCMD, CDS_PSType);
SInitCDSData(ADOQueryCMD, CDS_PSType);
finally
ADOQueryCMD.EnableControls;
2025-09-30 17:22:54 +08:00
end;
end;
2025-11-12 17:32:20 +08:00
procedure TfrmDyeSimpleTechnicsList.InitGlide();
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
try
ADOQueryTemp.DisableControls;
with ADOQueryTemp do
begin
Close;
SQL.Clear;
sql.Add(' select A.* FROM V_Dye_Technics_Details A');
sql.Add(' Where A.DTMID=''' + trim(CDS_2.fieldbyname('DTMID').AsString) + '''');
SQL.Add(' ORDER BY A.PSNO');
Open;
end;
SCreateCDS(ADOQueryTemp, CDS_GX);
SInitCDSData(ADOQueryTemp, CDS_GX);
finally
ADOQueryTemp.EnableControls;
2025-10-16 19:49:06 +08:00
end;
end;
2025-11-12 17:32:20 +08:00
procedure TfrmDyeSimpleTechnicsList.InitGXDetails();
2025-09-30 17:22:54 +08:00
begin
try
2025-11-12 17:32:20 +08:00
ADOQueryTemp.DisableControls;
2025-10-16 19:49:06 +08:00
CDS_GX.First;
2025-11-12 17:32:20 +08:00
while not CDS_GX.eof do
2025-09-30 17:22:54 +08:00
begin
2025-10-16 19:49:06 +08:00
2025-11-12 17:32:20 +08:00
with ADOQueryTemp do
begin
Close;
SQL.Clear;
sql.Add(' select A.* FROM V_Dye_Technics_Details A');
sql.Add(' Where A.PSID=''' + trim(CDS_GX.fieldbyname('PSID').AsString) + '''');
// SQL.Add(' and A.PSID = ''' + trim(CDS_2.fieldbyname('PSID').AsString) + '''');
Open;
end;
2025-10-16 19:49:06 +08:00
with ADOQueryCmd do
begin
Close;
SQL.Clear;
2025-11-12 17:32:20 +08:00
sql.Add(' select A.* FROM BS_Cloth_GY_Sub A');
sql.Add(' Where A.PSID=''' + trim(CDS_GX.fieldbyname('PSID').AsString) + '''');
// SQL.Add(' and A.PSID = ''' + trim(CDS_2.fieldbyname('PSID').AsString) + '''');
2025-10-16 19:49:06 +08:00
Open;
end;
2025-11-12 17:32:20 +08:00
// ShowMessage(IntToStr(ADOQueryCmd.RecordCount));
if CDS_GX.FieldByName('PSType').AsString = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ' then
begin
if self.FindComponent('frameCCQXList1') = nil then
begin
frameCCQXList1 := TframeCCQXList.Create(self);
frameCCQXList1.Name := 'frameCCQXList1';
frameCCQXList1.Parent := self.ScrollBox1;
frameCCQXList1.Top := GetNextFrameTop;
frameCCQXList1.Visible := True;
frameCCQXList1.LabelCCQX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameCCQXList1.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameCCQXList1';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameCCQXList1.Panel_ccqx, 2);
frameCCQXList1.ccqx_note.Lines.Text := ADOQueryTemp.FieldByName('ccqx_note').AsString;
SCreateCDS(ADOQueryCmd, frameCCQXList1.CDS_CCQX);
SInitCDSData(ADOQueryCmd, frameCCQXList1.CDS_CCQX);
end
else if self.FindComponent('frameCCQXList2') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameCCQXList2 := TframeCCQXList.Create(self);
frameCCQXList2.Name := 'frameCCQXList2';
frameCCQXList2.Parent := self.ScrollBox1;
frameCCQXList2.Top := GetNextFrameTop;
frameCCQXList2.Visible := True;
frameCCQXList2.LabelCCQX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameCCQXList2.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameCCQXList2';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameCCQXList2.Panel_ccqx, 2);
frameCCQXList2.ccqx_note.Lines.Text := ADOQueryTemp.FieldByName('ccqx_note').AsString;
SCreateCDS(ADOQueryCmd, frameCCQXList2.CDS_CCQX);
SInitCDSData(ADOQueryCmd, frameCCQXList2.CDS_CCQX);
2025-10-16 19:49:06 +08:00
end
2025-11-12 17:32:20 +08:00
else if self.FindComponent('frameCCQXList3') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameCCQXList3 := TframeCCQXList.Create(self);
frameCCQXList3.Name := 'frameCCQXList3';
frameCCQXList3.Parent := self.ScrollBox1;
frameCCQXList3.Top := GetNextFrameTop;
frameCCQXList3.Visible := True;
frameCCQXList3.LabelCCQX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameCCQXList3.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameCCQXList3';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameCCQXList3.Panel_ccqx, 2);
frameCCQXList3.ccqx_note.Lines.Text := ADOQueryTemp.FieldByName('ccqx_note').AsString;
SCreateCDS(ADOQueryCmd, frameCCQXList3.CDS_CCQX);
SInitCDSData(ADOQueryCmd, frameCCQXList3.CDS_CCQX);
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
end
else if CDS_GX.FieldByName('PSType').AsString = '<27><>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD>ϴ' then
begin
if self.FindComponent('frameRGQXList1') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameRGQXList1 := TframeRGQXList.Create(self);
frameRGQXList1.Name := 'frameRGQXList1';
frameRGQXList1.Parent := self.ScrollBox1;
frameRGQXList1.Top := GetNextFrameTop;
frameRGQXList1.Visible := True;
frameRGQXList1.LabelRGQX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameRGQXList1.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameRGQXList1';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameRGQXList1.Panel_rgqx, 2);
frameRGQXList1.rgqx_note.Lines.Text := ADOQueryTemp.FieldByName('rgqx_note').AsString;
SCreateCDS(ADOQueryCmd, frameRGQXList1.CDS_rgQX);
SInitCDSData(ADOQueryCmd, frameRGQXList1.CDS_RGQX);
end
else if self.FindComponent('frameRGQXList2') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameRGQXList2 := TframeRGQXList.Create(self);
frameRGQXList2.Name := 'frameRGQXList2';
frameRGQXList2.Parent := self.ScrollBox1;
frameRGQXList2.Top := GetNextFrameTop;
frameRGQXList2.Visible := True;
frameRGQXList2.LabelRGQX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameRGQXList2.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameRGQXList2';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameRGQXList2.Panel_rgqx, 2);
frameRGQXList2.rgqx_note.Lines.Text := ADOQueryTemp.FieldByName('rgqx_note').AsString;
SCreateCDS(ADOQueryCmd, frameRGQXList2.CDS_rgQX);
SInitCDSData(ADOQueryCmd, frameRGQXList2.CDS_RGQX);
end
else if self.FindComponent('frameRGQXList3') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameRGQXList3 := TframeRGQXList.Create(self);
frameRGQXList3.Name := 'frameRGQXList3';
frameRGQXList3.Parent := self.ScrollBox1;
frameRGQXList3.Top := GetNextFrameTop;
frameRGQXList3.Visible := True;
frameRGQXList3.LabelRGQX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameRGQXList3.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameRGQXList3';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameRGQXList3.Panel_rgqx, 2);
frameRGQXList3.rgqx_note.Lines.Text := ADOQueryTemp.FieldByName('rgqx_note').AsString;
SCreateCDS(ADOQueryCmd, frameRGQXList3.CDS_rgQX);
SInitCDSData(ADOQueryCmd, frameRGQXList3.CDS_RGQX);
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
end
else if CDS_GX.FieldByName('PSType').AsString = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ' then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
if self.FindComponent('frameJGQXList1') = nil then
begin
frameJGQXList1 := TframeJGQXList.Create(self);
frameJGQXList1.Name := 'frameJGQXList1';
frameJGQXList1.Parent := self.ScrollBox1;
frameJGQXList1.Top := GetNextFrameTop;
frameJGQXList1.Visible := True;
frameJGQXList1.LabelJGQX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameJGQXList1.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameJGQXList1';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameJGQXList1.Panel_jgqx, 2);
frameJGQXList1.jgqx_note.Lines.Text := ADOQueryTemp.FieldByName('jgqx_note').AsString;
SCreateCDS(ADOQueryCmd, frameJGQXList1.CDS_JGQX);
SInitCDSData(ADOQueryCmd, frameJGQXList1.CDS_JGQX);
end
else if self.FindComponent('frameJGQXList2') = nil then
begin
frameJGQXList2 := TframeJGQXList.Create(self);
frameJGQXList2.Name := 'frameJGQXList2';
frameJGQXList2.Parent := self.ScrollBox1;
frameJGQXList2.Top := GetNextFrameTop;
frameJGQXList2.Visible := True;
frameJGQXList2.LabelJGQX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameJGQXList2.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameJGQXList2';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameJGQXList2.Panel_jgqx, 2);
frameJGQXList2.jgqx_note.Lines.Text := ADOQueryTemp.FieldByName('jgqx_note').AsString;
SCreateCDS(ADOQueryCmd, frameJGQXList2.CDS_JGQX);
SInitCDSData(ADOQueryCmd, frameJGQXList2.CDS_JGQX);
end
else if self.FindComponent('frameJGQXList3') = nil then
begin
frameJGQXList3 := TframeJGQXList.Create(self);
frameJGQXList3.Name := 'frameJGQXList3';
frameJGQXList3.Parent := self.ScrollBox1;
frameJGQXList3.Top := GetNextFrameTop;
frameJGQXList3.Visible := True;
frameJGQXList3.LabelJGQX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameJGQXList3.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameJGQXList3';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameJGQXList3.Panel_jgqx, 2);
frameJGQXList3.jgqx_note.Lines.Text := ADOQueryTemp.FieldByName('jgqx_note').AsString;
SCreateCDS(ADOQueryCmd, frameJGQXList3.CDS_JGQX);
SInitCDSData(ADOQueryCmd, frameJGQXList3.CDS_JGQX);
end;
end
else if CDS_GX.FieldByName('PSType').AsString = '<27>ɶ<EFBFBD><C9B6><EFBFBD>' then
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
if self.FindComponent('frameGDXList1') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameGDXList1 := TframeGDXList.Create(self);
frameGDXList1.Name := 'frameGDXList1';
frameGDXList1.Parent := self.ScrollBox1;
frameGDXList1.Top := GetNextFrameTop;
frameGDXList1.Visible := True;
frameGDXList1.LabelGDX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameGDXList1.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameGDXList1';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameGDXList1.Panel_dx, 2);
frameGDXList1.dx_Precautions.Lines.Text := ADOQueryTemp.FieldByName('dx_Precautions').AsString;
2025-10-16 19:49:06 +08:00
end
2025-11-12 17:32:20 +08:00
else if self.FindComponent('frameGDXList2') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameGDXList2 := TframeGDXList.Create(self);
frameGDXList2.Name := 'frameGDXList2';
frameGDXList2.Parent := self.ScrollBox1;
frameGDXList2.Top := GetNextFrameTop;
frameGDXList2.Visible := True;
frameGDXList2.LabelGDX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameGDXList2.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameGDXList2';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameGDXList2.Panel_dx, 2);
frameGDXList2.dx_Precautions.Lines.Text := ADOQueryTemp.FieldByName('dx_Precautions').AsString;
end
else if self.FindComponent('frameGDXList3') = nil then
begin
frameGDXList3 := TframeGDXList.Create(self);
frameGDXList3.Name := 'frameGDXList3';
frameGDXList3.Parent := self.ScrollBox1;
frameGDXList3.Top := GetNextFrameTop;
frameGDXList3.Visible := True;
frameGDXList3.LabelGDX.Caption := CDS_GX.FieldByName('PSName').AsString;
frameGDXList3.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameGDXList3';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameGDXList3.Panel_dx, 2);
frameGDXList3.dx_Precautions.Lines.Text := ADOQueryTemp.FieldByName('dx_Precautions').AsString;
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
end
else if CDS_GX.FieldByName('PSType').AsString = '<27><>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>' then
begin
if self.FindComponent('frameFSList1') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameFSList1 := tframeFSList.Create(self);
frameFSList1.Name := 'frameFSList1';
frameFSList1.Parent := self.ScrollBox1;
frameFSList1.Top := GetNextFrameTop;
frameFSList1.Visible := True;
frameFSList1.LabelFS.Caption := CDS_GX.FieldByName('PSName').AsString;
frameFSList1.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameFSList1';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameFSList1.Panel_fs, 2);
frameFSList1.fs_Precautions.Lines.Text := ADOQueryTemp.FieldByName('fs_Precautions').AsString;
SCreateCDS(ADOQueryCmd, frameFSList1.CDS_fS);
SInitCDSData(ADOQueryCmd, frameFSList1.CDS_fS);
2025-10-16 19:49:06 +08:00
end
2025-11-12 17:32:20 +08:00
else if self.FindComponent('frameFSList2') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameFSList2 := tframeFSList.Create(self);
frameFSList2.Name := 'frameFSList2';
frameFSList2.Parent := self.ScrollBox1;
frameFSList2.Top := GetNextFrameTop;
frameFSList2.Visible := True;
frameFSList2.LabelFS.Caption := CDS_GX.FieldByName('PSName').AsString;
frameFSList2.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameFSList2';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameFSList2.Panel_fs, 2);
frameFSList2.fs_Precautions.Lines.Text := ADOQueryTemp.FieldByName('fs_Precautions').AsString;
SCreateCDS(ADOQueryCmd, frameFSList2.CDS_fS);
SInitCDSData(ADOQueryCmd, frameFSList2.CDS_fS);
2025-10-16 19:49:06 +08:00
end
2025-11-12 17:32:20 +08:00
else if self.FindComponent('frameFSList3') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameFSList3 := tframeFSList.Create(self);
frameFSList3.Name := 'frameFSList3';
frameFSList3.Parent := self.ScrollBox1;
frameFSList3.Top := GetNextFrameTop;
frameFSList3.Visible := True;
frameFSList3.LabelFS.Caption := CDS_GX.FieldByName('PSName').AsString;
frameFSList3.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameFSList3';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameFSList3.Panel_fs, 2);
frameFSList3.fs_Precautions.Lines.Text := ADOQueryTemp.FieldByName('fs_Precautions').AsString;
SCreateCDS(ADOQueryCmd, frameFSList3.CDS_fS);
SInitCDSData(ADOQueryCmd, frameFSList3.CDS_fS);
end
end
else if CDS_GX.FieldByName('PSType').AsString = '<27><><EFBFBD><EFBFBD>' then
begin
2025-10-16 19:49:06 +08:00
2025-11-12 17:32:20 +08:00
if self.FindComponent('frameFPList1') = nil then
begin
frameFPList1 := TframeFPList.Create(self);
frameFPList1.Name := 'frameFPList1';
frameFPList1.Parent := self.ScrollBox1;
frameFPList1.Top := GetNextFrameTop;
frameFPList1.Visible := True;
frameFPList1.LabelFP.Caption := CDS_GX.FieldByName('PSName').AsString;
frameFPList1.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameFPList1';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameFPList1.Panel_fp, 2);
frameFPList1.fp_Precautions.Lines.Text := ADOQueryTemp.FieldByName('fp_Precautions').AsString;
SCreateCDS(ADOQueryCmd, frameFPList1.CDS_FP);
SInitCDSData(ADOQueryCmd, frameFPList1.CDS_FP);
2025-10-16 19:49:06 +08:00
end
2025-11-12 17:32:20 +08:00
else if self.FindComponent('frameFPList2') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameFPList2 := TframeFPList.Create(self);
frameFPList2.Name := 'frameFPList2';
frameFPList2.Parent := self.ScrollBox1;
frameFPList2.Top := GetNextFrameTop;
frameFPList2.Visible := True;
frameFPList2.LabelFP.Caption := CDS_GX.FieldByName('PSName').AsString;
frameFPList2.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameFPList2';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameFPList2.Panel_fp, 2);
frameFPList2.fp_Precautions.Lines.Text := ADOQueryTemp.FieldByName('fp_Precautions').AsString;
SCreateCDS(ADOQueryCmd, frameFPList2.CDS_FP);
SInitCDSData(ADOQueryCmd, frameFPList2.CDS_FP);
end
else if self.FindComponent('frameFPList3') = nil then
begin
frameFPList3 := TframeFPList.Create(self);
frameFPList3.Name := 'frameFPList3';
frameFPList3.Parent := self.ScrollBox1;
frameFPList3.Top := GetNextFrameTop;
frameFPList3.Visible := True;
frameFPList3.LabelFP.Caption := CDS_GX.FieldByName('PSName').AsString;
frameFPList3.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameFPList3';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameFPList3.Panel_fp, 2);
frameFPList3.fp_Precautions.Lines.Text := ADOQueryTemp.FieldByName('fp_Precautions').AsString;
SCreateCDS(ADOQueryCmd, frameFPList3.CDS_FP);
SInitCDSData(ADOQueryCmd, frameFPList3.CDS_FP);
end;
2025-10-16 19:49:06 +08:00
2025-11-12 17:32:20 +08:00
end
else if CDS_GX.FieldByName('PSType').AsString = '<27>ν<EFBFBD>' then
begin
if self.FindComponent('frameGJList1') = nil then
begin
frameGJList1 := TframeGJList.Create(self);
frameGJList1.Name := 'frameGJList1';
frameGJList1.Parent := self.ScrollBox1;
frameGJList1.Top := GetNextFrameTop;
frameGJList1.Visible := True;
frameGJList1.LabelGJ.Caption := CDS_GX.FieldByName('PSName').AsString;
frameGJList1.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameGJList1';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameGJList1.Panel_gj, 2);
frameGJList1.gj_Precautions.Lines.Text := ADOQueryTemp.FieldByName('gj_Precautions').AsString;
SCreateCDS(ADOQueryCmd, frameGJList1.CDS_GJ);
SInitCDSData(ADOQueryCmd, frameGJList1.CDS_GJ);
2025-10-16 19:49:06 +08:00
end
2025-11-12 17:32:20 +08:00
else if self.FindComponent('frameGJList2') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameGJList2 := TframeGJList.Create(self);
frameGJList2.Name := 'frameGJList2';
frameGJList2.Parent := self.ScrollBox1;
frameGJList2.Top := GetNextFrameTop;
frameGJList2.Visible := True;
frameGJList2.LabelGJ.Caption := CDS_GX.FieldByName('PSName').AsString;
frameGJList2.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameGJList2';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameGJList2.Panel_gj, 2);
frameGJList2.gj_Precautions.Lines.Text := ADOQueryTemp.FieldByName('gj_Precautions').AsString;
SCreateCDS(ADOQueryCmd, frameGJList2.CDS_GJ);
SInitCDSData(ADOQueryCmd, frameGJList2.CDS_GJ);
2025-10-16 19:49:06 +08:00
end
2025-11-12 17:32:20 +08:00
else if self.FindComponent('frameGJList3') = nil then
begin
frameGJList3 := TframeGJList.Create(self);
frameGJList3.Name := 'frameGJList3';
frameGJList3.Parent := self.ScrollBox1;
frameGJList3.Top := GetNextFrameTop;
frameGJList3.Visible := True;
frameGJList3.LabelGJ.Caption := CDS_GX.FieldByName('PSName').AsString;
frameGJList3.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameGJList3';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameGJList3.Panel_gj, 2);
frameGJList3.gj_Precautions.Lines.Text := ADOQueryTemp.FieldByName('gj_Precautions').AsString;
SCreateCDS(ADOQueryCmd, frameGJList3.CDS_GJ);
SInitCDSData(ADOQueryCmd, frameGJList3.CDS_GJ);
end;
end
else if CDS_GX.FieldByName('PSType').AsString = '<27><>ë' then
begin
if self.FindComponent('frameYMList1') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameYMList1 := TframeYMList.Create(self);
frameYMList1.Name := 'frameYMList1';
frameYMList1.Parent := self.ScrollBox1;
frameYMList1.Top := GetNextFrameTop;
frameYMList1.Visible := True;
frameYMList1.LabelYM.Caption := CDS_GX.FieldByName('PSName').AsString;
frameYMList1.InitGrid();
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameYMList1';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameYMList1.Panel_zm, 2);
frameYMList1.zm_Precautions.Lines.Text := ADOQueryTemp.FieldByName('zm_Precautions').AsString;
2025-10-16 19:49:06 +08:00
end
2025-11-12 17:32:20 +08:00
else if self.FindComponent('frameYMList2') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameYMList2 := TframeYMList.Create(self);
frameYMList2.Name := 'frameYMList2';
frameYMList2.Parent := self.ScrollBox1;
frameYMList2.Top := GetNextFrameTop;
frameYMList2.Visible := True;
frameYMList2.LabelYM.Caption := CDS_GX.FieldByName('PSName').AsString;
frameYMList2.InitGrid();
2025-10-16 19:49:06 +08:00
2025-11-12 17:32:20 +08:00
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameYMList2';
CDS_GX.Post;
SCSHData(ADOQueryTemp, frameYMList2.Panel_zm, 2);
frameYMList2.zm_Precautions.Lines.Text := ADOQueryTemp.FieldByName('zm_Precautions').AsString;
2025-10-16 19:49:06 +08:00
end
2025-11-12 17:32:20 +08:00
else if self.FindComponent('frameYMList3') = nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
frameYMList3 := TframeYMList.Create(self);
frameYMList3.Name := 'frameYMList3';
frameYMList3.Parent := self.ScrollBox1;
frameYMList3.Top := GetNextFrameTop;
frameYMList3.Visible := True;
frameYMList3.LabelYM.Caption := CDS_GX.FieldByName('PSName').AsString;
frameYMList3.InitGrid();
2025-10-16 19:49:06 +08:00
2025-11-12 17:32:20 +08:00
CDS_GX.Edit;
CDS_GX.FieldByName('page').AsString := 'frameYMList3';
CDS_GX.Post;
2025-10-16 19:49:06 +08:00
2025-11-12 17:32:20 +08:00
SCSHData(ADOQueryTemp, frameYMList3.Panel_zm, 2);
frameYMList3.zm_Precautions.Lines.Text := ADOQueryTemp.FieldByName('zm_Precautions').AsString;
end;
2025-10-16 19:49:06 +08:00
end;
CDS_GX.Next;
end;
2025-11-12 17:32:20 +08:00
finally
ADOQueryTemp.EnableControls;
end;
end;
procedure TfrmDyeSimpleTechnicsList.CloseAllFrames();
var
i: Integer;
Component: TComponent;
begin
// <20>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD> GDXList <20><><EFBFBD><EFBFBD>
for i := 1 to 3 do
begin
Component := self.FindComponent('frameGDXList' + IntToStr(i));
if Component <> nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
TFrame(Component).Free;
end;
end;
// <20>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD> FSList <20><><EFBFBD><EFBFBD>
for i := 1 to 3 do
begin
Component := self.FindComponent('frameFSList' + IntToStr(i));
if Component <> nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
TFrame(Component).Free;
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
end;
// <20>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD> FPList <20><><EFBFBD><EFBFBD>
for i := 1 to 3 do
begin
Component := self.FindComponent('frameFPList' + IntToStr(i));
if Component <> nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
TFrame(Component).Free;
2025-09-30 17:22:54 +08:00
end;
2025-11-12 17:32:20 +08:00
end;
2025-09-30 17:22:54 +08:00
2025-11-12 17:32:20 +08:00
// <20>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD> GJList <20><><EFBFBD><EFBFBD>
for i := 1 to 3 do
begin
Component := self.FindComponent('frameGJList' + IntToStr(i));
if Component <> nil then
2025-09-30 17:22:54 +08:00
begin
2025-11-12 17:32:20 +08:00
TFrame(Component).Free;
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
end;
2025-10-16 19:49:06 +08:00
2025-11-12 17:32:20 +08:00
for i := 1 to 3 do
begin
Component := self.FindComponent('frameCCQXList' + IntToStr(i));
if Component <> nil then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
TFrame(Component).Free;
end;
end;
for i := 1 to 3 do
begin
Component := self.FindComponent('frameRGQXList' + IntToStr(i));
if Component <> nil then
begin
TFrame(Component).Free;
end;
end;
for i := 1 to 3 do
begin
Component := self.FindComponent('frameJGQXList' + IntToStr(i));
if Component <> nil then
begin
TFrame(Component).Free;
end;
end;
for i := 1 to 3 do
begin
Component := self.FindComponent('frameYMList' + IntToStr(i));
if Component <> nil then
begin
TFrame(Component).Free;
end;
end;
end;
procedure TfrmDyeSimpleTechnicsList.FormDestroy(Sender: TObject);
begin
inherited;
frmDyeSimpleTechnicsList := nil;
end;
procedure TfrmDyeSimpleTechnicsList.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key = VK_ESCAPE then // VK_ESCAPE <20><> ESC <20><><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
begin
Key := 0; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Close; // <20><><EFBFBD><EFBFBD> ModalResult := mrCancel;
end;
end;
procedure TfrmDyeSimpleTechnicsList.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inherited;
Action := caFree;
end;
procedure TfrmDyeSimpleTechnicsList.TBCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmDyeSimpleTechnicsList.TBDelClick(Sender: TObject);
begin
if CDS_2.IsEmpty then
Exit;
if CDS_2.Locate('ssel', true, []) = false then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><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;
try
ADOQueryCmd.Connection.BeginTrans;
with CDS_2 do
begin
DisableControls;
First;
while not eof do
begin
if Fieldbyname('ssel').AsBoolean then
2025-10-16 19:49:06 +08:00
begin
2025-11-12 17:32:20 +08:00
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('delete Dye_Technics_Main where DTMID=''' + Trim(CDS_2.fieldbyname('DTMID').AsString) + '''');
sql.Add('delete Dye_Technics_Sub where DTMID=''' + Trim(CDS_2.fieldbyname('DTMID').AsString) + '''');
2025-10-16 19:49:06 +08:00
2025-11-12 17:32:20 +08:00
execsql;
end;
// CDS_1.First;
// while not CDS_1.Eof do
// begin
// with ADOQueryCmd do
// begin
// close;
// sql.Clear;
// sql.Add('delete Dye_Process where PSID=''' + Trim(CDS_1.fieldbyname('PSID').AsString) + '''');
// sql.Add('delete BS_Cloth_GY_Sub where PSID=''' + Trim(CDS_1.fieldbyname('PSID').AsString) + '''');
// sql.Add('delete BS_Cloth_GY_Main where PSID=''' + Trim(CDS_1.fieldbyname('PSID').AsString) + '''');
//
// execsql;
// end;
// CDS_1.Next;
// end;
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
next;
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
First;
EnableControls;
2025-10-16 19:49:06 +08:00
end;
2025-11-12 17:32:20 +08:00
InitGrid();
2025-10-16 19:49:06 +08:00
ADOQueryCmd.Connection.CommitTrans;
except
ADOQueryCmd.Connection.RollbackTrans;
2025-11-12 17:32:20 +08:00
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
end;
end;
procedure TfrmDyeSimpleTechnicsList.FormShow(Sender: TObject);
begin
inherited;
ReadCxGrid(trim(self.Caption) + 'Tv1', Tv1, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
ReadCxGrid(trim(self.Caption) + 'Tv2', Tv2, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
ReadCxGrid(trim(self.Caption) + 'Tv3', Tv3, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
SetStatus();
InitGrid();
KeyPreview := True;
end;
procedure TfrmDyeSimpleTechnicsList.TBRafreshClick(Sender: TObject);
begin
InitGrid();
end;
procedure TfrmDyeSimpleTechnicsList.TbSaveClick(Sender: TObject);
begin
if SaveData() then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
end;
end;
procedure TfrmDyeSimpleTechnicsList.ToolButton1Click(Sender: TObject);
begin
CDS_2.Append;
tv2.Columns[1].Options.Editing := true;
tv2.Columns[2].Options.Editing := true;
end;
procedure TfrmDyeSimpleTechnicsList.ToolButton2Click(Sender: TObject);
begin
if ADOQueryMain.Active then
begin
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS(ADOQueryMain, CDS_2);
SInitCDSData(ADOQueryMain, CDS_2);
end;
end;
procedure TfrmDyeSimpleTechnicsList.ToolButton3Click(Sender: TObject);
begin
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
WriteCxGrid(trim(self.Caption) + 'Tv2', Tv2, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
WriteCxGrid(trim(self.Caption) + 'Tv3', Tv3, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
end;
procedure TfrmDyeSimpleTechnicsList.ToolButton4Click(Sender: TObject);
begin
InitPSTypeGrid();
tv2.Columns[1].Options.Editing := true;
tv2.Columns[2].Options.Editing := true;
end;
procedure TfrmDyeSimpleTechnicsList.ToolButton5Click(Sender: TObject);
begin
if CDS_GX.IsEmpty then
begin
Exit;
end;
if (CDS_GX.FieldByName('PSID').asString = '') or (CDS_GX.FieldByName('PSID').asString = null) then
begin
CDS_GX.Delete;
// InitGXDetails();
end
else
begin
Application.MessageBox('<27>ѱ<EFBFBD><D1B1><EFBFBD><E6B9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_OK);
2025-09-30 17:22:54 +08:00
end;
2025-11-12 17:32:20 +08:00
SetXH();
end;
procedure TfrmDyeSimpleTechnicsList.ToolButton6Click(Sender: TObject);
begin
CloseAllFrames();
InitGXDetails();
2025-09-30 17:22:54 +08:00
end;
procedure TfrmDyeSimpleTechnicsList.Tv1DblClick(Sender: TObject);
begin
with CDS_GX do
begin
Append;
FieldByName('PSNO').Value := CDS_GX.RecordCount + 1;
FieldByName('PSType').Value := CDS_PSType.fieldbyname('PSType').AsString;
FieldByName('PSId').Value := '';
post;
end;
2025-11-12 17:32:20 +08:00
// InitGXDetails();
2025-09-30 17:22:54 +08:00
end;
procedure TfrmDyeSimpleTechnicsList.Tv2FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
begin
2025-11-12 17:32:20 +08:00
CloseAllFrames();
2025-09-30 17:22:54 +08:00
SetStatus();
InitGlide();
2025-11-12 17:32:20 +08:00
// InitGXDetails();
2025-09-30 17:22:54 +08:00
// ShowMessage(CDS_2.FieldByName('DTMID').AsString);
if (CDS_2.FieldByName('DTMID').AsString = '') or (CDS_2.FieldByName('DTMID').AsString = null) then
begin
InitPSTypeGrid();
end
else
begin
ADOQueryCMD.DisableControls;
with ADOQueryCMD do
begin
// Filtered := False;
Close;
SQL.Clear;
sql.Add(' select *,PSXH=0 from Dye_Technics where 1 = 2 ');
Open;
end;
// SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS(ADOQueryCMD, CDS_PSType);
SInitCDSData(ADOQueryCMD, CDS_PSType);
end;
end;
procedure TfrmDyeSimpleTechnicsList.ButtonEdit(Sender: TObject; AButtonIndex: Integer);
begin
try
frmDyeProcessDefin := TfrmDyeProcessDefin.Create(Application);
with frmDyeProcessDefin do
begin
FPSType := self.CDS_GX.FieldByName('PSType').Value;
FPSID := Self.CDS_GX.FieldByName('PSID').Value;
BtnInt := 3;//<2F>
TbSave.visible := false;
TbUpFile.Visible := False;
if ShowModal = 1 then
begin
end;
end;
finally
frmDyeProcessDefin.Free;
end;
end;
2025-11-12 17:32:20 +08:00
procedure TfrmDyeSimpleTechnicsList.DTMNameKeyPress(Sender: TObject;
var Key: Char);
begin
ToolButton2.Click;
end;
2025-09-30 17:22:54 +08:00
procedure TfrmDyeSimpleTechnicsList.DTMNoChange(Sender: TObject);
begin
ToolButton2.Click;
end;
2025-11-12 17:32:20 +08:00
procedure TfrmDyeSimpleTechnicsList.DTMNoKeyPress(Sender: TObject;
var Key: Char);
begin
ToolButton2.Click;
end;
2025-09-30 17:22:54 +08:00
procedure TfrmDyeSimpleTechnicsList.TchkClick(Sender: TObject);
begin
if CDS_2.IsEmpty then
exit;
if CDS_2.Locate('ssel', true, []) = false then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
try
ADOQueryCmd.Connection.BeginTrans;
with CDS_2 do
begin
DisableControls;
First;
while not eof do
begin
if Fieldbyname('ssel').AsBoolean then
begin
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('update Dye_Technics_Main SET status=''1'' ');
sql.Add('where DTMID =' + quotedstr(trim(CDS_2.fieldbyname('DTMID').AsString)));
execsql;
end;
end;
next;
end;
First;
EnableControls;
end;
InitGrid();
ADOQueryCmd.Connection.CommitTrans;
except
ADOQueryCmd.Connection.RollbackTrans;
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
end;
end;
procedure TfrmDyeSimpleTechnicsList.TNochkClick(Sender: TObject);
begin
if CDS_2.IsEmpty then
exit;
if CDS_2.Locate('ssel', true, []) = false then
begin
Application.MessageBox(<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
try
ADOQueryCmd.Connection.BeginTrans;
with CDS_2 do
begin
DisableControls;
First;
while not eof do
begin
if Fieldbyname('ssel').AsBoolean then
begin
with ADOQueryCmd do
begin
close;
sql.Clear;
sql.Add('update Dye_Technics_Main SET status=''0'' ');
sql.Add('where DTMID =' + quotedstr(trim(CDS_2.fieldbyname('DTMID').AsString)));
execsql;
end;
end;
next;
end;
First;
EnableControls;
end;
InitGrid();
ADOQueryCmd.Connection.CommitTrans;
except
ADOQueryCmd.Connection.RollbackTrans;
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
end;
end;
procedure TfrmDyeSimpleTechnicsList.cxGridDBColumn1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin
try
frmDyeProcessDefin := TfrmDyeProcessDefin.Create(Application);
with frmDyeProcessDefin do
begin
// FPSType := self.CDS_1.FieldByName('PSType').Value;
// FPSID := Self.CDS_1.FieldByName('PSID').Value;
BtnInt := 3;//<2F>
TbSave.visible := false;
TbUpFile.Visible := False;
if ShowModal = 1 then
begin
end;
end;
finally
frmDyeProcessDefin.Free;
end;
end;
procedure TfrmDyeSimpleTechnicsList.cxTabControl1Change(Sender: TObject);
begin
SetStatus();
InitGrid();
end;
procedure TfrmDyeSimpleTechnicsList.FormCreate(Sender: TObject);
begin
inherited;
fmanage := Trim(DParameters1);
2025-11-12 17:32:20 +08:00
2025-09-30 17:22:54 +08:00
end;
2025-10-16 19:49:06 +08:00
procedure TfrmDyeSimpleTechnicsList.FillAllTextEditsWithValue(AParent: TWinControl; const AHint, AValue: string; AExclude: TcxTextEdit = nil); // <20><>ѡ<EFBFBD><D1A1><EFBFBD>ų<EFBFBD><C5B3>ض<EFBFBD><D8B6>ؼ<EFBFBD>
var
i: Integer;
AControl: TControl;
ATextEdit: TcxTextEdit;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
if (AControl is TcxTextEdit) and ((AControl as TcxTextEdit).Text = '') then
begin
ATextEdit := AControl as TcxTextEdit;
if (ATextEdit.Hint = AHint) and (ATextEdit <> AExclude) then
ATextEdit.Text := AValue;
end;
end;
end;
procedure TfrmDyeSimpleTechnicsList.ClearAllTextEditsByHint(AParent: TWinControl; const AHint: string; AExclude: TcxTextEdit = nil);
var
i: Integer;
AControl: TControl;
begin
for i := 0 to AParent.ControlCount - 1 do
begin
AControl := AParent.Controls[i];
// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD> TcxTextEdit<69><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Hint ƥ<><EFBFBD>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD>ų<EFBFBD><C5B3>Ŀؼ<C4BF>
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl) <> AExclude) then
begin
TcxTextEdit(AControl).Text := ''; // ֱ<><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
end;
end;
end;
function TfrmDyeSimpleTechnicsList.FindLastEditedTextEdit(AParent: TWinControl; const AHint: string): string;
var
i, j: Integer;
AControl: TControl;
SortedControls: TList;
TempControl: TControl;
begin
Result := '';
// <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>ӿؼ<D3BF><D8BC><EFBFBD>ֱ<EFBFBD>ӷ<EFBFBD><D3B7>ؿ<EFBFBD>
if AParent.ControlCount = 0 then
Exit;
// ʹ<><CAB9> TList <20><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݾɰ<DDBE> Delphi<68><69>
SortedControls := TList.Create;
try
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿؼ<D3BF><D8BC><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5>б<EFBFBD>
for i := 0 to AParent.ControlCount - 1 do
SortedControls.Add(AParent.Controls[i]);
// <20>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD>򣺰<EFBFBD> Top<6F><70>Y<EFBFBD><59><EFBFBD><EFBFBD><EAA3A9> Left<66><74>X<EFBFBD><58><EFBFBD><EFBFBD><EAA3A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for i := 0 to SortedControls.Count - 1 do
begin
for j := i + 1 to SortedControls.Count - 1 do
begin
// <20>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD> Top <20><> Left
if (TControl(SortedControls[i]).Top > TControl(SortedControls[j]).Top) or ((TControl(SortedControls[i]).Top = TControl(SortedControls[j]).Top) and (TControl(SortedControls[i]).Left > TControl(SortedControls[j]).Left)) then
begin
// <20><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
TempControl := TControl(SortedControls[i]);
SortedControls[i] := SortedControls[j];
SortedControls[j] := TempControl;
end;
end;
end;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀؼ<C4BF>
for i := 0 to SortedControls.Count - 1 do
begin
AControl := TControl(SortedControls[i]);
if (AControl is TcxTextEdit) and (TcxTextEdit(AControl).Hint = AHint) and (TcxTextEdit(AControl).Text <> '') then
begin
Result := TcxTextEdit(AControl).Text; // <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļᱻ<C4BB><E1B1BB><EFBFBD><EFBFBD>
end;
end;
finally
SortedControls.Free;
end;
end;
2025-11-12 17:32:20 +08:00
function TfrmDyeSimpleTechnicsList.GetNextFrameTop: Integer;
var
i: Integer;
Ctrl: TControl;
MaxBottom: Integer;
begin
MaxBottom := 0;
// <20><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>κοؼ<CEBF><D8BC><EFBFBD><EFBFBD><EFBFBD> 0 <20><>ʼ
if ScrollBox1.ControlCount = 1 then
begin
Result := 0;
Exit;
end;
for i := 0 to ScrollBox1.ControlCount - 1 do
begin
Ctrl := ScrollBox1.Controls[i];
if (Ctrl is TFrame) and Ctrl.Visible then
begin
// <20><><EFBFBD>㵱ǰ frame <20>ĵײ<C4B5>λ<EFBFBD><CEBB>
var BottomPos := Ctrl.Top + Ctrl.Height;
if BottomPos > MaxBottom then
MaxBottom := BottomPos;
end;
end;
// <20><><EFBFBD><EFBFBD>һЩ<D2BB><D0A9><EFBFBD><EFBFBD>
Result := MaxBottom + 5;
end;
2025-09-30 17:22:54 +08:00
end.