688 lines
17 KiB
ObjectPascal
688 lines
17 KiB
ObjectPascal
|
|
unit U_YGYPInPut;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
|||
|
|
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
|
|||
|
|
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
|
|||
|
|
cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer,
|
|||
|
|
cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB,
|
|||
|
|
ExtCtrls, BtnEdit, cxCalendar,StrUtils, cxDropDownEdit,jpeg,
|
|||
|
|
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdFTP, cxPC,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, Menus, ExtDlgs;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmYGYPInPut = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ScrollBox1: TScrollBox;
|
|||
|
|
ADOTemp: TADOQuery;
|
|||
|
|
ADOCmd: TADOQuery;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
TBSave: TToolButton;
|
|||
|
|
cxPageControl1: TcxPageControl;
|
|||
|
|
cxTabSheet1: TcxTabSheet;
|
|||
|
|
cxTabSheet2: TcxTabSheet;
|
|||
|
|
cxTabSheet3: TcxTabSheet;
|
|||
|
|
cxTabSheet4: TcxTabSheet;
|
|||
|
|
Panel3: TPanel;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
YGName: TEdit;
|
|||
|
|
YPDate: TDateTimePicker;
|
|||
|
|
YGSex: TComboBox;
|
|||
|
|
YPGangWei: TBtnEditA;
|
|||
|
|
YPMoneyYQ: TEdit;
|
|||
|
|
MinZu: TBtnEditA;
|
|||
|
|
JiGuan: TEdit;
|
|||
|
|
HunYin: TBtnEditA;
|
|||
|
|
ChuShengDate: TDateTimePicker;
|
|||
|
|
MianMao: TBtnEditA;
|
|||
|
|
XueLi: TBtnEditA;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
GroupBox1: TGroupBox;
|
|||
|
|
Image1: TImage;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
ZhiCheng: TBtnEditA;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
JSTeChang: TEdit;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
YYAiHao: TEdit;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
BYXueXiao: TBtnEditA;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
BYDate: TDateTimePicker;
|
|||
|
|
Label17: TLabel;
|
|||
|
|
ZhuanYe: TBtnEditA;
|
|||
|
|
Label18: TLabel;
|
|||
|
|
ZhuZhi: TEdit;
|
|||
|
|
Label19: TLabel;
|
|||
|
|
ShenFenNo: TEdit;
|
|||
|
|
Label20: TLabel;
|
|||
|
|
JTTel: TEdit;
|
|||
|
|
Label21: TLabel;
|
|||
|
|
Phone: TEdit;
|
|||
|
|
Label22: TLabel;
|
|||
|
|
EMail: TEdit;
|
|||
|
|
Label23: TLabel;
|
|||
|
|
JJLXPerson: TEdit;
|
|||
|
|
Label24: TLabel;
|
|||
|
|
JJLXPhone: TEdit;
|
|||
|
|
Label25: TLabel;
|
|||
|
|
JJLXGX: TBtnEditA;
|
|||
|
|
Label26: TLabel;
|
|||
|
|
FuCongAP: TComboBox;
|
|||
|
|
Label27: TLabel;
|
|||
|
|
YPNote: TRichEdit;
|
|||
|
|
OpenPictureDialog1: TOpenPictureDialog;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
Tv1: TcxGridDBTableView;
|
|||
|
|
v1Column7: TcxGridDBColumn;
|
|||
|
|
v1Column6: TcxGridDBColumn;
|
|||
|
|
v1Column1: TcxGridDBColumn;
|
|||
|
|
v1Column3: TcxGridDBColumn;
|
|||
|
|
v1Column15: TcxGridDBColumn;
|
|||
|
|
cxGrid1Level1: TcxGridLevel;
|
|||
|
|
DataSource1: TDataSource;
|
|||
|
|
ClientDataSet1: TClientDataSet;
|
|||
|
|
DataSource2: TDataSource;
|
|||
|
|
ClientDataSet2: TClientDataSet;
|
|||
|
|
DataSource3: TDataSource;
|
|||
|
|
ClientDataSet3: TClientDataSet;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn5: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
cxGrid3: TcxGrid;
|
|||
|
|
Tv3: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn6: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn7: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn8: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn9: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn10: TcxGridDBColumn;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
v3Column1: TcxGridDBColumn;
|
|||
|
|
v3Column2: TcxGridDBColumn;
|
|||
|
|
Label28: TLabel;
|
|||
|
|
YGEName: TEdit;
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure SKBankBtnDnClick(Sender: TObject);
|
|||
|
|
procedure TBSaveClick(Sender: TObject);
|
|||
|
|
procedure MinZuBtnClick(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure v1Column1PropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
TPInt:Integer;
|
|||
|
|
procedure InitData();
|
|||
|
|
function SaveData():Boolean;
|
|||
|
|
function SaveMXData(Tv11:TcxGridDBTableView;CDS1:TClientDataSet;FMaxNo,FYOType:string):Boolean;
|
|||
|
|
procedure SaveImageOther();
|
|||
|
|
procedure InitImage();
|
|||
|
|
{ Private declarations }
|
|||
|
|
public
|
|||
|
|
canshu1:String;
|
|||
|
|
PState,CopyInt:Integer;
|
|||
|
|
FMainId:String;
|
|||
|
|
{ Public declarations }
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmYGYPInPut: TfrmYGYPInPut;
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_ZDYHelp,U_RTFun,U_ZDYHelpSel;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.InitData();
|
|||
|
|
begin
|
|||
|
|
cxPageControl1.ActivePageIndex:=0;
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_YG_DangAn where YGID='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCSHDataNew(ADOQuery1,Panel3,2);
|
|||
|
|
if ADOQuery1.IsEmpty then
|
|||
|
|
YGEName.Text:=trim(DName);
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_YG_DangAn_Other where YGID='''+Trim(FMainId)+'''');
|
|||
|
|
sql.Add(' and YOType=''<27><>ͥ<EFBFBD><CDA5>Ա'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQuery1,ClientDataSet1);
|
|||
|
|
SInitCDSData20(ADOQuery1,ClientDataSet1);
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_YG_DangAn_Other where YGID='''+Trim(FMainId)+'''');
|
|||
|
|
sql.Add(' and YOType=''<27><>ѵ<EFBFBD><D1B5><EFBFBD><EFBFBD>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQuery1,ClientDataSet2);
|
|||
|
|
SInitCDSData20(ADOQuery1,ClientDataSet2);
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_YG_DangAn_Other where YGID='''+Trim(FMainId)+'''');
|
|||
|
|
sql.Add(' and YOType=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQuery1,ClientDataSet3);
|
|||
|
|
SInitCDSData20(ADOQuery1,ClientDataSet3);
|
|||
|
|
TPInt:=0;
|
|||
|
|
InitImage();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitData();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmYGYPInPut.SaveData():Boolean;
|
|||
|
|
var
|
|||
|
|
maxno,FHZStatus:String;
|
|||
|
|
begin
|
|||
|
|
Result:=False;
|
|||
|
|
try
|
|||
|
|
ADOCmd.Connection.BeginTrans;
|
|||
|
|
///<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
if Trim(FMainId)='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxno,'','OA_YG_DangAn',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
maxno:=Trim(FMainId);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from OA_YG_DangAn where YGId='''+Trim(FMainId)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FHZStatus:=Trim(ADOCmd.fieldbyname('HZStatus').AsString);
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(FMainId)='' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
end
|
|||
|
|
else begin
|
|||
|
|
Edit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('YGId').Value:=Trim(maxno);
|
|||
|
|
if Trim(FMainId)='' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
FieldByName('Editer').Value:=Trim(DName);
|
|||
|
|
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
RTSetsavedata(ADOCmd,'OA_YG_DangAn',Panel3,2);
|
|||
|
|
FieldByName('QCType').Value:='<27><><EFBFBD><EFBFBD>';
|
|||
|
|
if Trim(FHZStatus)='' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('HZStatus').Value:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
if TPInt=1 then
|
|||
|
|
begin
|
|||
|
|
SaveImageOther();
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('delete TP_File where WBID='''+Trim(maxno)+''' and TFType=''YG'' ');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if SaveMXData(Tv1,ClientDataSet1,maxno,'<27><>ͥ<EFBFBD><CDA5>Ա')=False then Exit;
|
|||
|
|
if SaveMXData(Tv2,ClientDataSet2,maxno,'<27><>ѵ<EFBFBD><D1B5><EFBFBD><EFBFBD>')=False then Exit;
|
|||
|
|
if SaveMXData(Tv3,ClientDataSet3,maxno,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')=False then Exit;
|
|||
|
|
ADOCmd.Connection.CommitTrans;
|
|||
|
|
FMainId:=Trim(maxno);
|
|||
|
|
Result:=True;
|
|||
|
|
except
|
|||
|
|
Result:=False;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
function TfrmYGYPInPut.SaveMXData(Tv11:TcxGridDBTableView;CDS1:TClientDataSet;FMaxNo,FYOType:string):Boolean;
|
|||
|
|
var
|
|||
|
|
maxsubno,FYOID:String;
|
|||
|
|
begin
|
|||
|
|
Result:=False;
|
|||
|
|
try
|
|||
|
|
CDS1.DisableControls;
|
|||
|
|
with CDS1 do
|
|||
|
|
begin
|
|||
|
|
First;
|
|||
|
|
while not Eof do
|
|||
|
|
begin
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from OA_YG_DangAn_Other where YOID='''+Trim(CDS1.fieldbyname('YOID').AsString)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
FYOID:=Trim(ADOCmd.fieldbyname('YOID').AsString);
|
|||
|
|
if Trim(FYOID)='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,maxsubno,'YO','OA_YG_DangAn_Other',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
Result:=False;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
maxsubno:=Trim(FYOID);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
SQL.Add('select * from OA_YG_DangAn_Other where YOID='''+Trim(FYOID)+'''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(FYOID)='' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
end
|
|||
|
|
else begin
|
|||
|
|
Edit;
|
|||
|
|
end;
|
|||
|
|
FieldByName('YGId').Value:=Trim(FMaxNo);
|
|||
|
|
FieldByName('YOType').Value:=Trim(FYOType);
|
|||
|
|
FieldByName('YOID').Value:=Trim(maxsubno);
|
|||
|
|
if Trim(FYOID)='' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
FieldByName('Editer').Value:=Trim(DName);
|
|||
|
|
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
RTSetSaveDataCDS(ADOCmd,Tv11,CDS1,'OA_YG_DangAn_Other',0);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('YOID').Value:=Trim(maxsubno);
|
|||
|
|
Next;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
CDS1.EnableControls;
|
|||
|
|
Result:=True;
|
|||
|
|
except
|
|||
|
|
CDS1.EnableControls;
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD>쳣!','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
procedure TfrmYGYPInPut.InitImage();
|
|||
|
|
var
|
|||
|
|
jpg:TJpegImage;
|
|||
|
|
myStream:TADOBlobStream;
|
|||
|
|
begin
|
|||
|
|
if Trim(FMainId)='' then Exit;
|
|||
|
|
Image1.Picture.Assign(nil);
|
|||
|
|
try
|
|||
|
|
with ADOQuery1 do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add(' select * from TP_File A where A.WBID='''+Trim(FMainId)+'''');
|
|||
|
|
sql.Add(' and TFType=''YG'' ');
|
|||
|
|
open;
|
|||
|
|
if RecordCount>0 then
|
|||
|
|
begin
|
|||
|
|
TPInt:=1;
|
|||
|
|
if trim(ADOQuery1.fieldbyname('FilesOther').AsString)<>'' then
|
|||
|
|
begin
|
|||
|
|
myStream:=tadoblobstream.Create(tblobfield(ADOQuery1.fieldbyname('FilesOther')),bmread);
|
|||
|
|
if myStream=nil then exit;
|
|||
|
|
jpg:=TJPEGImage.Create;
|
|||
|
|
jpg.LoadFromStream(myStream);
|
|||
|
|
Image1.Picture.Assign(jpg);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
jpg.Free;
|
|||
|
|
myStream.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.SKBankBtnDnClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
TBtnEditC(Sender).Text:='';
|
|||
|
|
TBtnEditC(Sender).TxtCode:='';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.TBSaveClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FSFNO:String;
|
|||
|
|
begin
|
|||
|
|
ToolBar1.SetFocus;
|
|||
|
|
if Trim(YGName.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(YPGangWei.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('ӦƸ<D3A6><C6B8>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(Phone.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>ֻ<EFBFBD><D6BB>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(ShenFenNo.Text)='' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>֤<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Trim(ValidatePID(Trim(ShenFenNo.Text)))<>'' then
|
|||
|
|
begin
|
|||
|
|
//ShowMessage(ValidatePID(Trim(ShenFenNo.Text)));
|
|||
|
|
ShowMessage('<27><><EFBFBD><EFBFBD>֤<EFBFBD>Ŵ<EFBFBD><C5B4><EFBFBD>!');
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
FSFNO:=Trim(ShenFenNo.Text);
|
|||
|
|
FSFNO:=Copy(FSFNO,7,4)+'-'+Copy(FSFNO,11,2)+'-'+Copy(FSFNO,13,2);
|
|||
|
|
if Trim(FormatDateTime('yyyy-MM-dd',ChuShengDate.Date))<>FSFNO then
|
|||
|
|
begin
|
|||
|
|
if Now-ChuShengDate.Date<12 then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
if Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
end;
|
|||
|
|
FSFNO:=Copy(Trim(ShenFenNo.Text),17,1);
|
|||
|
|
if StrToInt(FSFNO) mod 2=0 then
|
|||
|
|
begin
|
|||
|
|
if Trim(YGSex.Text)<>'Ů' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>֤<EFBFBD>ź<EFBFBD><C5BA>Ա<D4B1>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
if Trim(YGSex.Text)<>'<27><>' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>֤<EFBFBD>ź<EFBFBD><C5BA>Ա<D4B1>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
if SaveData() then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.MinZuBtnClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fsj:string;
|
|||
|
|
FWZ:Integer;
|
|||
|
|
begin
|
|||
|
|
fsj:=Trim(TEdit(Sender).Hint);
|
|||
|
|
FWZ:=Pos('/',fsj);
|
|||
|
|
try
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:=Copy(fsj,1,FWZ-1);
|
|||
|
|
flagname:=Copy(fsj,FWZ+1,Length(fsj)-fwz);
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
TEdit(Sender).Text:=Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
OpenPictureDialog1.Execute;
|
|||
|
|
if Trim(OpenPictureDialog1.FileName)='' then
|
|||
|
|
begin
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
|
|||
|
|
TPInt:=1;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if TPInt=0 then Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE>ͼƬ<CDBC><C6AC><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
Image1.Picture:=nil;
|
|||
|
|
Image1.Picture.Assign(nil);
|
|||
|
|
TPInt:=0;
|
|||
|
|
end;
|
|||
|
|
procedure TfrmYGYPInPut.SaveImageOther();
|
|||
|
|
var
|
|||
|
|
AJpeg: TJPEGImage;
|
|||
|
|
myStream: TADOBlobStream;
|
|||
|
|
ImgMaxNo:String;
|
|||
|
|
i,j: Integer;
|
|||
|
|
PatFile: String;
|
|||
|
|
FTPPath,FConNo,MaxNo,FTFID:string;
|
|||
|
|
begin
|
|||
|
|
if Image1.Picture=nil then Exit;
|
|||
|
|
AJpeg:=TJpegImage.Create();
|
|||
|
|
with ADOTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from TP_File where WBID='''+Trim(FMainId)+'''');
|
|||
|
|
sql.Add(' and TFType=''YG'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FTFID:=Trim(ADOTemp.fieldbyname('TFID').AsString);
|
|||
|
|
if Trim(FTFID)='' then
|
|||
|
|
begin
|
|||
|
|
if GetLSNo(ADOCmd,ImgMaxNo,'TF','TP_File',4,1)=False then
|
|||
|
|
begin
|
|||
|
|
ADOCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡͼƬ<CDBC><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
ImgMaxNo:=Trim(FTFID);
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add( ' select * from TP_File where TFID='''+Trim(FTFID)+'''');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
if Trim(FTFID)='' then
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('Filler').Value:=Trim(DName);
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Editer').Value:=Trim(DName);
|
|||
|
|
FieldByName('EditTime').Value:=SGetServerDateTime(ADOTemp);
|
|||
|
|
end;
|
|||
|
|
FieldByName('TFID').Value:=Trim(ImgMaxNo);
|
|||
|
|
FieldByName('WBID').Value:=Trim(FMainId);
|
|||
|
|
FieldByName('TFType').Value:='YG';
|
|||
|
|
AJpeg.Assign(Image1.Picture.Graphic);
|
|||
|
|
//CreThumb(AJpeg,Image1,160, 120);
|
|||
|
|
myStream := TADOBlobStream.Create(TBlobField(ADOCmd.FieldByName('FilesOther')), bmWrite);
|
|||
|
|
AJpeg.Assign(Image1.Picture.Graphic);
|
|||
|
|
AJpeg.SaveToStream(myStream);
|
|||
|
|
myStream.Free;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.v1Column1PropertiesButtonClick(Sender: TObject;
|
|||
|
|
AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp:=TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag:='JJLXGX';
|
|||
|
|
flagname:='<27>뱾<EFBFBD>˹<EFBFBD>ϵ';
|
|||
|
|
if ShowModal=1 then
|
|||
|
|
begin
|
|||
|
|
with Self.ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('JTLXGX').Value:=Trim(frmZDYHelp.ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex=0 then Exit;
|
|||
|
|
if cxPageControl1.ActivePageIndex=1 then
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet1 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
if cxPageControl1.ActivePageIndex=2 then
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet2 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end else
|
|||
|
|
if cxPageControl1.ActivePageIndex=3 then
|
|||
|
|
begin
|
|||
|
|
with ClientDataSet3 do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYGYPInPut.ToolButton2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if cxPageControl1.ActivePageIndex=0 then Exit;
|
|||
|
|
if cxPageControl1.ActivePageIndex=1 then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet1.IsEmpty then Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete OA_YG_DangAn_Other where YOID='''+Trim(ClientDataSet1.fieldbyname('YOID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet1.Delete;
|
|||
|
|
end else
|
|||
|
|
if cxPageControl1.ActivePageIndex=2 then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet2.IsEmpty then Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete OA_YG_DangAn_Other where YOID='''+Trim(ClientDataSet2.fieldbyname('YOID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet2.Delete;
|
|||
|
|
end else
|
|||
|
|
if cxPageControl1.ActivePageIndex=3 then
|
|||
|
|
begin
|
|||
|
|
if ClientDataSet3.IsEmpty then Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>ʾ',32+4)<>IDYES then Exit;
|
|||
|
|
with ADOCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete OA_YG_DangAn_Other where YOID='''+Trim(ClientDataSet3.fieldbyname('YOID').AsString)+'''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ClientDataSet3.Delete;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|