485 lines
13 KiB
ObjectPascal
485 lines
13 KiB
ObjectPascal
|
|
unit U_FileUp_GSHY;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
|||
|
|
cxDataStorage, cxEdit, DB, cxDBData, ComCtrls, ToolWin, ExtCtrls,
|
|||
|
|
cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
|||
|
|
cxClasses, cxControls, cxGridCustomView, cxGrid, IdBaseComponent,
|
|||
|
|
IdComponent, IdTCPConnection, IdTCPClient, IdFTP, StdCtrls, ADODB,jpeg,
|
|||
|
|
BtnEdit,IniFiles, cxGridCustomPopupMenu, cxGridPopupMenu, DBClient,ShellAPI,
|
|||
|
|
cxCalendar, cxCheckBox, Menus;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmFileUp_GSHY = class(TForm)
|
|||
|
|
cxGrid7: TcxGrid;
|
|||
|
|
TV7: TcxGridDBTableView;
|
|||
|
|
vFileName: TcxGridDBColumn;
|
|||
|
|
cxGridLevel6: TcxGridLevel;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
Code: TEdit;
|
|||
|
|
ODPat: TOpenDialog;
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
SaveDialog1: TSaveDialog;
|
|||
|
|
ADOQueryFile: TADOQuery;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ToolBar6: TToolBar;
|
|||
|
|
FileUp: TToolButton;
|
|||
|
|
FileDel: TToolButton;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
cxGridPopupMenu1: TcxGridPopupMenu;
|
|||
|
|
CDS_SC: TClientDataSet;
|
|||
|
|
FileDown: TToolButton;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
FileName: TEdit;
|
|||
|
|
cxStyleRepository1: TcxStyleRepository;
|
|||
|
|
cxStyle1: TcxStyle;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
ADOQuery2: TADOQuery;
|
|||
|
|
ToolButton3: TToolButton;
|
|||
|
|
V7FileDate: TcxGridDBColumn;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
BegDate: TDateTimePicker;
|
|||
|
|
EndDate: TDateTimePicker;
|
|||
|
|
Panel4: TPanel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Panel5: TPanel;
|
|||
|
|
Image1: TImage;
|
|||
|
|
TSure: TButton;
|
|||
|
|
ETaiTou: TEdit;
|
|||
|
|
FileDate: TDateTimePicker;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
FCYNO: TEdit;
|
|||
|
|
Panel2: TPanel;
|
|||
|
|
Panel16: TPanel;
|
|||
|
|
SBQty: TEdit;
|
|||
|
|
cxStyle2: TcxStyle;
|
|||
|
|
V7chkStatus: TcxGridDBColumn;
|
|||
|
|
TTJ: TToolButton;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
V7Ssel: TcxGridDBColumn;
|
|||
|
|
procedure FileUpClick(Sender: TObject);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure FileDelClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure FileDownClick(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure ToolButton3Click(Sender: TObject);
|
|||
|
|
procedure FileNameChange(Sender: TObject);
|
|||
|
|
procedure Image1Click(Sender: TObject);
|
|||
|
|
procedure TSureClick(Sender: TObject);
|
|||
|
|
procedure TTJClick(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
lstPat: TStringList;
|
|||
|
|
AJpeg: TJPEGImage;
|
|||
|
|
Canshu1,FDEPT,FDPName:string;
|
|||
|
|
procedure ReadINIFile10();
|
|||
|
|
procedure InitGrid();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
CYID:String;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmFileUp_GSHY: TfrmFileUp_GSHY;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_RTFun, U_ZDYHelp, U_ZDYHelpSel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.ReadINIFile10();
|
|||
|
|
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 TfrmFileUp_GSHY.FileUpClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
//Panel4.Visible:=True;
|
|||
|
|
fileDate.DateTime:=SGetServerDate(ADOQuery2);
|
|||
|
|
TSure.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
lstPat := TStringList.Create;
|
|||
|
|
canShu1:=trim(DParameters1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.FileDelClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_SC.IsEmpty then Exit;
|
|||
|
|
if CDS_SC.Locate('Ssel',true,[])=False then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
if CDS_SC.fieldbyname('filler').AsString<>trim(DName) then
|
|||
|
|
begin
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>','<27><>ʾ');
|
|||
|
|
exit;
|
|||
|
|
end;
|
|||
|
|
with CDS_SC do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('Ssel').Asboolean=true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add(' Delete XD_File where XFID='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add(' Delete OA_Chk where Mainid='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
initGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27><><EFBFBD>ű<EFBFBD>',TV7,'<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD>');
|
|||
|
|
EndDate.Date:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
BegDate.Date:=EndDate.Date-7;
|
|||
|
|
InitGrid();
|
|||
|
|
if Trim(canShu1)='<27><>ѯ' then
|
|||
|
|
begin
|
|||
|
|
FileUp.Visible:=False;
|
|||
|
|
FileDel.Visible:=False;
|
|||
|
|
TTJ.Visible:=False;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FileUp.Visible:=True;
|
|||
|
|
FileDel.Visible:=True;
|
|||
|
|
TTJ.Visible:=True;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.InitGrid();
|
|||
|
|
begin
|
|||
|
|
with ADOQueryFile do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.add('select *, ');
|
|||
|
|
sql.add(' chkStatus=(case when isnull((select Chkstatus from OA_Chk where Mainid=XFID),'''')='''' then ''δ<>ύ'' else ''<27><><EFBFBD>ύ'' end)');
|
|||
|
|
sql.add(' from XD_File where ');
|
|||
|
|
sql.Add(' FileType=''SC'' ');
|
|||
|
|
sql.add(' and FileDate>='''+Trim(FormatDateTime('yyyy-MM-dd',BegDate.Date))+'''');
|
|||
|
|
sql.Add(' and FileDate<'''+Trim(FormatDateTime('yyyy-MM-dd',EndDate.Date+1))+'''');
|
|||
|
|
sql.add(' and CYID=''<27><>˾<EFBFBD><CBBE><EFBFBD>˷<EFBFBD>''');
|
|||
|
|
sql.add(' order by FileDate desc');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryFile,CDS_SC);
|
|||
|
|
SInitCDSData20(ADOQueryFile,CDS_SC);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action:=caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmFileUp_GSHY:=nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.ToolButton1Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FPath:String;
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
WriteCxGrid('<27><><EFBFBD>ű<EFBFBD>',TV7,'<27>ļ<EFBFBD><C4BC>ϴ<EFBFBD>');
|
|||
|
|
FPath:='D:\Right1209\';
|
|||
|
|
if DirectoryExists(ExtractFileDir(FPath)) then
|
|||
|
|
winexec('cmd /c rd /s /q D:\Right1209\',sw_hide);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.FileDownClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fHandle:THandle;
|
|||
|
|
FInt:Integer;
|
|||
|
|
FFName,FPath:String;
|
|||
|
|
begin
|
|||
|
|
if CDS_SC.IsEmpty then Exit;
|
|||
|
|
Panel2.Visible:=True;
|
|||
|
|
Panel2.Refresh;
|
|||
|
|
{ }
|
|||
|
|
try
|
|||
|
|
ReadINIFile10();
|
|||
|
|
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ','127.0.0.1');
|
|||
|
|
if Length(server)<6 then
|
|||
|
|
begin
|
|||
|
|
server:='127.0.0.1';
|
|||
|
|
end;
|
|||
|
|
IdFTP1.Host :=server;//PicSvr;
|
|||
|
|
IdFTP1.Username := 'three';
|
|||
|
|
IdFTP1.Password := '641010';
|
|||
|
|
IdFTP1.Connect();
|
|||
|
|
except
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
FPath:='D:\Right1209\';
|
|||
|
|
if not DirectoryExists(ExtractFileDir(FPath)) then
|
|||
|
|
CreateDir(ExtractFileDir(FPath));
|
|||
|
|
if Trim(CDS_SC.fieldbyname('XFID').AsString)<'HY1310280009' then
|
|||
|
|
begin
|
|||
|
|
FFName:=Trim(CDS_SC.fieldbyname('FileName').AsString);
|
|||
|
|
|
|||
|
|
FFName:=FPath+FFName;
|
|||
|
|
if FileExists(FFName)=false then
|
|||
|
|
begin
|
|||
|
|
IdFTP1.Get('SC\'+Trim(CDS_SC.fieldbyname('FileName').AsString),
|
|||
|
|
FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)
|
|||
|
|
);
|
|||
|
|
end;
|
|||
|
|
Panel2.Visible:=False;
|
|||
|
|
if IdFTP1.Connected then IdFTP1.Quit;
|
|||
|
|
ShellExecute(Handle, 'open',PChar(FPath+Trim(CDS_SC.fieldbyname('FileName').AsString)),'', '', SW_SHOWNORMAL);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
FFName:=Trim(CDS_SC.fieldbyname('XFID').AsString)+Trim(CDS_SC.fieldbyname('HZStr').AsString);
|
|||
|
|
if FileExists(FPath+FFName)=false then
|
|||
|
|
begin
|
|||
|
|
IdFTP1.Get('SC\'+FFName,FPath+FFName);
|
|||
|
|
end;
|
|||
|
|
Panel2.Visible:=False;
|
|||
|
|
if IdFTP1.Connected then IdFTP1.Quit;
|
|||
|
|
if FileExists(FPath+FFName) then
|
|||
|
|
begin
|
|||
|
|
ShellExecute(Handle, 'open',PChar(FPath+FFName),'', '', SW_SHOWNORMAL);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.ToolButton2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.ToolButton3Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQueryFile,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryFile,CDS_SC);
|
|||
|
|
SInitCDSData20(ADOQueryFile,CDS_SC);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.FileNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
toolButton3.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.Image1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Panel4.Visible:=False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.TSureClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
i,j: Integer;
|
|||
|
|
PatFile,HZStr: String;
|
|||
|
|
FTPPath,FConNo,MaxNo:string;
|
|||
|
|
begin
|
|||
|
|
lstPat.Clear;
|
|||
|
|
if ODPat.Execute then
|
|||
|
|
begin
|
|||
|
|
lstPat.AddStrings(ODPat.Files);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if lstPat.Count > 0 then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ReadINIFile10();
|
|||
|
|
server:=ReadINIFileStr('SYSTEMSET.INI','SERVER','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ','127.0.0.1');
|
|||
|
|
IdFTP1.Host :=server;//PicSvr;
|
|||
|
|
IdFTP1.Username := 'three';
|
|||
|
|
IdFTP1.Password := '641010';
|
|||
|
|
IdFTP1.Connect();
|
|||
|
|
except
|
|||
|
|
IdFTP1.Quit;
|
|||
|
|
Application.MessageBox('<27><EFBFBD><DEB7><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>飡', '<27><>ʾ', MB_ICONWARNING);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Panel16.Visible:=True;
|
|||
|
|
Panel16.Refresh;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
for i := 0 to lstPat.Count - 1 do
|
|||
|
|
begin
|
|||
|
|
PatFile := ExtractFileName(lstPat[i]);
|
|||
|
|
HZStr:=Copy(PatFile,(Pos('.',PatFile)+1),(Length(PatFile)-Pos('.',PatFile)) ) ;
|
|||
|
|
if IdFTP1.Connected then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
if GetLSNo(ADOQueryCmd,MaxNo,'HY','XD_File',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
IdFTP1.Put(lstPat[i], Trim('\SC')+'\'+Trim(MaxNo)+'.'+Trim(HZStr));
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
SQL.Add('select * from XD_File where 1=2');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('XFID').Value:=Trim(MaxNo);
|
|||
|
|
FieldByName('CYID').Value:='<27><>˾<EFBFBD><CBBE><EFBFBD>˷<EFBFBD>';
|
|||
|
|
FieldByName('CYNO').Value:=Trim(FDPName);
|
|||
|
|
FieldByName('filename').Value:=Trim(PatFile);
|
|||
|
|
FieldByName('FileDate').Value:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
FieldByName('Filltime').Value:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
fieldbyname('FileType').value:=Trim('SC');
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
FieldByName('HZStr').Value:='.'+Trim(HZStr);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
except
|
|||
|
|
//ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
//Application.MessageBox('ͼƬ<CDBC>ϴ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
if IdFTP1.Connected then IdFTP1.Quit;
|
|||
|
|
Panel16.Visible:=False;
|
|||
|
|
Panel4.Visible:=False;
|
|||
|
|
InitGrid();
|
|||
|
|
Application.MessageBox('<27>ϴ<EFBFBD><CFB4>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ',0);
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27>ϴ<EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.TTJClick(Sender: TObject);
|
|||
|
|
var maxno: string;
|
|||
|
|
begin
|
|||
|
|
if CDS_SC.IsEmpty then exit;
|
|||
|
|
frmZDYHelpSel:=TfrmZDYHelpSel.Create(Application);
|
|||
|
|
with frmZDYHelpSel do
|
|||
|
|
begin
|
|||
|
|
flag:='SPR';
|
|||
|
|
flagname:='<27>Ķ<EFBFBD><C4B6><EFBFBD>';
|
|||
|
|
MainType:=Trim(DName);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
first;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('Ssel').AsBoolean=True then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from SY_User where UserName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Ķ<EFBFBD><C4B6>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_Chk where MainId='''+Trim(CDS_SC.fieldbyname('XFID').AsString)+'''');
|
|||
|
|
sql.Add(' and isnull(OAType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add(' and isnull(Chker,'''')='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryTemp.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOQueryCmd,maxno,'FB','OA_Chk',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_Chk where 1=2 ');
|
|||
|
|
Open;
|
|||
|
|
append;
|
|||
|
|
FieldByName('CKID').Value:=Trim(maxno);
|
|||
|
|
FieldByName('Mainid').Value:=Trim(CDS_SC.fieldbyname('XFID').AsString);
|
|||
|
|
FieldByName('OAType').value:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('Chker').Value:=Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Free;
|
|||
|
|
end;
|
|||
|
|
InitGrid();
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_SC,True);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmFileUp_GSHY.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_SC,False);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|