209 lines
5.5 KiB
ObjectPascal
209 lines
5.5 KiB
ObjectPascal
|
|
unit U_WorkDeptList_DK;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, ComCtrls, ToolWin, cxStyles, cxCustomData, cxGraphics, cxFilter,
|
|||
|
|
cxData, cxDataStorage, cxEdit, DB, cxDBData, cxTextEdit, cxCalendar,
|
|||
|
|
cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
|
|||
|
|
cxClasses, cxControls, cxGridCustomView, cxGrid, ADODB, DBClient,
|
|||
|
|
cxButtonEdit, cxPC, StdCtrls, ExtCtrls, ExtDlgs, IdBaseComponent,
|
|||
|
|
IdComponent, IdTCPConnection, IdTCPClient, IdFTP,jpeg, IniFiles,
|
|||
|
|
DelphiTwain, Buttons,MMSystem;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TFrmWorkDeptList_DK = class(TForm)
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1DKDate: TcxGridDBColumn;
|
|||
|
|
v1YGName: TcxGridDBColumn;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
Order_Main: TClientDataSet;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
ADOQueryDel: TADOQuery;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
YGID: TEdit;
|
|||
|
|
Button1: TButton;
|
|||
|
|
OpenPictureDialog1: TOpenPictureDialog;
|
|||
|
|
IdFTP1: TIdFTP;
|
|||
|
|
adoqueryImage: TADOQuery;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
SaveDialog1: TSavePictureDialog;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
filltime: TDateTimePicker;
|
|||
|
|
CheckBox1: TCheckBox;
|
|||
|
|
v1SXBstatus: TcxGridDBColumn;
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure YGIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
|
|||
|
|
Shift: TShiftState; X, Y: Integer);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
hWndC : THandle;
|
|||
|
|
CapturingAVI : bool;
|
|||
|
|
{ Private declarations }
|
|||
|
|
ClickPos: TPoint;
|
|||
|
|
SelectedSource, PicLeft, PicTop, PicWidth, PicHeight: Integer;
|
|||
|
|
procedure initGrid();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
canshu1:string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
FrmWorkDeptList_DK: TFrmWorkDeptList_DK;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses U_ZDYHelp,U_RTfun,U_DataLink,U_WorkDeptList_DKPZ;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TFrmWorkDeptList_DK.initGrid();
|
|||
|
|
begin
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_YG_KQ ');
|
|||
|
|
sql.add('where convert(varchar(10),DKDate,120)=convert(varchar(10),getdate(),120)');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TFrmWorkDeptList_DK.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('<27><><EFBFBD><EFBFBD>',Tv1,'<27><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_YG_KQ ');
|
|||
|
|
sql.Add('where convert(varchar(10),DKDate,120)=convert(varchar(10),getdate(),120)');
|
|||
|
|
sql.Add(' and isnull(SXBStatus,'''')='''+trim(canshu1)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,Order_Main);
|
|||
|
|
SInitCDSData20(ADOQueryMain,Order_Main);
|
|||
|
|
if canshu1='<27>ϰ<EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
Label1.Caption:='<27>ϰ<EFBFBD>ɨ<EFBFBD><C9A8>';
|
|||
|
|
label3.Caption:='<27>ϰ<EFBFBD><CFB0><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Label1.Caption:='<27>°<EFBFBD>ɨ<EFBFBD><C9A8>';
|
|||
|
|
label3.Caption:='<27>°<EFBFBD><C2B0><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
YGID.SetFocus;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TFrmWorkDeptList_DK.FormClose(Sender: TObject;
|
|||
|
|
var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action:=caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TFrmWorkDeptList_DK.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
FrmWorkDeptList_DK:=nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TFrmWorkDeptList_DK.YGIDKeyPress(Sender: TObject; var Key: Char);
|
|||
|
|
var maxno:string;
|
|||
|
|
begin
|
|||
|
|
if Key=#13 then
|
|||
|
|
begin
|
|||
|
|
YGID.Enabled:=false;
|
|||
|
|
if canshu1='<27>ϰ<EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
if FormatDateTime('HH',SGetServerDateTime(ADOQuery1))>'12' then
|
|||
|
|
begin
|
|||
|
|
if application.MessageBox('<27>ѳ<EFBFBD><D1B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>12<31><32>,ȷ<><C8B7>Ҫ<EFBFBD>ϰ<EFBFBD><CFB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',1)=2 then exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if canshu1='<27>°<EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
if FormatDateTime('HH',SGetServerDateTime(ADOQuery1))<'12' then
|
|||
|
|
begin
|
|||
|
|
if application.MessageBox('δ<><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>12<31><32>,ȷ<><C8B7>Ҫ<EFBFBD>°<EFBFBD><C2B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',1)=2 then exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryDel do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_YG_DangAn ');
|
|||
|
|
sql.Add('where YGID='''+Trim(YGID.Text)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryDel.IsEmpty then
|
|||
|
|
begin
|
|||
|
|
PlaySound('SMCW.wav', 0, SND_FILENAME or SND_ASYNC);
|
|||
|
|
YGID.Enabled:=true;
|
|||
|
|
YGID.Text:='';
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
FrmWorkDeptList_DKPZ:=TFrmWorkDeptList_DKPZ.Create(self);
|
|||
|
|
with FrmWorkDeptList_DKPZ do
|
|||
|
|
begin
|
|||
|
|
FYGID:=trim(self.YGID.Text);
|
|||
|
|
IFSXB:=Trim(canshu1);
|
|||
|
|
if CheckBox1.Checked=false then
|
|||
|
|
begin
|
|||
|
|
IFZT:='0';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
IFZT:='1';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
Self.YGID.Text:='';
|
|||
|
|
self.YGID.Enabled:=true;
|
|||
|
|
Self.YGID.SetFocus;
|
|||
|
|
with Self.ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_YG_KQ ');
|
|||
|
|
sql.Add('where convert(varchar(10),DKDate,120)=convert(varchar(10),getdate(),120)');
|
|||
|
|
sql.Add(' and isnull(SXBStatus,'''')='''+trim(canshu1)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(Self.ADOQueryMain,Self.Order_Main);
|
|||
|
|
SInitCDSData20(Self.ADOQueryMain,Self.Order_Main);
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TFrmWorkDeptList_DK.Button1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27><><EFBFBD><EFBFBD>',Tv1,'<27><><EFBFBD>ñ<EFBFBD><C3B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TFrmWorkDeptList_DK.Image1MouseDown(Sender: TObject;
|
|||
|
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|||
|
|
begin
|
|||
|
|
ClickPos.x := X;
|
|||
|
|
ClickPos.y := Y;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TFrmWorkDeptList_DK.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
filltime.Date:=SGetServerDate(ADOQueryDel);
|
|||
|
|
canshu1:=trim(DParameters1);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|