D10sxYilanbuyi/F02染色计划单/U_DyeSimpleTechnicsList.pas
2025-10-16 19:49:06 +08:00

2011 lines
56 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_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,
cxButtons, cxMemo;
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;
TbSave: TToolButton;
Panel2: TPanel;
cxGrid2: TcxGrid;
Tv2: TcxGridDBTableView;
v2Ssel: TcxGridDBColumn;
v2GYNO: TcxGridDBColumn;
v2GYName: TcxGridDBColumn;
v2GYGX: TcxGridDBColumn;
cxGridLevel1: TcxGridLevel;
Splitter1: TSplitter;
ScrollBox1: TScrollBox;
Panel_GJ: TPanel;
Label9: TLabel;
cxLabel240: TcxLabel;
gj_speed: TcxTextEdit;
cxLabel278: TcxLabel;
gj_number: TcxTextEdit;
TbGJReplace2: TcxButton;
TbGJClear2: TcxButton;
cxLabel234: TcxLabel;
cxLabel236: TcxLabel;
cxLabel237: TcxLabel;
cxLabel238: TcxLabel;
cxLabel247: TcxLabel;
cxLabel249: TcxLabel;
cxLabel250: TcxLabel;
cxLabel251: TcxLabel;
cxLabel252: TcxLabel;
cxLabel253: TcxLabel;
cxLabel273: TcxLabel;
gj_temperature1: TcxTextEdit;
gj_temperature10: TcxTextEdit;
gj_temperature11: TcxTextEdit;
gj_temperature2: TcxTextEdit;
gj_temperature3: TcxTextEdit;
gj_temperature4: TcxTextEdit;
gj_temperature5: TcxTextEdit;
gj_temperature6: TcxTextEdit;
gj_temperature7: TcxTextEdit;
gj_temperature8: TcxTextEdit;
gj_temperature9: TcxTextEdit;
cxGrid8: TcxGrid;
TvGJ: TcxGridDBTableView;
cxGridDBColumn24: TcxGridDBColumn;
cxGridDBColumn27: TcxGridDBColumn;
cxGridLevel7: TcxGridLevel;
cxLabel9: TcxLabel;
Panel_FP: TPanel;
Label10: TLabel;
cxLabel290: TcxLabel;
fp_speed: TcxTextEdit;
fp_gjNumber: TcxTextEdit;
cxLabel279: TcxLabel;
TbFPReplace2: TcxButton;
TbFPClear2: TcxButton;
cxLabel284: TcxLabel;
cxLabel286: TcxLabel;
cxLabel287: TcxLabel;
cxLabel288: TcxLabel;
cxLabel297: TcxLabel;
cxLabel299: TcxLabel;
cxLabel300: TcxLabel;
cxLabel301: TcxLabel;
cxLabel302: TcxLabel;
cxLabel303: TcxLabel;
cxLabel323: TcxLabel;
fp_temperature1: TcxTextEdit;
fp_temperature10: TcxTextEdit;
fp_temperature11: TcxTextEdit;
fp_temperature2: TcxTextEdit;
fp_temperature3: TcxTextEdit;
fp_temperature4: TcxTextEdit;
fp_temperature5: TcxTextEdit;
fp_temperature6: TcxTextEdit;
fp_temperature7: TcxTextEdit;
fp_temperature8: TcxTextEdit;
fp_temperature9: TcxTextEdit;
cxGrid6: TcxGrid;
TvFP: TcxGridDBTableView;
cxGridDBColumn14: TcxGridDBColumn;
cxGridDBColumn17: TcxGridDBColumn;
cxGridLevel5: TcxGridLevel;
cxLabel8: TcxLabel;
Panel_zm: TPanel;
Label2: TLabel;
Label11: TLabel;
zm_inout: TcxTextEdit;
zm_style: TcxComboBox;
cxLabel336: TcxLabel;
zm_mainElec: TcxTextEdit;
cxLabel344: TcxLabel;
zm_needleHigh: TcxTextEdit;
cxLabel342: TcxLabel;
Panel_ccqx: TPanel;
Label4: TLabel;
cxLabel113: TcxLabel;
ccqx_speed: TcxTextEdit;
ccqx_temperature1: TcxTextEdit;
ccqx_temperature2: TcxTextEdit;
ccqx_temperature3: TcxTextEdit;
ccqx_temperature4: TcxTextEdit;
ccqx_temperature5: TcxTextEdit;
ccqx_temperature6: TcxTextEdit;
TbCCQXReplace: TcxButton;
TbccqxClear: TcxButton;
cxLabel41: TcxLabel;
cxLabel42: TcxLabel;
cxLabel45: TcxLabel;
cxLabel46: TcxLabel;
cxLabel47: TcxLabel;
cxLabel48: TcxLabel;
cxGrid4: TcxGrid;
TvCCQX: TcxGridDBTableView;
cxGridDBColumn2: TcxGridDBColumn;
Tv1ccqx_rate: TcxGridDBColumn;
cxGridLevel4: TcxGridLevel;
cxLabel1: TcxLabel;
Panel_rgqx: TPanel;
Label5: TLabel;
cxLabel114: TcxLabel;
cxLabel150: TcxLabel;
cxLabel165: TcxLabel;
rgqx_daoSet: TcxTextEdit;
rgqx_speed: TcxTextEdit;
rgqx_waterTemper: TcxTextEdit;
cxGrid3: TcxGrid;
TvRGQX: TcxGridDBTableView;
cxGridDBColumn1: TcxGridDBColumn;
cxGridDBColumn7: TcxGridDBColumn;
cxGridLevel2: TcxGridLevel;
cxLabel2: TcxLabel;
Panel_jgqx: TPanel;
Label6: TLabel;
cxLabel340: TcxLabel;
jgqx_keepTemper: TcxTextEdit;
jgqx_keepTime: TcxTextEdit;
cxLabel347: TcxLabel;
cxLabel173: TcxLabel;
cxLabel334: TcxLabel;
jgqx_upperSpeed: TcxTextEdit;
jgqx_downSpeed: TcxTextEdit;
cxGrid5: TcxGrid;
TvJGQX: TcxGridDBTableView;
cxGridDBColumn9: TcxGridDBColumn;
cxGridDBColumn10: TcxGridDBColumn;
cxGridDBColumn11: TcxGridDBColumn;
cxGridDBColumn12: TcxGridDBColumn;
cxGridDBColumn13: TcxGridDBColumn;
cxGridLevel3: TcxGridLevel;
cxLabel3: TcxLabel;
Panel_dx: TPanel;
Label7: TLabel;
cxLabel4: TcxLabel;
dx_speed: TcxTextEdit;
cxLabel21: TcxLabel;
cxLabel23: TcxLabel;
cxLabel24: TcxLabel;
cxLabel25: TcxLabel;
cxLabel6: TcxLabel;
cxLabel61: TcxLabel;
cxLabel62: TcxLabel;
cxLabel63: TcxLabel;
cxLabel64: TcxLabel;
cxLabel65: TcxLabel;
dx_temperature1: TcxTextEdit;
dx_temperature5: TcxTextEdit;
dx_temperature9: TcxTextEdit;
dx_temperature6: TcxTextEdit;
dx_temperature3: TcxTextEdit;
dx_temperature4: TcxTextEdit;
dx_temperature7: TcxTextEdit;
dx_temperature8: TcxTextEdit;
dx_temperature10: TcxTextEdit;
dx_temperature2: TcxTextEdit;
TbDXReplace2: TcxButton;
TbDXClear2: TcxButton;
cxLabel189: TcxLabel;
dx_temperature11: TcxTextEdit;
cxLabel5: TcxLabel;
Panel_FS: TPanel;
Label8: TLabel;
cxLabel198: TcxLabel;
fs_speed: TcxTextEdit;
FS_Style: TcxComboBox;
fs_isVacuun: TcxComboBox;
TbFSReplace2: TcxButton;
TBFScLEAR2: TcxButton;
cxLabel192: TcxLabel;
cxLabel194: TcxLabel;
cxLabel195: TcxLabel;
cxLabel196: TcxLabel;
cxLabel205: TcxLabel;
cxLabel207: TcxLabel;
cxLabel208: TcxLabel;
cxLabel209: TcxLabel;
cxLabel210: TcxLabel;
cxLabel211: TcxLabel;
cxLabel231: TcxLabel;
fs_temperature1: TcxTextEdit;
fs_temperature10: TcxTextEdit;
fs_temperature11: TcxTextEdit;
fs_temperature2: TcxTextEdit;
fs_temperature3: TcxTextEdit;
fs_temperature4: TcxTextEdit;
fs_temperature5: TcxTextEdit;
fs_temperature6: TcxTextEdit;
fs_temperature7: TcxTextEdit;
fs_temperature8: TcxTextEdit;
fs_temperature9: TcxTextEdit;
cxGrid7: TcxGrid;
TvFS: TcxGridDBTableView;
cxGridDBColumn19: TcxGridDBColumn;
cxGridDBColumn22: TcxGridDBColumn;
cxGridLevel6: TcxGridLevel;
cxLabel7: TcxLabel;
Splitter2: TSplitter;
Panel3: TPanel;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid9: TcxGrid;
Tv3: TcxGridDBTableView;
cxGridLevel8: TcxGridLevel;
TbJGQXAdd: TcxButton;
TbJGQXDel: TcxButton;
TbRGQXAdd: TcxButton;
TbRGQXDel: TcxButton;
TbCCQXAdd: TcxButton;
TbCCQXDel: TcxButton;
TbGJAdd: TcxButton;
TbGJDel: TcxButton;
TbFPAdd: TcxButton;
TbFPDel: TcxButton;
TbFSAdd: TcxButton;
TbFSDel: TcxButton;
Tv1PSType: TcxGridDBColumn;
CDS_GX: TClientDataSet;
DS_GX: TDataSource;
Tv3PSNO: TcxGridDBColumn;
Tv3PSType: TcxGridDBColumn;
Tv3PSName: TcxGridDBColumn;
Tv3PSID: TcxGridDBColumn;
CDS_CCQX: TClientDataSet;
DS_CCQX: TDataSource;
CDS_RGQX: TClientDataSet;
DS_rgqx: TDataSource;
CDS_JGQX: TClientDataSet;
CDS_fS: TClientDataSet;
CDS_gj: TClientDataSet;
CDS_FP: TClientDataSet;
DS_jgqx: TDataSource;
DS_FS: TDataSource;
DS_gj: TDataSource;
DS_FP: TDataSource;
zm_Precautions: TcxMemo;
ccqx_note: TcxMemo;
rgqx_note: TcxMemo;
jgqx_note: TcxMemo;
dx_Precautions: TcxMemo;
fs_Precautions: TcxMemo;
gj_Precautions: TcxMemo;
fp_Precautions: TcxMemo;
Tv2DTMID: TcxGridDBColumn;
cxLabel10: TcxLabel;
gj_leftGap: TcxTextEdit;
cxLabel11: TcxLabel;
gj_rightGap: TcxTextEdit;
cxLabel12: TcxLabel;
fp_leftGap: TcxTextEdit;
cxLabel13: TcxLabel;
fp_rightGap: TcxTextEdit;
TvCCQXserialno: TcxGridDBColumn;
TvRGQXserialno: TcxGridDBColumn;
TvJGQXserialno: TcxGridDBColumn;
TvFSColumn1: TcxGridDBColumn;
TvGJserialno: TcxGridDBColumn;
TvFPserialno: TcxGridDBColumn;
ToolBar2: TToolBar;
ToolButton5: TToolButton;
Tv2Editer: TcxGridDBColumn;
Tv2Edittime: TcxGridDBColumn;
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);
procedure TbSaveClick(Sender: TObject);
procedure TbCCQXAddClick(Sender: TObject);
procedure TbRGQXAddClick(Sender: TObject);
procedure TbJGQXAddClick(Sender: TObject);
procedure TbFSAddClick(Sender: TObject);
procedure TbGJAddClick(Sender: TObject);
procedure TbFPAddClick(Sender: TObject);
procedure TbCCQXDelClick(Sender: TObject);
procedure TbFPDelClick(Sender: TObject);
procedure TbGJDelClick(Sender: TObject);
procedure TbFSDelClick(Sender: TObject);
procedure TbJGQXDelClick(Sender: TObject);
procedure TbRGQXDelClick(Sender: TObject);
procedure TbCCQXReplaceClick(Sender: TObject);
procedure TbDXReplace2Click(Sender: TObject);
procedure TbFSReplace2Click(Sender: TObject);
procedure TbGJReplace2Click(Sender: TObject);
procedure TbFPReplace2Click(Sender: TObject);
procedure TbccqxClearClick(Sender: TObject);
procedure TbDXClear2Click(Sender: TObject);
procedure TBFScLEAR2Click(Sender: TObject);
procedure TbGJClear2Click(Sender: TObject);
procedure TbFPClear2Click(Sender: TObject);
procedure ToolButton5Click(Sender: TObject);
private
{ Private declarations }
procedure InitGrid();
procedure SetStatus();
procedure InitPSTypeGrid();
procedure InitGlide();
procedure InitGXDetails();
function SaveData(): Boolean;
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;
public
fPSIDList: string;
fmanage: string;
end;
var
frmDyeSimpleTechnicsList: TfrmDyeSimpleTechnicsList;
implementation
uses
U_DataLink, U_RTFun, U_ZDYHelp, U_DyeTechnicsinput, U_DyeProcessDefin;
{$R *.dfm}
procedure TfrmDyeSimpleTechnicsList.SetStatus();
var
i: integer;
begin
Tchk.Visible := false;
TNochk.Visible := false;
TBDel.Visible := false;
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;
// 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;
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) + ''' ');
// ShowMessage(SQL.Text);
Open;
end;
SCreateCDS(ADOQueryMain, CDS_2);
SInitCDSData(ADOQueryMain, CDS_2);
// ShowMessage(ADOQueryMain.FieldByName('DTMID').AsString);
// ShowMessage(CDS_2.FieldByName('DTMID').AsString);
finally
ADOQueryMain.EnableControls;
//CDS_1.EmptyDataSet;
end;
end;
procedure TfrmDyeSimpleTechnicsList.InitPSTypeGrid();
begin
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;
end;
end;
procedure TfrmDyeSimpleTechnicsList.InitGlide();
begin
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;
end;
end;
procedure TfrmDyeSimpleTechnicsList.InitGXDetails();
begin
try
ADOQueryTemp.DisableControls;
CDS_GX.First;
while not CDS_GX.eof do
begin
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;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
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) + '''');
Open;
end;
// ShowMessage(IntToStr(ADOQueryCmd.RecordCount));
if CDS_GX.FieldByName('PSType').AsString = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ' then
begin
Panel_ccqx.Visible := True;
SCSHData(ADOQueryTemp, Panel_ccqx, 2);
ccqx_note.Lines.Text := ADOQueryTemp.FieldByName('ccqx_note').AsString;
SCreateCDS(ADOQueryCmd, CDS_CCQX);
SInitCDSData(ADOQueryCmd, CDS_CCQX);
end
else if CDS_GX.FieldByName('PSType').AsString = '<27><>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD>ϴ' then
begin
Panel_rgqx.Visible := True;
SCSHData(ADOQueryTemp, Panel_rgqx, 2);
rgqx_note.Lines.Text := ADOQueryTemp.FieldByName('rgqx_note').AsString;
SCreateCDS(ADOQueryCmd, CDS_rgQX);
SInitCDSData(ADOQueryCmd, CDS_RGQX);
end
else if CDS_GX.FieldByName('PSType').AsString = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ' then
begin
Panel_jgqx.Visible := True;
SCSHData(ADOQueryTemp, Panel_jgqx, 2);
jgqx_note.Lines.Text := ADOQueryTemp.FieldByName('jgqx_note').AsString;
SCreateCDS(ADOQueryCmd, CDS_JGQX);
SInitCDSData(ADOQueryCmd, CDS_JGQX);
end
else if CDS_GX.FieldByName('PSType').AsString = '<27>ɶ<EFBFBD><C9B6><EFBFBD>' then
begin
Panel_dx.Visible := True;
SCSHData(ADOQueryTemp, Panel_dx, 2);
dx_Precautions.Lines.Text := ADOQueryTemp.FieldByName('dx_Precautions').AsString;
end
else if CDS_GX.FieldByName('PSType').AsString = '<27><>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>' then
begin
Panel_fs.Visible := True;
SCSHData(ADOQueryTemp, Panel_fs, 2);
fs_Precautions.Lines.Text := ADOQueryTemp.FieldByName('fs_Precautions').AsString;
SCreateCDS(ADOQueryCmd, CDS_fS);
SInitCDSData(ADOQueryCmd, CDS_fS);
end
else if CDS_GX.FieldByName('PSType').AsString = '<27><><EFBFBD><EFBFBD>' then
begin
Panel_fp.Visible := True;
SCSHData(ADOQueryTemp, Panel_fp, 2);
fp_Precautions.Lines.Text := ADOQueryTemp.FieldByName('fp_Precautions').AsString;
SCreateCDS(ADOQueryCmd, CDS_FP);
SInitCDSData(ADOQueryCmd, CDS_FP);
end
else if CDS_GX.FieldByName('PSType').AsString = '<27>ν<EFBFBD>' then
begin
Panel_gj.Visible := True;
SCSHData(ADOQueryTemp, Panel_gj, 2);
gj_Precautions.Lines.Text := ADOQueryTemp.FieldByName('gj_Precautions').AsString;
SCreateCDS(ADOQueryCmd, CDS_GJ);
SInitCDSData(ADOQueryCmd, CDS_GJ);
end
else if CDS_GX.FieldByName('PSType').AsString = '<27><>ë' then
begin
Panel_zm.Visible := True;
SCSHData(ADOQueryTemp, Panel_zm, 2);
zm_Precautions.Lines.Text := ADOQueryTemp.FieldByName('zm_Precautions').AsString;
end;
CDS_GX.Next;
end;
finally
ADOQueryTemp.EnableControls;
end;
end;
procedure TfrmDyeSimpleTechnicsList.FormDestroy(Sender: TObject);
begin
inherited;
frmDyeSimpleTechnicsList := nil;
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
begin
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) + '''');
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;
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.TbDXClear2Click(Sender: TObject);
begin
ClearAllTextEditsByHint(panel_DX, '<27>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD>¿<EFBFBD>');
end;
procedure TfrmDyeSimpleTechnicsList.TbDXReplace2Click(Sender: TObject);
begin
FillAllTextEditsWithValue(panel_dx, '<27>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD>¿<EFBFBD>', FindLastEditedTextEdit(panel_dx, '<27>ɶ<EFBFBD><C9B6><EFBFBD><EFBFBD>¿<EFBFBD>'));
end;
procedure TfrmDyeSimpleTechnicsList.TbFPAddClick(Sender: TObject);
begin
with CDS_FP do
begin
Append;
CDS_FP.FieldByName('serialno').Value := CDS_FP.RecordCount + 1;
Post;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TbFPClear2Click(Sender: TObject);
begin
ClearAllTextEditsByHint(panel_Fp, '<27><><EFBFBD><EFBFBD><EFBFBD>¿<EFBFBD>');
end;
procedure TfrmDyeSimpleTechnicsList.TbFPDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_FP.IsEmpty then
begin
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) = IDYES then
begin
if Trim(CDS_FP.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_FP.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_FP.Delete;
end
else
exit;
i := 0;
CDS_FP.First;
while not CDS_FP.Eof do
begin
i := i + 1;
CDS_FP.Edit;
CDS_FP.fieldByName('serialno').value := i;
CDS_FP.Post;
CDS_FP.Next;
end;
end
else
begin
Application.MessageBox('<27>޿<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TbFPReplace2Click(Sender: TObject);
begin
FillAllTextEditsWithValue(panel_fp, '<27><><EFBFBD><EFBFBD><EFBFBD>¿<EFBFBD>', FindLastEditedTextEdit(panel_fp, '<27><><EFBFBD><EFBFBD><EFBFBD>¿<EFBFBD>'));
end;
procedure TfrmDyeSimpleTechnicsList.TbFSAddClick(Sender: TObject);
begin
with CDS_FS do
begin
Append;
CDS_FS.FieldByName('serialno').Value := CDS_FS.RecordCount + 1;
Post;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TBFScLEAR2Click(Sender: TObject);
begin
ClearAllTextEditsByHint(panel_FS, '<27><>ˮ<EFBFBD>¿<EFBFBD>');
end;
procedure TfrmDyeSimpleTechnicsList.TbFSDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_FS.IsEmpty then
begin
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) = IDYES then
begin
if Trim(CDS_FS.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_FS.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_FS.Delete;
end
else
exit;
i := 0;
CDS_FS.First;
while not CDS_FS.Eof do
begin
i := i + 1;
CDS_FS.Edit;
CDS_FS.fieldByName('serialno').value := i;
CDS_FS.Post;
CDS_FS.Next;
end;
end
else
begin
Application.MessageBox('<27>޿<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TbFSReplace2Click(Sender: TObject);
begin
FillAllTextEditsWithValue(panel_fs, '<27><>ˮ<EFBFBD>¿<EFBFBD>', FindLastEditedTextEdit(panel_fs, '<27><>ˮ<EFBFBD>¿<EFBFBD>'));
end;
procedure TfrmDyeSimpleTechnicsList.TbGJAddClick(Sender: TObject);
begin
with CDS_GJ do
begin
Append;
CDS_GJ.FieldByName('serialno').Value := CDS_GJ.RecordCount + 1;
Post;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TbGJClear2Click(Sender: TObject);
begin
ClearAllTextEditsByHint(panel_gj, '<27>ν<EFBFBD><CEBD>¿<EFBFBD>');
end;
procedure TfrmDyeSimpleTechnicsList.TbGJDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_GJ.IsEmpty then
begin
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) = IDYES then
begin
if Trim(CDS_GJ.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_GJ.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_GJ.Delete;
end
else
exit;
i := 0;
CDS_GJ.First;
while not CDS_GJ.Eof do
begin
i := i + 1;
CDS_GJ.Edit;
CDS_GJ.fieldByName('serialno').value := i;
CDS_GJ.Post;
CDS_GJ.Next;
end;
end
else
begin
Application.MessageBox('<27>޿<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TbGJReplace2Click(Sender: TObject);
begin
FillAllTextEditsWithValue(panel_gj, '<27>ν<EFBFBD><CEBD>¿<EFBFBD>', FindLastEditedTextEdit(panel_gj, '<27>ν<EFBFBD><CEBD>¿<EFBFBD>'));
end;
procedure TfrmDyeSimpleTechnicsList.TbJGQXAddClick(Sender: TObject);
begin
with CDS_JGQX do
begin
Append;
CDS_JGQX.FieldByName('serialno').Value := CDS_JGQX.RecordCount + 1;
Post;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TbJGQXDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_JGQX.IsEmpty then
begin
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) = IDYES then
begin
if Trim(CDS_JGQX.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_JGQX.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_JGQX.Delete;
end
else
exit;
i := 0;
CDS_JGQX.First;
while not CDS_JGQX.Eof do
begin
i := i + 1;
CDS_JGQX.Edit;
CDS_JGQX.fieldByName('serialno').value := i;
CDS_JGQX.Post;
CDS_JGQX.Next;
end;
end
else
begin
Application.MessageBox('<27>޿<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
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>');
ReadCxGrid(trim(self.Caption) + 'TvCCQX', TvCCQX, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
ReadCxGrid(trim(self.Caption) + 'TvRGQX', TvRGQX, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
ReadCxGrid(trim(self.Caption) + 'TvJGQX', TvJGQX, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
ReadCxGrid(trim(self.Caption) + 'TvFS', TvFS, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
ReadCxGrid(trim(self.Caption) + 'TvGJ', TvGJ, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
ReadCxGrid(trim(self.Caption) + 'TvFP', TvFP, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
SetStatus();
InitGrid();
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>');
WriteCxGrid(trim(self.Caption) + 'TvCCQX', TvCCQX, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
WriteCxGrid(trim(self.Caption) + 'TvRGQX', TvRGQX, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
WriteCxGrid(trim(self.Caption) + 'TvJGQX', TvJGQX, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
WriteCxGrid(trim(self.Caption) + 'TvFS', TvFS, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
WriteCxGrid(trim(self.Caption) + 'TvGJ', TvGJ, '<27><><EFBFBD>׹<EFBFBD><D7B9>չ<EFBFBD><D5B9><EFBFBD>');
WriteCxGrid(trim(self.Caption) + 'TvFP', TvFP, '<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);
end;
end;
function TfrmDyeSimpleTechnicsList.SaveData(): Boolean;
var
MaxProcessID, MaxBCPID, MaxPSID, MaxDTMID, mDTMID, DTMPSlist: string;
maxsubid1, maxsubid2, maxsubid3, maxsubid4, maxsubid5, maxsubid6, mmaxgx, maxId, mPSID, mPSType: string;
begin
try
ADOQueryCmd.Connection.BeginTrans;
CDS_GX.First;
while not CDS_GX.Eof do
begin
mPSID := CDS_GX.FieldByName('PSID').AsString;
mPSType := CDS_GX.FieldByName('PSType').AsString;
mDTMID := CDS_2.FieldByName('DTMID').AsString;
///////////////////////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dye_process////////////////////////////
with ADOQueryCmd do
begin
Filtered := False;
Close;
SQL.Clear;
sql.Add(' select * from Dye_Process where PSID=''' + Trim(mPSID) + '''');
Open;
end;
with ADOQueryCmd do
begin
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;
end;
///////////////////<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dye_process////////////////////////////
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //////////////////////
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Main where PSID=''' + Trim(maxId) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(mPSID) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('PSID').Value := Trim(maxId);
if mPSType = '<27><>ë' then
begin
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_zm, 2);
ADOQueryCmd.Post;
end
else if mPSType = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ' then
begin
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', Panel_ccqx, 2);
ADOQueryCmd.Post;
////////////////// <20><><EFBFBD><EFBFBD><E6B3A4><EFBFBD><EFBFBD>ϴ<EFBFBD>ӱ<EFBFBD> //////////////////////
with CDS_CCQX do
begin
First;
while not Eof do
begin
if Trim(CDS_CCQX.fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid1, 'CCQX', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
Exit;
end;
end
else
begin
maxsubid1 := Trim(CDS_CCQX.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add(' BCPID=''' + Trim(maxsubid1) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_CCQX.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ';
FieldByName('PSID').Value := Trim(maxId);
FieldByName('BCPID').Value := Trim(maxsubid1);
RTSetSaveDataCDS(ADOQueryCmd, TvCCQX, CDS_CCQX, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
//////////////// <20><><EFBFBD><EFBFBD><E6B3A4><EFBFBD><EFBFBD>ϴ<EFBFBD>ӱ<EFBFBD><D3B1><EFBFBD><EFBFBD><EFBFBD> //////////////////////
end
else if mPSType = '<27><>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD>ϴ' then
begin
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', Panel_rgqx, 2);
ADOQueryCmd.Post;
////////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD>ϴ<EFBFBD>ӱ<EFBFBD> //////////////////////
with CDS_RGQX do
begin
First;
while not Eof do
begin
if Trim(CDS_RGQX.fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid2, 'RGQX', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
Exit;
end;
end
else
begin
maxsubid2 := Trim(CDS_RGQX.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add(' BCPID=''' + Trim(maxsubid2) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_RGQX.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '<27><>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD>ϴ';
FieldByName('PSID').Value := Trim(maxId);
FieldByName('BCPID').Value := Trim(maxsubid2);
RTSetSaveDataCDS(ADOQueryCmd, TvRGQX, CDS_RGQX, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD>ϴ<EFBFBD>ӱ<EFBFBD><D3B1><EFBFBD><EFBFBD><EFBFBD> //////////////////////
end
else if mPSType = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ' then
begin
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_jgqx, 2);
ADOQueryCmd.Post;
////////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>ӱ<EFBFBD> //////////////////////
with CDS_JGQX do
begin
First;
while not Eof do
begin
if Trim(CDS_JGQX.fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid3, 'JGQX', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
Exit;
end;
end
else
begin
maxsubid3 := Trim(CDS_JGQX.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add(' BCPID=''' + Trim(maxsubid3) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_JGQX.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ';
FieldByName('PSID').Value := Trim(maxId);
FieldByName('BCPID').Value := Trim(maxsubid3);
RTSetSaveDataCDS(ADOQueryCmd, TvJGQX, CDS_JGQX, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>ӱ<EFBFBD><D3B1><EFBFBD><EFBFBD><EFBFBD> //////////////////////
end
else if mPSType = '<27>ɶ<EFBFBD><C9B6><EFBFBD>' then
begin
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_dx, 2);
ADOQueryCmd.Post;
end
else if mPSType = '<27><>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>' then
begin
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_fs, 2);
ADOQueryCmd.Post;
////////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>ͣ<EFBFBD><CDA3>ӱ<EFBFBD> //////////////////////
with CDS_fS do
begin
First;
while not Eof do
begin
if Trim(CDS_fS.fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid4, 'FS', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
Exit;
end;
end
else
begin
maxsubid4 := Trim(CDS_fS.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add(' BCPID=''' + Trim(maxsubid4) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_fS.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '<27><>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>';
FieldByName('PSID').Value := Trim(maxId);
FieldByName('BCPID').Value := Trim(maxsubid4);
RTSetSaveDataCDS(ADOQueryCmd, TvFS, CDS_fS, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE><EFBFBD>ͣ<EFBFBD><CDA3>ӱ<EFBFBD><D3B1><EFBFBD><EFBFBD><EFBFBD> //////////////////////
end
else if mPSType = '<27>ν<EFBFBD>' then
begin
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_gj, 2);
ADOQueryCmd.Post;
////////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD>ӱ<EFBFBD> //////////////////////
with CDS_gj do
begin
First;
while not Eof do
begin
if Trim(CDS_gj.fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid5, 'GJ', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
Exit;
end;
end
else
begin
maxsubid5 := Trim(CDS_gj.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add(' BCPID=''' + Trim(maxsubid5) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_gj.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '<27>ν<EFBFBD>';
FieldByName('PSID').Value := Trim(maxId);
FieldByName('BCPID').Value := Trim(maxsubid5);
RTSetSaveDataCDS(ADOQueryCmd, TvGJ, CDS_gj, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD>ӱ<EFBFBD><D3B1><EFBFBD><EFBFBD><EFBFBD> //////////////////////
end
else if mPSType = '<27><><EFBFBD><EFBFBD>' then
begin
RTSetsavedata(ADOQueryCmd, 'Bs_Cloth_GY_Main', panel_fp, 2);
ADOQueryCmd.Post;
/// ////////////////// <20><><EFBFBD><EFBFBD><E6B7A2><EFBFBD>ӱ<EFBFBD> //////////////////////
with CDS_FP do
begin
First;
while not Eof do
begin
if Trim(CDS_FP.Fieldbyname('BCPID').AsString) = '' then
begin
if GetLSNo(ADOQueryTemp, maxsubid6, 'FP', 'Bs_Cloth_GY_Sub', 5, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox(<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˮ<EFBFBD><CBAE>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
Exit;
end;
end
else
begin
maxsubid6 := Trim(CDS_FP.fieldbyname('BCPID').AsString);
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('select * from Bs_Cloth_GY_Sub where ');
sql.Add('BCPID=''' + Trim(maxsubid6) + '''');
Open;
end;
with ADOQueryCmd do
begin
if Trim(CDS_FP.fieldbyname('BCPID').AsString) = '' then
begin
Append;
end
else
begin
Edit;
end;
FieldByName('GYType').Value := '<27><><EFBFBD><EFBFBD>';
FieldByName('PSID').Value := Trim(maxId);
FieldByName('BCPID').Value := Trim(maxsubid6);
RTSetSaveDataCDS(ADOQueryCmd, TvFP, CDS_FP, 'Bs_Cloth_GY_Sub', 0);
Post;
end;
Next;
end;
end;
//////////////// <20><><EFBFBD><EFBFBD><E6B7A2><EFBFBD>ӱ<EFBFBD><D3B1><EFBFBD><EFBFBD><EFBFBD> //////////////////////
end;
end;
//////////////// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //////////////////////
CDS_GX.Next;
end;
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;
if fPSIDList <> '' then
begin
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Text := 'DELETE FROM Dye_Process WHERE PSID IN (' + fPSIDList + ')';
// ShowMessage(sql.Text);
try
ExecSQL;
except
on E: Exception do
ShowMessage(<><C9BE>ʧ<EFBFBD><CAA7>: ' + E.Message);
end;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Text := 'DELETE FROM BS_Cloth_GY_Main WHERE PSID IN (' + fPSIDList + ')';
// ShowMessage(sql.Text);
try
ExecSQL;
except
on E: Exception do
ShowMessage(<><C9BE>ʧ<EFBFBD><CAA7>: ' + E.Message);
end;
end;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
SQL.Text := 'DELETE FROM BS_Cloth_GY_Sub WHERE PSID IN (' + fPSIDList + ')';
// ShowMessage(sql.Text);
try
ExecSQL;
except
on E: Exception do
ShowMessage(<><C9BE>ʧ<EFBFBD><CAA7>: ' + E.Message);
end;
end;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete Dye_Technics_Sub where DTMID=' + quotedstr(trim(MaxDTMID)));
execsql;
end;
DTMPSlist := '';
with CDS_GX do
begin
First;
while not Eof do
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('SELECT * FROM Dye_Technics_Sub WHERE 1=2');
Open;
end;
with ADOQueryCmd do
begin
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);
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
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;
end;
Next;
end;
end;
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('select * from Dye_Technics_Main where DTMID =' + quotedstr(Trim(MaxDTMID)));
Open;
end;
with ADOQueryCmd do
begin
if ADOQueryCmd.IsEmpty then
begin
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);
end;
FieldByName('DTMNo').Value := CDS_2.FieldByName('DTMNo').AsString;
FieldByName('DTMName').Value := CDS_2.FieldByName('DTMName').AsString;
FieldByName('DTMPSlist').Value := Trim(DTMPSlist);
Post;
end;
ADOQueryCmd.Connection.CommitTrans;
// FPSID := maxId;
Result := True;
except
Result := False;
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
end;
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;
InitGXDetails();
end;
procedure TfrmDyeSimpleTechnicsList.Tv2FocusedRecordChanged(Sender: TcxCustomGridTableView; APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
begin
SetStatus();
InitGlide();
InitGXDetails();
// 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;
procedure TfrmDyeSimpleTechnicsList.DTMNoChange(Sender: TObject);
begin
ToolButton2.Click;
end;
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.TbRGQXAddClick(Sender: TObject);
begin
with CDS_RGQX do
begin
Append;
CDS_RGQX.FieldByName('serialno').Value := CDS_RGQX.RecordCount + 1;
Post;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TbRGQXDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_RGQX.IsEmpty then
begin
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) = IDYES then
begin
if Trim(CDS_RGQX.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_RGQX.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_RGQX.Delete;
end
else
exit;
i := 0;
CDS_RGQX.First;
while not CDS_RGQX.Eof do
begin
i := i + 1;
CDS_RGQX.Edit;
CDS_RGQX.fieldByName('serialno').value := i;
CDS_RGQX.Post;
CDS_RGQX.Next;
end;
end
else
begin
Application.MessageBox('<27>޿<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TbCCQXAddClick(Sender: TObject);
begin
with CDS_CCQX do
begin
Append;
CDS_CCQX.FieldByName('serialno').Value := CDS_CCQX.RecordCount + 1;
Post;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TbccqxClearClick(Sender: TObject);
begin
ClearAllTextEditsByHint(panel_ccqx, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>¿<EFBFBD>');
end;
procedure TfrmDyeSimpleTechnicsList.TbCCQXDelClick(Sender: TObject);
var
i: Integer;
begin
if not CDS_CCQX.IsEmpty then
begin
if Application.MessageBox(<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) = IDYES then
begin
if Trim(CDS_CCQX.fieldbyname('BCPID').AsString) <> '' then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('delete BS_Cloth_GY_Sub where BCPID=' + quotedStr(Trim(CDS_CCQX.fieldbyname('BCPID').AsString)));
ExecSQL;
end;
end;
CDS_CCQX.Delete;
end
else
exit;
i := 0;
CDS_CCQX.First;
while not CDS_CCQX.Eof do
begin
i := i + 1;
CDS_CCQX.Edit;
CDS_CCQX.fieldByName('serialno').value := i;
CDS_CCQX.Post;
CDS_CCQX.Next;
end;
end
else
begin
Application.MessageBox('<27>޿<EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
Exit;
end;
end;
procedure TfrmDyeSimpleTechnicsList.TbCCQXReplaceClick(Sender: TObject);
begin
FillAllTextEditsWithValue(panel_ccqx, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>¿<EFBFBD>', FindLastEditedTextEdit(panel_ccqx, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD>¿<EFBFBD>'));
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);
end;
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;
end.