476 lines
13 KiB
ObjectPascal
476 lines
13 KiB
ObjectPascal
|
|
unit U_CPManage_Sel;
|
|||
|
|
|
|||
|
|
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,jpeg,
|
|||
|
|
cxCurrencyEdit;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmCPManageSel = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
cxDBTreeList1: TcxDBTreeList;
|
|||
|
|
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
ADOQueryTree: TADOQuery;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
cxSplitter1: TcxSplitter;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
CDS_Main: TClientDataSet;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
ToolButton4: TToolButton;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
ODPat: TOpenDialog;
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
SaveDialog1: TSaveDialog;
|
|||
|
|
TOK: TToolButton;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
CYName: TEdit;
|
|||
|
|
CYEName: TEdit;
|
|||
|
|
CYSpec: TEdit;
|
|||
|
|
CYNO: TEdit;
|
|||
|
|
Edit1: TEdit;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
CYKZ: TEdit;
|
|||
|
|
defstr1: TEdit;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
ComboBox1: TComboBox;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
adoqueryPicture: TADOQuery;
|
|||
|
|
DefStr6: TEdit;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1Column12: TcxGridDBColumn;
|
|||
|
|
v1Column15: TcxGridDBColumn;
|
|||
|
|
v1Column1: TcxGridDBColumn;
|
|||
|
|
v1Column2: TcxGridDBColumn;
|
|||
|
|
v1Column3: TcxGridDBColumn;
|
|||
|
|
v1Column4: TcxGridDBColumn;
|
|||
|
|
v1Column5: TcxGridDBColumn;
|
|||
|
|
v1Column6: TcxGridDBColumn;
|
|||
|
|
v1Column7: TcxGridDBColumn;
|
|||
|
|
v1Column8: TcxGridDBColumn;
|
|||
|
|
v1Column9: TcxGridDBColumn;
|
|||
|
|
v1Column16: TcxGridDBColumn;
|
|||
|
|
v1Column41: TcxGridDBColumn;
|
|||
|
|
v1Column20: TcxGridDBColumn;
|
|||
|
|
v1Column17: TcxGridDBColumn;
|
|||
|
|
v1Column10: TcxGridDBColumn;
|
|||
|
|
v1Column18: TcxGridDBColumn;
|
|||
|
|
v1Column13: TcxGridDBColumn;
|
|||
|
|
v1Column11: TcxGridDBColumn;
|
|||
|
|
v1Column14: TcxGridDBColumn;
|
|||
|
|
v1Column25: TcxGridDBColumn;
|
|||
|
|
v1Column24: TcxGridDBColumn;
|
|||
|
|
v1Column42: TcxGridDBColumn;
|
|||
|
|
v1Column43: TcxGridDBColumn;
|
|||
|
|
v1Column44: TcxGridDBColumn;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
CYID: TEdit;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
TV2: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn5: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn6: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn7: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn8: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn9: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn10: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn11: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn12: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn13: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn14: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn15: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn16: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn17: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn18: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn19: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn20: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn21: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn22: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn23: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn24: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn25: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn26: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
DataSource3: TDataSource;
|
|||
|
|
ClientDataSet1: TClientDataSet;
|
|||
|
|
ToolBar2: TToolBar;
|
|||
|
|
ToolButton9: TToolButton;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure cxDBTreeList1DblClick(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure CYIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure CYNoChange(Sender: TObject);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure ToolButton4Click(Sender: TObject);
|
|||
|
|
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
|||
|
|
Shift: TShiftState);
|
|||
|
|
procedure CYSpecChange(Sender: TObject);
|
|||
|
|
procedure TOKClick(Sender: TObject);
|
|||
|
|
procedure CYNOKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure ToolButton9Click(Sender: TObject);
|
|||
|
|
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
CPID:string;
|
|||
|
|
PState:Integer;
|
|||
|
|
FCPID,FTopID:String;
|
|||
|
|
procedure InitTree();
|
|||
|
|
procedure InitGrid();
|
|||
|
|
procedure ReadINIFile();
|
|||
|
|
procedure InitImage();
|
|||
|
|
|
|||
|
|
public
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmCPManageSel: TfrmCPManageSel;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_Fun10;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.InitImage();
|
|||
|
|
var
|
|||
|
|
i,j:integer;
|
|||
|
|
jpg:TJpegImage;
|
|||
|
|
myStream: TADOBlobStream;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.InitTree();
|
|||
|
|
var
|
|||
|
|
i:Integer;
|
|||
|
|
begin
|
|||
|
|
with ADOQueryTree do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
SQL.Add('select * from CP_Type order by CPlevel,CPOrder,CPName');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
cxDBTreeList1.Items[0].Expand(false);
|
|||
|
|
//cxDBTreeList1.Items[1].Expand(False);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.InitGrid();
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible:=True;
|
|||
|
|
Panel2.Refresh;
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
SQL.Add('exec P_Select_CP_YDang :Code,:PState,:CYType');
|
|||
|
|
Parameters.ParamByName('Code').Value:='';
|
|||
|
|
Parameters.ParamByName('PState').Value:=0;
|
|||
|
|
Parameters.ParamByName('CYType').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
Panel2.Visible:=False;
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmCPManageSel:=nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
var
|
|||
|
|
i,j:integer;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid(self.Caption,Tv1,'<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>');
|
|||
|
|
if DirectoryExists(ExtractFileDir('D:\Right1209')) then
|
|||
|
|
winexec('cmd /c rd /s /q D:\Right1209',sw_hide);
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
procedure TfrmCPManageSel.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel3.Align:=alclient;
|
|||
|
|
InitTree();
|
|||
|
|
ReadCxGrid(self.Caption,Tv1,'<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>');
|
|||
|
|
with adoqueryPicture do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
SQL.Add('exec P_Select_CP_YDang :Code,:PState,:CYType');
|
|||
|
|
Parameters.ParamByName('Code').Value:='';
|
|||
|
|
Parameters.ParamByName('PState').Value:=0;
|
|||
|
|
Parameters.ParamByName('CYType').Value:=Trim(ADOQueryTree.fieldbyname('CPID').AsString);
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(adoqueryPicture,ClientDataSet1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.cxDBTreeList1DblClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
inittree();
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.ToolButton2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.Active then
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.CYIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
SQL.Add('exec P_Select_CP_YDang :Code,:PState,:CYType');
|
|||
|
|
Parameters.ParamByName('Code').Value:=Trim(CYID.Text);
|
|||
|
|
Parameters.ParamByName('PState').Value:=1;
|
|||
|
|
Parameters.ParamByName('CYType').Value:='';
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.CYNoChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
// if Length(Trim(CYNO.Text))<4 then Exit;
|
|||
|
|
if ADOQueryMain.Active then
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_Main.IsEmpty then Exit;
|
|||
|
|
TcxGridToExcel('<27><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>',cxGrid1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.ToolButton4Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile,FFCYID:string;
|
|||
|
|
DPS,i,j:Integer;
|
|||
|
|
Txt,fImagePath:string;
|
|||
|
|
Moudle: THandle;
|
|||
|
|
Makebar:TMakebar;
|
|||
|
|
Mixtext:TMixtext;
|
|||
|
|
begin
|
|||
|
|
CYID.SetFocus;
|
|||
|
|
if CDS_Main.IsEmpty then Exit;
|
|||
|
|
//if CDS_CYNO.IsEmpty then Exit;
|
|||
|
|
IF trim(ComboBox1.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><>Ʒ<EFBFBD><C6B7>ǩ<EFBFBD><C7A9><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(Edit1.Text)<>'' then
|
|||
|
|
begin
|
|||
|
|
if TryStrToInt(Edit1.Text,i)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+trim(ComboBox1.Text)+'.rmf';
|
|||
|
|
CDS_Main.DisableControls;
|
|||
|
|
DPS:=0;
|
|||
|
|
FFCYID:='';
|
|||
|
|
i:=1;
|
|||
|
|
if Trim(Edit1.Text)='' then
|
|||
|
|
begin
|
|||
|
|
j:=1;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
j:=StrToInt(Edit1.Text);
|
|||
|
|
end;
|
|||
|
|
with CDS_Main do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if CDS_Main.FieldByName('SSel').AsBoolean=True then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
Moudle:=LoadLibrary('MakeQRBarcode.dll');
|
|||
|
|
@Makebar:=GetProcAddress(Moudle,'Make');
|
|||
|
|
@Mixtext:=GetProcAddress(Moudle,'MixText');
|
|||
|
|
Txt:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
|||
|
|
fImagePath:=ExtractFilePath(Application.ExeName)+'image\temp.bmp';
|
|||
|
|
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName)+'image')) then
|
|||
|
|
CreateDirectory(pchar(ExtractFilePath(Application.ExeName)+'image'),nil);
|
|||
|
|
if FileExists(fImagePath) then DeleteFile(fImagePath);
|
|||
|
|
Makebar(pchar(Txt),Length(Txt),3,3,0,PChar(fImagePath),3);
|
|||
|
|
except
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',MB_ICONERROR);
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
RMVariables['QRBARCODE']:=fImagePath;
|
|||
|
|
for i:=1 to j do
|
|||
|
|
begin
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
RM1.PrintReport;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>'+ExtractFilePath(Application.ExeName)+'Report\<5C><>Ʒ<EFBFBD><C6B7>ǩ.rmf'),'<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if DPS=0 then
|
|||
|
|
begin
|
|||
|
|
FFCYID:=Trim(CDS_Main.fieldbyname('CYID').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
//CDS_Main.Locate('CYID',Trim(CDS_CYNO.fieldbyname('CYID').AsString),[]);
|
|||
|
|
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
CDS_Main.EnableControls;
|
|||
|
|
CDS_Main.Locate('CYID',FFCYID,[]);
|
|||
|
|
Edit1.Text:='1';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.ReadINIFile();
|
|||
|
|
var
|
|||
|
|
programIni:Tinifile; //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
|||
|
|
FileName:string;
|
|||
|
|
begin
|
|||
|
|
FileName:=ExtractFilePath(Paramstr(0))+'SYSTEMSET.INI';
|
|||
|
|
programIni:=Tinifile.create(FileName);
|
|||
|
|
server:=programIni.ReadString('SERVER','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ','127.0.0.1');
|
|||
|
|
programIni.Free;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.FormKeyDown(Sender: TObject; var Key: Word;
|
|||
|
|
Shift: TShiftState);
|
|||
|
|
begin
|
|||
|
|
{if Key= then
|
|||
|
|
begin
|
|||
|
|
if CDS_Main.IsEmpty then Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>6666Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
if Trim(CDS_Main.fieldbyname('CYID').AsString)<>'' then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('delete CP_YDang where CYID='''+Trim(CDS_Main.fieldbyname('CYID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
CDS_Main.Delete;
|
|||
|
|
end; }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.CYSpecChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
// if Length(Trim(CYSpec.Text))<3 then Exit;
|
|||
|
|
if ADOQueryMain.Active then
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_Main);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.TOKClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
IF ClientDataSet1.IsEmpty then exit;
|
|||
|
|
ModalResult:=1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.CYNOKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
TBRafresh.Click;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.ToolButton9Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ClientDataSet1.Delete;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmCPManageSel.Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
|||
|
|
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
|||
|
|
AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
begin
|
|||
|
|
InitCDSToCDS(CDS_Main,ClientDataSet1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|