~
This commit is contained in:
commit
74d01e92e1
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
**/layout
|
||||
**/report
|
||||
**/实施文件
|
||||
**/image
|
||||
**/doc
|
||||
**/wav
|
||||
**/__history
|
||||
**/__recovery
|
||||
*.dll
|
||||
*.exe
|
||||
*.ddp
|
||||
*.dcu
|
||||
*.~pas
|
||||
*.~dfm
|
||||
*.~ddp
|
||||
*.~dpr
|
||||
public10/ThreeFun/Fun/U_RTFun250225.pas
|
||||
13
public10/ThreeFun/Form/GetAddRess.dpr
Normal file
13
public10/ThreeFun/Form/GetAddRess.dpr
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
program GetAddRess;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
U_GetAddRess in 'U_GetAddRess.pas' {Form1};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
10793
public10/ThreeFun/Form/U_ColumnBandSet.dfm
Normal file
10793
public10/ThreeFun/Form/U_ColumnBandSet.dfm
Normal file
File diff suppressed because it is too large
Load Diff
468
public10/ThreeFun/Form/U_ColumnBandSet.pas
Normal file
468
public10/ThreeFun/Form/U_ColumnBandSet.pas
Normal file
|
|
@ -0,0 +1,468 @@
|
|||
unit U_ColumnBandSet;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxCheckBox, ADODB, DBClient,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, ComCtrls, ToolWin,
|
||||
ImgList, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, cxNavigator, dxDateRanges, System.ImageList;
|
||||
|
||||
type
|
||||
TfrmColumnBandSet = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBTP: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
v2Column1: TcxGridDBColumn;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
ClientDataSet2: TClientDataSet;
|
||||
DataSource1: TDataSource;
|
||||
DataSource2: TDataSource;
|
||||
ADOQuery1: TADOQuery;
|
||||
ADOQuery2: TADOQuery;
|
||||
ADOQuery3: TADOQuery;
|
||||
ADOQuery4: TADOQuery;
|
||||
ADOLink: TADOConnection;
|
||||
ThreeImgList: TImageList;
|
||||
ThreeColorBase: TcxStyleRepository;
|
||||
SHuangSe: TcxStyle;
|
||||
SkyBlue: TcxStyle;
|
||||
Default: TcxStyle;
|
||||
QHuangSe: TcxStyle;
|
||||
Red: TcxStyle;
|
||||
FontBlue: TcxStyle;
|
||||
TextSHuangSe: TcxStyle;
|
||||
FonePurple: TcxStyle;
|
||||
FoneClMaroon: TcxStyle;
|
||||
FoneRed: TcxStyle;
|
||||
RowColor: TcxStyle;
|
||||
handBlack: TcxStyle;
|
||||
cxBlue: TcxStyle;
|
||||
FenHongS: TcxStyle;
|
||||
cxGrid3: TcxGrid;
|
||||
Tv3: TcxGridDBTableView;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridDBColumn4: TcxGridDBColumn;
|
||||
cxGridDBColumn5: TcxGridDBColumn;
|
||||
cxGridLevel2: TcxGridLevel;
|
||||
DSName: TDataSource;
|
||||
CDSName: TClientDataSet;
|
||||
ADOQuery5: TADOQuery;
|
||||
v2Column2: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBTPClick(Sender: TObject);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
procedure SCreateCDS200(SADOQry:TADOQuery; mClientDataset:TclientDataSet );
|
||||
procedure SInitCDSData200(fromADO:TADOQuery;toCDS:TclientDataSet);
|
||||
function GetLSNo200(ADOQueryTmp:TADOQuery;
|
||||
var mMaxNo:string;
|
||||
mFlag:string;
|
||||
mTable:string;
|
||||
mlen:integer;
|
||||
mtype:integer=0):Boolean;
|
||||
public
|
||||
MKName:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmColumnBandSet: TfrmColumnBandSet;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmColumnBandSet.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmColumnBandSet:=nil;
|
||||
end;
|
||||
procedure TfrmColumnBandSet.SCreateCDS200(SADOQry:TADOQuery; mClientDataset:TclientDataSet );
|
||||
var
|
||||
i:integer;
|
||||
mfieldName:string;
|
||||
mSize:integer;
|
||||
begin
|
||||
mfieldName:='';
|
||||
mClientDataset.FieldDefs.Clear;
|
||||
with SADOQry do
|
||||
begin
|
||||
for i:=0 to fieldCount-1 do //
|
||||
begin
|
||||
if (Fields[i].DataType=ftString) and (Fields[i].Size=0) then
|
||||
begin
|
||||
msize:=1;
|
||||
end
|
||||
else
|
||||
msize:=Fields[i].Size;
|
||||
mfieldName:=trim(fields[i].FieldName);
|
||||
mClientDataset.FieldDefs.Add(mfieldName,
|
||||
Fields[i].DataType,msize);
|
||||
|
||||
end;
|
||||
end;
|
||||
mClientDataset.FieldDefs.Add('Sflag',ftString,1);
|
||||
mClientDataset.FieldDefs.Add('Sindex',ftInteger,0);
|
||||
mClientDataset.FieldDefs.Add('Ssel',ftBoolean,0);
|
||||
mClientDataset.FieldDefs.Add('SDefNote',ftString,10);
|
||||
mClientDataset.Close;
|
||||
mClientDataset.CreateDataSet;
|
||||
end;
|
||||
procedure TfrmColumnBandSet.SInitCDSData200(fromADO:TADOQuery;toCDS:TclientDataSet);
|
||||
var
|
||||
i:integer;
|
||||
k:integer;
|
||||
begin
|
||||
if fromADO.IsEmpty then exit;
|
||||
fromADO.first;
|
||||
K:=1;
|
||||
try
|
||||
toCDS.DisableControls;
|
||||
toCDS.Filtered:=false;
|
||||
|
||||
while not fromADO.Eof do
|
||||
begin
|
||||
with toCDS do
|
||||
begin
|
||||
Append;
|
||||
for i:=0 to fromADO.FieldCount-1 do
|
||||
begin
|
||||
fields[i].value:=fromADO.Fields[i].Value ;
|
||||
end;
|
||||
fieldByName('Sflag').AsString :='1';
|
||||
fieldByName('Sindex').value :=k;
|
||||
fieldByName('Ssel').value :=false;
|
||||
inc(k);
|
||||
Post;
|
||||
end;
|
||||
fromADO.Next;
|
||||
end;
|
||||
if not toCDS.IsEmpty then
|
||||
begin
|
||||
toCDS.First ;
|
||||
end;
|
||||
finally
|
||||
toCDS.EnableControls;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmColumnBandSet.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmColumnBandSet.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmColumnBandSet.FormShow(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
ADOQuery1.DisableControls;
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('select * from SY_User where UserId<>''Admin'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS200(ADOQuery1,ClientDataSet1);
|
||||
SInitCDSData200(ADOQuery1,ClientDataSet1);
|
||||
finally
|
||||
ADOQuery1.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmColumnBandSet.TBTPClick(Sender: TObject);
|
||||
var
|
||||
MaxNo:String;
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
if ClientDataSet1.Locate('SSel',True,[])=False then Exit;
|
||||
try
|
||||
ADOQuery3.Connection.BeginTrans;
|
||||
if ClientDataSet1.Locate('SSel',True,[])=True then
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if ClientDataSet1.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQuery3 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Delete Table_Column where ');
|
||||
sql.Add(' Owner='''+Trim(ClientDataSet1.fieldbyname('UserId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQuery3 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Table_Column where 1<>1 ');
|
||||
open;
|
||||
end;
|
||||
ClientDataSet2.DisableControls;
|
||||
with ClientDataSet2 do
|
||||
begin
|
||||
first;
|
||||
while not Eof do
|
||||
begin
|
||||
with ADOQuery3 do
|
||||
begin
|
||||
Append;
|
||||
if GetLSNo200(ADOQuery4,MaxNo,'CL','Table_Column',4,1)=False then
|
||||
begin
|
||||
ADOQuery3.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
FieldByName('TCID').Value:=Trim(MaxNo);
|
||||
FieldByName('Owner').Value:=Trim(ClientDataSet1.fieldbyname('UserId').AsString);
|
||||
//SSetSaveDataCDSNew(ADOQuery3,Tv2,ClientDataSet2,'Table_Column',0);
|
||||
FieldByName('CxTabName').Value:=Trim(ClientDataSet2.fieldbyname('CxTabName').AsString);
|
||||
FieldByName('CxColName').Value:=Trim(ClientDataSet2.fieldbyname('CxColName').AsString);
|
||||
if ClientDataSet2.fieldbyname('TCNotVisble').AsBoolean=True then
|
||||
FieldByName('TCNotVisble').Value:=1
|
||||
else
|
||||
FieldByName('TCNotVisble').Value:=0;
|
||||
FieldByName('ColName').Value:=Trim(ClientDataSet2.fieldbyname('ColName').AsString);
|
||||
FieldByName('OrderNo').Value:=ClientDataSet2.fieldbyname('OrderNo').Value;
|
||||
FieldByName('FillTime').Value:=Now;
|
||||
Post;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet2.EnableControls;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
if ClientDataSet1.Locate('SSel',True,[])=True then
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if ClientDataSet1.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQuery3 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(' Delete Table_Name where');
|
||||
sql.Add(' Owner='''+Trim(ClientDataSet1.fieldbyname('UserId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQuery3 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Table_Name where 1<>1 ');
|
||||
open;
|
||||
end;
|
||||
CDSName.DisableControls;
|
||||
with CDSName do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
with ADOQuery3 do
|
||||
begin
|
||||
Append;
|
||||
FieldByName('Owner').Value:=Trim(ClientDataSet1.fieldbyname('UserId').AsString);
|
||||
FieldByName('CxTabName').Value:=Trim(CDSName.fieldbyname('CxTabName').AsString);
|
||||
if CDSName.fieldbyname('TCNotVisble').AsBoolean=True then
|
||||
FieldByName('TCNotVisble').Value:=1
|
||||
else
|
||||
FieldByName('TCNotVisble').Value:=0;
|
||||
if CDSName.fieldbyname('InPut').AsBoolean=True then
|
||||
FieldByName('InPut').Value:=1
|
||||
else
|
||||
FieldByName('InPut').Value:=0;
|
||||
FieldByName('FillTime').Value:=Now;
|
||||
FieldByName('OrderNo').Value:=CDSName.fieldbyname('OrderNo').Value;
|
||||
Post;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
CDSName.EnableControls;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
ADOQuery3.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
except
|
||||
ADOQuery3.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
function TfrmColumnBandSet.GetLSNo200(ADOQueryTmp:TADOQuery;
|
||||
var mMaxNo:string;
|
||||
mFlag:string;
|
||||
mTable:string;
|
||||
mlen:integer;
|
||||
mtype:integer=0):Boolean;
|
||||
begin
|
||||
try
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear ;
|
||||
sql.Add('exec Get_SY_MaxBH ');
|
||||
sql.Add(' '+quotedStr(mFlag));
|
||||
sql.Add(','+quotedStr(mTable));
|
||||
sql.Add(','+intTostr(mlen));
|
||||
sql.Add(','+intTostr(mtype));
|
||||
//ShowMessage(SQL.Text);
|
||||
Open;
|
||||
|
||||
if RecordCount>0 then
|
||||
begin
|
||||
mMaxNo:=trim(fieldByName('MaxBH').AsString) ;
|
||||
if mMaxNo<>'' then
|
||||
result:=true
|
||||
else
|
||||
Result:=false;
|
||||
end
|
||||
else
|
||||
begin
|
||||
result:=false;
|
||||
end;
|
||||
|
||||
end;
|
||||
if not Result then
|
||||
application.MessageBox(Pchar('无法生成流水号('+mflag+')'),'提示信息',MB_ICONINFORMATION);
|
||||
|
||||
Except
|
||||
result:=false;
|
||||
application.MessageBox(Pchar('无法生成流水号('+mflag+')'),'提示信息',MB_ICONINFORMATION);
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmColumnBandSet.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
ADOQuery2.DisableControls;
|
||||
with ADOQuery2 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Table_Column where ');
|
||||
sql.Add(' Owner='''+Trim(ClientDataSet1.fieldbyname('UserId').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQuery2.IsEmpty=False then
|
||||
begin
|
||||
with ADOQuery2 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Table_Column where ');
|
||||
sql.Add(' Owner='''+Trim(ClientDataSet1.fieldbyname('UserId').AsString)+'''');
|
||||
sql.Add(' order by OrderNo ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS200(ADOQuery2,ClientDataSet2);
|
||||
SInitCDSData200(ADOQuery2,ClientDataSet2);
|
||||
end else
|
||||
begin
|
||||
while ClientDataSet2.Locate('TCNotVisble',True,[]) do
|
||||
begin
|
||||
with ClientDataSet2 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('TCNotVisble').Value:=0;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQuery2.EnableControls;
|
||||
ADOQuery5.DisableControls;
|
||||
with ADOQuery5 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Table_Name where ');
|
||||
sql.Add(' Owner='''+Trim(ClientDataSet1.fieldbyname('UserId').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQuery5.IsEmpty=False then
|
||||
begin
|
||||
with ADOQuery5 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Table_Name where ');
|
||||
sql.Add(' Owner='''+Trim(ClientDataSet1.fieldbyname('UserId').AsString)+'''');
|
||||
sql.Add(' order by OrderNo ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS200(ADOQuery5,CDSName);
|
||||
SInitCDSData200(ADOQuery5,CDSName);
|
||||
end else
|
||||
begin
|
||||
while CDSName.Locate('TCNotVisble',True,[]) do
|
||||
begin
|
||||
with CDSName do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('TCNotVisble').Value:=0;
|
||||
FieldByName('InPut').Value:=0;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQuery5.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmColumnBandSet.FormCreate(Sender: TObject);
|
||||
begin
|
||||
with ADOLink do
|
||||
begin
|
||||
if not Connected then
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//LoginPrompt:=false;
|
||||
Connected:=true;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
10736
public10/ThreeFun/Form/U_ColumnSet.dfm
Normal file
10736
public10/ThreeFun/Form/U_ColumnSet.dfm
Normal file
File diff suppressed because it is too large
Load Diff
348
public10/ThreeFun/Form/U_ColumnSet.pas
Normal file
348
public10/ThreeFun/Form/U_ColumnSet.pas
Normal file
|
|
@ -0,0 +1,348 @@
|
|||
unit U_ColumnSet;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, cxCheckBox, ADODB, DBClient,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, ComCtrls, ToolWin,
|
||||
ImgList, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, cxNavigator, dxDateRanges, System.ImageList;
|
||||
|
||||
type
|
||||
TfrmColumnSet = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBTP: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
v1Column2: TcxGridDBColumn;
|
||||
v1Column3: TcxGridDBColumn;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
v2Column1: TcxGridDBColumn;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
ClientDataSet2: TClientDataSet;
|
||||
DataSource1: TDataSource;
|
||||
DataSource2: TDataSource;
|
||||
ADOQuery1: TADOQuery;
|
||||
ADOQuery2: TADOQuery;
|
||||
ADOQuery3: TADOQuery;
|
||||
ADOQuery4: TADOQuery;
|
||||
ADOLink: TADOConnection;
|
||||
ThreeImgList: TImageList;
|
||||
ThreeColorBase: TcxStyleRepository;
|
||||
SHuangSe: TcxStyle;
|
||||
SkyBlue: TcxStyle;
|
||||
Default: TcxStyle;
|
||||
QHuangSe: TcxStyle;
|
||||
Red: TcxStyle;
|
||||
FontBlue: TcxStyle;
|
||||
TextSHuangSe: TcxStyle;
|
||||
FonePurple: TcxStyle;
|
||||
FoneClMaroon: TcxStyle;
|
||||
FoneRed: TcxStyle;
|
||||
RowColor: TcxStyle;
|
||||
handBlack: TcxStyle;
|
||||
cxBlue: TcxStyle;
|
||||
FenHongS: TcxStyle;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBTPClick(Sender: TObject);
|
||||
procedure Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
procedure SCreateCDS200(SADOQry:TADOQuery; mClientDataset:TclientDataSet );
|
||||
procedure SInitCDSData200(fromADO:TADOQuery;toCDS:TclientDataSet);
|
||||
function GetLSNo200(ADOQueryTmp:TADOQuery;
|
||||
var mMaxNo:string;
|
||||
mFlag:string;
|
||||
mTable:string;
|
||||
mlen:integer;
|
||||
mtype:integer=0):Boolean;
|
||||
public
|
||||
MKName:String;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmColumnSet: TfrmColumnSet;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmColumnSet.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmColumnSet:=nil;
|
||||
end;
|
||||
procedure TfrmColumnSet.SCreateCDS200(SADOQry:TADOQuery; mClientDataset:TclientDataSet );
|
||||
var
|
||||
i:integer;
|
||||
mfieldName:string;
|
||||
mSize:integer;
|
||||
begin
|
||||
mfieldName:='';
|
||||
mClientDataset.FieldDefs.Clear;
|
||||
with SADOQry do
|
||||
begin
|
||||
for i:=0 to fieldCount-1 do //
|
||||
begin
|
||||
if (Fields[i].DataType=ftString) and (Fields[i].Size=0) then
|
||||
begin
|
||||
msize:=1;
|
||||
end
|
||||
else
|
||||
msize:=Fields[i].Size;
|
||||
mfieldName:=trim(fields[i].FieldName);
|
||||
mClientDataset.FieldDefs.Add(mfieldName,
|
||||
Fields[i].DataType,msize);
|
||||
|
||||
end;
|
||||
end;
|
||||
mClientDataset.FieldDefs.Add('Sflag',ftString,1);
|
||||
mClientDataset.FieldDefs.Add('Sindex',ftInteger,0);
|
||||
mClientDataset.FieldDefs.Add('Ssel',ftBoolean,0);
|
||||
mClientDataset.FieldDefs.Add('SDefNote',ftString,10);
|
||||
mClientDataset.Close;
|
||||
mClientDataset.CreateDataSet;
|
||||
end;
|
||||
procedure TfrmColumnSet.SInitCDSData200(fromADO:TADOQuery;toCDS:TclientDataSet);
|
||||
var
|
||||
i:integer;
|
||||
k:integer;
|
||||
begin
|
||||
if fromADO.IsEmpty then exit;
|
||||
fromADO.first;
|
||||
K:=1;
|
||||
try
|
||||
toCDS.DisableControls;
|
||||
toCDS.Filtered:=false;
|
||||
|
||||
while not fromADO.Eof do
|
||||
begin
|
||||
with toCDS do
|
||||
begin
|
||||
Append;
|
||||
for i:=0 to fromADO.FieldCount-1 do
|
||||
begin
|
||||
fields[i].value:=fromADO.Fields[i].Value ;
|
||||
end;
|
||||
fieldByName('Sflag').AsString :='1';
|
||||
fieldByName('Sindex').value :=k;
|
||||
fieldByName('Ssel').value :=false;
|
||||
inc(k);
|
||||
Post;
|
||||
end;
|
||||
fromADO.Next;
|
||||
end;
|
||||
if not toCDS.IsEmpty then
|
||||
begin
|
||||
toCDS.First ;
|
||||
end;
|
||||
finally
|
||||
toCDS.EnableControls;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmColumnSet.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmColumnSet.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmColumnSet.FormShow(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
ADOQuery1.DisableControls;
|
||||
with ADOQuery1 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('select * from SY_User where UserId<>''Admin'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS200(ADOQuery1,ClientDataSet1);
|
||||
SInitCDSData200(ADOQuery1,ClientDataSet1);
|
||||
finally
|
||||
ADOQuery1.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmColumnSet.TBTPClick(Sender: TObject);
|
||||
var
|
||||
MaxNo:String;
|
||||
begin
|
||||
if ClientDataSet1.Locate('SSel',True,[])=False then Exit;
|
||||
try
|
||||
ADOQuery3.Connection.BeginTrans;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if ClientDataSet1.FieldByName('SSel').AsBoolean=True then
|
||||
begin
|
||||
with ADOQuery3 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('Delete Table_Column where CxTabName='''+Trim(ClientDataSet2.fieldbyname('CxTabName').AsString)+'''');
|
||||
sql.Add(' and Owner='''+Trim(ClientDataSet1.fieldbyname('UserId').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQuery3 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Table_Column where 1<>1 ');
|
||||
open;
|
||||
end;
|
||||
|
||||
with ClientDataSet2 do
|
||||
begin
|
||||
first;
|
||||
while not Eof do
|
||||
begin
|
||||
with ADOQuery3 do
|
||||
begin
|
||||
Append;
|
||||
if GetLSNo200(ADOQuery4,MaxNo,'CL','Table_Column',4,1)=False then
|
||||
begin
|
||||
ADOQuery3.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
FieldByName('TCID').Value:=Trim(MaxNo);
|
||||
FieldByName('Owner').Value:=Trim(ClientDataSet1.fieldbyname('UserId').AsString);
|
||||
//SSetSaveDataCDSNew(ADOQuery3,Tv2,ClientDataSet2,'Table_Column',0);
|
||||
FieldByName('CxTabName').Value:=Trim(ClientDataSet2.fieldbyname('CxTabName').AsString);
|
||||
FieldByName('CxColName').Value:=Trim(ClientDataSet2.fieldbyname('CxColName').AsString);
|
||||
FieldByName('TCNotVisble').Value:=ClientDataSet2.fieldbyname('TCNotVisble').Value;
|
||||
FieldByName('ColName').Value:=Trim(ClientDataSet2.fieldbyname('ColName').AsString);
|
||||
Post;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
|
||||
end;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
ADOQuery3.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
except
|
||||
ADOQuery3.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
function TfrmColumnSet.GetLSNo200(ADOQueryTmp:TADOQuery;
|
||||
var mMaxNo:string;
|
||||
mFlag:string;
|
||||
mTable:string;
|
||||
mlen:integer;
|
||||
mtype:integer=0):Boolean;
|
||||
begin
|
||||
try
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear ;
|
||||
sql.Add('exec Get_SY_MaxBH ');
|
||||
sql.Add(' '+quotedStr(mFlag));
|
||||
sql.Add(','+quotedStr(mTable));
|
||||
sql.Add(','+intTostr(mlen));
|
||||
sql.Add(','+intTostr(mtype));
|
||||
//ShowMessage(SQL.Text);
|
||||
Open;
|
||||
|
||||
if RecordCount>0 then
|
||||
begin
|
||||
mMaxNo:=trim(fieldByName('MaxBH').AsString) ;
|
||||
if mMaxNo<>'' then
|
||||
result:=true
|
||||
else
|
||||
Result:=false;
|
||||
end
|
||||
else
|
||||
begin
|
||||
result:=false;
|
||||
end;
|
||||
|
||||
end;
|
||||
if not Result then
|
||||
application.MessageBox(Pchar('无法生成流水号('+mflag+')'),'提示信息',MB_ICONINFORMATION);
|
||||
|
||||
Except
|
||||
result:=false;
|
||||
application.MessageBox(Pchar('无法生成流水号('+mflag+')'),'提示信息',MB_ICONINFORMATION);
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmColumnSet.Tv1CellClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
ADOQuery2.DisableControls;
|
||||
with ADOQuery2 do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from Table_Column where CxTabName='''+Trim(ClientDataSet2.fieldbyname('CxTabName').AsString)+'''');
|
||||
sql.Add(' and Owner='''+Trim(ClientDataSet1.fieldbyname('UserId').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQuery2.IsEmpty=False then
|
||||
begin
|
||||
SCreateCDS200(ADOQuery2,ClientDataSet2);
|
||||
SInitCDSData200(ADOQuery2,ClientDataSet2);
|
||||
end else
|
||||
begin
|
||||
while ClientDataSet2.Locate('TCNotVisble',True,[]) do
|
||||
begin
|
||||
with ClientDataSet2 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('TCNotVisble').Value:=0;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQuery2.EnableControls;
|
||||
end;
|
||||
|
||||
procedure TfrmColumnSet.FormCreate(Sender: TObject);
|
||||
begin
|
||||
with ADOLink do
|
||||
begin
|
||||
if not Connected then
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//LoginPrompt:=false;
|
||||
Connected:=true;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
88
public10/ThreeFun/Form/U_CompressionFun.pas
Normal file
88
public10/ThreeFun/Form/U_CompressionFun.pas
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
unit U_CompressionFun;
|
||||
|
||||
interface
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, ShlObj, cxShellCommon, cxControls,
|
||||
cxContainer, cxShellTreeView, cxShellListView, StdCtrls, BtnEdit,
|
||||
OleCtnrs, DB, ADODB,ZLib;
|
||||
|
||||
|
||||
procedure CompressionStream(var ASrcStream:TMemoryStream;ACompressionLevel:Integer = 2);
|
||||
procedure UnCompressionStream(var ASrcStream:TMemoryStream);
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_iniparam;
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
///////压缩流
|
||||
////////////////////////////////////////////////////
|
||||
procedure CompressionStream(var ASrcStream:TMemoryStream;ACompressionLevel:Integer = 2);
|
||||
var
|
||||
nDestStream:TMemoryStream;
|
||||
nTmpStream:TCompressionStream;
|
||||
nCompressionLevel:TCompressionLevel;
|
||||
begin
|
||||
ASrcStream.Position := 0;
|
||||
nDestStream := TMemoryStream.Create;
|
||||
try
|
||||
//级别
|
||||
case ACompressionLevel of
|
||||
0:nCompressionLevel := clNone;
|
||||
1:nCompressionLevel := clFastest;
|
||||
2:nCompressionLevel := clDefault;
|
||||
3:nCompressionLevel := clMax;
|
||||
else
|
||||
nCompressionLevel := clMax;
|
||||
end;
|
||||
//开始压缩
|
||||
nTmpStream := TCompressionStream.Create(nCompressionLevel,nDestStream);
|
||||
try
|
||||
ASrcStream.SaveToStream(nTmpStream);
|
||||
finally
|
||||
nTmpStream.Free;//释放后nDestStream才会有数据
|
||||
end;
|
||||
ASrcStream.Clear;
|
||||
ASrcStream.LoadFromStream(nDestStream);
|
||||
ASrcStream.Position := 0;
|
||||
finally
|
||||
nDestStream.Clear;
|
||||
nDestStream.Free;
|
||||
end;
|
||||
end;
|
||||
////////////////////////////////////////////////////
|
||||
///////解压缩流
|
||||
////////////////////////////////////////////////////
|
||||
procedure UnCompressionStream(var ASrcStream:TMemoryStream);
|
||||
var
|
||||
nTmpStream:TDecompressionStream;
|
||||
nDestStream:TMemoryStream;
|
||||
nBuf: array[1..512] of Byte;
|
||||
nSrcCount: integer;
|
||||
begin
|
||||
ASrcStream.Position := 0;
|
||||
nDestStream := TMemoryStream.Create;
|
||||
nTmpStream := TDecompressionStream.Create(ASrcStream);
|
||||
try
|
||||
repeat
|
||||
//读入实际大小
|
||||
nSrcCount := nTmpStream.Read(nBuf, SizeOf(nBuf));
|
||||
if nSrcCount > 0 then
|
||||
nDestStream.Write(nBuf, nSrcCount);
|
||||
until (nSrcCount = 0);
|
||||
ASrcStream.Clear;
|
||||
ASrcStream.LoadFromStream(nDestStream);
|
||||
ASrcStream.Position := 0;
|
||||
finally
|
||||
nDestStream.Clear;
|
||||
nDestStream.Free;
|
||||
nTmpStream.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
10616
public10/ThreeFun/Form/U_DxZDYHelp.dfm
Normal file
10616
public10/ThreeFun/Form/U_DxZDYHelp.dfm
Normal file
File diff suppressed because it is too large
Load Diff
312
public10/ThreeFun/Form/U_DxZDYHelp.pas
Normal file
312
public10/ThreeFun/Form/U_DxZDYHelp.pas
Normal file
|
|
@ -0,0 +1,312 @@
|
|||
unit U_DxZDYHelp;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
|
||||
StdCtrls, ExtCtrls, cxCheckBox, cxDropDownEdit, cxLookAndFeels,
|
||||
cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters, cxNavigator,
|
||||
dxDateRanges, System.ImageList;
|
||||
|
||||
type
|
||||
TfrmDxZDYHelp = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Code: TcxGridDBColumn;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
V1Note: TcxGridDBColumn;
|
||||
V1OrderNo: TcxGridDBColumn;
|
||||
ADOConnection1: TADOConnection;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZDYName: TEdit;
|
||||
ThreeImgList: TImageList;
|
||||
V1Sel: TcxGridDBColumn;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag,flagname,snote:string;
|
||||
fnote,forderno:Boolean;
|
||||
Mresult:string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmDxZDYHelp: TfrmDxZDYHelp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun10, U_ZDYHelp;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmDxZDYHelp.FormCreate(Sender: TObject);
|
||||
begin
|
||||
cxGrid1.Align:=alClient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
Connected:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where Type='''+flag+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
v1name.Options.Editing:=true;
|
||||
//TV1.OptionsData.Editing:=True;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.TBSaveClick(Sender: TObject);
|
||||
var
|
||||
maxno:string;
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
{with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KH_ZDY where Type='''+Trim(Flag)+'''');
|
||||
SQL.Add('delete KH_ZDY where ZDYNo='''+Trim(Flag)+'''');
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type) select :ZDYNo,:ZDYName,:Type ');
|
||||
Parameters.ParamByName('ZDYNo').Value:=Trim(flag);
|
||||
Parameters.ParamByName('ZDYName').Value:=Trim(flagname);
|
||||
Parameters.ParamByName('Type').Value:='Main';
|
||||
ExecSQL;
|
||||
end;}
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp,maxno,'SY','KH_ZDY',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO='''+Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYName').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=ClientDataSet1.fieldbyname('ZDYName').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(ClientDataSet1.fieldbyname('note').AsString);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value:=flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ClientDataSet1.Post;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
V1Name.Options.Editing:=false;
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString)<>'') or
|
||||
(Trim(ClientDataSet1.FieldByName('ZDYname').AsString)<>'') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?','提示信息',1)=2 then exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KH_ZDY where ZDYNo='''+Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString)+'''');
|
||||
SQL.Add(' and Type='''+Trim(flag)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=2;
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj,fsj1:string;
|
||||
begin
|
||||
InitGrid();
|
||||
fsj:=Trim(flag)+'01';
|
||||
fsj1:=Trim(flagname)+'01';
|
||||
{if ClientDataSet1.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYname,Type,note)');
|
||||
sql.Add('select '''+Trim(fsj)+'''');
|
||||
sql.Add(','''+Trim(fsj1)+'''');
|
||||
SQL.Add(','''+Trim(flag)+'''');
|
||||
sql.Add(','''+Trim(snote)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;}
|
||||
frmDxZDYHelp.Caption:=Trim(flagname)+'<'+Trim(flag)+'>';
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
ftype:string;
|
||||
i:integer;
|
||||
begin
|
||||
i:=0;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Mresult:='';
|
||||
First;
|
||||
DisableControls;
|
||||
while not eof do
|
||||
begin
|
||||
if fieldbyname('Ssel').AsBoolean then
|
||||
begin
|
||||
if (i=1) and (ftype<>trim(fieldbyname('note').AsString)) then
|
||||
begin
|
||||
application.MessageBox('备注信息不同,不能选择!','提示信息',0);
|
||||
EnableControls;
|
||||
exit;
|
||||
end;
|
||||
Mresult:=Mresult+trim(fieldbyname('zdyname').AsString)+';';
|
||||
ftype:=trim(fieldbyname('note').AsString);
|
||||
i:=1;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
First;
|
||||
EnableControls;
|
||||
end;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
v1name.Options.Editing:=true;
|
||||
// TV1.OptionsData.Editing:=True;
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if v1name.Options.Editing=False then
|
||||
begin
|
||||
ToolButton1.Click;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDxZDYHelp.ZDYNameChange(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
86
public10/ThreeFun/Form/U_FilterHelp.dfm
Normal file
86
public10/ThreeFun/Form/U_FilterHelp.dfm
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
object frmFilterHelp: TfrmFilterHelp
|
||||
Left = 287
|
||||
Top = 145
|
||||
BorderStyle = bsDialog
|
||||
Caption = #39640#32423#36807#28388
|
||||
ClientHeight = 507
|
||||
ClientWidth = 457
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ScrollBox1: TScrollBox
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 457
|
||||
Height = 465
|
||||
Align = alTop
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
object Label1: TLabel
|
||||
Left = 184
|
||||
Top = 8
|
||||
Width = 68
|
||||
Height = 16
|
||||
Caption = #36807#28388#26465#20214
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object CheckBox1: TCheckBox
|
||||
Left = 384
|
||||
Top = 8
|
||||
Width = 57
|
||||
Height = 17
|
||||
Caption = #31934#30830
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 465
|
||||
Width = 457
|
||||
Height = 43
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 1
|
||||
object Button1: TButton
|
||||
Left = 112
|
||||
Top = 9
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = #30830#23450
|
||||
TabOrder = 0
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 264
|
||||
Top = 9
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = #20851#38381
|
||||
TabOrder = 1
|
||||
OnClick = Button2Click
|
||||
end
|
||||
end
|
||||
object XPManifest1: TXPManifest
|
||||
Left = 280
|
||||
Top = 328
|
||||
end
|
||||
end
|
||||
213
public10/ThreeFun/Form/U_FilterHelp.pas
Normal file
213
public10/ThreeFun/Form/U_FilterHelp.pas
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
unit U_FilterHelp;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls,cxGridLevel,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGrid, cxStyles, cxCustomData, cxGraphics,
|
||||
cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData,StrUtils,ADODB,
|
||||
XPMan;
|
||||
|
||||
type
|
||||
TfrmFilterHelp = class(TForm)
|
||||
ScrollBox1: TScrollBox;
|
||||
Panel1: TPanel;
|
||||
Button1: TButton;
|
||||
Button2: TButton;
|
||||
Label1: TLabel;
|
||||
CheckBox1: TCheckBox;
|
||||
XPManifest1: TXPManifest;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
procedure CreateFilers(Tv1:TcxGridDBTableView);
|
||||
function GSGetFilters():string;
|
||||
procedure GSQryDofilter(ADOQry:TADOQuery;FilterStr:string);
|
||||
procedure TcxGridToExcel(mfileName:string;gridName:TcxGrid);
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFilterHelp: TfrmFilterHelp;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmFilterHelp.Button1Click(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=1
|
||||
end;
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//函数功能:利用cxGrid自带的功能导出到excel中
|
||||
//////////////////////////////////////////////////////////////////
|
||||
procedure TfrmFilterHelp.TcxGridToExcel(mfileName:string;gridName:TcxGrid);
|
||||
var
|
||||
saveDialog:TSaveDialog;
|
||||
begin
|
||||
try
|
||||
saveDialog:=TSaveDialog.Create(nil);
|
||||
saveDialog.Filter:='xls(*.xls)|*.xls|全部(*.*)|*.*';
|
||||
saveDialog.Options:=[ofOverwritePrompt];
|
||||
saveDialog.FileName:=mfileName;
|
||||
if saveDialog.Execute then
|
||||
if Assigned(gridName) then
|
||||
begin
|
||||
try
|
||||
|
||||
// ExportGrid4ToExcel(saveDialog.FileName,gridName);
|
||||
except
|
||||
application.MessageBox('创建失败,源文件可能处于编辑状态!','提示信息',0);
|
||||
exit;
|
||||
end;
|
||||
application.MessageBox('成功导出!','提示信息',0);
|
||||
end
|
||||
else
|
||||
application.MessageBox('导出失败!','提示信息',0);
|
||||
finally
|
||||
saveDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFilterHelp.Button2Click(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=-1;
|
||||
end;
|
||||
|
||||
procedure TfrmFilterHelp.CreateFilers(Tv1:TcxGridDBTableView);
|
||||
var
|
||||
i,j,z,m,FTop,FLeft,Fdiv,FMod:Integer;// mod 余数,div商
|
||||
FLableEdit:TLabeledEdit;
|
||||
|
||||
begin
|
||||
j:=0;
|
||||
for i:=0 to Tv1.ColumnCount-1 do
|
||||
begin
|
||||
m:=0;
|
||||
if Tv1.Columns[i].Visible=False then Continue;
|
||||
if not ( (Tv1.DataController.DataSource.DataSet.FieldByName(Tv1.Columns[i].DataBinding.FieldName).DataType=ftBCD) or
|
||||
(Tv1.DataController.DataSource.DataSet.FieldByName(Tv1.Columns[i].DataBinding.FieldName).DataType=ftString) ) then Continue;
|
||||
Fdiv:=(j+1) div 3;
|
||||
FMod:=(j+1) mod 3;
|
||||
FLableEdit:=TLabeledEdit.Create(Self);
|
||||
FLableEdit.EditLabel.Caption:=Trim(Tv1.Columns[i].Caption);
|
||||
FLableEdit.Name:=Trim(Tv1.Columns[i].DataBinding.FieldName);
|
||||
if Tv1.DataController.DataSource.DataSet.FieldByName(Tv1.Columns[i].DataBinding.FieldName).DataType=ftBCD then
|
||||
begin
|
||||
FLableEdit.EditLabel.Caption:=Trim(Tv1.Columns[i].Caption+'始');
|
||||
FLableEdit.Hint:=Trim(Tv1.Columns[i].DataBinding.FieldName);
|
||||
FLableEdit.Tag:=1;
|
||||
end;
|
||||
FLableEdit.Text:='';
|
||||
FLableEdit.TabOrder:=j;
|
||||
FLableEdit.Parent:=ScrollBox1;
|
||||
if FMod>0 then
|
||||
FLableEdit.Top:=50*(Fdiv+1)
|
||||
else
|
||||
FLableEdit.Top:=50*Fdiv;
|
||||
if FMod=1 then
|
||||
FLableEdit.Left:=29
|
||||
else if FMod=2 then
|
||||
FLableEdit.Left:=163
|
||||
else if FMod=0 then
|
||||
FLableEdit.Left:=305;
|
||||
if Tv1.DataController.DataSource.DataSet.FieldByName(Tv1.Columns[i].DataBinding.FieldName).DataType=ftBCD then
|
||||
begin
|
||||
j:=j+1;
|
||||
Fdiv:=(j+1) div 3;
|
||||
FMod:=(j+1) mod 3;
|
||||
FLableEdit:=TLabeledEdit.Create(Self);
|
||||
FLableEdit.EditLabel.Caption:=Trim(Tv1.Columns[i].Caption+'止');
|
||||
FLableEdit.Hint:=Trim(Tv1.Columns[i].DataBinding.FieldName);
|
||||
FLableEdit.Tag:=2;
|
||||
FLableEdit.Text:='';
|
||||
FLableEdit.TabOrder:=j;
|
||||
FLableEdit.Parent:=ScrollBox1;
|
||||
if FMod>0 then
|
||||
FLableEdit.Top:=50*(Fdiv+1)
|
||||
else
|
||||
FLableEdit.Top:=50*Fdiv;
|
||||
if FMod=1 then
|
||||
FLableEdit.Left:=29
|
||||
else if FMod=2 then
|
||||
FLableEdit.Left:=163
|
||||
else if FMod=0 then
|
||||
FLableEdit.Left:=305;
|
||||
end;
|
||||
j:=j+1;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TfrmFilterHelp.GSGetFilters():string;
|
||||
var
|
||||
i:Integer;
|
||||
FValue:Double;
|
||||
begin
|
||||
Result:='';
|
||||
with ScrollBox1 do
|
||||
begin
|
||||
for i:=0 to ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TLabel then Continue;
|
||||
if Controls[i] is TLabeledEdit then
|
||||
begin
|
||||
if Trim(TLabeledEdit(Controls[i]).Text)<>'' then
|
||||
begin
|
||||
if TLabeledEdit(Controls[i]).Tag>0 then
|
||||
begin
|
||||
try
|
||||
FValue:=StrToFloat(TLabeledEdit(Controls[i]).Text);
|
||||
except
|
||||
Application.MessageBox('不能输入非法数字!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
if TLabeledEdit(Controls[i]).Tag=1 then
|
||||
begin
|
||||
Result:=Result+'and '+Controls[i].Hint+'>='+Trim(TLabeledEdit(Controls[i]).Text);
|
||||
end else
|
||||
if TLabeledEdit(Controls[i]).Tag=2 then
|
||||
begin
|
||||
Result:=Result+'and '+Controls[i].Hint+'<='+Trim(TLabeledEdit(Controls[i]).Text);
|
||||
end else
|
||||
begin
|
||||
if CheckBox1.Checked then
|
||||
Result:=Result+'and '+Controls[i].Name+'='+QuotedStr(Trim(TLabeledEdit(Controls[i]).Text))
|
||||
else
|
||||
Result:=Result+'and '+Controls[i].Name+' like '+QuotedStr('%'+Trim(TLabeledEdit(Controls[i]).Text)+'%');
|
||||
end;
|
||||
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
if Trim(Result)<>'' then
|
||||
Result:=Trim(RightBStr(Result,Length(Result)-4));
|
||||
end;
|
||||
|
||||
procedure TfrmFilterHelp.GSQryDofilter(ADOQry:TADOQuery;FilterStr:string);
|
||||
begin
|
||||
try
|
||||
ADOQry.DisableControls;
|
||||
with ADOQry do
|
||||
begin
|
||||
if Trim(FilterStr)='' then
|
||||
begin
|
||||
Filtered:=False;
|
||||
end else
|
||||
begin
|
||||
Filtered:=False;
|
||||
Filter:=FilterStr;
|
||||
Filtered:=True;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
ADOQry.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
135
public10/ThreeFun/Form/U_FjList.dfm
Normal file
135
public10/ThreeFun/Form/U_FjList.dfm
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
object frmFjList: TfrmFjList
|
||||
Left = 237
|
||||
Top = 203
|
||||
BorderIcons = [biSystemMenu, biMinimize]
|
||||
Caption = #38468#20214#20449#24687
|
||||
ClientHeight = 417
|
||||
ClientWidth = 691
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ListView1: TListView
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 540
|
||||
Height = 417
|
||||
Align = alClient
|
||||
Columns = <>
|
||||
TabOrder = 0
|
||||
OnDblClick = ListView1DblClick
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 540
|
||||
Top = 0
|
||||
Width = 151
|
||||
Height = 417
|
||||
Align = alRight
|
||||
TabOrder = 1
|
||||
object FileName: TcxButton
|
||||
Left = 30
|
||||
Top = 60
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #28155#21152
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
TabOrder = 0
|
||||
OnClick = FileNameClick
|
||||
end
|
||||
object cxButton1: TcxButton
|
||||
Left = 30
|
||||
Top = 96
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #21024#38500
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
TabOrder = 1
|
||||
OnClick = cxButton1Click
|
||||
end
|
||||
object cxButton2: TcxButton
|
||||
Left = 30
|
||||
Top = 132
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #20445#23384
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
TabOrder = 2
|
||||
OnClick = cxButton2Click
|
||||
end
|
||||
object cxButton3: TcxButton
|
||||
Left = 30
|
||||
Top = 172
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #20851#38381
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
OnClick = cxButton3Click
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 176
|
||||
Top = 140
|
||||
Width = 193
|
||||
Height = 41
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = 'Panel2'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
OnDblClick = Panel2DblClick
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
Parameters = <>
|
||||
Left = 520
|
||||
Top = 28
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
Parameters = <>
|
||||
Left = 568
|
||||
Top = 32
|
||||
end
|
||||
object ImageList1: TImageList
|
||||
Left = 536
|
||||
Top = 228
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
ConnectTimeout = 0
|
||||
NATKeepAlive.UseKeepAlive = False
|
||||
NATKeepAlive.IdleTimeMS = 0
|
||||
NATKeepAlive.IntervalMS = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
ReadTimeout = 0
|
||||
Left = 500
|
||||
Top = 198
|
||||
end
|
||||
object ADOConnection1: TADOConnection
|
||||
LoginPrompt = False
|
||||
Left = 532
|
||||
Top = 240
|
||||
end
|
||||
end
|
||||
395
public10/ThreeFun/Form/U_FjList.pas
Normal file
395
public10/ThreeFun/Form/U_FjList.pas
Normal file
|
|
@ -0,0 +1,395 @@
|
|||
unit U_FjList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ExtCtrls, ComCtrls, Menus, cxLookAndFeelPainters, StdCtrls,
|
||||
cxButtons, DB, ADODB, ImgList,shellapi, IdBaseComponent, IdComponent,
|
||||
IdTCPConnection, IdTCPClient, IdFTP,strutils, cxGraphics, cxLookAndFeels,
|
||||
dxSkinsCore, dxSkinsDefaultPainters, IdExplicitTLSClientServerBase,
|
||||
System.ImageList;
|
||||
|
||||
type
|
||||
TfrmFjList = class(TForm)
|
||||
ListView1: TListView;
|
||||
Panel1: TPanel;
|
||||
FileName: TcxButton;
|
||||
cxButton1: TcxButton;
|
||||
cxButton2: TcxButton;
|
||||
cxButton3: TcxButton;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ImageList1: TImageList;
|
||||
Panel2: TPanel;
|
||||
IdFTP1: TIdFTP;
|
||||
ADOConnection1: TADOConnection;
|
||||
procedure cxButton3Click(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FileNameClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ListView1DblClick(Sender: TObject);
|
||||
procedure cxButton1Click(Sender: TObject);
|
||||
procedure cxButton2Click(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure Panel2DblClick(Sender: TObject);
|
||||
private
|
||||
procedure InitData();
|
||||
{ Private declarations }
|
||||
public
|
||||
fkeyNO:string;
|
||||
fType:string;
|
||||
fId:integer;
|
||||
|
||||
fstatus:integer;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFjList: TfrmFjList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun10;
|
||||
{$R *.dfm}
|
||||
procedure TfrmFjList.InitData();
|
||||
var
|
||||
ListItem: TListItem;
|
||||
Flag: Cardinal;
|
||||
info: TSHFileInfo;//SHFILEINFOA;
|
||||
Icon: TIcon;
|
||||
begin
|
||||
ListView1.Items.Clear;
|
||||
try
|
||||
|
||||
with adoqueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select fileName from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
while not eof do
|
||||
begin
|
||||
with ListView1 do
|
||||
begin
|
||||
LargeImages := ImageList1;
|
||||
Icon := TIcon.Create;
|
||||
ListItem := Items.Add;
|
||||
Listitem.Caption := trim(fieldbyname('fileName').AsString);
|
||||
// Listitem.SubItems.Add(OpenDiaLog.FileName);
|
||||
Flag := (SHGFI_SMALLICON or SHGFI_ICON or SHGFI_USEFILEATTRIBUTES);
|
||||
SHGetFileInfo(Pwidechar(trim(fieldbyname('fileName').AsString)), 0, info, Sizeof(info), Flag);
|
||||
Icon.Handle := info.hIcon;
|
||||
ImageList1.AddIcon(Icon);
|
||||
ListItem.ImageIndex := ImageList1.Count - 1;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.cxButton3Click(Sender: TObject);
|
||||
begin
|
||||
ADOQueryTmp.Close;
|
||||
ADOQuerycmd.Close;
|
||||
ListView1.Items.Free;
|
||||
ModalResult:=-1;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFjList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.FileNameClick(Sender: TObject);
|
||||
var
|
||||
OpenDiaLog: TOpenDialog;
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
maxNo:string;
|
||||
// myStream: TADOBlobStream;
|
||||
// FJStream : TMemoryStream;
|
||||
begin
|
||||
|
||||
try
|
||||
OpenDiaLog := TOpenDialog.Create(Self);
|
||||
if OpenDiaLog.Execute then
|
||||
begin
|
||||
fFilePath:=OpenDiaLog.FileName;
|
||||
fFileName:=ExtractFileName(OpenDiaLog.FileName);
|
||||
|
||||
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select TFId from TP_File ');
|
||||
sql.Add('where WBID<>'+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
open;
|
||||
IF not adoqueryCmd.IsEmpty then
|
||||
begin
|
||||
application.MessageBox('此附件名称已存在,请修改文件名,继续上传!','提示信息',MB_ICONERROR);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Panel2.Caption:='正在上传数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
|
||||
if GetLSNo(ADOQueryCmd,maxNo,'FJ','TP_File',4,1)=False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
adoqueryCmd.Connection.BeginTrans;
|
||||
|
||||
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
execsql;
|
||||
end;
|
||||
|
||||
try
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
open;
|
||||
append;
|
||||
fieldbyname('TFID').Value:=trim(maxNO);
|
||||
fieldbyname('WBID').Value:=trim(fkeyNO);
|
||||
fieldbyname('TFType').Value:=trim(fType);
|
||||
fieldbyname('FileName').Value:=trim(fFileName);
|
||||
// tblobfield(FieldByName('Filesother')).LoadFromFile(fFilePath);
|
||||
post;
|
||||
end;
|
||||
|
||||
if fFilePath <> '' then
|
||||
begin
|
||||
try
|
||||
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI','SERVER','FTP地址','127.0.0.1');
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
IdFTP1.Put(fFilePath, 'FJ\' + Trim(fFileName));
|
||||
IdFTP1.Quit;
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('上传客户图样文件失败,请检查文件服务器!', '提示', MB_ICONWARNING);
|
||||
end;
|
||||
end;
|
||||
IdFTP1.Quit;
|
||||
|
||||
Panel2.Visible:=false;
|
||||
initdata();
|
||||
finally
|
||||
// FJStream.Free;
|
||||
end;
|
||||
|
||||
end;
|
||||
adoqueryCmd.Connection.CommitTrans;
|
||||
except
|
||||
adoqueryCmd.Connection.RollbackTrans;
|
||||
application.MessageBox('附件保存失败!','提示信息',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.FormCreate(Sender: TObject);
|
||||
begin
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='';
|
||||
Connected:=true;
|
||||
end;
|
||||
ListView1.Align:=alclient;
|
||||
fstatus:=0;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.FormShow(Sender: TObject);
|
||||
begin
|
||||
IF fstatus=0 then Panel1.Visible:=true
|
||||
else Panel1.Visible:=false;
|
||||
initdata();
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.ListView1DblClick(Sender: TObject);
|
||||
var
|
||||
sFieldName:string;
|
||||
fileName:string;
|
||||
begin
|
||||
if ListView1.Items.Count<1 THEN EXIT;
|
||||
|
||||
if listView1.SelCount<1 then exit;
|
||||
sFieldName:=leftbstr(ExtractFilePath(Application.ExeName),1)+':\图片查看';
|
||||
|
||||
if not DirectoryExists(pchar(sFieldName)) then
|
||||
CreateDirectory(pchar(sFieldName),nil);
|
||||
|
||||
fileName:=ListView1.Selected.Caption;
|
||||
|
||||
sFieldName:=sFieldName+'\'+trim(fileName);
|
||||
|
||||
try
|
||||
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI','SERVER','FTP地址','127.0.0.1');
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
;
|
||||
end;
|
||||
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
|
||||
Panel2.Caption:='正在下载数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
try
|
||||
IdFTP1.Get('FJ\'+ Trim(fileName), sFieldName,true, false);
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('客户图样文件不存在', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('无法连接文件服务器', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
Panel2.Visible:=false;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(sFieldName),'', '', SW_SHOWNORMAL);
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.cxButton1Click(Sender: TObject);
|
||||
var
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
begin
|
||||
if listView1.SelCount<1 then exit;
|
||||
|
||||
try
|
||||
fFileName:=ListView1.Selected.Caption;
|
||||
// ADOQueryTmp.Locate('fileName',fFileName,[]);
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
execsql;
|
||||
end;
|
||||
|
||||
initData();
|
||||
|
||||
except
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.cxButton2Click(Sender: TObject);
|
||||
var
|
||||
SaveDialog: TSaveDialog;
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
begin
|
||||
if listView1.SelCount<1 then exit;
|
||||
|
||||
try
|
||||
|
||||
fFileName:=ListView1.Selected.Caption;
|
||||
|
||||
SaveDialog := TSaveDialog.Create(Self);
|
||||
|
||||
SaveDialog.FileName:=fFileName;
|
||||
if SaveDialog.Execute then
|
||||
begin
|
||||
Panel2.Caption:='正在保存数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
fFilePath:=SaveDialog.FileName;
|
||||
try
|
||||
IdFTP1.Host := ReadINIFileStr('SYSTEMSET.INI','SERVER','FTP地址','127.0.0.1');;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
;
|
||||
end;
|
||||
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
|
||||
Panel2.Caption:='正在下载数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
try
|
||||
IdFTP1.Get('FJ\'+ Trim(fFileName), fFilePath,false, true);
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('客户图样文件不存在', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('无法连接文件服务器', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
Panel2.Visible:=false;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
end;
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
if fId=10 then Action:=cafree
|
||||
else
|
||||
Action:=cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList.Panel2DblClick(Sender: TObject);
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
end;
|
||||
|
||||
end.
|
||||
147
public10/ThreeFun/Form/U_FjList10.dfm
Normal file
147
public10/ThreeFun/Form/U_FjList10.dfm
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
object frmFjList10: TfrmFjList10
|
||||
Left = 237
|
||||
Top = 203
|
||||
BorderIcons = [biSystemMenu, biMinimize]
|
||||
Caption = #38468#20214#20449#24687
|
||||
ClientHeight = 463
|
||||
ClientWidth = 782
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ListView1: TListView
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 631
|
||||
Height = 463
|
||||
Align = alClient
|
||||
Columns = <
|
||||
item
|
||||
end>
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
OnDblClick = ListView1DblClick
|
||||
ExplicitHeight = 464
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 631
|
||||
Top = 0
|
||||
Width = 151
|
||||
Height = 463
|
||||
Align = alRight
|
||||
TabOrder = 1
|
||||
ExplicitHeight = 464
|
||||
object FileName: TcxButton
|
||||
Left = 30
|
||||
Top = 60
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #28155#21152
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
TabOrder = 0
|
||||
OnClick = FileNameClick
|
||||
end
|
||||
object cxButton1: TcxButton
|
||||
Left = 30
|
||||
Top = 96
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #21024#38500
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
TabOrder = 1
|
||||
OnClick = cxButton1Click
|
||||
end
|
||||
object cxButton2: TcxButton
|
||||
Left = 30
|
||||
Top = 132
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #21478#23384#20026'...'
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
TabOrder = 2
|
||||
OnClick = cxButton2Click
|
||||
end
|
||||
object cxButton3: TcxButton
|
||||
Left = 30
|
||||
Top = 172
|
||||
Width = 75
|
||||
Height = 25
|
||||
Hint = 'Filesother'
|
||||
Caption = #20851#38381
|
||||
LookAndFeel.Kind = lfOffice11
|
||||
TabOrder = 3
|
||||
Visible = False
|
||||
OnClick = cxButton3Click
|
||||
end
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 176
|
||||
Top = 140
|
||||
Width = 193
|
||||
Height = 41
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = 'Panel2'
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
OnDblClick = Panel2DblClick
|
||||
end
|
||||
object ADOQueryTmp: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
Parameters = <>
|
||||
Left = 520
|
||||
Top = 28
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
Parameters = <>
|
||||
Left = 568
|
||||
Top = 32
|
||||
end
|
||||
object ImageList1: TImageList
|
||||
Height = 32
|
||||
Width = 32
|
||||
Left = 536
|
||||
Top = 228
|
||||
end
|
||||
object IdFTP1: TIdFTP
|
||||
ConnectTimeout = 0
|
||||
NATKeepAlive.UseKeepAlive = False
|
||||
NATKeepAlive.IdleTimeMS = 0
|
||||
NATKeepAlive.IntervalMS = 0
|
||||
ProxySettings.ProxyType = fpcmNone
|
||||
ProxySettings.Port = 0
|
||||
ReadTimeout = 0
|
||||
Left = 500
|
||||
Top = 198
|
||||
end
|
||||
object ADOConnection1: TADOConnection
|
||||
LoginPrompt = False
|
||||
Left = 532
|
||||
Top = 276
|
||||
end
|
||||
end
|
||||
441
public10/ThreeFun/Form/U_FjList10.pas
Normal file
441
public10/ThreeFun/Form/U_FjList10.pas
Normal file
|
|
@ -0,0 +1,441 @@
|
|||
unit U_FjList10;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ExtCtrls, ComCtrls, Menus, cxLookAndFeelPainters, StdCtrls,
|
||||
cxButtons, DB, ADODB, ImgList,shellapi, IdBaseComponent, IdComponent,
|
||||
IdTCPConnection, IdTCPClient, IdFTP,strutils, cxGraphics, cxLookAndFeels,
|
||||
dxSkinsCore, dxSkinsDefaultPainters, IdExplicitTLSClientServerBase,
|
||||
System.ImageList;
|
||||
|
||||
type
|
||||
TfrmFjList10 = class(TForm)
|
||||
ListView1: TListView;
|
||||
Panel1: TPanel;
|
||||
FileName: TcxButton;
|
||||
cxButton1: TcxButton;
|
||||
cxButton2: TcxButton;
|
||||
cxButton3: TcxButton;
|
||||
ADOQueryTmp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ImageList1: TImageList;
|
||||
Panel2: TPanel;
|
||||
IdFTP1: TIdFTP;
|
||||
ADOConnection1: TADOConnection;
|
||||
procedure cxButton3Click(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FileNameClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ListView1DblClick(Sender: TObject);
|
||||
procedure cxButton1Click(Sender: TObject);
|
||||
procedure cxButton2Click(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure Panel2DblClick(Sender: TObject);
|
||||
private
|
||||
procedure InitData();
|
||||
{ Private declarations }
|
||||
public
|
||||
fkeyNO:string;
|
||||
fType:string;
|
||||
fId:integer;
|
||||
|
||||
fstatus:integer;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmFjList10: TfrmFjList10;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_CompressionFun;
|
||||
{$R *.dfm}
|
||||
procedure TfrmFjList10.InitData();
|
||||
var
|
||||
ListItem: TListItem;
|
||||
Flag: Cardinal;
|
||||
info:TSHFileInfo;// SHFILEINFOA;
|
||||
Icon: TIcon;
|
||||
begin
|
||||
ListView1.Items.Clear;
|
||||
try
|
||||
|
||||
with adoqueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
while not eof do
|
||||
begin
|
||||
with ListView1 do
|
||||
begin
|
||||
LargeImages := ImageList1;
|
||||
Icon := TIcon.Create;
|
||||
ListItem := Items.Add;
|
||||
Listitem.Caption := trim(fieldbyname('fileName').AsString);
|
||||
// Listitem.SubItems.Add(OpenDiaLog.FileName);
|
||||
// Flag := (SHGFI_LARGEICON or SHGFI_ICON or SHGFI_USEFILEATTRIBUTES); //大图标, 改imagelist里面的宽度高度 32*32
|
||||
Flag := (SHGFI_SMALLICON or SHGFI_ICON or SHGFI_USEFILEATTRIBUTES); //小图标, 16*16
|
||||
SHGetFileInfo(Pwidechar(trim(fieldbyname('fileName').AsString)), 0, info, Sizeof(info), flag);
|
||||
Icon.Handle := info.hIcon;
|
||||
ImageList1.AddIcon(Icon);
|
||||
ListItem.ImageIndex := ImageList1.Count - 1;
|
||||
end;
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList10.cxButton3Click(Sender: TObject);
|
||||
begin
|
||||
ADOQueryTmp.Close;
|
||||
ADOQuerycmd.Close;
|
||||
ListView1.Items.Free;
|
||||
ModalResult:=-1;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList10.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmFjList10:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList10.FileNameClick(Sender: TObject);
|
||||
var
|
||||
OpenDiaLog: TOpenDialog;
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
maxNo:string;
|
||||
// myStream: TADOBlobStream;
|
||||
// FJStream : TMemoryStream;
|
||||
FJStream : TMemoryStream;
|
||||
mfileSize:integer;
|
||||
mCreationTime:TdateTime;
|
||||
mWriteTime:TdateTime;
|
||||
begin
|
||||
|
||||
try
|
||||
OpenDiaLog := TOpenDialog.Create(Self);
|
||||
if OpenDiaLog.Execute then
|
||||
begin
|
||||
fFilePath:=OpenDiaLog.FileName;
|
||||
fFileName:=ExtractFileName(OpenDiaLog.FileName);
|
||||
|
||||
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select TFId from TP_File ');
|
||||
sql.Add('where WBID<>'+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
open;
|
||||
IF not adoqueryCmd.IsEmpty then
|
||||
begin
|
||||
application.MessageBox('此附件名称已存在,请修改文件名,继续上传!','提示信息',MB_ICONERROR);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
Panel2.Caption:='正在上传数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
|
||||
if GetLSNo(ADOQueryCmd,maxNo,'FJ','TP_File',4,1)=False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
//获取文件信息
|
||||
// GetFileInfo(fFilePath,mfileSize,mCreationTime,mWriteTime);
|
||||
|
||||
adoqueryCmd.Connection.BeginTrans;
|
||||
|
||||
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
execsql;
|
||||
end;
|
||||
|
||||
try
|
||||
FJStream:=TMemoryStream.Create;
|
||||
with adoqueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
open;
|
||||
append;
|
||||
fieldbyname('TFID').Value:=trim(maxNO);
|
||||
fieldbyname('WBID').Value:=trim(fkeyNO);
|
||||
fieldbyname('TFType').Value:=trim(fType);
|
||||
fieldbyname('FileName').Value:=trim(fFileName);
|
||||
FJStream.LoadFromFile(fFilePath);
|
||||
CompressionStream(FJStream);
|
||||
tblobfield(FieldByName('Filesother')).LoadFromStream(FJStream);
|
||||
// tblobfield(FieldByName('Filesother')).LoadFromFile(fFilePath);
|
||||
post;
|
||||
end;
|
||||
|
||||
{ if fFilePath <> '' then
|
||||
begin
|
||||
try
|
||||
IdFTP1.Host := PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
IdFTP1.Put(fFilePath, 'FJ\' + Trim(fFileName));
|
||||
IdFTP1.Quit;
|
||||
except
|
||||
IdFTP1.Quit;
|
||||
Application.MessageBox('上传客户图样文件失败,请检查文件服务器!', '提示', MB_ICONWARNING);
|
||||
end;
|
||||
end;
|
||||
IdFTP1.Quit; }
|
||||
|
||||
Panel2.Visible:=false;
|
||||
initdata();
|
||||
finally
|
||||
// FJStream.Free;
|
||||
end;
|
||||
adoqueryCmd.Connection.CommitTrans;
|
||||
end;
|
||||
|
||||
except
|
||||
adoqueryCmd.Connection.RollbackTrans;
|
||||
application.MessageBox('附件保存失败!','提示信息',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList10.FormCreate(Sender: TObject);
|
||||
begin
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='';
|
||||
Connected:=true;
|
||||
end;
|
||||
ListView1.Align:=alclient;
|
||||
fstatus:=0;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList10.FormShow(Sender: TObject);
|
||||
begin
|
||||
IF fstatus=0 then Panel1.Visible:=true
|
||||
else Panel1.Visible:=false;
|
||||
initdata();
|
||||
end;
|
||||
|
||||
procedure TfrmFjList10.ListView1DblClick(Sender: TObject);
|
||||
var
|
||||
sFieldName:string;
|
||||
fileName:string;
|
||||
ff: TADOBlobStream;
|
||||
FJStream : TMemoryStream;
|
||||
begin
|
||||
if ListView1.Items.Count<1 THEN EXIT;
|
||||
|
||||
if listView1.SelCount<1 then exit;
|
||||
sFieldName:=leftbstr(ExtractFilePath(Application.ExeName),1)+':\图片查看';
|
||||
|
||||
if not DirectoryExists(pchar(sFieldName)) then
|
||||
CreateDirectory(pchar(sFieldName),nil);
|
||||
|
||||
fileName:=ListView1.Selected.Caption;
|
||||
|
||||
sFieldName:=sFieldName+'\'+trim(fileName);
|
||||
|
||||
{ try
|
||||
IdFTP1.Host := PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
;
|
||||
end;
|
||||
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
|
||||
Panel2.Caption:='正在下载数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
try
|
||||
IdFTP1.Get('FJ\'+ Trim(fileName), sFieldName,true, false);
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('客户图样文件不存在', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('无法连接文件服务器', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
Panel2.Visible:=false;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
ShellExecute(Handle, 'open',PChar(sFieldName),'', '', SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
try
|
||||
adoqueryTmp.Locate('FileName',fileName,[]);
|
||||
ff := TADOBlobstream.Create(adoqueryTmp.fieldByName('FilesOther') as TblobField, bmRead);
|
||||
|
||||
fjStream:= TMemoryStream.Create ;
|
||||
ff.SaveToStream(fjStream);
|
||||
UnCompressionStream(fjStream);
|
||||
fjStream.SaveToFile(sFieldName);
|
||||
ShellExecute(Handle, 'open',PChar(sFieldName),'', '', SW_SHOWNORMAL);
|
||||
finally
|
||||
fjStream.free;
|
||||
ff.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList10.cxButton1Click(Sender: TObject);
|
||||
var
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
begin
|
||||
if listView1.SelCount<1 then exit;
|
||||
|
||||
try
|
||||
fFileName:=ListView1.Selected.Caption;
|
||||
// ADOQueryTmp.Locate('fileName',fFileName,[]);
|
||||
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete from TP_File ');
|
||||
sql.Add('where WBID='+quotedstr(trim(fkeyNO)));
|
||||
sql.Add('and TFType='+quotedstr(trim(fType)));
|
||||
sql.Add('and FileName='+quotedstr(trim(fFileName)));
|
||||
execsql;
|
||||
end;
|
||||
|
||||
initData();
|
||||
|
||||
except
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmFjList10.cxButton2Click(Sender: TObject);
|
||||
var
|
||||
SaveDialog: TSaveDialog;
|
||||
fFileName:string;
|
||||
fFilePath:string;
|
||||
ff: TADOBlobStream;
|
||||
FJStream : TMemoryStream;
|
||||
begin
|
||||
if listView1.SelCount<1 then exit;
|
||||
|
||||
try
|
||||
|
||||
fFileName:=ListView1.Selected.Caption;
|
||||
adoqueryTmp.Locate('FileName',fFileName,[]);
|
||||
|
||||
SaveDialog := TSaveDialog.Create(Self);
|
||||
|
||||
SaveDialog.FileName:=fFileName;
|
||||
if SaveDialog.Execute then
|
||||
begin
|
||||
Panel2.Caption:='正在保存数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
fFilePath:=SaveDialog.FileName;
|
||||
try
|
||||
ff := TADOBlobstream.Create(adoqueryTmp.fieldByName('FilesOther') as TblobField, bmRead);
|
||||
|
||||
fjStream:= TMemoryStream.Create ;
|
||||
ff.SaveToStream(fjStream);
|
||||
UnCompressionStream(fjStream);
|
||||
fjStream.SaveToFile(fFilePath);
|
||||
// ShellExecute(Handle, 'open',PChar(sFieldName),'', '', SW_SHOWNORMAL);
|
||||
finally
|
||||
fjStream.free;
|
||||
ff.Free;
|
||||
Panel2.Visible:=false;
|
||||
end;
|
||||
|
||||
end;
|
||||
{ try
|
||||
IdFTP1.Host := PicSvr;
|
||||
IdFTP1.Username := 'three';
|
||||
IdFTP1.Password := '641010';
|
||||
IdFTP1.Connect();
|
||||
except
|
||||
;
|
||||
end;
|
||||
|
||||
if IdFTP1.Connected then
|
||||
begin
|
||||
|
||||
Panel2.Caption:='正在下载数据,请稍等...';
|
||||
Panel2.Visible:=true;
|
||||
application.ProcessMessages;
|
||||
try
|
||||
IdFTP1.Get('FJ\'+ Trim(fFileName), fFilePath,false, true);
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('客户图样文件不存在', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
Application.MessageBox('无法连接文件服务器', '提示', MB_ICONWARNING);
|
||||
IdFTP1.Quit;
|
||||
Exit;
|
||||
end;
|
||||
Panel2.Visible:=false;
|
||||
if IdFTP1.Connected then IdFTP1.Quit;
|
||||
end; }
|
||||
except
|
||||
Panel2.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList10.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
if fId=10 then Action:=cafree
|
||||
else
|
||||
Action:=cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmFjList10.Panel2DblClick(Sender: TObject);
|
||||
begin
|
||||
Panel2.Visible:=false;
|
||||
end;
|
||||
|
||||
end.
|
||||
46
public10/ThreeFun/Form/U_GetAddRess.dfm
Normal file
46
public10/ThreeFun/Form/U_GetAddRess.dfm
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
object Form1: TForm1
|
||||
Left = 387
|
||||
Top = 243
|
||||
Width = 520
|
||||
Height = 376
|
||||
Caption = 'Form1'
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'MS Sans Serif'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object Label1: TLabel
|
||||
Left = 128
|
||||
Top = 96
|
||||
Width = 32
|
||||
Height = 13
|
||||
Caption = 'Label1'
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 208
|
||||
Top = 104
|
||||
Width = 32
|
||||
Height = 13
|
||||
Caption = 'Label2'
|
||||
end
|
||||
object Button1: TButton
|
||||
Left = 112
|
||||
Top = 48
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = 'Button1'
|
||||
TabOrder = 0
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object Edit1: TEdit
|
||||
Left = 200
|
||||
Top = 48
|
||||
Width = 121
|
||||
Height = 21
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
43
public10/ThreeFun/Form/U_GetAddRess.pas
Normal file
43
public10/ThreeFun/Form/U_GetAddRess.pas
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
unit U_GetAddRess;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs,StdCtrls,WinSock, ComCtrls;
|
||||
Function sendarp(ipaddr:ulong;temp:dword;ulmacaddr:pointer;ulmacaddrleng:pointer) : DWord; StdCall; External 'Iphlpapi.dll' Name 'SendARP';
|
||||
type
|
||||
TForm1 = class(TForm)
|
||||
Button1: TButton;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
Edit1: TEdit;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
var
|
||||
myip:ulong;
|
||||
mymac:array[0..5] of byte;
|
||||
mymaclength:ulong;
|
||||
r:integer;
|
||||
begin
|
||||
{myip:=inet_addr(PChar(Trim(Edit1.Text)));
|
||||
mymaclength:=length(mymac);
|
||||
r:=sendarp(myip,0,@mymac,@mymaclength);
|
||||
label1.caption:='errorcode:'+inttostr(r);
|
||||
label2.caption:=format('%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x',[mymac[0],mymac[1],mymac[2],mymac[3],mymac[4],mymac[5]]); }
|
||||
end;
|
||||
|
||||
end.
|
||||
3503
public10/ThreeFun/Form/U_ItemManageNew.dfm
Normal file
3503
public10/ThreeFun/Form/U_ItemManageNew.dfm
Normal file
File diff suppressed because it is too large
Load Diff
265
public10/ThreeFun/Form/U_ItemManageNew.pas
Normal file
265
public10/ThreeFun/Form/U_ItemManageNew.pas
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
unit U_ItemManageNew;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
|
||||
StdCtrls, ExtCtrls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, cxNavigator, dxDateRanges, System.ImageList;
|
||||
|
||||
type
|
||||
TfrmItemManageNew = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Code: TcxGridDBColumn;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
V1Note: TcxGridDBColumn;
|
||||
V1OrderNo: TcxGridDBColumn;
|
||||
ADOConnection1: TADOConnection;
|
||||
ImageList24: TImageList;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
Edit1: TEdit;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag,flagname,snote:string;
|
||||
fnote,forderno:Boolean;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmItemManageNew: TfrmItemManageNew;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmItemManageNew.FormCreate(Sender: TObject);
|
||||
begin
|
||||
cxGrid1.Align:=alClient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
Connected:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmItemManageNew.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmItemManageNew.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from XC_Code where Flag='''+flag+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmItemManageNew.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing:=True;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmItemManageNew.TBSaveClick(Sender: TObject);
|
||||
begin
|
||||
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('delete XC_Code where Flag='''+Flag+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from XC_Code where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then
|
||||
begin
|
||||
ADOQueryCmd.Close;
|
||||
ADOQueryCmd.sql.Clear;
|
||||
ADOQueryCmd.sql.Add('delete from XC_Code where Code='''+Flag+'''');
|
||||
ADOQueryCmd.ExecSQL;
|
||||
end else
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Trim(ClientDataSet1.FieldByName('Code').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('编号不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.FieldByName('Name').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from XC_Code where Code='''+Trim(ClientDataSet1.fieldbyname('Code').AsString)+'''');
|
||||
Open;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('编号重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('Code').Value:=ClientDataSet1.fieldbyname('Code').AsString;
|
||||
ADOQueryCmd.FieldByName('Name').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Flag').Value:=flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
TV1.OptionsData.Editing:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmItemManageNew.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('Code').AsString)<>'') or
|
||||
(Trim(ClientDataSet1.FieldByName('name').AsString)<>'') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?','提示信息',1)=2 then exit;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmItemManageNew.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=2;
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmItemManageNew.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj,fsj1:string;
|
||||
begin
|
||||
InitGrid();
|
||||
fsj:=Trim(flag)+'01';
|
||||
fsj1:=Trim(flagname)+'01';
|
||||
if ClientDataSet1.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
//sql.Add('insert into XC_Code(code,name,flag,note)');
|
||||
//sql.Add('select '''+Trim(flag)+'''');
|
||||
//sql.Add(','''+Trim(flagname)+'''');
|
||||
//SQL.Add(',''BASECODE'' ');
|
||||
//sql.Add(','''+Trim(snote)+'''');
|
||||
sql.Add('insert into XC_Code(code,name,flag,note)');
|
||||
sql.Add('select '''+Trim(fsj)+'''');
|
||||
sql.Add(','''+Trim(fsj1)+'''');
|
||||
SQL.Add(','''+Trim(flag)+'''');
|
||||
sql.Add(','''+Trim(snote)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
frmItemManageNew.Caption:=Trim(flagname)+'<'+Trim(flag)+'>';
|
||||
end;
|
||||
|
||||
procedure TfrmItemManageNew.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmItemManageNew.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing:=True;
|
||||
end;
|
||||
|
||||
procedure TfrmItemManageNew.TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing=False then
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
10572
public10/ThreeFun/Form/U_KHHelp.dfm
Normal file
10572
public10/ThreeFun/Form/U_KHHelp.dfm
Normal file
File diff suppressed because it is too large
Load Diff
169
public10/ThreeFun/Form/U_KHHelp.pas
Normal file
169
public10/ThreeFun/Form/U_KHHelp.pas
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
unit U_KHHelp;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
|
||||
StdCtrls, ExtCtrls, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu,
|
||||
cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters,
|
||||
cxNavigator, dxDateRanges, dxBarBuiltInMenu, System.ImageList;
|
||||
|
||||
type
|
||||
TfrmKHHelp = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
ADOConnection1: TADOConnection;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZDYName: TEdit;
|
||||
ThreeImgList: TImageList;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
V1Column1: TcxGridDBColumn;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag,flagname,snote,MainType:string;
|
||||
fnote,forderno,fZdyFlag:Boolean;
|
||||
PPSTE:integer;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmKHHelp: TfrmKHHelp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmKHHelp.FormCreate(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
cxGrid1.Align:=alClient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='';
|
||||
Connected:=true;
|
||||
end;
|
||||
except
|
||||
frmKHHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKHHelp.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmKHHelp.InitGrid();
|
||||
var
|
||||
CYType:String;
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_User where UserId='''+Trim(DCode)+'''');
|
||||
Open;
|
||||
end;
|
||||
CYType:=Trim(ADOQueryTemp.fieldbyname('DPID').AsString);
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('exec P_Select_User_KHName :CYType');
|
||||
Parameters.ParamByName('CYType').Value:=Trim(CYType);
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKHHelp.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=2;
|
||||
ZDYName.SetFocus;
|
||||
WriteCxGrid('客户名称',TV1,'基础数据');
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmKHHelp.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
ReadCxGrid('客户名称',TV1,'基础数据');
|
||||
end;
|
||||
|
||||
procedure TfrmKHHelp.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmKHHelp.TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing=False then
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKHHelp.ZDYNameChange(Sender: TObject);
|
||||
var
|
||||
fsj:String;
|
||||
begin
|
||||
if Trim(ZDYName.Text)<>'' then
|
||||
begin
|
||||
fsj:=' zdyname like '''+'%'+Trim(ZDYName.Text)+'%'+''''
|
||||
+' or ZJM like '''+'%'+Trim(ZDYName.Text)+'%'+'''';
|
||||
end;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,fsj);
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmKHHelp.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmKHHelp:=nil;
|
||||
end;
|
||||
|
||||
end.
|
||||
3962
public10/ThreeFun/Form/U_LbaelMap.dfm
Normal file
3962
public10/ThreeFun/Form/U_LbaelMap.dfm
Normal file
File diff suppressed because it is too large
Load Diff
279
public10/ThreeFun/Form/U_LbaelMap.pas
Normal file
279
public10/ThreeFun/Form/U_LbaelMap.pas
Normal file
|
|
@ -0,0 +1,279 @@
|
|||
unit U_LbaelMap;
|
||||
|
||||
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, cxCheckComboBox, cxDropDownEdit, Menus, RM_e_Xls,
|
||||
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, dxDateRanges, dxBarBuiltInMenu, System.ImageList,
|
||||
Vcl.ImgList;
|
||||
|
||||
type
|
||||
TfrmLbaelMap = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ToolButton2: TToolButton;
|
||||
ADOQueryMain: TADOQuery;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
DS_HZ: TDataSource;
|
||||
CDS_HZ: TClientDataSet;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N1: TMenuItem;
|
||||
N2: TMenuItem;
|
||||
Panel1: TPanel;
|
||||
LMName: TEdit;
|
||||
v2Column8: TcxGridDBColumn;
|
||||
Label1: TLabel;
|
||||
v2Column12: TcxGridDBColumn;
|
||||
ToolButton4: TToolButton;
|
||||
ToolButton5: TToolButton;
|
||||
Label2: TLabel;
|
||||
LMType: TEdit;
|
||||
v2Column1: TcxGridDBColumn;
|
||||
Tv2Column1: TcxGridDBColumn;
|
||||
ADOConnection1: TADOConnection;
|
||||
ImageList_new32: TImageList;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure cxTabControl1Change(Sender: TObject);
|
||||
procedure N1Click(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
procedure CustomerChange(Sender: TObject);
|
||||
procedure v2Column8PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure ToolButton5Click(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
procedure InitGrid();
|
||||
public
|
||||
FLMType: string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmLbaelMap: TfrmLbaelMap;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_RTFun, U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmLbaelMap.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select A.* from Lbael_Map A ');
|
||||
sql.Add(' where LMType= ' + QuotedStr(trim(FLMType)));
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain, CDS_HZ);
|
||||
SInitCDSData(ADOQueryMain, CDS_HZ);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
ToolButton2.Click;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmLbaelMap := nil;
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action := caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.FormCreate(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected := false;
|
||||
ConnectionString := DConString;
|
||||
//ConnectionString:='';
|
||||
Connected := true;
|
||||
end;
|
||||
except
|
||||
frmLbaelMap.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid(Trim(Self.Caption), Tv2, '标签管理');
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.FormShow(Sender: TObject);
|
||||
begin
|
||||
ReadCxGrid(Trim(Self.Caption), Tv2, '标签管理');
|
||||
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.ToolButton2Click(Sender: TObject);
|
||||
var
|
||||
sql: string;
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
sql := SGetFilters(Panel1, 1, 2);
|
||||
SDofilter(ADOQueryMain, sql);
|
||||
SCreateCDS(ADOQueryMain, CDS_HZ);
|
||||
SInitCDSData(ADOQueryMain, CDS_HZ);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.cxTabControl1Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid;
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.N1Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_HZ.IsEmpty then
|
||||
exit;
|
||||
with CDS_HZ do
|
||||
begin
|
||||
DisableControls;
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('ssel').Value := true;
|
||||
post;
|
||||
next;
|
||||
end;
|
||||
First;
|
||||
EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.N2Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_HZ.IsEmpty then
|
||||
exit;
|
||||
with CDS_HZ do
|
||||
begin
|
||||
DisableControls;
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
edit;
|
||||
fieldbyname('ssel').Value := false;
|
||||
post;
|
||||
next;
|
||||
end;
|
||||
First;
|
||||
EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.CustomerChange(Sender: TObject);
|
||||
begin
|
||||
ToolButton2.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.v2Column8PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue, FFieldName: string;
|
||||
begin
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with CDS_HZ do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(FFieldName).Value := Trim(mvalue);
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('UPdate Lbael_Map ');
|
||||
sql.Add(' Set ' + FFieldName + '=''' + Trim(mvalue) + '''');
|
||||
sql.Add(' , Editer=''' + Trim(DName) + '''');
|
||||
sql.Add(' , Edittime=getdate()');
|
||||
sql.Add(' where LMID=' + quotedstr(CDS_HZ.fieldbyname('LMID').AsString));
|
||||
ExecSQL;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
tv2.Controller.EditingController.ShowEdit();
|
||||
except
|
||||
tv2.Controller.EditingController.ShowEdit();
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!', '提示', 0);
|
||||
end
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.ToolButton4Click(Sender: TObject);
|
||||
var
|
||||
maxId: string;
|
||||
begin
|
||||
if GetLSNo(ADOQueryCmd, maxId, 'M', 'Lbael_Map', 4, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into Lbael_Map(LMType,Filler) values(' + quotedstr(Trim(FLMType)) + ',' + quotedstr(Trim(dname)) + ')');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmLbaelMap.ToolButton5Click(Sender: TObject);
|
||||
begin
|
||||
if CDS_HZ.IsEmpty then
|
||||
Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?', '提示', 32 + 4) <> IDYES then
|
||||
Exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete Lbael_Map where LMID=' + QuotedStr(CDS_HZ.FieldByName('LMID').AsString));
|
||||
ExecSQL;
|
||||
end;
|
||||
CDS_HZ.Delete;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
182
public10/ThreeFun/Form/U_ModulePromptList.dfm
Normal file
182
public10/ThreeFun/Form/U_ModulePromptList.dfm
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
object frmModulePromptList: TfrmModulePromptList
|
||||
Left = 126
|
||||
Top = 142
|
||||
Caption = #25105#30340#31649#23478
|
||||
ClientHeight = 508
|
||||
ClientWidth = 1049
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1049
|
||||
Height = 29
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_TradeManage.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 9
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 55
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 29
|
||||
Width = 1049
|
||||
Height = 41
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
ExplicitTop = 32
|
||||
object Panel2: TPanel
|
||||
Left = 664
|
||||
Top = 2
|
||||
Width = 383
|
||||
Height = 37
|
||||
Align = alRight
|
||||
BevelOuter = bvNone
|
||||
Caption = #25552#31034#65306#21452#20987#25171#24320#22788#29702#20449#24687#30028#38754
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 70
|
||||
Width = 1049
|
||||
Height = 438
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
ExplicitTop = 73
|
||||
ExplicitHeight = 436
|
||||
object Tv1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
OnCellDblClick = Tv1CellDblClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.GroupByBox = False
|
||||
OptionsView.Indicator = True
|
||||
Styles.Header = DataLink_TradeManage.FontBlue
|
||||
object v1Column5: TcxGridDBColumn
|
||||
Caption = #24453#22788#29702#20107#39033
|
||||
DataBinding.FieldName = 'ModuleName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 235
|
||||
end
|
||||
object v1Column1: TcxGridDBColumn
|
||||
Caption = #22788#29702#20154
|
||||
DataBinding.FieldName = 'DName'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 107
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = Tv1
|
||||
end
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 1128
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_TradeManage.ADOLink
|
||||
Parameters = <>
|
||||
Left = 936
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_TradeManage.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 1000
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_TradeManage.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 1040
|
||||
Top = 8
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = Order_Main
|
||||
Left = 1168
|
||||
Top = 8
|
||||
end
|
||||
object Order_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 815
|
||||
Top = 7
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 506
|
||||
Top = 195
|
||||
end
|
||||
end
|
||||
224
public10/ThreeFun/Form/U_ModulePromptList.pas
Normal file
224
public10/ThreeFun/Form/U_ModulePromptList.pas
Normal file
|
|
@ -0,0 +1,224 @@
|
|||
unit U_ModulePromptList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxGrid, DBClient, cxCalendar, cxButtonEdit, cxSplitter,
|
||||
RM_Common, RM_Class, RM_e_Xls, RM_Dataset, RM_System, RM_GridReport,
|
||||
cxTextEdit, cxPC, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, cxNavigator, dxDateRanges, dxBarBuiltInMenu;
|
||||
|
||||
type
|
||||
TfrmModulePromptList = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
Panel1: TPanel;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
Order_Main: TClientDataSet;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
cxGrid1: TcxGrid;
|
||||
Tv1: TcxGridDBTableView;
|
||||
v1Column5: TcxGridDBColumn;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
v1Column1: TcxGridDBColumn;
|
||||
Panel2: TPanel;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TBRafreshClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxPageControl1Change(Sender: TObject);
|
||||
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
private
|
||||
fDConString_link1:string;
|
||||
procedure InitGrid();
|
||||
procedure InitForm();
|
||||
procedure InitDllEvt(FromFile:String;FormID:Integer;Para:String;FormType:Integer; Title: String;
|
||||
Def1: String; Def2: String; Def3: String; Def4: String; Def5: String;
|
||||
Def6: String; Def7: String; Def8: String; Def9: String; Def10: string);
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
userID,username:string;
|
||||
end;
|
||||
|
||||
var
|
||||
frmModulePromptList: TfrmModulePromptList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun;
|
||||
type
|
||||
TMyF = function(
|
||||
App: TApplication; //主应用程序 (对Delphi而言)
|
||||
FormH: HWND; //创建窗口的父窗口句柄 (对PB而言)
|
||||
FormID: Integer; //要调用dll中功能窗体的Id号; 如果只有一个功能窗口,FormID默认为0
|
||||
Language: Integer; //0=Delphi; 1=PB
|
||||
WinStyle: Integer; //0=子窗口; 1:普通窗口 (PB中都为普通窗口)
|
||||
UID: PChar; //用户Id
|
||||
UName: PChar; //用户名
|
||||
Para: PChar;
|
||||
Title: PChar;
|
||||
Defstr1: PChar;
|
||||
Defstr2: PChar;
|
||||
Defstr3: PChar;
|
||||
Defstr4: PChar;
|
||||
Defstr5: PChar;
|
||||
Defstr6: PChar;
|
||||
Defstr7: PChar;
|
||||
Defstr8: PChar;
|
||||
Defstr9: PChar;
|
||||
Defstr10: PChar;
|
||||
Datalink: PChar
|
||||
): HWND; stdcall;
|
||||
var
|
||||
TP: FARPROC;
|
||||
Tf: TMyF;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmModulePromptList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmModulePromptList:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('工作列表',Tv1,'我的管家');
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add(' exec P_Chk_Tishi :DName,:DCode');
|
||||
Parameters.ParamByName('DName').Value:=Trim(DName);
|
||||
Parameters.ParamByName('DCode').Value:=Trim(DCode);
|
||||
ExecSQL;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,Order_Main);
|
||||
SInitCDSData20(ADOQueryMain,Order_Main);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.InitForm();
|
||||
begin
|
||||
fDConString_link1:=Trim(DConString);
|
||||
ReadCxGrid('工作列表',Tv1,'我的管家');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitForm();
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.cxPageControl1Change(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmModulePromptList.InitDllEvt(FromFile:String;FormID:Integer;Para:String;FormType:Integer; Title: String;
|
||||
Def1: String; Def2: String; Def3: String; Def4: String; Def5: String;
|
||||
Def6: String; Def7: String; Def8: String; Def9: String; Def10: string);
|
||||
var
|
||||
Th: HMODULE;
|
||||
begin
|
||||
Th := LoadLibrary(PChar(FromFile));
|
||||
if Th > 0 then
|
||||
begin
|
||||
TP := GetProcAddress(Th, 'GetDllForm');
|
||||
if TP <> nil then
|
||||
begin
|
||||
Tf := TMyF(Tp);
|
||||
Tf(Application, 0, FormID, 0, FormType, PChar(DCode), PChar(DName), PChar(Para), PChar(Title),
|
||||
PChar(Def1), PChar(Def2),PChar(Def3),PChar(Def4),PChar(Def5),
|
||||
PChar(Def6),PChar(Def7),PChar(Def8),PChar(Def9),PChar(Def10),
|
||||
pchar(fDConString_link1));
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Application.MessageBox(PChar('打不开文件' + FromFile + '!'), '错误', MB_ICONERROR);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmModulePromptList.Tv1CellDblClick(
|
||||
Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from SY_ModuleSub where ModuleId='''+Trim(Order_Main.fieldbyname('ModuleId').AsString)+'''');
|
||||
sql.Add(' and ModuleSubId='''+Trim(Order_Main.fieldbyname('ModuleSubId').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
IF (trim(Order_Main.FieldByName('ModuleId').AsString)='05' ) and (trim(Order_Main.FieldByName('ModuleSubId').AsString)='04' ) then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('update JYOrder_Sub_AnPai SET Aordflag10=1 where Aordflag10=0 ');
|
||||
execsql;
|
||||
end;
|
||||
end;
|
||||
IF not ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
InitDllEvt(Trim(ADOQueryTemp.FieldByName('formFile').AsString),
|
||||
ADOQueryTemp.FieldByName('FormID').AsInteger,
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara').AsString),
|
||||
ADOQueryTemp.FieldByName('FormType').AsInteger,
|
||||
Trim(ADOQueryTemp.FieldByName('Formname').AsString),
|
||||
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara1').AsString),
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara2').AsString),
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara3').AsString),
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara4').AsString),
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara5').AsString),
|
||||
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara6').AsString),
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara7').AsString),
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara8').AsString),
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara9').AsString),
|
||||
Trim(ADOQueryTemp.FieldByName('FormPara10').AsString),
|
||||
);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
245
public10/ThreeFun/Form/U_RTZDYHelp.dfm
Normal file
245
public10/ThreeFun/Form/U_RTZDYHelp.dfm
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
object frmRTZDYHelp: TfrmRTZDYHelp
|
||||
Left = 466
|
||||
Top = 188
|
||||
Caption = #39033#30446#32500#25252
|
||||
ClientHeight = 489
|
||||
ClientWidth = 479
|
||||
Color = clWhite
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 8
|
||||
Top = 88
|
||||
Width = 417
|
||||
Height = 200
|
||||
TabOrder = 0
|
||||
object TV1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
OnCellDblClick = TV1CellDblClick
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Filter.AutoDataSetFilter = True
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Editing = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.Footer = DataLink_ProductWarehouse.Default
|
||||
Styles.Header = DataLink_ProductWarehouse.Default
|
||||
object V1Code: TcxGridDBColumn
|
||||
Caption = #32534#21495
|
||||
DataBinding.FieldName = 'ZDYNo'
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 97
|
||||
end
|
||||
object V1OrderNo: TcxGridDBColumn
|
||||
Caption = #39034#24207#21495
|
||||
DataBinding.FieldName = 'OrderNo'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1OrderNoPropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 57
|
||||
end
|
||||
object V1Name: TcxGridDBColumn
|
||||
Tag = 2
|
||||
Caption = #21517#31216
|
||||
DataBinding.FieldName = 'ZDYName'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1NamePropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 146
|
||||
end
|
||||
object V1Note: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1NotePropertiesEditValueChanged
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 113
|
||||
end
|
||||
object V1ZdyFlag: TcxGridDBColumn
|
||||
Caption = #26631#24535
|
||||
DataBinding.FieldName = 'ZdyFlag'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1Column1PropertiesEditValueChanged
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 57
|
||||
end
|
||||
object V1HelpType: TcxGridDBColumn
|
||||
Caption = #24110#21161#31867#27604
|
||||
DataBinding.FieldName = 'HelpType'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
Properties.OnEditValueChanged = V1HelpTypePropertiesEditValueChanged
|
||||
Visible = False
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 55
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = TV1
|
||||
end
|
||||
end
|
||||
object ToolBar1: TToolBar
|
||||
Tag = 1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 479
|
||||
Height = 38
|
||||
AutoSize = True
|
||||
ButtonHeight = 38
|
||||
ButtonWidth = 75
|
||||
Caption = 'ToolBar1'
|
||||
DisabledImages = DataLink_ProductWarehouse.ImageList_new32
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
Images = DataLink_ProductWarehouse.ImageList_new32
|
||||
List = True
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = #36873#25321
|
||||
ImageIndex = 12
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBAdd: TToolButton
|
||||
Left = 75
|
||||
Top = 0
|
||||
Caption = #22686#34892
|
||||
ImageIndex = 2
|
||||
OnClick = TBAddClick
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 150
|
||||
Top = 0
|
||||
Caption = #21024#34892
|
||||
ImageIndex = 6
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object TBEdit: TToolButton
|
||||
Left = 225
|
||||
Top = 0
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 3
|
||||
OnClick = TBEditClick
|
||||
end
|
||||
object TBSave: TToolButton
|
||||
Left = 300
|
||||
Top = 0
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 16
|
||||
Visible = False
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 375
|
||||
Top = 0
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 7
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 38
|
||||
Width = 479
|
||||
Height = 44
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 2
|
||||
ExplicitTop = 18
|
||||
object Label1: TLabel
|
||||
Left = 18
|
||||
Top = 17
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #21517#31216
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 240
|
||||
Top = 11
|
||||
Width = 120
|
||||
Height = 24
|
||||
Caption = #27880#65306#28966#28857#31163#24320#24403#21069#32534#36753#13#10' '#21333#20803#26684#20445#23384#25968#25454#12290
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clBlue
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object ZDYName: TEdit
|
||||
Tag = 2
|
||||
Left = 53
|
||||
Top = 12
|
||||
Width = 169
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = ZDYNameChange
|
||||
end
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 48
|
||||
Top = 136
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 80
|
||||
Top = 144
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
Parameters = <>
|
||||
Left = 112
|
||||
Top = 152
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ClientDataSet1
|
||||
Left = 280
|
||||
Top = 144
|
||||
end
|
||||
object ClientDataSet1: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 208
|
||||
Top = 144
|
||||
end
|
||||
object ADOConnection1: TADOConnection
|
||||
LoginPrompt = False
|
||||
Left = 80
|
||||
Top = 232
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 168
|
||||
Top = 152
|
||||
end
|
||||
end
|
||||
687
public10/ThreeFun/Form/U_RTZDYHelp.pas
Normal file
687
public10/ThreeFun/Form/U_RTZDYHelp.pas
Normal file
|
|
@ -0,0 +1,687 @@
|
|||
unit U_RTZDYHelp;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
|
||||
StdCtrls, ExtCtrls, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu,
|
||||
cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters,
|
||||
cxNavigator, dxDateRanges, dxBarBuiltInMenu;
|
||||
|
||||
type
|
||||
TfrmRTZDYHelp = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Code: TcxGridDBColumn;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
V1Note: TcxGridDBColumn;
|
||||
V1OrderNo: TcxGridDBColumn;
|
||||
ADOConnection1: TADOConnection;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZDYName: TEdit;
|
||||
Label2: TLabel;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
V1ZdyFlag: TcxGridDBColumn;
|
||||
V1HelpType: TcxGridDBColumn;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
procedure V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1OrderNoPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1NotePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1HelpTypePropertiesEditValueChanged(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag,flagname,snote,MainType:string;
|
||||
fnote,forderno,fZdyFlag,ViewFlag:Boolean;
|
||||
PPSTE:integer;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmRTZDYHelp: TfrmRTZDYHelp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmRTZDYHelp.FormCreate(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
cxGrid1.Align:=alClient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='';
|
||||
Connected:=true;
|
||||
end;
|
||||
except
|
||||
{if Application.MessageBox('网络连接失败,是否要再次连接?','提示',32+4)=IDYES then
|
||||
begin
|
||||
try
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='23242';
|
||||
Connected:=true;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end; }
|
||||
|
||||
frmRTZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,ZJM=dbo.getPinYin(A.ZdyName) from KH_ZDY A where A.Type='''+flag+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
begin
|
||||
sql.Add(' and A.MainType='''+Trim(MainType)+'''');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData(ADOQueryMain,ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmRTZDYHelp.TBAddClick(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
TV1.OptionsData.Editing:=True;
|
||||
TV1.OptionsSelection.CellSelect:=True;
|
||||
for i:=0 to 5 do
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
procedure TfrmRTZDYHelp.TBSaveClick(Sender: TObject);
|
||||
var
|
||||
maxno:string;
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
ZDYName.SetFocus;
|
||||
|
||||
if ClientDataSet1.Locate('ZDYName',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if ClientDataSet1.Locate('ZDYName','',[]) then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo='''+Trim(flag)+'''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType ');
|
||||
Parameters.ParamByName('ZDYNo').Value:=Trim(flag);
|
||||
Parameters.ParamByName('ZDYName').Value:=Trim(flagname);
|
||||
Parameters.ParamByName('Type').Value:='Main';
|
||||
Parameters.ParamByName('MainType').Value:=Trim(MainType);
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
ClientDataSet1.DisableControls;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp,maxno,'SY','KH_ZDY',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from KH_Zdy where Type='''+Trim(flag)+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
SQL.Add(' and MainType='''+Trim(MainType)+'''');
|
||||
sql.Add(' and ZdyName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
begin
|
||||
if ADOQueryTemp.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end else
|
||||
begin
|
||||
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString)<>Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO='''+Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=ClientDataSet1.fieldbyname('ZDYName').Value;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value:=flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
if Trim(MainType)<>'' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value:=Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ClientDataSet1.Post;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.EnableControls;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
TV1.OptionsData.Editing:=False;
|
||||
TV1.OptionsSelection.CellSelect:=False;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString)<>'') or
|
||||
(Trim(ClientDataSet1.FieldByName('ZDYname').AsString)<>'') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?','提示信息',1)=2 then exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KH_ZDY where ZDYNo='''+Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString)+'''');
|
||||
SQL.Add(' and Type='''+Trim(flag)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=2;
|
||||
ZDYName.SetFocus;
|
||||
WriteCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj,fsj1:string;
|
||||
begin
|
||||
{if PPSTE=1 then
|
||||
begin
|
||||
Application.Terminate;
|
||||
Exit;
|
||||
end; }
|
||||
InitGrid();
|
||||
fsj:=Trim(flag)+'01';
|
||||
fsj1:=Trim(flagname)+'01';
|
||||
{if ClientDataSet1.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYname,Type,note)');
|
||||
sql.Add('select '''+Trim(fsj)+'''');
|
||||
sql.Add(','''+Trim(fsj1)+'''');
|
||||
SQL.Add(','''+Trim(flag)+'''');
|
||||
sql.Add(','''+Trim(snote)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
InitGrid();
|
||||
end;}
|
||||
//frmZDYHelp.Caption:=Trim(flagname)+'<'+Trim(flag)+'>';
|
||||
//ReadCxGrid('自定义',TV1,'自定义数据');
|
||||
ReadCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
|
||||
frmRTZDYHelp.Caption:=Trim(flagname);
|
||||
V1Note.Visible:=fnote;
|
||||
V1ZdyFlag.Visible:=fZdyFlag;
|
||||
V1OrderNo.Visible:=forderno;
|
||||
if ViewFlag=True then
|
||||
begin
|
||||
TBAdd.Visible:=False;
|
||||
TBSave.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
TBEdit.Visible:=False;
|
||||
Label2.Visible:=False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
WriteCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing:=True;
|
||||
TV1.OptionsSelection.CellSelect:=True;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing=False then
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.ZDYNameChange(Sender: TObject);
|
||||
var
|
||||
fsj:String;
|
||||
begin
|
||||
if Trim(ZDYName.Text)<>'' then
|
||||
begin
|
||||
fsj:=' zdyname like '''+'%'+Trim(ZDYName.Text)+'%'+''''
|
||||
+' or Note like '''+'%'+Trim(ZDYName.Text)+'%'+''''
|
||||
+' or ZJM like '''+'%'+Trim(ZDYName.Text)+'%'+'''';
|
||||
end;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
// SDofilter(ADOQueryMain,fsj);
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
if Trim(fsj)='' then
|
||||
begin
|
||||
Filtered:=False;
|
||||
end else
|
||||
begin
|
||||
Filtered:=False;
|
||||
Filter:=fsj;
|
||||
Filtered:=True;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData(ADOQueryMain,ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
maxno,mvalue:string;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
//Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('ZdyName').Value:=Trim(mvalue);
|
||||
//Post;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo='''+Trim(flag)+'''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType ');
|
||||
Parameters.ParamByName('ZDYNo').Value:=Trim(flag);
|
||||
Parameters.ParamByName('ZDYName').Value:=Trim(flagname);
|
||||
Parameters.ParamByName('Type').Value:='Main';
|
||||
Parameters.ParamByName('MainType').Value:=Trim(MainType);
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
//ClientDataSet1.DisableControls;
|
||||
//with ClientDataSet1 do
|
||||
//begin
|
||||
//First;
|
||||
//while not eof do
|
||||
//begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp,maxno,'SY','KH_ZDY',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from KH_Zdy where Type='''+Trim(flag)+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
SQL.Add(' and MainType='''+Trim(MainType)+'''');
|
||||
sql.Add(' and ZdyName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
begin
|
||||
if ADOQueryTemp.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end else
|
||||
begin
|
||||
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString)<>Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO='''+Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=ClientDataSet1.fieldbyname('ZDYName').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value:=flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
if Trim(MainType)<>'' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value:=Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
//ClientDataSet1.Post;
|
||||
// Next;
|
||||
//end;
|
||||
//end;
|
||||
// ClientDataSet1.EnableControls;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
//Application.MessageBox('保存成功!','提示',0);
|
||||
//TV1.OptionsData.Editing:=False;
|
||||
//TV1.OptionsSelection.CellSelect:=False;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.V1OrderNoPropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue:string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
mvalue:='0';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('OrderNo').Value:=mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set OrderNo='+mvalue);
|
||||
sql.Add(' where ZdyNo='''+Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.V1NotePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue:string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
mvalue:='0';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Note').Value:=mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set Note='''+Trim(mvalue)+'''');
|
||||
sql.Add(' where ZdyNo='''+Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.V1Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue:String;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
mvalue:='0';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('ZdyFlag').Value:=StrToInt(mvalue);
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set ZdyFlag='+Trim(mvalue));
|
||||
sql.Add(' where ZdyNo='''+Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmRTZDYHelp.V1HelpTypePropertiesEditValueChanged(
|
||||
Sender: TObject);
|
||||
var
|
||||
mvalue:string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then
|
||||
begin
|
||||
mvalue:='0';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('HelpType').Value:=mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set HelpType='''+Trim(mvalue)+'''');
|
||||
sql.Add(' where ZdyNo='''+Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
104
public10/ThreeFun/Form/U_SelExportField.dfm
Normal file
104
public10/ThreeFun/Form/U_SelExportField.dfm
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
object frmSelExportField: TfrmSelExportField
|
||||
Left = 473
|
||||
Top = 162
|
||||
BorderStyle = bsDialog
|
||||
Caption = #23383#27573#23548#20986#36873#25321
|
||||
ClientHeight = 493
|
||||
ClientWidth = 430
|
||||
Color = clBtnFace
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object Button1: TButton
|
||||
Left = 94
|
||||
Top = 456
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = #30830#23450
|
||||
TabOrder = 0
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 243
|
||||
Top = 456
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = #20851#38381
|
||||
TabOrder = 1
|
||||
OnClick = Button2Click
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 425
|
||||
Top = 63
|
||||
Width = 281
|
||||
Height = 113
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
object ExpGrid: TcxGridDBTableView
|
||||
NavigatorButtons.ConfirmDelete = False
|
||||
DataController.DataSource = ExportDataSource
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.AlwaysShowEditor = True
|
||||
OptionsView.GroupByBox = False
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = ExpGrid
|
||||
end
|
||||
end
|
||||
object Panel2: TScrollBox
|
||||
Left = 2
|
||||
Top = 0
|
||||
Width = 423
|
||||
Height = 438
|
||||
HorzScrollBar.Visible = False
|
||||
Color = clSkyBlue
|
||||
ParentColor = False
|
||||
TabOrder = 3
|
||||
object Label4: TLabel
|
||||
Left = 158
|
||||
Top = 9
|
||||
Width = 60
|
||||
Height = 14
|
||||
Caption = #23383#27573#36873#25321
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -14
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
end
|
||||
object CheckBox1: TCheckBox
|
||||
Left = 20
|
||||
Top = 449
|
||||
Width = 49
|
||||
Height = 17
|
||||
Caption = #20840#36873
|
||||
TabOrder = 4
|
||||
OnClick = CheckBox1Click
|
||||
end
|
||||
object CheckBox2: TCheckBox
|
||||
Left = 20
|
||||
Top = 465
|
||||
Width = 49
|
||||
Height = 17
|
||||
Caption = #20840#24323
|
||||
TabOrder = 5
|
||||
OnClick = CheckBox2Click
|
||||
end
|
||||
object ExportDataSource: TDataSource
|
||||
Left = 424
|
||||
Top = 233
|
||||
end
|
||||
end
|
||||
309
public10/ThreeFun/Form/U_SelExportField.pas
Normal file
309
public10/ThreeFun/Form/U_SelExportField.pas
Normal file
|
|
@ -0,0 +1,309 @@
|
|||
unit U_SelExportField;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
{Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, RM_FormReport, RM_PDBGrid,
|
||||
DB,IniFiles, RM_Common, RM_Class, RM_e_Xls, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData,
|
||||
cxGridLevel, cxClasses, cxControls, cxGridCustomView,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid; }
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, StdCtrls, BtnEdit, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit,DBGrids, DB, cxDBData,
|
||||
cxGridLevel, cxClasses, cxControls, cxGridCustomView, ADODB,StrUtils,
|
||||
Midas,cxGridCustomTableView, cxGridTableView, cxGridDBTableView,cxTimeEdit,
|
||||
cxTreeView, cxGrid,cxDBLookupComboBox,cxCalendar, cxCurrencyEdit,cxExportGrid4Link,
|
||||
ExtCtrls, Buttons,DBClient,FTComboBox,cxDropDownEdit,cxGridBandedTableView,
|
||||
cxGridDBBandedTableView,cxRichEdit,cxButtonEdit,IniFiles,WinSock;
|
||||
|
||||
type
|
||||
TfrmSelExportField = class(TForm)
|
||||
Button1: TButton;
|
||||
Button2: TButton;
|
||||
ExportDataSource: TDataSource;
|
||||
ExpGrid: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
Panel2: TScrollBox;
|
||||
Label4: TLabel;
|
||||
CheckBox1: TCheckBox;
|
||||
CheckBox2: TCheckBox;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure CheckBox1Click(Sender: TObject);
|
||||
procedure CheckBox2Click(Sender: TObject);
|
||||
private
|
||||
procedure CreateCheckBox();
|
||||
procedure ExportData();
|
||||
procedure ReadINIFile(fieldname:string);
|
||||
procedure WriteINIFile(fieldname:string);
|
||||
Function IsINIFile(fieldname:string):Boolean;
|
||||
procedure GetExportFields();
|
||||
procedure IsCheck();
|
||||
procedure TcxGridToExcel(mfileName:string;gridName:TcxGrid);
|
||||
{ Private declarations }
|
||||
public
|
||||
ExportFields,IniName:string;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmSelExportField: TfrmSelExportField;
|
||||
|
||||
implementation
|
||||
|
||||
//uses U_SelPrintField,U_FormPas;
|
||||
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmSelExportField.CreateCheckBox();
|
||||
var
|
||||
i,j,FTop,FLeft,Fdiv,FMod:Integer;// mod 余数,div商
|
||||
FCheckBox:TCheckBox;
|
||||
begin
|
||||
for i:=0 to ExpGrid.ColumnCount-1 do
|
||||
begin
|
||||
Fdiv:=(i+1) div 3;
|
||||
FMod:=(i+1) mod 3;
|
||||
FCheckBox:=TCheckBox.Create(Self);
|
||||
FCheckBox.Caption:=Trim(ExpGrid.Columns[i].Caption);
|
||||
FCheckBox.TabOrder:=i;
|
||||
FCheckBox.Parent:=Panel2;
|
||||
FCheckBox.Checked:=True;
|
||||
if FMod>0 then
|
||||
FCheckBox.Top:=36*(Fdiv+1)
|
||||
else
|
||||
FCheckBox.Top:=36*Fdiv;
|
||||
if FMod=1 then
|
||||
FCheckBox.Left:=29
|
||||
else if FMod=2 then
|
||||
FCheckBox.Left:=163
|
||||
else if FMod=0 then
|
||||
FCheckBox.Left:=305;
|
||||
|
||||
end;
|
||||
end;
|
||||
procedure TfrmSelExportField.TcxGridToExcel(mfileName:string;gridName:TcxGrid);
|
||||
var
|
||||
saveDialog:TSaveDialog;
|
||||
begin
|
||||
try
|
||||
saveDialog:=TSaveDialog.Create(nil);
|
||||
saveDialog.Filter:='xls(*.xls)|*.xls|全部(*.*)|*.*';
|
||||
saveDialog.Options:=[ofOverwritePrompt];
|
||||
saveDialog.FileName:=mfileName;
|
||||
if saveDialog.Execute then
|
||||
if Assigned(gridName) then
|
||||
begin
|
||||
try
|
||||
|
||||
ExportGrid4ToExcel(saveDialog.FileName,gridName);
|
||||
except
|
||||
application.MessageBox('创建失败,源文件可能处于编辑状态!','提示信息',0);
|
||||
exit;
|
||||
end;
|
||||
application.MessageBox('成功导出!','提示信息',0);
|
||||
end
|
||||
else
|
||||
application.MessageBox('导出失败!','提示信息',0);
|
||||
finally
|
||||
saveDialog.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.Button1Click(Sender: TObject);
|
||||
begin
|
||||
//ShowMessage('10除以3取余'+inttostr(10 mod 3)+',取整'+inttostr(10 div 3));
|
||||
ExportData();
|
||||
GetExportFields();
|
||||
if IsINIFile(IniName)=True then
|
||||
begin
|
||||
DeleteFile(IniName);
|
||||
end;
|
||||
WriteINIFile(IniName);
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmSelExportField:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.FormShow(Sender: TObject);
|
||||
begin
|
||||
CreateCheckBox();
|
||||
ReadINIFile(IniName);
|
||||
IsCheck();
|
||||
end;
|
||||
procedure TfrmSelExportField.IsCheck();
|
||||
var
|
||||
i:Integer;
|
||||
fsj:string;
|
||||
begin
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
fsj:=Trim(TCheckBox(Controls[i]).Caption);
|
||||
if Pos(fsj,ExportFields)>0 then
|
||||
TCheckBox(Controls[i]).Checked:=True
|
||||
else
|
||||
TCheckBox(Controls[i]).Checked:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.ExportData();
|
||||
var
|
||||
i,j:Integer;
|
||||
begin
|
||||
j:=0;
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if TCheckBox(Controls[i]).Checked=True then
|
||||
begin
|
||||
j:=1;
|
||||
ExpGrid.Columns[TCheckBox(Controls[i]).TabOrder].Visible:=True
|
||||
end else
|
||||
begin
|
||||
ExpGrid.Columns[TCheckBox(Controls[i]).TabOrder].Visible:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
TcxGridToExcel(Trim(IniName),cxGrid1);
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmSelExportField.Button2Click(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.ReadINIFile(fieldname:string);
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
FName:string;
|
||||
begin
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldExportSet\' +trim(fieldname)+'.INI';
|
||||
programIni:=Tinifile.create(FName);
|
||||
ExportFields:=programIni.ReadString('导出设置','导出字段','');
|
||||
programIni.Free;
|
||||
end;
|
||||
procedure TfrmSelExportField.GetExportFields();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
ExportFields:='Begin';
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if TCheckBox(Controls[i]).Checked then
|
||||
begin
|
||||
ExportFields:=ExportFields+'/'+TCheckBox(Controls[i]).Caption;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//写设置信息到INI文件
|
||||
//参数
|
||||
//////////////////////////////////////////////////////////////////
|
||||
procedure TfrmSelExportField.WriteINIFile(fieldname:string);
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
FName:string;
|
||||
begin
|
||||
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldExportSet\'+trim(fieldname)+'.INI';
|
||||
if not DirectoryExists(ExtractFileDir(FName)) then
|
||||
CreateDir(ExtractFileDir(FName));
|
||||
programIni:=Tinifile.create(FName);
|
||||
programIni.WriteString('导出设置','导出字段',ExportFields);
|
||||
programIni.Free;
|
||||
end;
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//判断InI文件是否存在
|
||||
//////////////////////////////////////////////////////////////////
|
||||
Function TfrmSelExportField.IsINIFile(fieldname:string):Boolean;
|
||||
var
|
||||
FName:string;
|
||||
begin
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldExportSet\'+trim(fieldname)+'.INI';
|
||||
if FileExists(FName) then
|
||||
Result:=True
|
||||
else
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.CheckBox1Click(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
if CheckBox1.Checked then
|
||||
begin
|
||||
CheckBox2.Checked:=False;
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if (TCheckBox(Controls[i]).Name<>'CheckBox1') and (TCheckBox(Controls[i]).Name<>'CheckBox2') then
|
||||
begin
|
||||
TCheckBox(Controls[i]).Checked:=True;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.CheckBox2Click(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
if CheckBox2.Checked then
|
||||
begin
|
||||
CheckBox1.Checked:=False;
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if (TCheckBox(Controls[i]).Name<>'CheckBox1') and (TCheckBox(Controls[i]).Name<>'CheckBox2') then
|
||||
begin
|
||||
TCheckBox(Controls[i]).Checked:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
154
public10/ThreeFun/Form/U_SelPrintField.dfm
Normal file
154
public10/ThreeFun/Form/U_SelPrintField.dfm
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
object frmSelPrintField: TfrmSelPrintField
|
||||
Left = 329
|
||||
Top = 100
|
||||
Caption = #23383#27573#25171#21360#36873#25321
|
||||
ClientHeight = 492
|
||||
ClientWidth = 411
|
||||
Color = clBtnFace
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object Button1: TButton
|
||||
Left = 94
|
||||
Top = 456
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = #30830#23450
|
||||
TabOrder = 0
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 243
|
||||
Top = 456
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = #20851#38381
|
||||
TabOrder = 1
|
||||
OnClick = Button2Click
|
||||
end
|
||||
object PrnGrid: TDBGrid
|
||||
Left = 497
|
||||
Top = 93
|
||||
Width = 200
|
||||
Height = 120
|
||||
DataSource = PrintDataSource
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -13
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 2
|
||||
TitleFont.Charset = ANSI_CHARSET
|
||||
TitleFont.Color = clWindowText
|
||||
TitleFont.Height = -16
|
||||
TitleFont.Name = #23435#20307
|
||||
TitleFont.Style = []
|
||||
Visible = False
|
||||
end
|
||||
object ScrollBox1: TScrollBox
|
||||
Left = 2
|
||||
Top = 0
|
||||
Width = 415
|
||||
Height = 438
|
||||
Color = clSkyBlue
|
||||
ParentColor = False
|
||||
TabOrder = 3
|
||||
object Label4: TLabel
|
||||
Left = 158
|
||||
Top = 9
|
||||
Width = 60
|
||||
Height = 14
|
||||
Caption = #23383#27573#36873#25321
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -14
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
end
|
||||
object RMPrintDBGrid1: TRMPrintDBGrid
|
||||
ReportOptions = [rmgoStretch, rmgoWordWrap, rmgoGridLines]
|
||||
PageLayout.ColumnCount = 1
|
||||
PageLayout.ColumnGap = 0
|
||||
PageLayout.PageSize = 9
|
||||
PageLayout.LeftMargin = 38
|
||||
PageLayout.TopMargin = 38
|
||||
PageLayout.RightMargin = 38
|
||||
PageLayout.BottomMargin = 38
|
||||
PageLayout.Height = 2970
|
||||
PageLayout.Width = 2100
|
||||
PageLayout.PageOrientation = rmpoPortrait
|
||||
PageLayout.PageBin = 0
|
||||
PageLayout.PrinterName = #40664#35748#25171#21360#26426
|
||||
PageLayout.DoublePass = False
|
||||
PageLayout.ColorPrint = False
|
||||
PageHeaderMsg.Font.Charset = GB2312_CHARSET
|
||||
PageHeaderMsg.Font.Color = clWindowText
|
||||
PageHeaderMsg.Font.Height = -13
|
||||
PageHeaderMsg.Font.Name = #23435#20307
|
||||
PageHeaderMsg.Font.Style = []
|
||||
PageFooterMsg.Font.Charset = GB2312_CHARSET
|
||||
PageFooterMsg.Font.Color = clWindowText
|
||||
PageFooterMsg.Font.Height = -15
|
||||
PageFooterMsg.Font.Name = #23435#20307
|
||||
PageFooterMsg.Font.Style = []
|
||||
PageCaptionMsg.CaptionMsg.Font.Charset = GB2312_CHARSET
|
||||
PageCaptionMsg.CaptionMsg.Font.Color = clWindowText
|
||||
PageCaptionMsg.CaptionMsg.Font.Height = -13
|
||||
PageCaptionMsg.CaptionMsg.Font.Name = #23435#20307
|
||||
PageCaptionMsg.CaptionMsg.Font.Style = []
|
||||
PageCaptionMsg.TitleFont.Charset = GB2312_CHARSET
|
||||
PageCaptionMsg.TitleFont.Color = clWindowText
|
||||
PageCaptionMsg.TitleFont.Height = -16
|
||||
PageCaptionMsg.TitleFont.Name = #23435#20307
|
||||
PageCaptionMsg.TitleFont.Style = [fsBold]
|
||||
MasterDataBandOptions.ReprintColumnHeaderOnNewColumn = True
|
||||
GridNumOptions.Text = 'No'
|
||||
GridFontOptions.Font.Charset = ANSI_CHARSET
|
||||
GridFontOptions.Font.Color = clWindowText
|
||||
GridFontOptions.Font.Height = -15
|
||||
GridFontOptions.Font.Name = #23435#20307
|
||||
GridFontOptions.Font.Style = []
|
||||
ReportSettings.InitialZoom = pzDefault
|
||||
ReportSettings.PreviewButtons = [rmpbZoom, rmpbLoad, rmpbSave, rmpbPrint, rmpbFind, rmpbPageSetup, rmpbExit, rmpbExport, rmpbNavigator]
|
||||
DBGrid = PrnGrid
|
||||
Left = 339
|
||||
Top = 449
|
||||
end
|
||||
object PrintDataSource: TDataSource
|
||||
DataSet = ClientDataSet1
|
||||
Left = 536
|
||||
Top = 246
|
||||
end
|
||||
object RMXLSExport1: TRMXLSExport
|
||||
ShowAfterExport = True
|
||||
ExportPrecision = 1
|
||||
PagesOfSheet = 1
|
||||
ExportImages = True
|
||||
ExportFrames = True
|
||||
ExportImageFormat = ifBMP
|
||||
JPEGQuality = 0
|
||||
ScaleX = 1.000000000000000000
|
||||
ScaleY = 1.000000000000000000
|
||||
CompressFile = False
|
||||
Left = 359
|
||||
Top = 368
|
||||
end
|
||||
object ClientDataSet1: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 378
|
||||
Top = 340
|
||||
end
|
||||
end
|
||||
241
public10/ThreeFun/Form/U_SelPrintField.pas
Normal file
241
public10/ThreeFun/Form/U_SelPrintField.pas
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
unit U_SelPrintField;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, RM_FormReport, RM_PDBGrid,
|
||||
DB,IniFiles, RM_Common, RM_Class, RM_e_Xls, DBClient;
|
||||
|
||||
type
|
||||
TfrmSelPrintField = class(TForm)
|
||||
RMPrintDBGrid1: TRMPrintDBGrid;
|
||||
Button1: TButton;
|
||||
Button2: TButton;
|
||||
PrintDataSource: TDataSource;
|
||||
PrnGrid: TDBGrid;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
ScrollBox1: TScrollBox;
|
||||
Label4: TLabel;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
private
|
||||
procedure CreateCheckBox();
|
||||
procedure PrintData();
|
||||
procedure ReadINIFile(fieldname:string);
|
||||
procedure WriteINIFile(fieldname:string);
|
||||
Function IsINIFile(fieldname:string):Boolean;
|
||||
procedure GetPrintFields();
|
||||
procedure IsCheck();
|
||||
{ Private declarations }
|
||||
public
|
||||
PrintFields,IniName:string;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmSelPrintField: TfrmSelPrintField;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmSelPrintField.CreateCheckBox();
|
||||
var
|
||||
i,j,FTop,FLeft,Fdiv,FMod:Integer;// mod 余数,div商
|
||||
FCheckBox:TCheckBox;
|
||||
begin
|
||||
for i:=0 to PrnGrid.Columns.Count-1 do
|
||||
begin
|
||||
Fdiv:=(i+1) div 3;
|
||||
FMod:=(i+1) mod 3;
|
||||
FCheckBox:=TCheckBox.Create(Self);
|
||||
FCheckBox.Caption:=Trim(PrnGrid.Columns[i].Title.Caption);
|
||||
FCheckBox.TabOrder:=i;
|
||||
FCheckBox.Parent:=ScrollBox1;
|
||||
FCheckBox.Checked:=True;
|
||||
if FMod>0 then
|
||||
FCheckBox.Top:=36*(Fdiv+1)
|
||||
else
|
||||
FCheckBox.Top:=36*Fdiv;
|
||||
if FMod=1 then
|
||||
FCheckBox.Left:=29
|
||||
else if FMod=2 then
|
||||
FCheckBox.Left:=163
|
||||
else if FMod=0 then
|
||||
FCheckBox.Left:=305;
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintField.Button1Click(Sender: TObject);
|
||||
begin
|
||||
//ShowMessage('10除以3取余'+inttostr(10 mod 3)+',取整'+inttostr(10 div 3));
|
||||
PrintData();
|
||||
GetPrintFields();
|
||||
if IsINIFile(IniName)=True then
|
||||
begin
|
||||
DeleteFile(IniName);
|
||||
end;
|
||||
WriteINIFile(IniName);
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintField.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintField.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmSelPrintField:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintField.FormShow(Sender: TObject);
|
||||
begin
|
||||
CreateCheckBox();
|
||||
ReadINIFile(IniName);
|
||||
IsCheck();
|
||||
end;
|
||||
procedure TfrmSelPrintField.IsCheck();
|
||||
var
|
||||
i:Integer;
|
||||
fsj:string;
|
||||
begin
|
||||
with ScrollBox1 do
|
||||
begin
|
||||
for i:=0 to ScrollBox1.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
fsj:=Trim(TCheckBox(Controls[i]).Caption);
|
||||
if Pos(fsj,PrintFields)>0 then
|
||||
TCheckBox(Controls[i]).Checked:=True
|
||||
else
|
||||
TCheckBox(Controls[i]).Checked:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintField.PrintData();
|
||||
var
|
||||
i,j,k:Integer;
|
||||
FFieldName:string;
|
||||
begin
|
||||
j:=0;
|
||||
k:=0;
|
||||
with ScrollBox1 do
|
||||
begin
|
||||
for i:=0 to ScrollBox1.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if TCheckBox(Controls[i]).Checked=True then
|
||||
begin
|
||||
j:=1;
|
||||
PrnGrid.Columns[TCheckBox(Controls[i]).TabOrder].Visible:=True;
|
||||
k:=k+1;
|
||||
if k=1 then
|
||||
begin
|
||||
FFieldName:=PrnGrid.Columns[TCheckBox(Controls[i]).TabOrder].FieldName;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
PrnGrid.Columns[TCheckBox(Controls[i]).TabOrder].Visible:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
{ClientDataSet1.Last;
|
||||
if Trim(ClientDataSet1.FieldByName('flag').AsString)='Y' then
|
||||
begin
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName(FFieldName).Value:='合计';
|
||||
ClientDataSet1.Post;
|
||||
end;}
|
||||
|
||||
if j=1 then
|
||||
begin
|
||||
RMPrintDBGrid1.ShowReport ;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Application.MessageBox('没有可打印的信息!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
//Panel2.Visible:=False;
|
||||
//RMPrintDBGrid1.ShowReport;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintField.Button2Click(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintField.ReadINIFile(fieldname:string);
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
FName:string;
|
||||
begin
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldPrintSet\' +trim(fieldname)+'.INI';
|
||||
programIni:=Tinifile.create(FName);
|
||||
PrintFields:=programIni.ReadString('打印设置','打印字段','');
|
||||
programIni.Free;
|
||||
end;
|
||||
procedure TfrmSelPrintField.GetPrintFields();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
PrintFields:='Begin';
|
||||
with ScrollBox1 do
|
||||
begin
|
||||
for i:=0 to ScrollBox1.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if TCheckBox(Controls[i]).Checked then
|
||||
begin
|
||||
PrintFields:=PrintFields+'/'+TCheckBox(Controls[i]).Caption;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//写设置信息到INI文件
|
||||
//参数
|
||||
//////////////////////////////////////////////////////////////////
|
||||
procedure TfrmSelPrintField.WriteINIFile(fieldname:string);
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
FName:string;
|
||||
begin
|
||||
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldPrintSet\'+trim(fieldname)+'.INI';
|
||||
if not DirectoryExists(ExtractFileDir(FName)) then
|
||||
CreateDir(ExtractFileDir(FName));
|
||||
programIni:=Tinifile.create(FName);
|
||||
programIni.WriteString('打印设置','打印字段',PrintFields);
|
||||
programIni.Free;
|
||||
end;
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//判断InI文件是否存在
|
||||
//////////////////////////////////////////////////////////////////
|
||||
Function TfrmSelPrintField.IsINIFile(fieldname:string):Boolean;
|
||||
var
|
||||
FName:string;
|
||||
begin
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldPrintSet\'+trim(fieldname)+'.INI';
|
||||
if FileExists(FName) then
|
||||
Result:=True
|
||||
else
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
end.
|
||||
183
public10/ThreeFun/Form/U_SelPrintFieldNew.dfm
Normal file
183
public10/ThreeFun/Form/U_SelPrintFieldNew.dfm
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
object frmSelPrintFieldNew: TfrmSelPrintFieldNew
|
||||
Left = 219
|
||||
Top = 32
|
||||
BorderStyle = bsDialog
|
||||
Caption = #23383#27573#25171#21360#36873#25321
|
||||
ClientHeight = 493
|
||||
ClientWidth = 428
|
||||
Color = clBtnFace
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object Button1: TButton
|
||||
Left = 94
|
||||
Top = 456
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = #30830#23450
|
||||
TabOrder = 0
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 243
|
||||
Top = 456
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = #20851#38381
|
||||
TabOrder = 1
|
||||
OnClick = Button2Click
|
||||
end
|
||||
object PrnGrid: TDBGrid
|
||||
Left = 17
|
||||
Top = 165
|
||||
Width = 320
|
||||
Height = 120
|
||||
DataSource = PrintDataSource
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 2
|
||||
TitleFont.Charset = GB2312_CHARSET
|
||||
TitleFont.Color = clWindowText
|
||||
TitleFont.Height = -12
|
||||
TitleFont.Name = #23435#20307
|
||||
TitleFont.Style = []
|
||||
Visible = False
|
||||
end
|
||||
object Panel2: TScrollBox
|
||||
Left = 2
|
||||
Top = 0
|
||||
Width = 423
|
||||
Height = 438
|
||||
HorzScrollBar.Visible = False
|
||||
BevelInner = bvSpace
|
||||
BevelKind = bkTile
|
||||
BorderStyle = bsNone
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
TabOrder = 3
|
||||
object Label4: TLabel
|
||||
Left = 166
|
||||
Top = 9
|
||||
Width = 60
|
||||
Height = 14
|
||||
Caption = #23383#27573#36873#25321
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -14
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
end
|
||||
object CheckBox1: TCheckBox
|
||||
Left = 21
|
||||
Top = 450
|
||||
Width = 49
|
||||
Height = 17
|
||||
Caption = #20840#36873
|
||||
TabOrder = 4
|
||||
OnClick = CheckBox1Click
|
||||
end
|
||||
object CheckBox2: TCheckBox
|
||||
Left = 21
|
||||
Top = 466
|
||||
Width = 49
|
||||
Height = 17
|
||||
Caption = #20840#24323
|
||||
TabOrder = 5
|
||||
OnClick = CheckBox2Click
|
||||
end
|
||||
object RMPrintDBGrid1: TRMPrintDBGrid
|
||||
ReportOptions = [rmgoStretch, rmgoWordWrap, rmgoGridLines]
|
||||
PageLayout.ColumnCount = 1
|
||||
PageLayout.ColumnGap = 0
|
||||
PageLayout.PageSize = 9
|
||||
PageLayout.LeftMargin = 38
|
||||
PageLayout.TopMargin = 38
|
||||
PageLayout.RightMargin = 38
|
||||
PageLayout.BottomMargin = 38
|
||||
PageLayout.Height = 2970
|
||||
PageLayout.Width = 2100
|
||||
PageLayout.PageOrientation = rmpoPortrait
|
||||
PageLayout.PageBin = 0
|
||||
PageLayout.PrinterName = #40664#35748#25171#21360#26426
|
||||
PageLayout.DoublePass = False
|
||||
PageLayout.ColorPrint = False
|
||||
PageHeaderMsg.Font.Charset = GB2312_CHARSET
|
||||
PageHeaderMsg.Font.Color = clWindowText
|
||||
PageHeaderMsg.Font.Height = -13
|
||||
PageHeaderMsg.Font.Name = #23435#20307
|
||||
PageHeaderMsg.Font.Style = []
|
||||
PageFooterMsg.Font.Charset = GB2312_CHARSET
|
||||
PageFooterMsg.Font.Color = clWindowText
|
||||
PageFooterMsg.Font.Height = -15
|
||||
PageFooterMsg.Font.Name = #23435#20307
|
||||
PageFooterMsg.Font.Style = []
|
||||
PageCaptionMsg.CaptionMsg.Font.Charset = GB2312_CHARSET
|
||||
PageCaptionMsg.CaptionMsg.Font.Color = clWindowText
|
||||
PageCaptionMsg.CaptionMsg.Font.Height = -12
|
||||
PageCaptionMsg.CaptionMsg.Font.Name = #23435#20307
|
||||
PageCaptionMsg.CaptionMsg.Font.Style = []
|
||||
PageCaptionMsg.TitleFont.Charset = GB2312_CHARSET
|
||||
PageCaptionMsg.TitleFont.Color = clWindowText
|
||||
PageCaptionMsg.TitleFont.Height = -16
|
||||
PageCaptionMsg.TitleFont.Name = #23435#20307
|
||||
PageCaptionMsg.TitleFont.Style = [fsBold]
|
||||
MasterDataBandOptions.ReprintColumnHeaderOnNewColumn = True
|
||||
GridNumOptions.Text = 'No'
|
||||
GridFontOptions.Font.Charset = ANSI_CHARSET
|
||||
GridFontOptions.Font.Color = clWindowText
|
||||
GridFontOptions.Font.Height = -15
|
||||
GridFontOptions.Font.Name = #23435#20307
|
||||
GridFontOptions.Font.Style = []
|
||||
ReportSettings.InitialZoom = pzDefault
|
||||
ReportSettings.PreviewButtons = [rmpbZoom, rmpbLoad, rmpbSave, rmpbPrint, rmpbFind, rmpbPageSetup, rmpbExit, rmpbExport, rmpbNavigator]
|
||||
DBGrid = PrnGrid
|
||||
Left = 339
|
||||
Top = 449
|
||||
end
|
||||
object PrintDataSource: TDataSource
|
||||
DataSet = ClientDataSet1
|
||||
Left = 536
|
||||
Top = 246
|
||||
end
|
||||
object RMXLSExport1: TRMXLSExport
|
||||
ShowAfterExport = True
|
||||
ExportPrecision = 1
|
||||
PagesOfSheet = 1
|
||||
ExportImages = True
|
||||
ExportFrames = True
|
||||
ExportImageFormat = ifBMP
|
||||
JPEGQuality = 0
|
||||
ScaleX = 1.000000000000000000
|
||||
ScaleY = 1.000000000000000000
|
||||
CompressFile = False
|
||||
Left = 359
|
||||
Top = 368
|
||||
end
|
||||
object ClientDataSet1: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 378
|
||||
Top = 340
|
||||
end
|
||||
end
|
||||
292
public10/ThreeFun/Form/U_SelPrintFieldNew.pas
Normal file
292
public10/ThreeFun/Form/U_SelPrintFieldNew.pas
Normal file
|
|
@ -0,0 +1,292 @@
|
|||
unit U_SelPrintFieldNew;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, RM_FormReport, RM_PDBGrid,
|
||||
DB,IniFiles, RM_Common, RM_Class, RM_e_Xls, DBClient;
|
||||
|
||||
type
|
||||
TfrmSelPrintFieldNew = class(TForm)
|
||||
RMPrintDBGrid1: TRMPrintDBGrid;
|
||||
Button1: TButton;
|
||||
Button2: TButton;
|
||||
PrintDataSource: TDataSource;
|
||||
PrnGrid: TDBGrid;
|
||||
RMXLSExport1: TRMXLSExport;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
Panel2: TScrollBox;
|
||||
Label4: TLabel;
|
||||
CheckBox1: TCheckBox;
|
||||
CheckBox2: TCheckBox;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure CheckBox1Click(Sender: TObject);
|
||||
procedure CheckBox2Click(Sender: TObject);
|
||||
private
|
||||
procedure CreateCheckBox();
|
||||
procedure PrintData();
|
||||
procedure ReadINIFile(fieldname:string);
|
||||
procedure WriteINIFile(fieldname:string);
|
||||
Function IsINIFile(fieldname:string):Boolean;
|
||||
procedure GetPrintFields();
|
||||
procedure IsCheck();
|
||||
{ Private declarations }
|
||||
public
|
||||
PrintFields,IniName:string;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
var
|
||||
frmSelPrintFieldNew: TfrmSelPrintFieldNew;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmSelPrintFieldNew.CreateCheckBox();
|
||||
var
|
||||
i,j,FTop,FLeft,Fdiv,FMod:Integer;// mod 余数,div商
|
||||
FCheckBox:TCheckBox;
|
||||
begin
|
||||
for i:=0 to PrnGrid.Columns.Count-1 do
|
||||
begin
|
||||
Fdiv:=(i+1) div 3;
|
||||
FMod:=(i+1) mod 3;
|
||||
FCheckBox:=TCheckBox.Create(Self);
|
||||
FCheckBox.Caption:=Trim(PrnGrid.Columns[i].Title.Caption);
|
||||
FCheckBox.TabOrder:=i;
|
||||
FCheckBox.Parent:=Panel2;
|
||||
FCheckBox.Checked:=True;
|
||||
if FMod>0 then
|
||||
FCheckBox.Top:=36*(Fdiv+1)
|
||||
else
|
||||
FCheckBox.Top:=36*Fdiv;
|
||||
if FMod=1 then
|
||||
FCheckBox.Left:=29
|
||||
else if FMod=2 then
|
||||
FCheckBox.Left:=163
|
||||
else if FMod=0 then
|
||||
FCheckBox.Left:=305;
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintFieldNew.Button1Click(Sender: TObject);
|
||||
begin
|
||||
//ShowMessage('10除以3取余'+inttostr(10 mod 3)+',取整'+inttostr(10 div 3));
|
||||
PrintData();
|
||||
GetPrintFields();
|
||||
if IsINIFile(IniName)=True then
|
||||
begin
|
||||
DeleteFile(IniName);
|
||||
end;
|
||||
WriteINIFile(IniName);
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintFieldNew.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintFieldNew.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmSelPrintFieldNew:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintFieldNew.FormShow(Sender: TObject);
|
||||
begin
|
||||
CreateCheckBox();
|
||||
ReadINIFile(IniName);
|
||||
IsCheck();
|
||||
end;
|
||||
procedure TfrmSelPrintFieldNew.IsCheck();
|
||||
var
|
||||
i:Integer;
|
||||
fsj:string;
|
||||
begin
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
fsj:=Trim(TCheckBox(Controls[i]).Caption);
|
||||
if Pos(fsj,PrintFields)>0 then
|
||||
TCheckBox(Controls[i]).Checked:=True
|
||||
else
|
||||
TCheckBox(Controls[i]).Checked:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintFieldNew.PrintData();
|
||||
var
|
||||
i,j,k:Integer;
|
||||
FFieldName:string;
|
||||
begin
|
||||
j:=0;
|
||||
k:=0;
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if TCheckBox(Controls[i]).Checked=True then
|
||||
begin
|
||||
j:=1;
|
||||
PrnGrid.Columns[TCheckBox(Controls[i]).TabOrder].Visible:=True;
|
||||
k:=k+1;
|
||||
if k=1 then
|
||||
begin
|
||||
FFieldName:=PrnGrid.Columns[TCheckBox(Controls[i]).TabOrder].FieldName;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
PrnGrid.Columns[TCheckBox(Controls[i]).TabOrder].Visible:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
{ClientDataSet1.Last;
|
||||
if Trim(ClientDataSet1.FieldByName('flag').AsString)='Y' then
|
||||
begin
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName(FFieldName).Value:='合计';
|
||||
ClientDataSet1.Post;
|
||||
end;}
|
||||
|
||||
if j=1 then
|
||||
begin
|
||||
RMPrintDBGrid1.ShowReport ;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Application.MessageBox('没有可打印的信息!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
//Panel2.Visible:=False;
|
||||
//RMPrintDBGrid1.ShowReport;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintFieldNew.Button2Click(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintFieldNew.ReadINIFile(fieldname:string);
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
FName:string;
|
||||
begin
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldPrintSet\' +trim(fieldname)+'.INI';
|
||||
programIni:=Tinifile.create(FName);
|
||||
PrintFields:=programIni.ReadString('打印设置','打印字段','');
|
||||
programIni.Free;
|
||||
end;
|
||||
procedure TfrmSelPrintFieldNew.GetPrintFields();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
PrintFields:='Begin';
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if TCheckBox(Controls[i]).Checked then
|
||||
begin
|
||||
PrintFields:=PrintFields+'/'+TCheckBox(Controls[i]).Caption;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//写设置信息到INI文件
|
||||
//参数
|
||||
//////////////////////////////////////////////////////////////////
|
||||
procedure TfrmSelPrintFieldNew.WriteINIFile(fieldname:string);
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
FName:string;
|
||||
begin
|
||||
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldPrintSet\'+trim(fieldname)+'.INI';
|
||||
if not DirectoryExists(ExtractFileDir(FName)) then
|
||||
CreateDir(ExtractFileDir(FName));
|
||||
programIni:=Tinifile.create(FName);
|
||||
programIni.WriteString('打印设置','打印字段',PrintFields);
|
||||
programIni.Free;
|
||||
end;
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//判断InI文件是否存在
|
||||
//////////////////////////////////////////////////////////////////
|
||||
Function TfrmSelPrintFieldNew.IsINIFile(fieldname:string):Boolean;
|
||||
var
|
||||
FName:string;
|
||||
begin
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldPrintSet\'+trim(fieldname)+'.INI';
|
||||
if FileExists(FName) then
|
||||
Result:=True
|
||||
else
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintFieldNew.CheckBox1Click(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
if CheckBox1.Checked then
|
||||
begin
|
||||
CheckBox2.Checked:=False;
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if (TCheckBox(Controls[i]).Name<>'CheckBox1') and (TCheckBox(Controls[i]).Name<>'CheckBox2') then
|
||||
begin
|
||||
TCheckBox(Controls[i]).Checked:=True;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmSelPrintFieldNew.CheckBox2Click(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
if CheckBox2.Checked then
|
||||
begin
|
||||
CheckBox1.Checked:=False;
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if (TCheckBox(Controls[i]).Name<>'CheckBox1') and (TCheckBox(Controls[i]).Name<>'CheckBox2') then
|
||||
begin
|
||||
TCheckBox(Controls[i]).Checked:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
14484
public10/ThreeFun/Form/U_SysLogHelp.dfm
Normal file
14484
public10/ThreeFun/Form/U_SysLogHelp.dfm
Normal file
File diff suppressed because it is too large
Load Diff
204
public10/ThreeFun/Form/U_SysLogHelp.pas
Normal file
204
public10/ThreeFun/Form/U_SysLogHelp.pas
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
unit U_SysLogHelp;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, cxStyles, cxCustomData, cxGraphics, cxFilter,
|
||||
cxData, cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, strUtils,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGrid, ADODB, StdCtrls, ExtCtrls, ImgList,
|
||||
cxLookAndFeels, cxLookAndFeelPainters,
|
||||
cxNavigator, dxDateRanges, System.ImageList, dxScrollbarAnnotations;
|
||||
|
||||
type
|
||||
TfrmSysLogHelp = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TQry: TToolButton;
|
||||
Tclose: TToolButton;
|
||||
ADOQueryLog: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOConnection1: TADOConnection;
|
||||
cxGrid1: TcxGrid;
|
||||
tv1: TcxGridDBTableView;
|
||||
tv1OperMan: TcxGridDBColumn;
|
||||
tv1jopertime: TcxGridDBColumn;
|
||||
tv1Model: TcxGridDBColumn;
|
||||
tv1acction: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
tv1Opevent: TcxGridDBColumn;
|
||||
tv1Result: TcxGridDBColumn;
|
||||
Panel1: TPanel;
|
||||
Label2: TLabel;
|
||||
begDate: TDateTimePicker;
|
||||
endDate: TDateTimePicker;
|
||||
Label3: TLabel;
|
||||
edt_model: TEdit;
|
||||
CheckBox1: TCheckBox;
|
||||
Label4: TLabel;
|
||||
Opevent: TEdit;
|
||||
ThreeImgList: TImageList;
|
||||
ImageList_new32: TImageList;
|
||||
ThreeColorBase: TcxStyleRepository;
|
||||
SHuangSe: TcxStyle;
|
||||
SkyBlue: TcxStyle;
|
||||
Default: TcxStyle;
|
||||
QHuangSe: TcxStyle;
|
||||
Red: TcxStyle;
|
||||
FontBlue: TcxStyle;
|
||||
TextSHuangSe: TcxStyle;
|
||||
FonePurple: TcxStyle;
|
||||
FoneClMaroon: TcxStyle;
|
||||
FoneRed: TcxStyle;
|
||||
RowColor: TcxStyle;
|
||||
handBlack: TcxStyle;
|
||||
cxBlue: TcxStyle;
|
||||
SHuangSeCu: TcxStyle;
|
||||
procedure TcloseClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TQryClick(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure OpeventKeyPress(Sender: TObject; var Key: Char);
|
||||
private
|
||||
procedure DoQuery();
|
||||
procedure DoFilter();
|
||||
public
|
||||
fModel, facction: string;
|
||||
fOtherWhere: string;
|
||||
end;
|
||||
|
||||
var
|
||||
frmSysLogHelp: TfrmSysLogHelp;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_RTFun;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmSysLogHelp.TcloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmSysLogHelp.FormCreate(Sender: TObject);
|
||||
begin
|
||||
cxGrid1.Align := alClient;
|
||||
begDate.DateTime := date - 31;
|
||||
endDate.DateTime := date;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected := false;
|
||||
ConnectionString := DConString;
|
||||
Connected := true;
|
||||
end;
|
||||
end;
|
||||
/////////////////////////////////////////////////////////
|
||||
//
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
procedure TfrmSysLogHelp.DoQuery();
|
||||
var
|
||||
mbegdate, menddate: string;
|
||||
begin
|
||||
mbegdate := formatDatetime('yyyy-MM-dd', begDate.Date);
|
||||
menddate := formatDatetime('yyyy-MM-dd', endDate.Date + 1);
|
||||
try
|
||||
with ADOQueryLog do
|
||||
begin
|
||||
close;
|
||||
sql.clear;
|
||||
filtered := false;
|
||||
sql.add('select A.* ');
|
||||
sql.add('from SY_sysLog A');
|
||||
if CheckBox1.Checked then
|
||||
begin
|
||||
sql.Add('where OperTime>=' + quotedStr(mbegdate));
|
||||
sql.Add('and OperTime<' + quotedStr(menddate));
|
||||
end
|
||||
else
|
||||
begin
|
||||
sql.Add('where 1=1');
|
||||
end;
|
||||
|
||||
if trim(Opevent.Text) <> '' then
|
||||
sql.add('and Opevent LIKE ' + quotedStr('%' + Opevent.Text + '%'));
|
||||
|
||||
if trim(fModel) <> '' then
|
||||
sql.add('and Model=' + quotedStr(fModel));
|
||||
if trim(facction) <> '' then
|
||||
sql.add('and acction=' + quotedStr(facction));
|
||||
if trim(fOtherWhere) <> '' then
|
||||
begin
|
||||
sql.add(fOtherWhere);
|
||||
end;
|
||||
sql.Add('order by operOr,Opertime');
|
||||
Open;
|
||||
end;
|
||||
finally
|
||||
end;
|
||||
end;
|
||||
///////////////////////////////////////////////////////////
|
||||
//
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
procedure TfrmSysLogHelp.DoFilter();
|
||||
var
|
||||
filterStr: string;
|
||||
begin
|
||||
filterStr := '';
|
||||
if trim(edt_model.text) <> '' then
|
||||
begin
|
||||
filterStr := ' and model =' + quotedStr(trim(edt_model.text));
|
||||
end;
|
||||
if trim(Opevent.text) <> '' then
|
||||
begin
|
||||
filterStr := ' and OpEvent like ' + quotedStr('%' + trim(Opevent.text) + '%');
|
||||
end;
|
||||
|
||||
try
|
||||
ADOQueryLog.DisableControls;
|
||||
if trim(filterStr) = '' then
|
||||
begin
|
||||
ADOQueryLog.Filtered := false;
|
||||
exit;
|
||||
end;
|
||||
filterStr := trim(RightBStr(filterStr, length(filterStr) - 3));
|
||||
with ADOQueryLog do
|
||||
begin
|
||||
filtered := false;
|
||||
filter := filterStr;
|
||||
filtered := true;
|
||||
end;
|
||||
finally
|
||||
ADOQueryLog.EnableControls;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmSysLogHelp.FormShow(Sender: TObject);
|
||||
begin
|
||||
DoQuery();
|
||||
end;
|
||||
|
||||
procedure TfrmSysLogHelp.OpeventKeyPress(Sender: TObject; var Key: Char);
|
||||
begin
|
||||
if Key = #13 then
|
||||
begin
|
||||
DoQuery();
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSysLogHelp.TQryClick(Sender: TObject);
|
||||
begin
|
||||
DoQuery();
|
||||
end;
|
||||
|
||||
procedure TfrmSysLogHelp.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action := cafree;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
16394
public10/ThreeFun/Form/U_UserHelp.dfm
Normal file
16394
public10/ThreeFun/Form/U_UserHelp.dfm
Normal file
File diff suppressed because it is too large
Load Diff
216
public10/ThreeFun/Form/U_UserHelp.pas
Normal file
216
public10/ThreeFun/Form/U_UserHelp.pas
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
unit U_UserHelp;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, cxFilter,
|
||||
cxData, cxDataStorage, cxEdit, DB, cxDBData, StdCtrls, cxGridLevel,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGrid, cxInplaceContainer, cxDBTL,
|
||||
cxTLData, ComCtrls, ToolWin, ADODB, ImgList,StrUtils, ExtCtrls,
|
||||
cxLookAndFeels, cxLookAndFeelPainters, cxTLdxBarBuiltInMenu, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, cxNavigator, dxDateRanges, System.ImageList;
|
||||
|
||||
type
|
||||
TfrmUserHelp = class(TForm)
|
||||
ToolBar2: TToolBar;
|
||||
TOk: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
cxGrid1: TcxGrid;
|
||||
tv1: TcxGridDBTableView;
|
||||
tv1Code: TcxGridDBColumn;
|
||||
tv1Name: TcxGridDBColumn;
|
||||
DBGrid1Level1: TcxGridLevel;
|
||||
GroupBox1: TGroupBox;
|
||||
ADOQueryDept: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOConnection1: TADOConnection;
|
||||
tv1Column1: TcxGridDBColumn;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
cxStyle2: TcxStyle;
|
||||
cxStyle_gridRow: TcxStyle;
|
||||
cxStyle_gridFoot: TcxStyle;
|
||||
cxStyle_gridHead: TcxStyle;
|
||||
cxStyle_gridGroupBox: TcxStyle;
|
||||
cxStyle_yellow: TcxStyle;
|
||||
cxStyle_Red: TcxStyle;
|
||||
ADOQueryHelp: TADOQuery;
|
||||
DataSource2: TDataSource;
|
||||
Label1: TLabel;
|
||||
Edt_name: TEdit;
|
||||
ImageList1: TImageList;
|
||||
cxStyleTree: TcxStyle;
|
||||
Label2: TLabel;
|
||||
Edt_Code: TEdit;
|
||||
Splitter1: TSplitter;
|
||||
ThreeImgList: TImageList;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TOkClick(Sender: TObject);
|
||||
procedure tv1DblClick(Sender: TObject);
|
||||
procedure Edt_nameChange(Sender: TObject);
|
||||
procedure cxDBTreeList1Click(Sender: TObject);
|
||||
private
|
||||
procedure InitTree();
|
||||
procedure DoQuery();
|
||||
procedure FilterData(strdepotno,strcode,strname:string);
|
||||
public
|
||||
fFrameNo:string;
|
||||
fFrameName:string;
|
||||
fIsYwy:boolean;
|
||||
end;
|
||||
|
||||
var
|
||||
frmUserHelp: TfrmUserHelp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink;
|
||||
{$R *.dfm}
|
||||
///////////////////////////////////////////////////////////
|
||||
//////功能:过滤数据
|
||||
///////////////////////////////////////////////////////////
|
||||
procedure TfrmUserHelp.FilterData(strdepotno,strcode,strname:string);
|
||||
var
|
||||
filterStr:string;
|
||||
begin
|
||||
filterStr:='';
|
||||
if trim(strdepotno)<>'' then
|
||||
filterStr:=filterStr+' and dept like '+quotedstr('%'+trim(strdepotno)+'%');
|
||||
if trim(strcode)<>'' then
|
||||
filterStr:=filterStr+' and userID like '+quotedstr('%'+trim(strcode)+'%');
|
||||
if trim(strname)<>'' then
|
||||
filterStr:=filterStr+' and userName like '+quotedstr('%'+trim(strname)+'%');
|
||||
|
||||
try
|
||||
ADOQueryHelp.DisableControls ;
|
||||
if trim(filterStr)='' then
|
||||
begin
|
||||
ADOQueryHelp.Filtered:=false;
|
||||
ADOQueryHelp.EnableControls;
|
||||
exit;
|
||||
end;
|
||||
filterStr:=trim(RightBStr(filterStr,length(filterStr)-5));
|
||||
// showmessage(filterStr);
|
||||
with ADOQueryHelp do
|
||||
begin
|
||||
filtered:=false;
|
||||
filter:=filterStr;
|
||||
filtered:=true;
|
||||
end;
|
||||
finally
|
||||
ADOQueryHelp.EnableControls;
|
||||
end;
|
||||
end;
|
||||
//////////////////////////////////////////////////////
|
||||
procedure TfrmUserHelp.InitTree();
|
||||
var
|
||||
strsql,strwhere:string;
|
||||
begin
|
||||
strsql:=' SELECT distinct UDept=''ALL'',UDeptTop='''',UDeptName=''所有部门'',Framelevel=0 '+
|
||||
' union '+
|
||||
' SELECT distinct UDept,UDeptTop=''ALL'',UDept,Framelevel=1 '+
|
||||
' FROM BD_staff A '+
|
||||
' WHERE USERID<>''ADMIN'' and ISNULL(UDept,'''')<>'''' ';
|
||||
|
||||
strwhere:=' where A.Valid=''Y'' ';
|
||||
{ if fIsYwy then
|
||||
strwhere:=strwhere+' and A.YWYFlag=''Y'' ';
|
||||
if trim(fFrameNo)<>'' then
|
||||
strwhere:=strwhere+' and A.dept='+quotedstr(trim(fFrameNo));
|
||||
if trim(fFrameName)<>'' then
|
||||
strwhere:=strwhere+' and B.frameName like '+quotedstr('%'+trim(fFrameName)+'%');
|
||||
strsql:=strsql+ strwhere; }
|
||||
|
||||
with ADOQueryDept do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add( strsql);
|
||||
Open;
|
||||
end;
|
||||
cxDBTreeList1.FullExpand;
|
||||
|
||||
DoQuery();
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp.FormCreate(Sender: TObject);
|
||||
begin
|
||||
cxGrid1.Align :=alclient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
Connected:=true;
|
||||
end;
|
||||
end;
|
||||
//////////////////////////////////////////////////
|
||||
//
|
||||
//////////////////////////////////////////////////
|
||||
procedure TfrmUserHelp.DoQuery();
|
||||
var
|
||||
strsql,strwhere:string;
|
||||
begin
|
||||
strsql:=' select * '+
|
||||
' from BD_staff A '+
|
||||
' where isnull(UserID,'''')<>''ADMIN'' ';
|
||||
strwhere:=' and A.Valid=''Y'' ';
|
||||
if fIsYwy then
|
||||
strwhere:=strwhere+' and A.Isywy=1 ';
|
||||
|
||||
strsql:=strsql+ strwhere +' order by A.userID ';
|
||||
|
||||
with ADOQueryHelp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add( strsql);
|
||||
Open;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp.TOkClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryHelp.IsEmpty then
|
||||
begin
|
||||
ModalResult:=-1
|
||||
end
|
||||
else
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp.tv1DblClick(Sender: TObject);
|
||||
begin
|
||||
Tok.Click ;
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp.Edt_nameChange(Sender: TObject);
|
||||
begin
|
||||
FilterData('',edt_code.Text,Edt_name.Text);
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp.cxDBTreeList1Click(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryDept.IsEmpty then exit;
|
||||
if trim(ADOQueryDept.FieldByName('Framelevel').AsString)='0' then
|
||||
FilterData('','','')
|
||||
else
|
||||
FilterData(ADOQueryDept.FieldByName('UDept').AsString,'','');
|
||||
end;
|
||||
|
||||
end.
|
||||
23877
public10/ThreeFun/Form/U_UserHelp_Dx.dfm
Normal file
23877
public10/ThreeFun/Form/U_UserHelp_Dx.dfm
Normal file
File diff suppressed because it is too large
Load Diff
245
public10/ThreeFun/Form/U_UserHelp_Dx.pas
Normal file
245
public10/ThreeFun/Form/U_UserHelp_Dx.pas
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
unit U_UserHelp_Dx;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, cxFilter,
|
||||
cxData, cxDataStorage, cxEdit, DB, cxDBData, StdCtrls, cxGridLevel,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxClasses,
|
||||
cxControls, cxGridCustomView, cxGrid, cxInplaceContainer, cxDBTL,
|
||||
cxTLData, ComCtrls, ToolWin, ADODB, ImgList,StrUtils, ExtCtrls, DBClient;
|
||||
|
||||
type
|
||||
TfrmUserHelp_Dx = class(TForm)
|
||||
ToolBar2: TToolBar;
|
||||
TOk: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
cxGrid1: TcxGrid;
|
||||
tv1: TcxGridDBTableView;
|
||||
tv1Code: TcxGridDBColumn;
|
||||
tv1Name: TcxGridDBColumn;
|
||||
DBGrid1Level1: TcxGridLevel;
|
||||
GroupBox1: TGroupBox;
|
||||
ADOQueryDept: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ADOConnection1: TADOConnection;
|
||||
tv1Column1: TcxGridDBColumn;
|
||||
cxStyleRepository1: TcxStyleRepository;
|
||||
cxStyle1: TcxStyle;
|
||||
cxStyle2: TcxStyle;
|
||||
cxStyle_gridRow: TcxStyle;
|
||||
cxStyle_gridFoot: TcxStyle;
|
||||
cxStyle_gridHead: TcxStyle;
|
||||
cxStyle_gridGroupBox: TcxStyle;
|
||||
cxStyle_yellow: TcxStyle;
|
||||
cxStyle_Red: TcxStyle;
|
||||
ADOQueryHelp: TADOQuery;
|
||||
DataSource2: TDataSource;
|
||||
Label1: TLabel;
|
||||
Edt_name: TEdit;
|
||||
ImageList1: TImageList;
|
||||
cxStyleTree: TcxStyle;
|
||||
Label2: TLabel;
|
||||
Edt_Code: TEdit;
|
||||
ThreeImgList: TImageList;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridDBColumn1: TcxGridDBColumn;
|
||||
cxGridDBColumn2: TcxGridDBColumn;
|
||||
cxGridDBColumn3: TcxGridDBColumn;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
GroupBox2: TGroupBox;
|
||||
CDS_sel: TClientDataSet;
|
||||
DataSourceSel: TDataSource;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
Splitter1: TSplitter;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TOkClick(Sender: TObject);
|
||||
procedure tv1DblClick(Sender: TObject);
|
||||
procedure Edt_nameChange(Sender: TObject);
|
||||
procedure cxDBTreeList1Click(Sender: TObject);
|
||||
procedure Tv2DblClick(Sender: TObject);
|
||||
private
|
||||
procedure InitTree();
|
||||
procedure DoQuery();
|
||||
procedure FilterData(strdepotno,strcode,strname:string);
|
||||
public
|
||||
fFrameNo:string;
|
||||
fFrameName:string;
|
||||
fIsYwy:boolean;
|
||||
end;
|
||||
|
||||
var
|
||||
frmUserHelp_Dx: TfrmUserHelp_Dx;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun10;
|
||||
{$R *.dfm}
|
||||
///////////////////////////////////////////////////////////
|
||||
//////功能:过滤数据
|
||||
///////////////////////////////////////////////////////////
|
||||
procedure TfrmUserHelp_Dx.FilterData(strdepotno,strcode,strname:string);
|
||||
var
|
||||
filterStr:string;
|
||||
begin
|
||||
filterStr:='';
|
||||
if trim(strdepotno)<>'' then
|
||||
filterStr:=filterStr+' and dept like '+quotedstr('%'+trim(strdepotno)+'%');
|
||||
if trim(strcode)<>'' then
|
||||
filterStr:=filterStr+' and userID like '+quotedstr('%'+trim(strcode)+'%');
|
||||
if trim(strname)<>'' then
|
||||
filterStr:=filterStr+' and userName like '+quotedstr('%'+trim(strname)+'%');
|
||||
|
||||
try
|
||||
ADOQueryHelp.DisableControls ;
|
||||
if trim(filterStr)='' then
|
||||
begin
|
||||
ADOQueryHelp.Filtered:=false;
|
||||
ADOQueryHelp.EnableControls;
|
||||
exit;
|
||||
end;
|
||||
filterStr:=trim(RightBStr(filterStr,length(filterStr)-5));
|
||||
// showmessage(filterStr);
|
||||
with ADOQueryHelp do
|
||||
begin
|
||||
filtered:=false;
|
||||
filter:=filterStr;
|
||||
filtered:=true;
|
||||
end;
|
||||
finally
|
||||
ADOQueryHelp.EnableControls;
|
||||
end;
|
||||
end;
|
||||
//////////////////////////////////////////////////////
|
||||
procedure TfrmUserHelp_Dx.InitTree();
|
||||
var
|
||||
strsql,strwhere:string;
|
||||
begin
|
||||
strsql:=' SELECT distinct UDept=''ALL'',UDeptTop='''',UDeptName=''所有部门'',Framelevel=0 '+
|
||||
' union '+
|
||||
' SELECT distinct UDept,UDeptTop=''ALL'',UDept,Framelevel=1 '+
|
||||
' FROM BD_staff A '+
|
||||
' WHERE USERID<>''ADMIN'' and ISNULL(UDept,'''')<>'''' ';
|
||||
|
||||
strwhere:=' where A.Valid=''Y'' ';
|
||||
{ if fIsYwy then
|
||||
strwhere:=strwhere+' and A.YWYFlag=''Y'' ';
|
||||
if trim(fFrameNo)<>'' then
|
||||
strwhere:=strwhere+' and A.dept='+quotedstr(trim(fFrameNo));
|
||||
if trim(fFrameName)<>'' then
|
||||
strwhere:=strwhere+' and B.frameName like '+quotedstr('%'+trim(fFrameName)+'%');
|
||||
strsql:=strsql+ strwhere; }
|
||||
|
||||
with ADOQueryDept do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add( strsql);
|
||||
Open;
|
||||
end;
|
||||
cxDBTreeList1.FullExpand;
|
||||
|
||||
DoQuery();
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp_Dx.FormShow(Sender: TObject);
|
||||
begin
|
||||
InitTree();
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp_Dx.FormCreate(Sender: TObject);
|
||||
begin
|
||||
GroupBox2.Align :=alclient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
Connected:=true;
|
||||
end;
|
||||
end;
|
||||
//////////////////////////////////////////////////
|
||||
//
|
||||
//////////////////////////////////////////////////
|
||||
procedure TfrmUserHelp_Dx.DoQuery();
|
||||
var
|
||||
strsql,strwhere:string;
|
||||
begin
|
||||
strsql:=' select * '+
|
||||
' from BD_staff A '+
|
||||
' where isnull(UserID,'''')<>''ADMIN'' ';
|
||||
strwhere:=' and A.Valid=''Y'' ';
|
||||
if fIsYwy then
|
||||
strwhere:=strwhere+' and A.Isywy=1 ';
|
||||
|
||||
strsql:=strsql+ strwhere +' order by A.userID ';
|
||||
|
||||
with ADOQueryHelp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear ;
|
||||
sql.Add( strsql);
|
||||
Open;
|
||||
end;
|
||||
|
||||
sCreateCDS20(ADOQueryHelp,cds_sel);
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp_Dx.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp_Dx.TOkClick(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryHelp.IsEmpty then
|
||||
begin
|
||||
ModalResult:=-1
|
||||
end
|
||||
else
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp_Dx.tv1DblClick(Sender: TObject);
|
||||
var
|
||||
i:integer;
|
||||
begin
|
||||
if ADOQueryHelp.IsEmpty then exit;
|
||||
|
||||
if CDS_Sel.Locate('userID',trim(adoqueryHelp.fieldbyname('userID').AsString),[]) then exit;
|
||||
with CDS_Sel do
|
||||
begin
|
||||
CDS_Sel.append;
|
||||
for i:=0 to ADOQueryHelp.FieldCount-1 do
|
||||
begin
|
||||
fields[i].Value:=ADOQueryHelp.Fields[i].Value;
|
||||
end;
|
||||
CDS_Sel.Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp_Dx.Edt_nameChange(Sender: TObject);
|
||||
begin
|
||||
FilterData('',edt_code.Text,Edt_name.Text);
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp_Dx.cxDBTreeList1Click(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryDept.IsEmpty then exit;
|
||||
if trim(ADOQueryDept.FieldByName('Framelevel').AsString)='0' then
|
||||
FilterData('','','')
|
||||
else
|
||||
FilterData(ADOQueryDept.FieldByName('UDept').AsString,'','');
|
||||
end;
|
||||
|
||||
procedure TfrmUserHelp_Dx.Tv2DblClick(Sender: TObject);
|
||||
begin
|
||||
IF cds_sel.IsEmpty then exit;
|
||||
cds_sel.Delete;
|
||||
end;
|
||||
|
||||
end.
|
||||
63
public10/ThreeFun/Form/U_YPTypeHelp.dfm
Normal file
63
public10/ThreeFun/Form/U_YPTypeHelp.dfm
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
object frmYPTypeHelp: TfrmYPTypeHelp
|
||||
Left = 320
|
||||
Top = 178
|
||||
Width = 371
|
||||
Height = 524
|
||||
Caption = #26679#21697#31867#21035#36873#25321#21015#34920
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object cxDBTreeList1: TcxDBTreeList
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 249
|
||||
Height = 486
|
||||
Align = alLeft
|
||||
Bands = <
|
||||
item
|
||||
end>
|
||||
BufferedPaint = False
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.ParentField = 'CPParent'
|
||||
DataController.KeyField = 'CPID'
|
||||
OptionsBehavior.ExpandOnDblClick = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.CellAutoHeight = True
|
||||
OptionsView.Headers = False
|
||||
RootValue = -1
|
||||
TabOrder = 0
|
||||
OnDblClick = cxDBTreeList1DblClick
|
||||
object cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn
|
||||
DataBinding.FieldName = 'CPName'
|
||||
Width = 210
|
||||
Position.ColIndex = 1
|
||||
Position.RowIndex = 0
|
||||
Position.BandIndex = 0
|
||||
end
|
||||
end
|
||||
object ADOConnection1: TADOConnection
|
||||
LoginPrompt = False
|
||||
Left = 288
|
||||
Top = 60
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = ADOQueryHelp
|
||||
Left = 280
|
||||
Top = 188
|
||||
end
|
||||
object ADOQueryHelp: TADOQuery
|
||||
Connection = ADOConnection1
|
||||
Parameters = <>
|
||||
Left = 288
|
||||
Top = 136
|
||||
end
|
||||
end
|
||||
67
public10/ThreeFun/Form/U_YPTypeHelp.pas
Normal file
67
public10/ThreeFun/Form/U_YPTypeHelp.pas
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
unit U_YPTypeHelp;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit,
|
||||
cxInplaceContainer, cxDBTL, cxControls, cxTLData, DB, ADODB;
|
||||
|
||||
type
|
||||
TfrmYPTypeHelp = class(TForm)
|
||||
ADOConnection1: TADOConnection;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxDBTreeList1cxDBTreeListColumn2: TcxDBTreeListColumn;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryHelp: TADOQuery;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure cxDBTreeList1DblClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmYPTypeHelp: TfrmYPTypeHelp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmYPTypeHelp.FormCreate(Sender: TObject);
|
||||
begin
|
||||
cxDBTreeList1.Align:=alclient;
|
||||
try
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='';
|
||||
Connected:=true;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmYPTypeHelp.FormShow(Sender: TObject);
|
||||
begin
|
||||
with ADOQueryHelp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from CP_Type order by CPlevel,CPOrder,CPName');
|
||||
Open;
|
||||
end;
|
||||
cxDBTreeList1.Items[0].Expand(false);
|
||||
end;
|
||||
|
||||
procedure TfrmYPTypeHelp.cxDBTreeList1DblClick(Sender: TObject);
|
||||
begin
|
||||
IF ADOQueryHelp.IsEmpty then exit;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
end.
|
||||
14405
public10/ThreeFun/Form/U_ZDYHelp.dfm
Normal file
14405
public10/ThreeFun/Form/U_ZDYHelp.dfm
Normal file
File diff suppressed because it is too large
Load Diff
667
public10/ThreeFun/Form/U_ZDYHelp.pas
Normal file
667
public10/ThreeFun/Form/U_ZDYHelp.pas
Normal file
|
|
@ -0,0 +1,667 @@
|
|||
unit U_ZDYHelp;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||
cxEdit, DB, cxDBData, ToolWin, ComCtrls, U_BaseInput, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls,
|
||||
cxGridCustomView, cxGrid, DBClient, ADODB, ImgList, StdCtrls, ExtCtrls,
|
||||
cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels,
|
||||
cxNavigator,
|
||||
dxDateRanges, dxBarBuiltInMenu, System.ImageList,
|
||||
dxScrollbarAnnotations, cxContainer, cxImageList, cxLookAndFeelPainters;
|
||||
|
||||
type
|
||||
TfrmZDYHelp = class(TfrmBaseInput)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Code: TcxGridDBColumn;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
V1Note: TcxGridDBColumn;
|
||||
V1OrderNo: TcxGridDBColumn;
|
||||
ADOConnection1: TADOConnection;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ThreeImgList: TImageList;
|
||||
Label2: TLabel;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
V1ZdyFlag: TcxGridDBColumn;
|
||||
V1HelpType: TcxGridDBColumn;
|
||||
V1note1: TcxGridDBColumn;
|
||||
ImageList1: TImageList;
|
||||
ZDYName: TcxTextEdit;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
procedure V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1OrderNoPropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1NotePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1HelpTypePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag, flagname, snote, MainType: string;
|
||||
fnote, forderno, fZdyFlag, ViewFlag, fnote1, FHelpType: Boolean;
|
||||
PPSTE: integer;
|
||||
// DConString:string;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmZDYHelp: TfrmZDYHelp;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_globalVar,U_DataLink, U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmZDYHelp.FormCreate(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected := false;
|
||||
ConnectionString := DConString;
|
||||
Connected := true;
|
||||
end;
|
||||
ADOQueryBaseCmd.Connection := ADOConnection1;
|
||||
ADOQueryBaseTemp.Connection := ADOConnection1;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
|
||||
ZDYName.SetFocus;
|
||||
|
||||
Action := cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,ZJM=dbo.getPinYin(A.ZdyName) from KH_ZDY A where A.Type=''' + flag + '''');
|
||||
if Trim(MainType) <> '' then
|
||||
begin
|
||||
sql.Add(' and A.MainType=''' + Trim(MainType) + '''');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain, ClientDataSet1);
|
||||
SInitCDSData(ADOQueryMain, ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.TBAddClick(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
TV1.OptionsData.Editing := True;
|
||||
TV1.OptionsSelection.CellSelect := True;
|
||||
for i := 0 to 5 do
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.TBSaveClick(Sender: TObject);
|
||||
var
|
||||
maxno: string;
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then
|
||||
Exit;
|
||||
ZDYName.SetFocus;
|
||||
|
||||
if ClientDataSet1.Locate('ZDYName', null, []) then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if ClientDataSet1.Locate('ZDYName', '', []) then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo=''' + Trim(flag) + '''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1=2');
|
||||
open;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(flag);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value := trim(flagname);
|
||||
ADOQueryCmd.FieldByName('Type').Value := 'Main';
|
||||
ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType);
|
||||
ADOQueryCmd.Post;
|
||||
{ sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType ');
|
||||
Parameters.ParamByName('ZDYNo').Value:=Trim(flag);
|
||||
Parameters.ParamByName('ZDYName').Value:=Trim(flagname);
|
||||
Parameters.ParamByName('Type').Value:='Main';
|
||||
Parameters.ParamByName('MainType').Value:=Trim(MainType);
|
||||
ExecSQL; }
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
ClientDataSet1.DisableControls;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString) = '' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
maxno := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from KH_Zdy where Type=''' + Trim(flag) + '''');
|
||||
if Trim(MainType) <> '' then
|
||||
SQL.Add(' and MainType=''' + Trim(MainType) + '''');
|
||||
sql.Add(' and ZdyName=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty = False then
|
||||
begin
|
||||
if ADOQueryTemp.RecordCount > 1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) = '' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!', '提示', 0);
|
||||
Exit;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString) <> Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO=''' + Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value := ClientDataSet1.fieldbyname('ZDYName').Value;
|
||||
ADOQueryCmd.FieldByName('note').Value := Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value := flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value := 'Y';
|
||||
if Trim(MainType) <> '' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value := Trim(maxno);
|
||||
ClientDataSet1.Post;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.EnableControls;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!', '提示', 0);
|
||||
TV1.OptionsData.Editing := False;
|
||||
TV1.OptionsSelection.CellSelect := False;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!', '提示', 0);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then
|
||||
Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString) <> '') or (Trim(ClientDataSet1.FieldByName('ZDYname').AsString) <> '') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?', '提示信息', 1) = 2 then
|
||||
exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KH_ZDY where ZDYNo=''' + Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString) + '''');
|
||||
SQL.Add(' and Type=''' + Trim(flag) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult := 2;
|
||||
ZDYName.SetFocus;
|
||||
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj, fsj1: string;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
InitGrid();
|
||||
fsj := Trim(flag) + '01';
|
||||
fsj1 := Trim(flagname) + '01';
|
||||
|
||||
ReadCxGrid('自定义' + Trim(flag), TV1, '自定义数据');
|
||||
frmZDYHelp.Caption := Trim(flagname);
|
||||
V1Note.Visible := fnote;
|
||||
V1ZdyFlag.Visible := fZdyFlag;
|
||||
V1OrderNo.Visible := forderno;
|
||||
v1note1.Visible := fnote1;
|
||||
V1HelpType.Visible := fhelpType;
|
||||
if ViewFlag = True then
|
||||
begin
|
||||
TBAdd.Visible := False;
|
||||
TBSave.Visible := False;
|
||||
TBDel.Visible := False;
|
||||
TBEdit.Visible := False;
|
||||
Label2.Visible := False;
|
||||
end;
|
||||
|
||||
zdyName.setfocus ;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
// WriteCxGrid('自定义'+Trim(flag),TV1,'自定义数据');
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing := True;
|
||||
TV1.OptionsSelection.CellSelect := True;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.TV1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing = False then
|
||||
begin
|
||||
ModalResult := 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.ZDYNameChange(Sender: TObject);
|
||||
var
|
||||
fsj: string;
|
||||
begin
|
||||
if Trim(ZDYName.Text) <> '' then
|
||||
begin
|
||||
fsj := ' zdyname like ''' + '%' + Trim(ZDYName.Text) + '%' + '''' + ' or Note like ''' + '%' + Trim(ZDYName.Text) + '%' + '''' + ' or ZJM like ''' + '%' + Trim(ZDYName.Text) + '%' + '''';
|
||||
end;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain, fsj);
|
||||
SCreateCDS(ADOQueryMain, ClientDataSet1);
|
||||
SInitCDSData(ADOQueryMain, ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
maxno, mvalue: string;
|
||||
begin
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue) = '' then
|
||||
begin
|
||||
//Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('ZdyName').Value := Trim(mvalue);
|
||||
//Post;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo=''' + Trim(flag) + '''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1=2');
|
||||
open;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(flag);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value := trim(flagname);
|
||||
ADOQueryCmd.FieldByName('Type').Value := 'Main';
|
||||
ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType);
|
||||
ADOQueryCmd.Post;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
//ClientDataSet1.DisableControls;
|
||||
//with ClientDataSet1 do
|
||||
//begin
|
||||
//First;
|
||||
//while not eof do
|
||||
//begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString) = '' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
maxno := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from KH_Zdy where Type=''' + Trim(flag) + '''');
|
||||
if Trim(MainType) <> '' then
|
||||
SQL.Add(' and MainType=''' + Trim(MainType) + '''');
|
||||
sql.Add(' and ZdyName=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
||||
sql.Add(' and note=''' + Trim(ClientDataSet1.fieldbyname('note').AsString) + '''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty = False then
|
||||
begin
|
||||
if ADOQueryTemp.RecordCount > 1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) = '' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!', '提示', 0);
|
||||
Exit;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString) <> Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO=''' + Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value := ClientDataSet1.fieldbyname('ZDYName').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value := Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value := flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value := 'Y';
|
||||
if Trim(MainType) <> '' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value := Trim(maxno);
|
||||
//ClientDataSet1.Post;
|
||||
// Next;
|
||||
//end;
|
||||
//end;
|
||||
// ClientDataSet1.EnableControls;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
//Application.MessageBox('保存成功!','提示',0);
|
||||
//TV1.OptionsData.Editing:=False;
|
||||
//TV1.OptionsSelection.CellSelect:=False;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!', '提示', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1OrderNoPropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue: string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) = '' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue) = '' then
|
||||
begin
|
||||
mvalue := '0';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('OrderNo').Value := mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set OrderNo=' + mvalue);
|
||||
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1NotePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue: string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) = '' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue) = '' then
|
||||
begin
|
||||
mvalue := '';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Note').Value := mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set Note=''' + Trim(mvalue) + '''');
|
||||
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue: string;
|
||||
fieldname: string;
|
||||
begin
|
||||
fieldname := Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) = '' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(fieldname).Value := mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set ' + fieldname + '=''' + Trim(mvalue) + ''' ');
|
||||
sql.Add('where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.V1HelpTypePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue: string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) = '' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue) = '' then
|
||||
begin
|
||||
mvalue := '0';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('HelpType').Value := mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set HelpType=''' + Trim(mvalue) + '''');
|
||||
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelp.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
WriteCxGrid('自定义' + Trim(flag), TV1, '自定义数据');
|
||||
frmZDYHelp := nil;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
96
public10/ThreeFun/Form/U_ZDYHelp.vlb
Normal file
96
public10/ThreeFun/Form/U_ZDYHelp.vlb
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
[TBDel]
|
||||
Coordinates=374,214,50,36
|
||||
|
||||
[Label2]
|
||||
Coordinates=298,146,53,58
|
||||
|
||||
[ToolButton1]
|
||||
Coordinates=280,214,84,36
|
||||
|
||||
[cxGrid1Level1]
|
||||
Coordinates=361,155,97,36
|
||||
|
||||
[V1HelpType]
|
||||
Coordinates=361,210,85,36
|
||||
|
||||
[TBEdit]
|
||||
Coordinates=217,214,53,36
|
||||
|
||||
[V1Note]
|
||||
Coordinates=342,251,57,36
|
||||
|
||||
[ADOQueryCmd]
|
||||
Coordinates=121,146,104,58
|
||||
|
||||
[TBAdd]
|
||||
Coordinates=153,214,54,36
|
||||
|
||||
[V1OrderNo]
|
||||
Coordinates=194,251,79,36
|
||||
|
||||
[V1note1]
|
||||
Coordinates=125,251,62,36
|
||||
|
||||
[TV1]
|
||||
Coordinates=76,251,40,36
|
||||
|
||||
[TBClose]
|
||||
Coordinates=79,214,64,36
|
||||
|
||||
[Panel1]
|
||||
Coordinates=333,78,55,58
|
||||
|
||||
[cxGrid1]
|
||||
Coordinates=10,214,59,36
|
||||
|
||||
[V1Name]
|
||||
Coordinates=504,133,64,36
|
||||
|
||||
[ADOQueryTemp]
|
||||
Coordinates=233,10,109,58
|
||||
|
||||
[cxGridPopupMenu1]
|
||||
Coordinates=504,188,128,36
|
||||
|
||||
[ADOConnection1]
|
||||
Coordinates=504,243,114,36
|
||||
|
||||
[ThreeImgList]
|
||||
Coordinates=504,298,90,36
|
||||
|
||||
[V1Code]
|
||||
Coordinates=435,325,61,36
|
||||
|
||||
[ClientDataSet1]
|
||||
Coordinates=10,146,101,58
|
||||
|
||||
[V1ZdyFlag]
|
||||
Coordinates=356,325,77,36
|
||||
|
||||
[DataSource1]
|
||||
Coordinates=219,78,89,36
|
||||
|
||||
[Label1]
|
||||
Coordinates=235,146,53,58
|
||||
|
||||
[TBSave]
|
||||
Coordinates=438,146,60,36
|
||||
|
||||
[ADOQueryMain]
|
||||
Coordinates=398,78,105,58
|
||||
|
||||
[DataLink_TradeManage.AdoDataLink]
|
||||
Coordinates=10,78,229,58
|
||||
|
||||
[ToolBar1]
|
||||
Coordinates=361,146,67,36
|
||||
|
||||
[frmBaseInput.ADOQueryBaseTemp]
|
||||
Coordinates=352,10,219,58
|
||||
|
||||
[frmBaseInput.ADOQueryBaseCmd]
|
||||
Coordinates=10,10,213,58
|
||||
|
||||
[]
|
||||
Coordinates=249,78,74,58
|
||||
|
||||
18083
public10/ThreeFun/Form/U_ZDYHelpDL.dfm
Normal file
18083
public10/ThreeFun/Form/U_ZDYHelpDL.dfm
Normal file
File diff suppressed because it is too large
Load Diff
294
public10/ThreeFun/Form/U_ZDYHelpDL.pas
Normal file
294
public10/ThreeFun/Form/U_ZDYHelpDL.pas
Normal file
|
|
@ -0,0 +1,294 @@
|
|||
unit U_ZDYHelpDL;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
|
||||
StdCtrls, ExtCtrls, cxTL, cxMaskEdit, cxInplaceContainer, cxDBTL,
|
||||
cxTLData, cxDropDownEdit;
|
||||
|
||||
type
|
||||
TfrmZDYDLHelp = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Code: TcxGridDBColumn;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
V1Note: TcxGridDBColumn;
|
||||
V1OrderNo: TcxGridDBColumn;
|
||||
ADOConnection1: TADOConnection;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZDYName: TEdit;
|
||||
ThreeImgList: TImageList;
|
||||
ADOQueryChild: TADOQuery;
|
||||
DataSource2: TDataSource;
|
||||
cxDBTreeList1: TcxDBTreeList;
|
||||
cxColumn2: TcxDBTreeListColumn;
|
||||
V1Column1: TcxGridDBColumn;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
procedure cxDBTreeList1Click(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
MainType,MainTypeName,flag,flagname,snote:string;
|
||||
fnote,forderno:Boolean;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmZDYDLHelp: TfrmZDYDLHelp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_Fun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmZDYDLHelp.FormCreate(Sender: TObject);
|
||||
begin
|
||||
cxGrid1.Align:=alClient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
Connected:=true;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.InitGrid();
|
||||
begin
|
||||
try
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,TypeName=(select ZdyName from KH_Zdy B where B.ZdyNO=A.Type) from KH_Zdy A');
|
||||
if Trim(ADOQueryChild.fieldbyname('frameNo').AsString)<>'QB' then
|
||||
sql.Add('where Type='''+Trim(ADOQueryChild.fieldbyname('frameNo').AsString)+'''')
|
||||
else
|
||||
sql.Add('where MainType='''+Trim(MainType)+''' and Type<>''Main'' ');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.TBAddClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing:=True;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.TBSaveClick(Sender: TObject);
|
||||
var
|
||||
maxno,fsj:string;
|
||||
i:Integer;
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('TypeName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('类别不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp,maxno,'SY','KH_ZDY',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO='''+Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYName').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=ClientDataSet1.fieldbyname('ZDYName').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
// ADOQueryCmd.FieldByName('Type').Value:=TcxComboBox(V1Column1).Properties.Items.Strings[1];
|
||||
i:=(V1Column1.Properties as TcxComboBoxProperties).Items.IndexOf(ClientDataSet1.fieldbyname('TypeName').AsString);
|
||||
fsj:=TA((V1Column1.Properties as TcxComboBoxProperties).Items.Objects[i]).S;
|
||||
ADOQueryCmd.FieldByName('Type').Value:=Trim(fsj);
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
ADOQueryCmd.FieldByName('Maintype').Value:=Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ClientDataSet1.Post;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
TV1.OptionsData.Editing:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString)<>'') or
|
||||
(Trim(ClientDataSet1.FieldByName('ZDYname').AsString)<>'') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?','提示信息',1)=2 then exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KH_ZDY where ZDYNo='''+Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString)+'''');
|
||||
SQL.Add(' and Type='''+Trim(ADOQueryChild.fieldbyname('frameNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=2;
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj,fsj1:string;
|
||||
begin
|
||||
fsj:='select ZdyNo code,ZdyName name from KH_Zdy where MainType='''+MainType+''' and Type=''Main''';
|
||||
SInitCxGridComboBoxBySql(ADOQueryTemp,V1Column1,fsj,1,True,'');
|
||||
fsj:= ' select frameNo=''QB'',frameName=''全部'',TopFrameNo='''+Trim(MainType)+''''+
|
||||
' union all select frameNo=ZdyNo,frameName=ZdyName,TopFrameNo=MainType '+
|
||||
' from KH_Zdy A '+
|
||||
' where A.MainType='''+MainType+''' and Type=''Main''';
|
||||
with ADOQueryChild do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add(fsj);
|
||||
Open;
|
||||
end;
|
||||
cxDBTreeList1.FullExpand;
|
||||
InitGrid();
|
||||
|
||||
frmZDYDLHelp.Caption:=Trim(MainTypename)+'<'+Trim(MainType)+'>';
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing:=True;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing=False then
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.ZDYNameChange(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYDLHelp.cxDBTreeList1Click(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
end.
|
||||
14363
public10/ThreeFun/Form/U_ZDYHelpFZSel.dfm
Normal file
14363
public10/ThreeFun/Form/U_ZDYHelpFZSel.dfm
Normal file
File diff suppressed because it is too large
Load Diff
397
public10/ThreeFun/Form/U_ZDYHelpFZSel.pas
Normal file
397
public10/ThreeFun/Form/U_ZDYHelpFZSel.pas
Normal file
|
|
@ -0,0 +1,397 @@
|
|||
unit U_ZDYHelpFZSel;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||
cxEdit, DB, cxDBData, ToolWin, ComCtrls, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls,
|
||||
cxGridCustomView, cxGrid, DBClient, ADODB, ImgList, StdCtrls, ExtCtrls,
|
||||
cxCheckBox, cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, cxNavigator, dxDateRanges, System.ImageList,
|
||||
System.Types, cxDropDownEdit, cxButtonEdit, dxBarBuiltInMenu,
|
||||
cxGridCustomPopupMenu, cxGridPopupMenu, U_BaseHelp, BtnEdit, Vcl.Menus;
|
||||
|
||||
type
|
||||
TfrmZDYHelpFZSel = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
ADOConnection1: TADOConnection;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZDYName: TEdit;
|
||||
ThreeImgList: TImageList;
|
||||
V1Column1: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
TV1Column1: TcxGridDBColumn;
|
||||
cxgrdpmn1: TcxGridPopupMenu;
|
||||
BZType: TBtnEditC;
|
||||
Label3: TLabel;
|
||||
ImageList_new32: TImageList;
|
||||
PopupMenu1: TPopupMenu;
|
||||
N2: TMenuItem;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
procedure V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure TV1Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure BZTypeBtnDnClick(Sender: TObject);
|
||||
procedure BZTypeBtnUpClick(Sender: TObject);
|
||||
procedure N2Click(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag, flagname, snote, MainType, ReturnStr, FGStr, FChkStr: string;
|
||||
fnote, forderno: Boolean;
|
||||
PPSTE, JiangeStr: integer;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmZDYHelpFZSel: TfrmZDYHelpFZSel;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_RTFun, U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmZDYHelpFZSel.TBAddClick(Sender: TObject);
|
||||
var
|
||||
maxno: string;
|
||||
begin
|
||||
if Trim(BZType.Text) = '' then
|
||||
begin
|
||||
Application.MessageBox('类型不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
ZDYName.SetFocus;
|
||||
TV1.OptionsData.Editing := True;
|
||||
TV1.OptionsSelection.CellSelect := True;
|
||||
if GetLSNo(ADOQueryTemp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('取最大编号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
fieldbyname('ZDYNo').Value := maxno;
|
||||
fieldbyname('Note').Value := BZType.Text;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(Type,MainType,ZDYNo,Note) ');
|
||||
sql.Add('values(' + quotedstr(Trim(flag)));
|
||||
sql.Add(',' + quotedstr(Trim(MainType)));
|
||||
sql.Add(',' + quotedstr(Trim(maxno)));
|
||||
sql.Add(',' + quotedstr(Trim(BZType.Text)) + ') ');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.FormCreate(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
cxGrid1.Align := alClient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected := false;
|
||||
ConnectionString := DConString;
|
||||
//ConnectionString:='';
|
||||
Connected := true;
|
||||
end;
|
||||
except
|
||||
frmZDYHelpFZSel.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.BZTypeBtnDnClick(Sender: TObject);
|
||||
begin
|
||||
TBtnEditC(Sender).Text := '';
|
||||
TBtnEditC(Sender).TxtCode := '';
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.BZTypeBtnUpClick(Sender: TObject);
|
||||
var
|
||||
fsj: string;
|
||||
FWZ: Integer;
|
||||
begin
|
||||
|
||||
try
|
||||
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
||||
with frmZDYHelp do
|
||||
begin
|
||||
flag := Trim(self.flag) + 'MX';
|
||||
flagname := '类型';
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZDYHelp.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
inherited;
|
||||
writeCxGrid('自定义' + Trim(flag), TV1, '自定义数据');
|
||||
ZDYName.SetFocus;
|
||||
Action := caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where Type=''' + flag + '''');
|
||||
if Trim(MainType) <> '' then
|
||||
begin
|
||||
sql.Add(' and MainType=''' + Trim(MainType) + '''');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain, ClientDataSet1);
|
||||
SInitCDSData(ADOQueryMain, ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.N2Click(Sender: TObject);
|
||||
var
|
||||
MNote: string;
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
DisableControls;
|
||||
MNote := Trim(ClientDataSet1.fieldbyname('Note').AsString);
|
||||
|
||||
First;
|
||||
|
||||
while not EOF do
|
||||
begin
|
||||
ClientDataSet1.Edit;
|
||||
if MNote = Trim(ClientDataSet1.fieldbyname('Note').AsString) then
|
||||
begin
|
||||
ClientDataSet1.fieldbyname('ssel').Value := TRUE;
|
||||
end
|
||||
else
|
||||
begin
|
||||
ClientDataSet1.fieldbyname('ssel').Value := False;
|
||||
end;
|
||||
ClientDataSet1.Post;
|
||||
ClientDataSet1.Next;
|
||||
end;
|
||||
|
||||
EnableControls;
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then
|
||||
Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString) <> '') or (Trim(ClientDataSet1.FieldByName('ZDYname').AsString) <> '') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?', '提示信息', 1) = 2 then
|
||||
exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KH_ZDY where ZDYNo=''' + Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString) + '''');
|
||||
SQL.Add('and Type=''' + Trim(flag) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult := 2;
|
||||
ZDYName.SetFocus;
|
||||
WriteCxGrid('自定义包装要求1', TV1, '自定义数据');
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj, fsj1: string;
|
||||
FStrs: TStringList;
|
||||
i: integer;
|
||||
begin
|
||||
|
||||
ReadCxGrid('自定义包装要求1', TV1, '自定义数据');
|
||||
InitGrid();
|
||||
fsj := Trim(flag) + '01';
|
||||
fsj1 := Trim(flagname) + '01';
|
||||
|
||||
if Trim(FChkStr) <> '' then
|
||||
begin
|
||||
FStrs := TStringList.Create();
|
||||
ExtractStrings(['|'], [' '], PChar(FChkStr), FStrs);
|
||||
frmZDYHelpFZSel.Caption := Trim(flagname);
|
||||
|
||||
// for i := 0 to FStrs.Count-1 do
|
||||
// showmessage(FStrs[i]);
|
||||
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if FStrs.IndexOf(Trim(FieldByName('ZDYName').AsString)) >= 0 then
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('SSel').Value := true;
|
||||
Post;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
FStrs.Free;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ReturnStr := '';
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if FieldByName('SSel').AsBoolean = True then
|
||||
begin
|
||||
if JiangeStr <> 99 then
|
||||
begin
|
||||
if FGStr <> '' then
|
||||
ReturnStr := ReturnStr + Trim(fieldbyname('ZDYName').AsString) + FGStr
|
||||
else
|
||||
ReturnStr := ReturnStr + Trim(fieldbyname('ZDYName').AsString) + ';'
|
||||
end
|
||||
else
|
||||
ReturnStr := ReturnStr + Trim(fieldbyname('ZDYName').AsString);
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
if JiangeStr <> 99 then
|
||||
ReturnStr := Copy(ReturnStr, 1, Length(ReturnStr) - 1);
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing := True;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.TV1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing = False then
|
||||
begin
|
||||
ModalResult := 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.TV1Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue, FFieldName: string;
|
||||
begin
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
FFieldName := Trim(Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(FFieldName).Value := mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set ' + FFieldName + '=' + quotedstr(Trim(mvalue)));
|
||||
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
tv1.Controller.EditingController.ShowEdit();
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.ZDYNameChange(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||||
SCreateCDS(ADOQueryMain, ClientDataSet1);
|
||||
SInitCDSData(ADOQueryMain, ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
maxno, mvalue: string;
|
||||
begin
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('ZDYName').Value := mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set ZDYName=''' + Trim(mvalue) + '''');
|
||||
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpFZSel.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
|
||||
frmZDYHelpFZSel := nil;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
18074
public10/ThreeFun/Form/U_ZDYHelpSM.dfm
Normal file
18074
public10/ThreeFun/Form/U_ZDYHelpSM.dfm
Normal file
File diff suppressed because it is too large
Load Diff
539
public10/ThreeFun/Form/U_ZDYHelpSM.pas
Normal file
539
public10/ThreeFun/Form/U_ZDYHelpSM.pas
Normal file
|
|
@ -0,0 +1,539 @@
|
|||
unit U_ZDYHelpSM;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, DB, cxDBData, ToolWin, ComCtrls,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
|
||||
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
|
||||
StdCtrls, ExtCtrls, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu;
|
||||
|
||||
type
|
||||
TfrmZDYHelpSM = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Code: TcxGridDBColumn;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
V1Note: TcxGridDBColumn;
|
||||
ADOConnection1: TADOConnection;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZDYName: TEdit;
|
||||
ThreeImgList: TImageList;
|
||||
Label2: TLabel;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
V1ZdyFlag: TcxGridDBColumn;
|
||||
V1HelpType: TcxGridDBColumn;
|
||||
V1note1: TcxGridDBColumn;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
procedure V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure V1Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag,flagname,snote,MainType:string;
|
||||
fnote,forderno,fZdyFlag,ViewFlag,fnote1:Boolean;
|
||||
PPSTE:integer;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmZDYHelpSM: TfrmZDYHelpSM;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmZDYHelpSM.FormCreate(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
cxGrid1.Align:=alClient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
Connected:=true;
|
||||
end;
|
||||
except
|
||||
frmZDYHelpSM.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
Action:=cahide;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.*,ZJM=dbo.getPinYin(A.ZdyName) ');
|
||||
sql.Add('from KH_ZDY'+DSMFlag+' A ');
|
||||
sql.Add('where A.Type='''+flag+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
begin
|
||||
sql.Add(' and A.MainType='''+Trim(MainType)+'''');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.TBAddClick(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
TV1.OptionsData.Editing:=True;
|
||||
TV1.OptionsSelection.CellSelect:=True;
|
||||
for i:=0 to 5 do
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.TBSaveClick(Sender: TObject);
|
||||
var
|
||||
maxno:string;
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
ZDYName.SetFocus;
|
||||
|
||||
if ClientDataSet1.Locate('ZDYName',null,[]) then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if ClientDataSet1.Locate('ZDYName','',[]) then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo='''+Trim(flag)+'''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1=2');
|
||||
open;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(flag);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=trim(flagname);
|
||||
ADOQueryCmd.FieldByName('Type').Value:='Main';
|
||||
ADOQueryCmd.FieldByName('MainType').Value:=Trim(MainType);
|
||||
ADOQueryCmd.Post;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
ClientDataSet1.DisableControls;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp,maxno,'SY','KH_ZDY',3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from KH_Zdy where Type='''+Trim(flag)+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
SQL.Add(' and MainType='''+Trim(MainType)+'''');
|
||||
sql.Add(' and ZdyName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
begin
|
||||
if ADOQueryTemp.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end else
|
||||
begin
|
||||
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString)<>Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO='''+Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=ClientDataSet1.fieldbyname('ZDYName').Value;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value:=flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
if Trim(MainType)<>'' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value:=Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ClientDataSet1.Post;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.EnableControls;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!','提示',0);
|
||||
TV1.OptionsData.Editing:=False;
|
||||
TV1.OptionsSelection.CellSelect:=False;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString)<>'') or
|
||||
(Trim(ClientDataSet1.FieldByName('ZDYname').AsString)<>'') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?','提示信息',1)=2 then exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KH_ZDY'+DSMFlag+' where ZDYNo='''+Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString)+'''');
|
||||
SQL.Add(' and Type='''+Trim(flag)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult:=2;
|
||||
ZDYName.SetFocus;
|
||||
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj,fsj1:string;
|
||||
begin
|
||||
InitGrid();
|
||||
fsj:=Trim(flag)+'01';
|
||||
fsj1:=Trim(flagname)+'01';
|
||||
|
||||
ReadCxGrid('自定义'+Trim(flag),TV1);
|
||||
frmZDYHelpSM.Caption:=Trim(flagname);
|
||||
V1Note.Visible:=fnote;
|
||||
v1note1.Visible:=fnote1;
|
||||
if ViewFlag=True then
|
||||
begin
|
||||
TBAdd.Visible:=False;
|
||||
TBSave.Visible:=False;
|
||||
TBDel.Visible:=False;
|
||||
TBEdit.Visible:=False;
|
||||
Label2.Visible:=False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.TBEditClick(Sender: TObject);
|
||||
begin
|
||||
TV1.OptionsData.Editing:=True;
|
||||
TV1.OptionsSelection.CellSelect:=True;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.TV1CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing=False then
|
||||
begin
|
||||
ModalResult:=1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.ZDYNameChange(Sender: TObject);
|
||||
var
|
||||
fsj:String;
|
||||
begin
|
||||
if Trim(ZDYName.Text)<>'' then
|
||||
begin
|
||||
fsj:=' zdyname like '''+'%'+Trim(ZDYName.Text)+'%'+''''
|
||||
+' or Note like '''+'%'+Trim(ZDYName.Text)+'%'+''''
|
||||
+' or ZJM like '''+'%'+Trim(ZDYName.Text)+'%'+'''';
|
||||
end;
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,fsj);
|
||||
SCreateCDS20(ADOQueryMain,ClientDataSet1);
|
||||
SInitCDSData20(ADOQueryMain,ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
maxno,mvalue:string;
|
||||
begin
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue)='' then Exit;
|
||||
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('ZdyName').Value:=Trim(mvalue);
|
||||
//Post;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY'+DSMFlag+' where ZdyNo='''+Trim(flag)+'''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY'+DSMFlag+' where 1=2');
|
||||
open;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(flag);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=trim(flagname);
|
||||
ADOQueryCmd.FieldByName('Type').Value:='Main';
|
||||
ADOQueryCmd.FieldByName('MainType').Value:=Trim(MainType);
|
||||
ADOQueryCmd.FieldByName('SMFlag').Value:=trim(DSmflag);
|
||||
ADOQueryCmd.Post;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
//ClientDataSet1.DisableControls;
|
||||
//with ClientDataSet1 do
|
||||
//begin
|
||||
//First;
|
||||
//while not eof do
|
||||
//begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString)='' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp,maxno,'SY','KH_ZDY'+trim(DSMFlag),3,1)=False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
maxno:=Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from KH_Zdy'+DSMFlag+' ');
|
||||
sql.add('where Type='''+Trim(flag)+'''');
|
||||
if Trim(MainType)<>'' then
|
||||
SQL.Add(' and MainType='''+Trim(MainType)+'''');
|
||||
sql.Add(' and ZdyName='''+Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)+'''');
|
||||
sql.Add(' and note='''+Trim(ClientDataSet1.fieldbyname('note').AsString)+'''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty=False then
|
||||
begin
|
||||
if ADOQueryTemp.RecordCount>1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)='' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end else
|
||||
begin
|
||||
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString)<>Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('名称重复!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY'+DSMFlag+' where ZDYNO='''+Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY'+DSMFlag+' where 1=2 ');
|
||||
Open;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value:=ClientDataSet1.fieldbyname('ZDYName').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value:=Trim(snote);
|
||||
ADOQueryCmd.FieldByName('Type').Value:=flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value:='Y';
|
||||
ADOQueryCmd.FieldByName('SMFlag').Value:=trim(DSmflag);
|
||||
if Trim(MainType)<>'' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value:=Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value:=Trim(maxno);
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!','提示',0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.V1Column1PropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue:String;
|
||||
fieldname:string;
|
||||
begin
|
||||
fieldname:=Tv1.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString)='' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue:=TcxTextEdit(Sender).EditingText;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName(fieldname).Value:=mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy'+DSMFlag+' Set '+fieldname+'='''+Trim(mvalue)+''' ');
|
||||
sql.Add('where ZdyNo='''+Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSM.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
|
||||
frmZDYHelpSM:=nil;
|
||||
WriteCxGrid('自定义'+Trim(flag),TV1);
|
||||
end;
|
||||
|
||||
end.
|
||||
14360
public10/ThreeFun/Form/U_ZDYHelpSel.dfm
Normal file
14360
public10/ThreeFun/Form/U_ZDYHelpSel.dfm
Normal file
File diff suppressed because it is too large
Load Diff
567
public10/ThreeFun/Form/U_ZDYHelpSel.pas
Normal file
567
public10/ThreeFun/Form/U_ZDYHelpSel.pas
Normal file
|
|
@ -0,0 +1,567 @@
|
|||
unit U_ZDYHelpSel;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
|
||||
cxEdit, DB, cxDBData, ToolWin, ComCtrls, cxGridCustomTableView,
|
||||
cxGridTableView, cxGridDBTableView, cxGridLevel, cxClasses, cxControls,
|
||||
cxGridCustomView, cxGrid, DBClient, ADODB, ImgList, StdCtrls, ExtCtrls,
|
||||
cxCheckBox, cxTextEdit, cxLookAndFeels,
|
||||
cxNavigator, dxDateRanges, System.ImageList,
|
||||
System.Types, dxBarBuiltInMenu, cxGridCustomPopupMenu, cxGridPopupMenu,
|
||||
dxScrollbarAnnotations, cxLookAndFeelPainters;
|
||||
|
||||
type
|
||||
TfrmZDYHelpSel = class(TForm)
|
||||
TV1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
V1Code: TcxGridDBColumn;
|
||||
V1Name: TcxGridDBColumn;
|
||||
ToolBar1: TToolBar;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
DataSource1: TDataSource;
|
||||
ClientDataSet1: TClientDataSet;
|
||||
TBAdd: TToolButton;
|
||||
TBSave: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ToolButton1: TToolButton;
|
||||
TBEdit: TToolButton;
|
||||
V1Note: TcxGridDBColumn;
|
||||
V1OrderNo: TcxGridDBColumn;
|
||||
ADOConnection1: TADOConnection;
|
||||
Panel1: TPanel;
|
||||
Label1: TLabel;
|
||||
ZDYName: TEdit;
|
||||
ThreeImgList: TImageList;
|
||||
V1Column1: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
ImageList_new32: TImageList;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TBAddClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure TBDelClick(Sender: TObject);
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
procedure TBEditClick(Sender: TObject);
|
||||
procedure TV1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||||
procedure ZDYNameChange(Sender: TObject);
|
||||
procedure V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure V1NotePropertiesEditValueChanged(Sender: TObject);
|
||||
private
|
||||
procedure InitGrid();
|
||||
{ Private declarations }
|
||||
public
|
||||
flag, flagname, FChkStr, snote, MainType, ReturnStr, FGStr: string;
|
||||
fnote, forderno: Boolean;
|
||||
PPSTE, JiangeStr: integer;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmZDYHelpSel: TfrmZDYHelpSel;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_RTFun;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmZDYHelpSel.FormCreate(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
|
||||
cxGrid1.Align := alClient;
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected := false;
|
||||
ConnectionString := DConString;
|
||||
//ConnectionString:='';
|
||||
Connected := true;
|
||||
end;
|
||||
except
|
||||
{if Application.MessageBox('网络连接失败,是否要再次连接?','提示',32+4)=IDYES then
|
||||
begin
|
||||
try
|
||||
with ADOConnection1 do
|
||||
begin
|
||||
Connected:=false;
|
||||
ConnectionString:=DConString;
|
||||
//ConnectionString:='23242';
|
||||
Connected:=true;
|
||||
end;
|
||||
except
|
||||
end;
|
||||
end; }
|
||||
|
||||
frmZDYHelpSel.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
writeCxGrid('自定义' + Trim(flag), TV1, '自定义数据');
|
||||
ZDYName.SetFocus;
|
||||
Action := caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where Type=''' + flag + '''');
|
||||
if Trim(MainType) <> '' then
|
||||
begin
|
||||
sql.Add(' and MainType=''' + Trim(MainType) + '''');
|
||||
end;
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain, ClientDataSet1);
|
||||
SInitCDSData(ADOQueryMain, ClientDataSet1);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TBAddClick(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
ZDYName.SetFocus;
|
||||
TV1.OptionsData.Editing := True;
|
||||
TV1.OptionsSelection.CellSelect := True;
|
||||
for i := 0 to TV1.ColumnCount - 1 do
|
||||
begin
|
||||
if uppercase(TV1.Columns[i].DataBinding.FieldName) <> 'SSEL' then
|
||||
TV1.Columns[i].Options.Editing := True;
|
||||
end;
|
||||
for i := 0 to 5 do
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Append;
|
||||
Post;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TBSaveClick(Sender: TObject);
|
||||
var
|
||||
maxno: string;
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then
|
||||
Exit;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo=''' + Trim(flag) + '''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType ');
|
||||
Parameters.ParamByName('ZDYNo').Value := Trim(flag);
|
||||
Parameters.ParamByName('ZDYName').Value := Trim(flagname);
|
||||
Parameters.ParamByName('Type').Value := 'Main';
|
||||
Parameters.ParamByName('MainType').Value := Trim(MainType);
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString) = '' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('取最大编号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
maxno := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO=''' + Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYName').AsString) = '' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('名称不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value := ClientDataSet1.fieldbyname('ZDYName').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value := Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value := flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value := 'Y';
|
||||
if Trim(MainType) <> '' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value := Trim(maxno);
|
||||
ClientDataSet1.Post;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
Application.MessageBox('保存成功!', '提示', 0);
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!', '提示', 0);
|
||||
end;
|
||||
// TV1.OptionsData.Editing:=False;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
if ClientDataSet1.IsEmpty then
|
||||
Exit;
|
||||
if (Trim(ClientDataSet1.FieldByName('ZDYNo').AsString) <> '') or (Trim(ClientDataSet1.FieldByName('ZDYname').AsString) <> '') then
|
||||
begin
|
||||
if application.MessageBox('确定要删除吗?', '提示信息', 1) = 2 then
|
||||
exit;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('delete KH_ZDY where ZDYNo=''' + Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString) + '''');
|
||||
SQL.Add('and Type=''' + Trim(flag) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
ClientDataSet1.Delete;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
ModalResult := 2;
|
||||
ZDYName.SetFocus;
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.FormShow(Sender: TObject);
|
||||
var
|
||||
fsj, fsj1: string;
|
||||
FStrs: TStringList;
|
||||
i: Integer;
|
||||
begin
|
||||
{if PPSTE=1 then
|
||||
begin
|
||||
Application.Terminate;
|
||||
Exit;
|
||||
end; }
|
||||
|
||||
for i := 0 to TV1.ColumnCount - 1 do
|
||||
begin
|
||||
if uppercase(TV1.Columns[i].DataBinding.FieldName) <> 'SSEL' then
|
||||
TV1.Columns[i].Options.Editing := false;
|
||||
end;
|
||||
ReadCxGrid('自定义' + Trim(flag), TV1, '自定义数据');
|
||||
InitGrid();
|
||||
fsj := Trim(flag) + '01';
|
||||
fsj1 := Trim(flagname) + '01';
|
||||
|
||||
if Trim(FChkStr) <> '' then
|
||||
begin
|
||||
FStrs := TStringList.Create();
|
||||
ExtractStrings(['|'], [' '], PChar(FChkStr), FStrs);
|
||||
frmZDYHelpSel.Caption := Trim(flagname);
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not eof do
|
||||
begin
|
||||
if FStrs.IndexOf(Trim(FieldByName('ZDYName').AsString)) >= 0 then
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('SSel').Value := true;
|
||||
Post;
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
FStrs.Free;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
ReturnStr := '';
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
if FieldByName('SSel').AsBoolean = True then
|
||||
begin
|
||||
if JiangeStr <> 99 then
|
||||
begin
|
||||
if FGStr <> '' then
|
||||
ReturnStr := ReturnStr + Trim(fieldbyname('ZDYName').AsString) + FGStr
|
||||
else
|
||||
ReturnStr := ReturnStr + Trim(fieldbyname('ZDYName').AsString) + ';'
|
||||
end
|
||||
else
|
||||
ReturnStr := ReturnStr + Trim(fieldbyname('ZDYName').AsString);
|
||||
end;
|
||||
Next;
|
||||
end;
|
||||
end;
|
||||
if JiangeStr <> 99 then
|
||||
ReturnStr := Copy(ReturnStr, 1, Length(ReturnStr) - 1);
|
||||
ModalResult := 1;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TBEditClick(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i := 0 to TV1.ColumnCount - 1 do
|
||||
begin
|
||||
if uppercase(TV1.Columns[i].DataBinding.FieldName) <> 'SSEL' then
|
||||
TV1.Columns[i].Options.Editing := True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.TV1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if TV1.OptionsData.Editing = False then
|
||||
begin
|
||||
ModalResult := 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.ZDYNameChange(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
||||
SCreateCDS(ADOQueryMain, ClientDataSet1);
|
||||
SInitCDSData(ADOQueryMain, ClientDataSet1);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.V1NamePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
maxno, mvalue: string;
|
||||
begin
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue) = '' then
|
||||
begin
|
||||
//Application.MessageBox('名称不能为空!','提示',0);
|
||||
Exit;
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('ZdyName').Value := Trim(mvalue);
|
||||
//Post;
|
||||
end;
|
||||
try
|
||||
ADOQueryCmd.Connection.BeginTrans;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select * from KH_ZDY where ZdyNo=''' + Trim(flag) + '''');
|
||||
open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType) select :ZDYNo,:ZDYName,:Type,:MainType ');
|
||||
Parameters.ParamByName('ZDYNo').Value := Trim(flag);
|
||||
Parameters.ParamByName('ZDYName').Value := Trim(flagname);
|
||||
Parameters.ParamByName('Type').Value := 'Main';
|
||||
Parameters.ParamByName('MainType').Value := Trim(MainType);
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
//ClientDataSet1.DisableControls;
|
||||
//with ClientDataSet1 do
|
||||
//begin
|
||||
//First;
|
||||
//while not eof do
|
||||
//begin
|
||||
if Trim(ClientDataSet1.FieldByName('ZDYNO').AsString) = '' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryTemp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('取最大编号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
maxno := Trim(ClientDataSet1.fieldbyname('ZDYNo').AsString);
|
||||
end;
|
||||
with ADOQueryTemp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.add('select * from KH_Zdy where Type=''' + Trim(flag) + '''');
|
||||
if Trim(MainType) <> '' then
|
||||
SQL.Add(' and MainType=''' + Trim(MainType) + '''');
|
||||
sql.Add(' and ZdyName=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
||||
Open;
|
||||
end;
|
||||
if ADOQueryTemp.IsEmpty = False then
|
||||
begin
|
||||
if ADOQueryTemp.RecordCount > 1 then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) = '' then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!', '提示', 0);
|
||||
Exit;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if Trim(ADOQueryTemp.fieldbyname('ZdyNo').AsString) <> Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) then
|
||||
begin
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
//ClientDataSet1.EnableControls;
|
||||
Application.MessageBox('名称重复!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
SQL.Add('delete KH_ZDY where ZDYNO=''' + Trim(ClientDataSet1.fieldbyname('ZDYNO').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from KH_ZDY where 1<>1');
|
||||
Open;
|
||||
end;
|
||||
ADOQueryCmd.Append;
|
||||
ADOQueryCmd.FieldByName('ZDYNo').Value := Trim(maxno);
|
||||
ADOQueryCmd.FieldByName('ZDYName').Value := ClientDataSet1.fieldbyname('ZDYName').AsString;
|
||||
ADOQueryCmd.FieldByName('note').Value := Trim(snote);
|
||||
//ADOQueryCmd.FieldByName('orderno').Value:=ClientDataSet1.fieldbyname('Name').AsString;
|
||||
ADOQueryCmd.FieldByName('Type').Value := flag;
|
||||
ADOQueryCmd.FieldByName('valid').Value := 'Y';
|
||||
if Trim(MainType) <> '' then
|
||||
ADOQueryCmd.FieldByName('MainType').Value := Trim(MainType);
|
||||
//ADOQueryCmd.FieldByName('sel').Value:=0;
|
||||
ADOQueryCmd.Post;
|
||||
ClientDataSet1.Edit;
|
||||
ClientDataSet1.FieldByName('ZDYNo').Value := Trim(maxno);
|
||||
//ClientDataSet1.Post;
|
||||
// Next;
|
||||
//end;
|
||||
//end;
|
||||
// ClientDataSet1.EnableControls;
|
||||
end;
|
||||
ADOQueryCmd.Connection.CommitTrans;
|
||||
//Application.MessageBox('保存成功!','提示',0);
|
||||
//TV1.OptionsData.Editing:=False;
|
||||
//TV1.OptionsSelection.CellSelect:=False;
|
||||
except
|
||||
ADOQueryCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox('保存失败!', '提示', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.V1NotePropertiesEditValueChanged(Sender: TObject);
|
||||
var
|
||||
mvalue: string;
|
||||
begin
|
||||
if Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) = '' then
|
||||
begin
|
||||
Application.MessageBox('名称不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
mvalue := TcxTextEdit(Sender).EditingText;
|
||||
if Trim(mvalue) = '' then
|
||||
begin
|
||||
mvalue := '';
|
||||
end;
|
||||
with ClientDataSet1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('Note').Value := mvalue;
|
||||
Post;
|
||||
end;
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('Update KH_Zdy Set Note=''' + Trim(mvalue) + '''');
|
||||
sql.Add(' where ZdyNo=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZDYHelpSel.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmZDYHelpSel := nil;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
328
public10/ThreeFun/Form/U_ZdyAttachGYSHelp.dfm
Normal file
328
public10/ThreeFun/Form/U_ZdyAttachGYSHelp.dfm
Normal file
|
|
@ -0,0 +1,328 @@
|
|||
object frmZdyAttachGYSHelp: TfrmZdyAttachGYSHelp
|
||||
Left = 173
|
||||
Top = 121
|
||||
Caption = #20379#24212#21830#36164#26009#31649#29702
|
||||
ClientHeight = 579
|
||||
ClientWidth = 1022
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1022
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_TradeManage.ThreeImgList
|
||||
Images = DataLink_TradeManage.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 9
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 59
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 3
|
||||
Visible = False
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 54
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 248
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 17
|
||||
Visible = False
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 311
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 53
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 374
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 55
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1022
|
||||
Height = 39
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label3: TLabel
|
||||
Left = 203
|
||||
Top = 13
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#21517#31216
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 22
|
||||
Top = 13
|
||||
Width = 60
|
||||
Height = 12
|
||||
Caption = #20379#24212#21830#32534#21495
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 395
|
||||
Top = 13
|
||||
Width = 24
|
||||
Height = 12
|
||||
Caption = #31867#22411
|
||||
end
|
||||
object ZdyName: TEdit
|
||||
Tag = 2
|
||||
Left = 267
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = ZdyNameChange
|
||||
end
|
||||
object ZdyCode: TEdit
|
||||
Tag = 2
|
||||
Left = 83
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnChange = ZdyNameChange
|
||||
end
|
||||
object DEFstr5: TComboBox
|
||||
Tag = 1
|
||||
Left = 424
|
||||
Top = 8
|
||||
Width = 81
|
||||
Height = 20
|
||||
Style = csDropDownList
|
||||
TabOrder = 2
|
||||
OnChange = ZdyNameChange
|
||||
Items.Strings = (
|
||||
#22383#24067
|
||||
#21152#24037#21378)
|
||||
end
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 70
|
||||
Width = 1022
|
||||
Height = 509
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
ExplicitHeight = 510
|
||||
object Tv2: TcxGridDBTableView
|
||||
OnDblClick = Tv2DblClick
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
Navigator.Buttons.Delete.Enabled = False
|
||||
Navigator.Buttons.Delete.Visible = False
|
||||
DataController.DataSource = DS_HZ
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.IncSearch = DataLink_TradeManage.SHuangSe
|
||||
Styles.Header = DataLink_TradeManage.handBlack
|
||||
Styles.Inactive = DataLink_TradeManage.SHuangSe
|
||||
Styles.Selection = DataLink_TradeManage.SHuangSe
|
||||
object v2Column6: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#21517#31216
|
||||
DataBinding.FieldName = 'ZdyName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.ReadOnly = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 124
|
||||
end
|
||||
object v2Column2: TcxGridDBColumn
|
||||
Caption = #20379#24212#21830#32534#21495
|
||||
DataBinding.FieldName = 'ZdyCode'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 80
|
||||
end
|
||||
object v2Column8: TcxGridDBColumn
|
||||
Caption = #31867#22411
|
||||
DataBinding.FieldName = 'DEFstr5'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 77
|
||||
end
|
||||
object v2Column3: TcxGridDBColumn
|
||||
Caption = #30005#35805
|
||||
DataBinding.FieldName = 'DEFstr1'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 72
|
||||
end
|
||||
object v2Column4: TcxGridDBColumn
|
||||
Caption = #25163#26426
|
||||
DataBinding.FieldName = 'DEFstr2'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 74
|
||||
end
|
||||
object v2Column5: TcxGridDBColumn
|
||||
Caption = #20256#30495
|
||||
DataBinding.FieldName = 'DEFstr3'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 68
|
||||
end
|
||||
object v2Column7: TcxGridDBColumn
|
||||
Caption = #20844#21496#22320#22336
|
||||
DataBinding.FieldName = 'DEFNote1'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 69
|
||||
end
|
||||
object v2Column9: TcxGridDBColumn
|
||||
Caption = #32852#31995#20154
|
||||
DataBinding.FieldName = 'DEFstr4'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 73
|
||||
end
|
||||
object v2Column1: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 114
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = Tv2
|
||||
end
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_TradeManage.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 789
|
||||
Top = 9
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_TradeManage.ADOLink
|
||||
Parameters = <>
|
||||
Left = 829
|
||||
Top = 1
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_TradeManage.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 949
|
||||
Top = 225
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [rmpbZoom, rmpbLoad, rmpbSave, rmpbPrint, rmpbFind, rmpbPageSetup, rmpbExit, rmpbExport, rmpbNavigator]
|
||||
DefaultCollate = False
|
||||
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||
PreviewOptions.RulerVisible = False
|
||||
PreviewOptions.DrawBorder = False
|
||||
PreviewOptions.BorderPen.Color = clGray
|
||||
PreviewOptions.BorderPen.Style = psDash
|
||||
Dataset = RMDB_Main
|
||||
CompressLevel = rmzcFastest
|
||||
CompressThread = False
|
||||
LaterBuildEvents = True
|
||||
OnlyOwnerDataSet = False
|
||||
Left = 864
|
||||
Top = 224
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
Left = 928
|
||||
Top = 216
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
Grid = cxGrid2
|
||||
PopupMenus = <>
|
||||
Left = 888
|
||||
Top = 224
|
||||
end
|
||||
object DS_HZ: TDataSource
|
||||
DataSet = CDS_HZ
|
||||
Left = 899
|
||||
Top = 235
|
||||
end
|
||||
object CDS_HZ: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 872
|
||||
Top = 224
|
||||
end
|
||||
end
|
||||
205
public10/ThreeFun/Form/U_ZdyAttachGYSHelp.pas
Normal file
205
public10/ThreeFun/Form/U_ZdyAttachGYSHelp.pas
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
unit U_ZdyAttachGYSHelp;
|
||||
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, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, cxNavigator, dxDateRanges, dxBarBuiltInMenu;
|
||||
|
||||
type
|
||||
TfrmZdyAttachGYSHelp = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
Panel1: TPanel;
|
||||
ToolButton2: TToolButton;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ToolButton1: TToolButton;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
Label3: TLabel;
|
||||
ZdyName: TEdit;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
DS_HZ: TDataSource;
|
||||
CDS_HZ: TClientDataSet;
|
||||
ToolButton3: TToolButton;
|
||||
v2Column6: TcxGridDBColumn;
|
||||
v2Column1: TcxGridDBColumn;
|
||||
v2Column2: TcxGridDBColumn;
|
||||
v2Column3: TcxGridDBColumn;
|
||||
v2Column4: TcxGridDBColumn;
|
||||
v2Column5: TcxGridDBColumn;
|
||||
v2Column7: TcxGridDBColumn;
|
||||
v2Column9: TcxGridDBColumn;
|
||||
Label1: TLabel;
|
||||
ZdyCode: TEdit;
|
||||
ToolButton4: TToolButton;
|
||||
v2Column8: TcxGridDBColumn;
|
||||
Label2: TLabel;
|
||||
DEFstr5: TComboBox;
|
||||
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 ZdyNameChange(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure ToolButton3Click(Sender: TObject);
|
||||
procedure Tv2DblClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
procedure InitGrid();
|
||||
|
||||
public
|
||||
fkhType:string;
|
||||
end;
|
||||
|
||||
var
|
||||
frmZdyAttachGYSHelp: TfrmZdyAttachGYSHelp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select * from KH_Zdy_Attachment where Type=''GYS'' and isnull(KHType,'''')='''+trim(fkhType)+'''');
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain,CDS_HZ);
|
||||
SInitCDSData(ADOQueryMain,CDS_HZ);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmZdyAttachGYSHelp:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('供应商资料',Tv2);
|
||||
Close;
|
||||
end;
|
||||
procedure TfrmZdyAttachGYSHelp.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
{ if CDS_HZ.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Trim(CDS_HZ.fieldbyname('ATID').AsString)<>'' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('delete KH_Zdy_Attachment where ATID='''+Trim(CDS_HZ.fieldbyname('ATID').AsString)+'''');
|
||||
sql.Add('delete KH_Zdy where ZdyNo='''+Trim(CDS_HZ.fieldbyname('ATID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
CDS_HZ.Delete;}
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.FormShow(Sender: TObject);
|
||||
begin
|
||||
ReadCxGrid('供应商资料',Tv2);
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS(ADOQueryMain,CDS_HZ);
|
||||
SInitCDSData(ADOQueryMain,CDS_HZ);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.ZdyNameChange(Sender: TObject);
|
||||
begin
|
||||
ToolButton2.Click;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.ToolButton4Click(Sender: TObject);
|
||||
begin
|
||||
{ try
|
||||
frmZdyAttInputGYS:=TfrmZdyAttInputGYS.Create(Application);
|
||||
with frmZdyAttInputGYS do
|
||||
begin
|
||||
FCYID:=Trim(Self.CDS_HZ.fieldbyname('ATID').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttInputGYS.Free;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.ToolButton3Click(Sender: TObject);
|
||||
begin
|
||||
{ try
|
||||
frmZdyAttInputGYS:=TfrmZdyAttInputGYS.Create(Application);
|
||||
with frmZdyAttInputGYS do
|
||||
begin
|
||||
FCYID:='';
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttInputGYS.Free;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachGYSHelp.Tv2DblClick(Sender: TObject);
|
||||
begin
|
||||
if CDS_HZ.IsEmpty then exit;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
331
public10/ThreeFun/Form/U_ZdyAttachmentHelp.dfm
Normal file
331
public10/ThreeFun/Form/U_ZdyAttachmentHelp.dfm
Normal file
|
|
@ -0,0 +1,331 @@
|
|||
object frmZdyAttachmentHelp: TfrmZdyAttachmentHelp
|
||||
Left = 157
|
||||
Top = 76
|
||||
Caption = #23458#25143#36164#26009#31649#29702
|
||||
ClientHeight = 613
|
||||
ClientWidth = 1048
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1048
|
||||
Height = 31
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 59
|
||||
Caption = 'ToolBar1'
|
||||
Color = clSkyBlue
|
||||
DisabledImages = DataLink_TradeManage.ThreeImgList
|
||||
Images = DataLink_TradeManage.ThreeImgList
|
||||
List = True
|
||||
ParentColor = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 9
|
||||
OnClick = TBRafreshClick
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #36807#28388
|
||||
ImageIndex = 59
|
||||
OnClick = ToolButton2Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 126
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 3
|
||||
Visible = False
|
||||
end
|
||||
object ToolButton4: TToolButton
|
||||
Left = 189
|
||||
Top = 0
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 54
|
||||
Visible = False
|
||||
OnClick = ToolButton4Click
|
||||
end
|
||||
object TBDel: TToolButton
|
||||
Left = 248
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 17
|
||||
Visible = False
|
||||
OnClick = TBDelClick
|
||||
end
|
||||
object ToolButton1: TToolButton
|
||||
Left = 311
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986
|
||||
ImageIndex = 53
|
||||
Visible = False
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 374
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 55
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Top = 31
|
||||
Width = 1048
|
||||
Height = 39
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Color = clSkyBlue
|
||||
TabOrder = 1
|
||||
object Label3: TLabel
|
||||
Left = 190
|
||||
Top = 13
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #23458#25143#21517#31216
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 22
|
||||
Top = 13
|
||||
Width = 48
|
||||
Height = 12
|
||||
Caption = #23458#25143#32534#21495
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 350
|
||||
Top = 13
|
||||
Width = 36
|
||||
Height = 12
|
||||
Caption = #19994#21153#21592
|
||||
end
|
||||
object ZdyName: TEdit
|
||||
Tag = 2
|
||||
Left = 238
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 0
|
||||
OnChange = ZdyNameChange
|
||||
end
|
||||
object ZdyCode: TEdit
|
||||
Tag = 2
|
||||
Left = 70
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 1
|
||||
OnChange = ZdyNameChange
|
||||
end
|
||||
object DEFstr5: TEdit
|
||||
Tag = 2
|
||||
Left = 388
|
||||
Top = 9
|
||||
Width = 89
|
||||
Height = 20
|
||||
TabOrder = 2
|
||||
OnChange = ZdyNameChange
|
||||
end
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 70
|
||||
Width = 1048
|
||||
Height = 543
|
||||
Align = alClient
|
||||
TabOrder = 2
|
||||
ExplicitHeight = 544
|
||||
object Tv2: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
Navigator.Buttons.Delete.Enabled = False
|
||||
Navigator.Buttons.Delete.Visible = False
|
||||
OnCellDblClick = Tv2CellDblClick
|
||||
DataController.DataSource = DS_HZ
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsSelection.CellSelect = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.IncSearch = DataLink_TradeManage.SHuangSe
|
||||
Styles.Header = DataLink_TradeManage.handBlack
|
||||
Styles.Inactive = DataLink_TradeManage.SHuangSe
|
||||
Styles.Selection = DataLink_TradeManage.SHuangSe
|
||||
object v2Column2: TcxGridDBColumn
|
||||
Caption = #23458#25143#32534#21495
|
||||
DataBinding.FieldName = 'ZdyCode'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 86
|
||||
end
|
||||
object v2Column6: TcxGridDBColumn
|
||||
Caption = #23458#25143#21517#31216
|
||||
DataBinding.FieldName = 'ZdyName'
|
||||
PropertiesClassName = 'TcxButtonEditProperties'
|
||||
Properties.Buttons = <
|
||||
item
|
||||
Default = True
|
||||
Kind = bkEllipsis
|
||||
end>
|
||||
Properties.ReadOnly = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Focusing = False
|
||||
Width = 127
|
||||
end
|
||||
object v2Column10: TcxGridDBColumn
|
||||
Caption = #19994#21153#21592
|
||||
DataBinding.FieldName = 'DEFstr5'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 56
|
||||
end
|
||||
object v2Column3: TcxGridDBColumn
|
||||
Caption = #30005#35805
|
||||
DataBinding.FieldName = 'DEFstr1'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 71
|
||||
end
|
||||
object v2Column4: TcxGridDBColumn
|
||||
Caption = #25163#26426
|
||||
DataBinding.FieldName = 'DEFstr2'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 74
|
||||
end
|
||||
object v2Column5: TcxGridDBColumn
|
||||
Caption = #20256#30495
|
||||
DataBinding.FieldName = 'DEFstr3'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 68
|
||||
end
|
||||
object v2Column7: TcxGridDBColumn
|
||||
Caption = #20844#21496#22320#22336
|
||||
DataBinding.FieldName = 'DEFNote1'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 67
|
||||
end
|
||||
object v2Column8: TcxGridDBColumn
|
||||
Caption = #21457#36135#22320#22336
|
||||
DataBinding.FieldName = 'DEFNote2'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 72
|
||||
end
|
||||
object v2Column9: TcxGridDBColumn
|
||||
Caption = #32852#31995#20154
|
||||
DataBinding.FieldName = 'DEFstr4'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 73
|
||||
end
|
||||
object v2Column1: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'Note'
|
||||
PropertiesClassName = 'TcxTextEditProperties'
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 165
|
||||
end
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = Tv2
|
||||
end
|
||||
end
|
||||
object ADOQueryTemp: TADOQuery
|
||||
Connection = DataLink_TradeManage.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 789
|
||||
Top = 9
|
||||
end
|
||||
object ADOQueryCmd: TADOQuery
|
||||
Connection = DataLink_TradeManage.ADOLink
|
||||
Parameters = <>
|
||||
Left = 829
|
||||
Top = 1
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_TradeManage.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 949
|
||||
Top = 225
|
||||
end
|
||||
object RM1: TRMGridReport
|
||||
ThreadPrepareReport = True
|
||||
InitialZoom = pzDefault
|
||||
PreviewButtons = [rmpbZoom, rmpbLoad, rmpbSave, rmpbPrint, rmpbFind, rmpbPageSetup, rmpbExit, rmpbExport, rmpbNavigator]
|
||||
DefaultCollate = False
|
||||
SaveReportOptions.RegistryPath = 'Software\ReportMachine\ReportSettings\'
|
||||
PreviewOptions.RulerUnit = rmutScreenPixels
|
||||
PreviewOptions.RulerVisible = False
|
||||
PreviewOptions.DrawBorder = False
|
||||
PreviewOptions.BorderPen.Color = clGray
|
||||
PreviewOptions.BorderPen.Style = psDash
|
||||
Dataset = RMDB_Main
|
||||
CompressLevel = rmzcFastest
|
||||
CompressThread = False
|
||||
LaterBuildEvents = True
|
||||
OnlyOwnerDataSet = False
|
||||
Left = 864
|
||||
Top = 224
|
||||
ReportData = {}
|
||||
end
|
||||
object RMDB_Main: TRMDBDataSet
|
||||
Visible = True
|
||||
Left = 928
|
||||
Top = 216
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
Grid = cxGrid2
|
||||
PopupMenus = <>
|
||||
Left = 888
|
||||
Top = 224
|
||||
end
|
||||
object DS_HZ: TDataSource
|
||||
DataSet = CDS_HZ
|
||||
Left = 899
|
||||
Top = 235
|
||||
end
|
||||
object CDS_HZ: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 872
|
||||
Top = 224
|
||||
end
|
||||
end
|
||||
195
public10/ThreeFun/Form/U_ZdyAttachmentHelp.pas
Normal file
195
public10/ThreeFun/Form/U_ZdyAttachmentHelp.pas
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
unit U_ZdyAttachmentHelp;
|
||||
|
||||
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, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, cxNavigator, dxDateRanges, dxBarBuiltInMenu;
|
||||
|
||||
type
|
||||
TfrmZdyAttachmentHelp = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBRafresh: TToolButton;
|
||||
TBDel: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
ADOQueryTemp: TADOQuery;
|
||||
ADOQueryCmd: TADOQuery;
|
||||
Panel1: TPanel;
|
||||
ToolButton2: TToolButton;
|
||||
ADOQueryMain: TADOQuery;
|
||||
ToolButton1: TToolButton;
|
||||
RM1: TRMGridReport;
|
||||
RMDB_Main: TRMDBDataSet;
|
||||
Label3: TLabel;
|
||||
ZdyName: TEdit;
|
||||
cxGrid2: TcxGrid;
|
||||
Tv2: TcxGridDBTableView;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
DS_HZ: TDataSource;
|
||||
CDS_HZ: TClientDataSet;
|
||||
ToolButton3: TToolButton;
|
||||
v2Column6: TcxGridDBColumn;
|
||||
v2Column1: TcxGridDBColumn;
|
||||
v2Column2: TcxGridDBColumn;
|
||||
v2Column3: TcxGridDBColumn;
|
||||
v2Column4: TcxGridDBColumn;
|
||||
v2Column5: TcxGridDBColumn;
|
||||
v2Column7: TcxGridDBColumn;
|
||||
v2Column8: TcxGridDBColumn;
|
||||
v2Column9: TcxGridDBColumn;
|
||||
Label1: TLabel;
|
||||
ZdyCode: TEdit;
|
||||
v2Column10: TcxGridDBColumn;
|
||||
ToolButton4: TToolButton;
|
||||
Label2: TLabel;
|
||||
DEFstr5: TEdit;
|
||||
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 ZdyNameChange(Sender: TObject);
|
||||
procedure ToolButton4Click(Sender: TObject);
|
||||
procedure Tv2CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
private
|
||||
{ Private declarations }
|
||||
procedure InitGrid();
|
||||
|
||||
public
|
||||
fkhType:string;
|
||||
end;
|
||||
|
||||
var
|
||||
frmZdyAttachmentHelp: TfrmZdyAttachmentHelp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_DataLink,U_RTFun,U_ZDYHelp;
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
|
||||
|
||||
procedure TfrmZdyAttachmentHelp.InitGrid();
|
||||
begin
|
||||
try
|
||||
ADOQueryMain.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
Filtered:=False;
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add(' select * from KH_Zdy_Attachment where Type=''KHName'' ');
|
||||
sql.Add(' and isnull(khType,'''')='+quotedstr(trim(fkhType)));
|
||||
Open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain,CDS_HZ);
|
||||
SInitCDSData(ADOQueryMain,CDS_HZ);
|
||||
finally
|
||||
ADOQueryMain.EnableControls;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmZdyAttachmentHelp.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmZdyAttachmentHelp:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachmentHelp.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachmentHelp.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('客户资料',Tv2,'客户自定义');
|
||||
Close;
|
||||
end;
|
||||
procedure TfrmZdyAttachmentHelp.TBDelClick(Sender: TObject);
|
||||
begin
|
||||
{ if CDS_HZ.IsEmpty then Exit;
|
||||
if Application.MessageBox('确定要删除数据吗?','提示',32+4)<>IDYES then Exit;
|
||||
if Trim(CDS_HZ.fieldbyname('ATID').AsString)<>'' then
|
||||
begin
|
||||
with ADOQueryCmd do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
sql.Add('delete KH_Zdy_Attachment where ATID='''+Trim(CDS_HZ.fieldbyname('ATID').AsString)+'''');
|
||||
sql.Add('delete KH_Zdy where ZdyNo='''+Trim(CDS_HZ.fieldbyname('ATID').AsString)+'''');
|
||||
ExecSQL;
|
||||
end;
|
||||
end;
|
||||
CDS_HZ.Delete; }
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachmentHelp.FormShow(Sender: TObject);
|
||||
begin
|
||||
ReadCxGrid('客户资料',Tv2,'客户自定义');
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachmentHelp.TBRafreshClick(Sender: TObject);
|
||||
begin
|
||||
InitGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachmentHelp.ToolButton2Click(Sender: TObject);
|
||||
begin
|
||||
if ADOQueryMain.Active then
|
||||
begin
|
||||
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
||||
SCreateCDS(ADOQueryMain,CDS_HZ);
|
||||
SInitCDSData(ADOQueryMain,CDS_HZ);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachmentHelp.ZdyNameChange(Sender: TObject);
|
||||
begin
|
||||
ToolButton2.Click;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmZdyAttachmentHelp.ToolButton4Click(Sender: TObject);
|
||||
begin
|
||||
{ try
|
||||
frmZdyAttInput:=TfrmZdyAttInput.Create(Application);
|
||||
with frmZdyAttInput do
|
||||
begin
|
||||
FCYID:=Trim(Self.CDS_HZ.fieldbyname('ATID').AsString);
|
||||
if ShowModal=1 then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmZdyAttInput.Free;
|
||||
end; }
|
||||
end;
|
||||
|
||||
procedure TfrmZdyAttachmentHelp.Tv2CellDblClick(Sender: TcxCustomGridTableView;
|
||||
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
|
||||
AShift: TShiftState; var AHandled: Boolean);
|
||||
begin
|
||||
if CDS_HZ.IsEmpty then exit;
|
||||
ModalResult:=1;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
1944
public10/ThreeFun/Fun/SPCOMM.PAS
Normal file
1944
public10/ThreeFun/Fun/SPCOMM.PAS
Normal file
File diff suppressed because it is too large
Load Diff
45
public10/ThreeFun/Fun/U_AdoFunc.pas
Normal file
45
public10/ThreeFun/Fun/U_AdoFunc.pas
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
unit U_AdoFunc;
|
||||
|
||||
interface
|
||||
uses
|
||||
Windows, SysUtils, Messages, Classes, Controls, StdCtrls, ComCtrls, Forms,
|
||||
ExtCtrls, ComObj, ActiveX, cxMemo, cxButtons, Graphics, IniFiles,
|
||||
Dialogs, Menus, DB, ADODB,Dbclient ;
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
function writeSysLog(AdoCmd:TADOQuery;cds_data:TclientDataSet):boolean;
|
||||
var
|
||||
i:Integer;
|
||||
mfieldName:string;
|
||||
begin
|
||||
result:=false;
|
||||
try
|
||||
with AdoCmd do
|
||||
begin
|
||||
close;
|
||||
sql.clear;
|
||||
sql.add('select * from SY_SysLog where 1=2');
|
||||
open;
|
||||
cds_data.First;
|
||||
while cds_data.eof do
|
||||
begin
|
||||
append;
|
||||
for I := 0 to cds_data.FieldCount-1 do
|
||||
begin
|
||||
FieldByName(mfieldName).value:=cds_data.FieldByName(mfieldName).value ;
|
||||
end;
|
||||
post;
|
||||
|
||||
cds_data.Next;
|
||||
end;
|
||||
|
||||
end;
|
||||
result:=true;
|
||||
except
|
||||
Application.MessageBox('写数据日志时发生错误!','警告信息');
|
||||
end;
|
||||
|
||||
end;
|
||||
end.
|
||||
108
public10/ThreeFun/Fun/U_CompressionFun.pas
Normal file
108
public10/ThreeFun/Fun/U_CompressionFun.pas
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
unit U_CompressionFun;
|
||||
|
||||
interface
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, ShlObj, cxShellCommon, cxControls,
|
||||
cxContainer, cxShellTreeView, cxShellListView, StdCtrls, BtnEdit,
|
||||
OleCtnrs, DB, ADODB,ZLib;
|
||||
|
||||
|
||||
procedure CompressionStream(var ASrcStream:TMemoryStream;ACompressionLevel:Integer = 2);
|
||||
procedure UnCompressionStream(var ASrcStream:TMemoryStream);
|
||||
procedure GetFileInfo(mFile:string;var mfileSize:integer;var CreationTime:tdatetime;var WriteTime:tdatetime);
|
||||
function CovFileDate(Fd:_FileTime):TDateTime;
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
|
||||
procedure GetFileInfo(mFile:string;var mfileSize:integer;var CreationTime:tdatetime;var WriteTime:tdatetime);
|
||||
var
|
||||
vSearchRec: TSearchRec;
|
||||
begin
|
||||
FindFirst(mFile,faAnyFile,vSearchRec);
|
||||
mfileSize:=vSearchRec.Size;
|
||||
CreationTime:=CovFileDate(vSearchRec.FindData.ftCreationTime);//创建时间
|
||||
//vSearchRec.FindData.ftLastAccessTime//访问时间
|
||||
WriteTime:=CovFileDate(vSearchRec.FindData.ftLastWriteTime);//修改时间
|
||||
FindClose(vSearchRec);
|
||||
end;
|
||||
function CovFileDate(Fd:_FileTime):TDateTime;
|
||||
var
|
||||
Tct:_SystemTime;
|
||||
Temp:_FileTime;
|
||||
begin
|
||||
FileTimeToLocalFileTime(Fd,Temp);
|
||||
FileTimeToSystemTime(Temp,Tct);
|
||||
CovFileDate:=SystemTimeToDateTime(Tct);
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
///////压缩流
|
||||
////////////////////////////////////////////////////
|
||||
procedure CompressionStream(var ASrcStream:TMemoryStream;ACompressionLevel:Integer = 2);
|
||||
var
|
||||
nDestStream:TMemoryStream;
|
||||
nTmpStream:TCompressionStream;
|
||||
nCompressionLevel:TCompressionLevel;
|
||||
begin
|
||||
ASrcStream.Position := 0;
|
||||
nDestStream := TMemoryStream.Create;
|
||||
try
|
||||
//级别
|
||||
case ACompressionLevel of
|
||||
0:nCompressionLevel := clNone;
|
||||
1:nCompressionLevel := clFastest;
|
||||
2:nCompressionLevel := clDefault;
|
||||
3:nCompressionLevel := clMax;
|
||||
else
|
||||
nCompressionLevel := clMax;
|
||||
end;
|
||||
//开始压缩
|
||||
nTmpStream := TCompressionStream.Create(nCompressionLevel,nDestStream);
|
||||
try
|
||||
ASrcStream.SaveToStream(nTmpStream);
|
||||
finally
|
||||
nTmpStream.Free;//释放后nDestStream才会有数据
|
||||
end;
|
||||
ASrcStream.Clear;
|
||||
ASrcStream.LoadFromStream(nDestStream);
|
||||
ASrcStream.Position := 0;
|
||||
finally
|
||||
nDestStream.Clear;
|
||||
nDestStream.Free;
|
||||
end;
|
||||
end;
|
||||
////////////////////////////////////////////////////
|
||||
///////解压缩流
|
||||
////////////////////////////////////////////////////
|
||||
procedure UnCompressionStream(var ASrcStream:TMemoryStream);
|
||||
var
|
||||
nTmpStream:TDecompressionStream;
|
||||
nDestStream:TMemoryStream;
|
||||
nBuf: array[1..512] of Byte;
|
||||
nSrcCount: integer;
|
||||
begin
|
||||
ASrcStream.Position := 0;
|
||||
nDestStream := TMemoryStream.Create;
|
||||
nTmpStream := TDecompressionStream.Create(ASrcStream);
|
||||
try
|
||||
repeat
|
||||
//读入实际大小
|
||||
nSrcCount := nTmpStream.Read(nBuf, SizeOf(nBuf));
|
||||
if nSrcCount > 0 then
|
||||
nDestStream.Write(nBuf, nSrcCount);
|
||||
until (nSrcCount = 0);
|
||||
ASrcStream.Clear;
|
||||
ASrcStream.LoadFromStream(nDestStream);
|
||||
ASrcStream.Position := 0;
|
||||
finally
|
||||
nDestStream.Clear;
|
||||
nDestStream.Free;
|
||||
nTmpStream.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
118
public10/ThreeFun/Fun/U_ControlData.pas
Normal file
118
public10/ThreeFun/Fun/U_ControlData.pas
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
unit U_ControlData;
|
||||
|
||||
interface
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, ShlObj, cxShellCommon, cxControls, cxDropDownEdit,
|
||||
cxContainer, cxShellTreeView, cxShellListView, StdCtrls, BtnEdit,
|
||||
OleCtnrs, DB, ADODB,ZLib;
|
||||
|
||||
function InitDevCombobox(ADOQueryTmp: TADOQuery; combobox: TcxCombobox; mFlag: string; selFlag:Boolean=true): Boolean;
|
||||
function InitDevCxGridCombobox(ADOQueryTmp: TADOQuery; ComboBoxProperties: TcxComboBoxProperties; mFlag: string): Boolean;
|
||||
implementation
|
||||
|
||||
/// ////////////////////////////////////////////////
|
||||
// 函数功能:取流水号
|
||||
// mFlag:前缀;mTable:表名
|
||||
// mlen:流水号长度; mtype:是否带日期 1:带 0 不带
|
||||
/// ////////////////////////////////////////////////
|
||||
function InitDevCombobox(ADOQueryTmp: TADOQuery; combobox: TcxCombobox; mFlag: string; selFlag:Boolean=true): Boolean;
|
||||
var
|
||||
defaultValue:string;
|
||||
idx:integer;
|
||||
begin
|
||||
Result := false;
|
||||
try
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select a.* from SY_Dict_Item a');
|
||||
sql.Add(' inner join SY_Dict b on b.dictId=a.dictId');
|
||||
sql.Add(' where b.dictcode='+QuotedStr(mFlag));
|
||||
sql.Add('and a.valid=1 and b.valid=1');
|
||||
sql.Add('order by b.sortorder');
|
||||
Open;
|
||||
|
||||
if IsEmpty then
|
||||
begin
|
||||
application.MessageBox(PWideChar('未定义字段字典数据(' + mFlag + ')'),'',0);
|
||||
Exit;
|
||||
end;
|
||||
combobox.Properties.BeginUpdate;
|
||||
combobox.Properties.Items.Clear;
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
combobox.Properties.Items.Add(trim(FieldByName('itemText').AsString));
|
||||
if (findField('default_Sel_flag')<>nil) and FieldByName('default_Sel_flag').AsBoolean then
|
||||
defaultValue:= trim(FieldByName('itemText').AsString) ;
|
||||
next;
|
||||
end;
|
||||
if selFlag and (combobox.Properties.Items.Count>0) then
|
||||
begin
|
||||
combobox.ItemIndex:=0;
|
||||
end;
|
||||
|
||||
if (defaultValue<>'') and (combobox.Properties.Items.Count>0) then
|
||||
begin
|
||||
idx:= combobox.Properties.Items.IndexOf(defaultValue) ;
|
||||
if idx>=0 then
|
||||
combobox.ItemIndex:=idx;
|
||||
end;
|
||||
|
||||
combobox.Properties.EndUpdate();
|
||||
end;
|
||||
|
||||
except
|
||||
|
||||
raise Exception.Create(PWideChar('获取字段字典数据(' + mFlag + ')时,发生错误!'));
|
||||
|
||||
end;
|
||||
end;
|
||||
////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////
|
||||
///
|
||||
function InitDevCxGridCombobox(ADOQueryTmp: TADOQuery; ComboBoxProperties: TcxComboBoxProperties; mFlag: string): Boolean;
|
||||
var
|
||||
defaultValue:string;
|
||||
idx:integer;
|
||||
begin
|
||||
Result := false;
|
||||
try
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select a.itemText from SY_Dict_Item a');
|
||||
sql.Add(' inner join SY_Dict b on b.dictId=a.dictId');
|
||||
sql.Add(' where b.dictcode='+QuotedStr(mFlag));
|
||||
sql.Add('and a.valid=1 and b.valid=1');
|
||||
sql.Add('order by b.sortorder');
|
||||
Open;
|
||||
|
||||
if IsEmpty then
|
||||
begin
|
||||
application.MessageBox(PWideChar('未定义字段字典数据(' + mFlag + ')'),'',0);
|
||||
Exit;
|
||||
end;
|
||||
ComboBoxProperties.Items.Clear;
|
||||
first;
|
||||
while not eof do
|
||||
begin
|
||||
ComboBoxProperties.Items.Add(trim(FieldByName('itemText').AsString));
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
// if (defaultValue<>'') and (ComboBoxProperties.Items.Count>0) then
|
||||
// begin
|
||||
// ComboBoxProperties.de:=defaultValue ;
|
||||
// end;
|
||||
|
||||
except
|
||||
|
||||
raise Exception.Create(PWideChar('获取字段字典数据(' + mFlag + ')时,发生错误!'));
|
||||
|
||||
end;
|
||||
end;
|
||||
end.
|
||||
4041
public10/ThreeFun/Fun/U_Fun.pas
Normal file
4041
public10/ThreeFun/Fun/U_Fun.pas
Normal file
File diff suppressed because it is too large
Load Diff
38
public10/ThreeFun/Fun/U_Fun10.cfg
Normal file
38
public10/ThreeFun/Fun/U_Fun10.cfg
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
-$A8
|
||||
-$B-
|
||||
-$C+
|
||||
-$D+
|
||||
-$E-
|
||||
-$F-
|
||||
-$G+
|
||||
-$H+
|
||||
-$I+
|
||||
-$J-
|
||||
-$K-
|
||||
-$L+
|
||||
-$M-
|
||||
-$N+
|
||||
-$O+
|
||||
-$P+
|
||||
-$Q-
|
||||
-$R-
|
||||
-$S-
|
||||
-$T-
|
||||
-$U-
|
||||
-$V+
|
||||
-$W-
|
||||
-$X+
|
||||
-$YD
|
||||
-$Z1
|
||||
-cg
|
||||
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
-H+
|
||||
-W+
|
||||
-M
|
||||
-$M16384,1048576
|
||||
-K$00400000
|
||||
-LE"d:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||
-LN"d:\program files (x86)\borland\delphi7\Projects\Bpl"
|
||||
-w-UNSAFE_TYPE
|
||||
-w-UNSAFE_CODE
|
||||
-w-UNSAFE_CAST
|
||||
136
public10/ThreeFun/Fun/U_Fun10.dof
Normal file
136
public10/ThreeFun/Fun/U_Fun10.dof
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
[FileVersion]
|
||||
Version=7.0
|
||||
[Compiler]
|
||||
A=8
|
||||
B=0
|
||||
C=1
|
||||
D=1
|
||||
E=0
|
||||
F=0
|
||||
G=1
|
||||
H=1
|
||||
I=1
|
||||
J=0
|
||||
K=0
|
||||
L=1
|
||||
M=0
|
||||
N=1
|
||||
O=1
|
||||
P=1
|
||||
Q=0
|
||||
R=0
|
||||
S=0
|
||||
T=0
|
||||
U=0
|
||||
V=1
|
||||
W=0
|
||||
X=1
|
||||
Y=1
|
||||
Z=1
|
||||
ShowHints=1
|
||||
ShowWarnings=1
|
||||
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
NamespacePrefix=
|
||||
SymbolDeprecated=1
|
||||
SymbolLibrary=1
|
||||
SymbolPlatform=1
|
||||
UnitLibrary=1
|
||||
UnitPlatform=1
|
||||
UnitDeprecated=1
|
||||
HResultCompat=1
|
||||
HidingMember=1
|
||||
HiddenVirtual=1
|
||||
Garbage=1
|
||||
BoundsError=1
|
||||
ZeroNilCompat=1
|
||||
StringConstTruncated=1
|
||||
ForLoopVarVarPar=1
|
||||
TypedConstVarPar=1
|
||||
AsgToTypedConst=1
|
||||
CaseLabelRange=1
|
||||
ForVariable=1
|
||||
ConstructingAbstract=1
|
||||
ComparisonFalse=1
|
||||
ComparisonTrue=1
|
||||
ComparingSignedUnsigned=1
|
||||
CombiningSignedUnsigned=1
|
||||
UnsupportedConstruct=1
|
||||
FileOpen=1
|
||||
FileOpenUnitSrc=1
|
||||
BadGlobalSymbol=1
|
||||
DuplicateConstructorDestructor=1
|
||||
InvalidDirective=1
|
||||
PackageNoLink=1
|
||||
PackageThreadVar=1
|
||||
ImplicitImport=1
|
||||
HPPEMITIgnored=1
|
||||
NoRetVal=1
|
||||
UseBeforeDef=1
|
||||
ForLoopVarUndef=1
|
||||
UnitNameMismatch=1
|
||||
NoCFGFileFound=1
|
||||
MessageDirective=1
|
||||
ImplicitVariants=1
|
||||
UnicodeToLocale=1
|
||||
LocaleToUnicode=1
|
||||
ImagebaseMultiple=1
|
||||
SuspiciousTypecast=1
|
||||
PrivatePropAccessor=1
|
||||
UnsafeType=0
|
||||
UnsafeCode=0
|
||||
UnsafeCast=0
|
||||
[Linker]
|
||||
MapFile=0
|
||||
OutputObjs=0
|
||||
ConsoleApp=1
|
||||
DebugInfo=0
|
||||
RemoteSymbols=0
|
||||
MinStackSize=16384
|
||||
MaxStackSize=1048576
|
||||
ImageBase=4194304
|
||||
ExeDescription=
|
||||
[Directories]
|
||||
OutputDir=
|
||||
UnitOutputDir=
|
||||
PackageDLLOutputDir=
|
||||
PackageDCPOutputDir=
|
||||
SearchPath=
|
||||
Packages=
|
||||
Conditionals=
|
||||
DebugSourceDirs=
|
||||
UsePackages=0
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
Launcher=
|
||||
UseLauncher=0
|
||||
DebugCWD=
|
||||
[Language]
|
||||
ActiveLang=
|
||||
ProjectLang=
|
||||
RootDir=
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=2052
|
||||
CodePage=936
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
3326
public10/ThreeFun/Fun/U_Fun10.pas
Normal file
3326
public10/ThreeFun/Fun/U_Fun10.pas
Normal file
File diff suppressed because it is too large
Load Diff
124
public10/ThreeFun/Fun/U_PublicFunction.pas
Normal file
124
public10/ThreeFun/Fun/U_PublicFunction.pas
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
unit U_PublicFunction;
|
||||
interface
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, StdCtrls, BtnEdit, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit,DBGrids, DB, cxDBData,
|
||||
cxGridLevel, cxClasses, cxControls, cxGridCustomView, ADODB,StrUtils,
|
||||
Midas,cxGridCustomTableView, cxGridTableView, cxGridDBTableView,cxTimeEdit,
|
||||
cxGrid,cxDBLookupComboBox,cxCalendar, cxCurrencyEdit,cxGridExportLink,
|
||||
ExtCtrls, Buttons,DBClient,RTComboBox,cxDropDownEdit,CXmemo;
|
||||
|
||||
function GetMaxBh(ADOQueryTmp:TADOQuery;
|
||||
var mMaxBh:string;
|
||||
mBhType:string;
|
||||
mFlag:string;
|
||||
mStatus:string;
|
||||
lsLen:integer=3):Boolean;
|
||||
procedure CreateAdoToCds(Ado1:TADOQuery; Cds1:TclientDataSet );
|
||||
procedure InitAdoToCds(Ado1:TADOQuery;Cds1:TclientDataSet);
|
||||
implementation
|
||||
|
||||
function GetMaxBh(ADOQueryTmp:TADOQuery;
|
||||
var mMaxBh:string;
|
||||
mBhType:string;
|
||||
mFlag:string;
|
||||
mStatus:string;
|
||||
lsLen:integer=3):Boolean;
|
||||
begin
|
||||
try
|
||||
with ADOQueryTmp do
|
||||
begin
|
||||
Close;
|
||||
sql.Clear ;
|
||||
sql.Add(' exec Get_SY_MaxBH ');
|
||||
sql.Add(' @BHstr='+quotedstr(mFlag));
|
||||
sql.Add(',@BHType='+quotedStr(mBhType));
|
||||
sql.Add(',@Len='+inttostr(LsLen));
|
||||
sql.Add(',@status='+quotedStr(mStatus));
|
||||
Open;
|
||||
|
||||
if RecordCount>0 then
|
||||
begin
|
||||
mMaxBh:=trim(fieldByName('MaxBH').AsString) ;
|
||||
if mMaxBh<>'' then
|
||||
result:=true
|
||||
else
|
||||
Result:=false;
|
||||
end
|
||||
else
|
||||
begin
|
||||
result:=false;
|
||||
end;
|
||||
|
||||
end;
|
||||
if not Result then
|
||||
application.MessageBox(Pchar('无法生成自动编号('+mflag+')'),'提示信息',MB_ICONINFORMATION);
|
||||
|
||||
Except
|
||||
result:=false;
|
||||
application.MessageBox(Pchar('无法生成自动编号('+mflag+')'),'提示信息',MB_ICONINFORMATION);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure CreateAdoToCds(Ado1:TADOQuery; Cds1:TclientDataSet );
|
||||
var
|
||||
i:integer;
|
||||
mfieldName:string;
|
||||
mSize:integer;
|
||||
begin
|
||||
mfieldName:='';
|
||||
Cds1.FieldDefs.Clear;
|
||||
with Ado1 do
|
||||
begin
|
||||
for i:=0 to fieldCount-1 do //
|
||||
begin
|
||||
if (Fields[i].DataType=ftString) and (Fields[i].Size=0) then
|
||||
begin
|
||||
msize:=1;
|
||||
end
|
||||
else
|
||||
msize:=Fields[i].Size;
|
||||
mfieldName:=trim(fields[i].FieldName);
|
||||
Cds1.FieldDefs.Add(mfieldName,Fields[i].DataType,msize);
|
||||
end;
|
||||
end;
|
||||
Cds1.FieldDefs.Add('flag',ftString,1);
|
||||
Cds1.FieldDefs.Add('index',ftInteger,0);
|
||||
Cds1.Close;
|
||||
Cds1.CreateDataSet;
|
||||
end;
|
||||
procedure InitAdoToCds(Ado1:TADOQuery;Cds1:TclientDataSet);
|
||||
var
|
||||
i:integer;
|
||||
k:integer;
|
||||
begin
|
||||
Ado1.DisableControls;
|
||||
Cds1.DisableControls;
|
||||
Ado1.first;
|
||||
K:=1;
|
||||
while not Ado1.Eof do
|
||||
begin
|
||||
with Cds1 do
|
||||
begin
|
||||
Append;
|
||||
for i:=0 to Ado1.FieldCount-1 do
|
||||
begin
|
||||
fields[i].value:=Ado1.Fields[i].Value ;
|
||||
end;
|
||||
fieldByName('flag').AsString :='1';
|
||||
fieldByName('index').value :=k;
|
||||
inc(k);
|
||||
Post;
|
||||
end;
|
||||
Ado1.Next;
|
||||
end;
|
||||
if not Cds1.IsEmpty then
|
||||
begin
|
||||
Cds1.First ;
|
||||
end;
|
||||
Ado1.EnableControls;
|
||||
Cds1.EnableControls;
|
||||
end;
|
||||
|
||||
end.
|
||||
84
public10/ThreeFun/Fun/U_RPFun.pas
Normal file
84
public10/ThreeFun/Fun/U_RPFun.pas
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
unit U_RPFun;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ComCtrls, ToolWin, StdCtrls, BtnEdit, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DBGrids, DB, cxDBData,
|
||||
cxGridLevel, cxClasses, cxControls, cxGridCustomView, ADODB, StrUtils, Midas,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxTimeEdit,
|
||||
cxTreeView, cxGrid, cxDBLookupComboBox, cxCalendar, cxCurrencyEdit,
|
||||
cxGridExportLink, ExtCtrls, Buttons, DBClient, RTComboBox, cxDropDownEdit,
|
||||
cxGridBandedTableView, cxGridDBBandedTableView, cxRichEdit, cxButtonEdit,
|
||||
IniFiles, WinSock, IdHTTP, dxcore, cxTextEdit, FireDAC.Comp.Client, cxCheckBox,
|
||||
Vcl.Clipbrd, cxMemo, dxLayoutControl;
|
||||
|
||||
function FromPrintFr3(App: Tapplication; DataBaseStr: PChar; JsonArgs: PChar): PChar;
|
||||
|
||||
function FunPrintFr3(App: Tapplication; DataBaseStr: PChar; JsonArgs: PChar): PChar;
|
||||
|
||||
implementation
|
||||
|
||||
function FromPrintFr3(App: Tapplication; DataBaseStr: PChar; JsonArgs: PChar): PChar;
|
||||
type
|
||||
TMyFunc = function(App: Tapplication; FormID: integer; Title: PChar; DataBaseStr: PChar; JsonArgs: PChar): PChar; stdcall;
|
||||
var
|
||||
Tf: TMyFunc;
|
||||
Tp: TFarProc;
|
||||
Th: Thandle;
|
||||
JsonResult: PChar;
|
||||
begin
|
||||
Th := LoadLibrary('ReportPrint.dll');
|
||||
if Th > 0 then
|
||||
begin
|
||||
Tp := GetProcAddress(Th, 'GetDllForm');
|
||||
if Tp <> nil then
|
||||
begin
|
||||
Tf := TMyFunc(Tp);
|
||||
JsonResult := Tf(Application, 11, 'FR3报表', DataBaseStr, JsonArgs);
|
||||
end
|
||||
else
|
||||
begin
|
||||
JsonResult := '{"succsee":false,"message": "读取调用号异常"}';
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
JsonResult := '{"succsee":false,"message": "找不到ReportPrint.dll"}';
|
||||
end;
|
||||
Result := JsonResult;
|
||||
end;
|
||||
|
||||
function FunPrintFr3(App: Tapplication; DataBaseStr: PChar; JsonArgs: PChar): PChar;
|
||||
type
|
||||
TMyFunc = function(App: Tapplication; FormID: integer; Title: PChar; DataBaseStr: PChar; JsonArgs: PChar): PChar; stdcall;
|
||||
var
|
||||
Tf: TMyFunc;
|
||||
Tp: TFarProc;
|
||||
Th: Thandle;
|
||||
JsonResult: PChar;
|
||||
begin
|
||||
Th := LoadLibrary('ReportPrint.dll');
|
||||
if Th > 0 then
|
||||
begin
|
||||
Tp := GetProcAddress(Th, 'GetDllForm');
|
||||
if Tp <> nil then
|
||||
begin
|
||||
Tf := TMyFunc(Tp);
|
||||
JsonResult := Tf(Application, 12, 'FR3报表', DataBaseStr, JsonArgs);
|
||||
end
|
||||
else
|
||||
begin
|
||||
JsonResult := '{"succsee":false,"message": "读取调用号异常"}';
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
JsonResult := '{"succsee":false,"message": "找不到ReportPrint.dll"}';
|
||||
end;
|
||||
Result := JsonResult;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
4026
public10/ThreeFun/Fun/U_RTFun.pas
Normal file
4026
public10/ThreeFun/Fun/U_RTFun.pas
Normal file
File diff suppressed because it is too large
Load Diff
2038
public10/ThreeFun/Fun/U_RTFun1024.pas
Normal file
2038
public10/ThreeFun/Fun/U_RTFun1024.pas
Normal file
File diff suppressed because it is too large
Load Diff
2131
public10/ThreeFun/Fun/U_RTFun1112.pas
Normal file
2131
public10/ThreeFun/Fun/U_RTFun1112.pas
Normal file
File diff suppressed because it is too large
Load Diff
104
public10/ThreeFun/Fun/U_SelExportField.dfm
Normal file
104
public10/ThreeFun/Fun/U_SelExportField.dfm
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
object frmSelExportField: TfrmSelExportField
|
||||
Left = 206
|
||||
Top = 131
|
||||
BorderStyle = bsDialog
|
||||
Caption = #23383#27573#23548#20986#36873#25321
|
||||
ClientHeight = 491
|
||||
ClientWidth = 423
|
||||
Color = clBtnFace
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 12
|
||||
object Button1: TButton
|
||||
Left = 94
|
||||
Top = 456
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = #30830#23450
|
||||
TabOrder = 0
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 243
|
||||
Top = 456
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = #20851#38381
|
||||
TabOrder = 1
|
||||
OnClick = Button2Click
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 329
|
||||
Top = 151
|
||||
Width = 200
|
||||
Height = 162
|
||||
TabOrder = 2
|
||||
Visible = False
|
||||
object ExpGrid: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
DataController.DataSource = ExportDataSource
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.AlwaysShowEditor = True
|
||||
OptionsView.GroupByBox = False
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = ExpGrid
|
||||
end
|
||||
end
|
||||
object Panel2: TScrollBox
|
||||
Left = 2
|
||||
Top = 0
|
||||
Width = 423
|
||||
Height = 438
|
||||
HorzScrollBar.Visible = False
|
||||
Color = clSkyBlue
|
||||
ParentColor = False
|
||||
TabOrder = 3
|
||||
object Label4: TLabel
|
||||
Left = 158
|
||||
Top = 9
|
||||
Width = 60
|
||||
Height = 14
|
||||
Caption = #23383#27573#36873#25321
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -14
|
||||
Font.Name = #23435#20307
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
end
|
||||
object CheckBox1: TCheckBox
|
||||
Left = 20
|
||||
Top = 449
|
||||
Width = 49
|
||||
Height = 17
|
||||
Caption = #20840#36873
|
||||
TabOrder = 4
|
||||
OnClick = CheckBox1Click
|
||||
end
|
||||
object CheckBox2: TCheckBox
|
||||
Left = 20
|
||||
Top = 465
|
||||
Width = 49
|
||||
Height = 17
|
||||
Caption = #20840#24323
|
||||
TabOrder = 5
|
||||
OnClick = CheckBox2Click
|
||||
end
|
||||
object ExportDataSource: TDataSource
|
||||
Left = 424
|
||||
Top = 233
|
||||
end
|
||||
end
|
||||
278
public10/ThreeFun/Fun/U_SelExportField.pas
Normal file
278
public10/ThreeFun/Fun/U_SelExportField.pas
Normal file
|
|
@ -0,0 +1,278 @@
|
|||
unit U_SelExportField;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, RM_FormReport, RM_PDBGrid,
|
||||
DB,IniFiles, RM_Common, RM_Class, RM_e_Xls, cxStyles, cxCustomData,
|
||||
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData,
|
||||
cxGridLevel, cxClasses, cxControls, cxGridCustomView,
|
||||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGrid,
|
||||
cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters,
|
||||
cxNavigator, dxDateRanges;
|
||||
|
||||
type
|
||||
TfrmSelExportField = class(TForm)
|
||||
Button1: TButton;
|
||||
Button2: TButton;
|
||||
ExportDataSource: TDataSource;
|
||||
ExpGrid: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid1: TcxGrid;
|
||||
Panel2: TScrollBox;
|
||||
Label4: TLabel;
|
||||
CheckBox1: TCheckBox;
|
||||
CheckBox2: TCheckBox;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure CheckBox1Click(Sender: TObject);
|
||||
procedure CheckBox2Click(Sender: TObject);
|
||||
private
|
||||
procedure CreateCheckBox();
|
||||
procedure ExportData();
|
||||
procedure ReadINIFile(fieldname:string);
|
||||
procedure WriteINIFile(fieldname:string);
|
||||
Function IsINIFile(fieldname:string):Boolean;
|
||||
procedure GetExportFields();
|
||||
procedure IsCheck();
|
||||
{ Private declarations }
|
||||
public
|
||||
ExportFields,IniName:string;
|
||||
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmSelExportField: TfrmSelExportField;
|
||||
|
||||
implementation
|
||||
|
||||
uses U_Fun;
|
||||
|
||||
{$R *.dfm}
|
||||
procedure TfrmSelExportField.CreateCheckBox();
|
||||
var
|
||||
i,j,FTop,FLeft,Fdiv,FMod,z:Integer;// mod 余数,div商
|
||||
FCheckBox:TCheckBox;
|
||||
begin
|
||||
z:=0;
|
||||
for i:=0 to ExpGrid.ColumnCount-1 do
|
||||
begin
|
||||
if ExpGrid.Columns[i].Visible=True then
|
||||
begin
|
||||
Fdiv:=(z+1) div 3;
|
||||
FMod:=(z+1) mod 3;
|
||||
FCheckBox:=TCheckBox.Create(Self);
|
||||
FCheckBox.Caption:=Trim(ExpGrid.Columns[i].Caption);
|
||||
FCheckBox.Tag:=i;
|
||||
FCheckBox.Parent:=Panel2;
|
||||
FCheckBox.Checked:=True;
|
||||
if FMod>0 then
|
||||
FCheckBox.Top:=36*(Fdiv+1)
|
||||
else
|
||||
FCheckBox.Top:=36*Fdiv;
|
||||
if FMod=1 then
|
||||
FCheckBox.Left:=29
|
||||
else if FMod=2 then
|
||||
FCheckBox.Left:=163
|
||||
else if FMod=0 then
|
||||
FCheckBox.Left:=305;
|
||||
z:=z+1;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.Button1Click(Sender: TObject);
|
||||
begin
|
||||
//ShowMessage('10除以3取余'+inttostr(10 mod 3)+',取整'+inttostr(10 div 3));
|
||||
ExportData();
|
||||
GetExportFields();
|
||||
if IsINIFile(IniName)=True then
|
||||
begin
|
||||
DeleteFile(IniName);
|
||||
end;
|
||||
WriteINIFile(IniName);
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.FormClose(Sender: TObject;
|
||||
var Action: TCloseAction);
|
||||
begin
|
||||
Action:=caFree;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
frmSelExportField:=nil;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.FormShow(Sender: TObject);
|
||||
begin
|
||||
CreateCheckBox();
|
||||
ReadINIFile(IniName);
|
||||
IsCheck();
|
||||
end;
|
||||
procedure TfrmSelExportField.IsCheck();
|
||||
var
|
||||
i:Integer;
|
||||
fsj:string;
|
||||
begin
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
fsj:=Trim(TCheckBox(Controls[i]).Caption);
|
||||
if Pos(fsj,ExportFields)>0 then
|
||||
TCheckBox(Controls[i]).Checked:=True
|
||||
else
|
||||
TCheckBox(Controls[i]).Checked:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.ExportData();
|
||||
var
|
||||
i,j:Integer;
|
||||
begin
|
||||
j:=0;
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if TCheckBox(Controls[i]).Checked=True then
|
||||
begin
|
||||
j:=1;
|
||||
ExpGrid.Columns[TCheckBox(Controls[i]).Tag].Visible:=True
|
||||
end else
|
||||
begin
|
||||
ExpGrid.Columns[TCheckBox(Controls[i]).Tag].Visible:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
TcxGridToExcel(Trim(IniName),cxGrid1);
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmSelExportField.Button2Click(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.ReadINIFile(fieldname:string);
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
FName:string;
|
||||
begin
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldExportSet\' +trim(fieldname)+'.INI';
|
||||
programIni:=Tinifile.create(FName);
|
||||
ExportFields:=programIni.ReadString('导出设置','导出字段','');
|
||||
programIni.Free;
|
||||
end;
|
||||
procedure TfrmSelExportField.GetExportFields();
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
ExportFields:='Begin';
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if TCheckBox(Controls[i]).Checked then
|
||||
begin
|
||||
ExportFields:=ExportFields+'/'+TCheckBox(Controls[i]).Caption;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//写设置信息到INI文件
|
||||
//参数
|
||||
//////////////////////////////////////////////////////////////////
|
||||
procedure TfrmSelExportField.WriteINIFile(fieldname:string);
|
||||
var
|
||||
programIni:Tinifile; //配置文件名
|
||||
FName:string;
|
||||
begin
|
||||
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldExportSet\'+trim(fieldname)+'.INI';
|
||||
if not DirectoryExists(ExtractFileDir(FName)) then
|
||||
CreateDir(ExtractFileDir(FName));
|
||||
programIni:=Tinifile.create(FName);
|
||||
programIni.WriteString('导出设置','导出字段',ExportFields);
|
||||
programIni.Free;
|
||||
end;
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//判断InI文件是否存在
|
||||
//////////////////////////////////////////////////////////////////
|
||||
Function TfrmSelExportField.IsINIFile(fieldname:string):Boolean;
|
||||
var
|
||||
FName:string;
|
||||
begin
|
||||
FName:=ExtractFilePath(Application.ExeName)+'FieldExportSet\'+trim(fieldname)+'.INI';
|
||||
if FileExists(FName) then
|
||||
Result:=True
|
||||
else
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.CheckBox1Click(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
if CheckBox1.Checked then
|
||||
begin
|
||||
CheckBox2.Checked:=False;
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if (TCheckBox(Controls[i]).Name<>'CheckBox1') and (TCheckBox(Controls[i]).Name<>'CheckBox2') then
|
||||
begin
|
||||
TCheckBox(Controls[i]).Checked:=True;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmSelExportField.CheckBox2Click(Sender: TObject);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
if CheckBox2.Checked then
|
||||
begin
|
||||
CheckBox1.Checked:=False;
|
||||
with Panel2 do
|
||||
begin
|
||||
for i:=0 to Panel2.ControlCount-1 do
|
||||
begin
|
||||
if Controls[i] is TCheckBox then
|
||||
begin
|
||||
if (TCheckBox(Controls[i]).Name<>'CheckBox1') and (TCheckBox(Controls[i]).Name<>'CheckBox2') then
|
||||
begin
|
||||
TCheckBox(Controls[i]).Checked:=False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
86
public10/ThreeFun/Fun/U_dynamicsDll.pas
Normal file
86
public10/ThreeFun/Fun/U_dynamicsDll.pas
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
unit U_dynamicsDll;
|
||||
|
||||
interface
|
||||
uses
|
||||
Windows, Messages, SysUtils,Dialogs, Variants, Classes,Forms;
|
||||
|
||||
function showFr3LableForm(userCode:string;userName:string;connStr:string;title:string):integer;
|
||||
function showRmfLableForm(userCode:string;userName:string;connStr:string;title:string):integer;
|
||||
var
|
||||
newh: hwnd;
|
||||
|
||||
implementation
|
||||
|
||||
//显示reportMachine标签串口 userCode :用户编号;userName:用户名称 connstr:数据库连接串; titile:串口标签
|
||||
// fast report 返回值标签recid 记录号 1
|
||||
function showRmfLableForm(userCode:string;userName:string;connStr:string;title:string):integer;
|
||||
type
|
||||
TMyFunc = function(App: Tapplication; FormH: hwnd; FormID: integer; Language: integer; WinStyle: integer; GCode: Pchar; GName: Pchar; DataBase: Pchar; Title: PChar; Parameters1: PChar; Parameters2: PChar; Parameters3: PChar; Parameters4: PChar; Parameters5: PChar; Parameters6: PChar; Parameters7: PChar; Parameters8: PChar; Parameters9: PChar; Parameters10: PChar; DataBaseStr: PChar): hwnd; stdcall;
|
||||
var
|
||||
Tf: TMyFunc;
|
||||
Tp: TFarProc;
|
||||
Th: Thandle;
|
||||
begin
|
||||
result:=0;
|
||||
Th := LoadLibrary('labelDesign.dll');
|
||||
if Th > 0 then
|
||||
begin
|
||||
try
|
||||
Tp := GetProcAddress(Th, 'GetDllForm');
|
||||
if Tp <> nil then
|
||||
begin
|
||||
Tf := TMyFunc(Tp);
|
||||
result := Tf(Application, 0, 1, 0, 0, PChar(userCode), PChar(userName), PChar(''), PChar(title), PChar(''), PChar(''), '', '', '', '', '', '', '', '', PChar(connStr));
|
||||
end
|
||||
else
|
||||
begin
|
||||
ShowMessage('打印执行错误');
|
||||
end;
|
||||
finally
|
||||
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
ShowMessage('找不到labelDesign.dll' );
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
//显示fr3标签串口 userCode :用户编号;userName:用户名称 connstr:数据库连接串; titile:串口标签
|
||||
// fast report 返回值标签recid 记录号 10
|
||||
function showFr3LableForm(userCode:string;userName:string;connStr:string;title:string):integer;
|
||||
type
|
||||
TMyFunc = function(App: Tapplication; FormH: hwnd; FormID: integer; Language: integer; WinStyle: integer; GCode: Pchar; GName: Pchar; DataBase: Pchar; Title: PChar; Parameters1: PChar; Parameters2: PChar; Parameters3: PChar; Parameters4: PChar; Parameters5: PChar; Parameters6: PChar; Parameters7: PChar; Parameters8: PChar; Parameters9: PChar; Parameters10: PChar; DataBaseStr: PChar): hwnd; stdcall;
|
||||
var
|
||||
Tf: TMyFunc;
|
||||
Tp: TFarProc;
|
||||
Th: Thandle;
|
||||
begin
|
||||
result:=0;
|
||||
Th := LoadLibrary('labelDesign.dll');
|
||||
if Th > 0 then
|
||||
begin
|
||||
try
|
||||
Tp := GetProcAddress(Th, 'GetDllForm');
|
||||
if Tp <> nil then
|
||||
begin
|
||||
Tf := TMyFunc(Tp);
|
||||
result := Tf(Application, 0, 10, 0, 0, PChar(userCode), PChar(userName), PChar(''), PChar(title), PChar(''), PChar(''), '', '', '', '', '', '', '', '', pchar(connStr));
|
||||
end
|
||||
else
|
||||
begin
|
||||
ShowMessage('打印执行错误');
|
||||
end;
|
||||
finally
|
||||
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
ShowMessage('找不到labelDesign.dll' );
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
30
public10/ThreeFun/Fun/U_getDogServer.pas
Normal file
30
public10/ThreeFun/Fun/U_getDogServer.pas
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
unit U_getDogServer;
|
||||
|
||||
interface
|
||||
uses
|
||||
SysUtils,Windows,IniFiles,StrUtils;
|
||||
|
||||
|
||||
function GetLink(H: THandle;var ADOConnString:PAnsiChar):Integer;stdcall; external 'PUBLICDLL.DLL';
|
||||
|
||||
function GetLinkDog(H: THandle;var ADOConnString:string):Integer;
|
||||
implementation
|
||||
|
||||
|
||||
function GetLinkDog(H: THandle;var ADOConnString:string):Integer;
|
||||
var
|
||||
str1:string;
|
||||
Pstr1: PChar;
|
||||
begin
|
||||
try
|
||||
SetLength(str1,255);
|
||||
pstr1:=pchar(str1);
|
||||
result:= GetLink(H,pstr1);
|
||||
ADOConnString:=trim(pstr1);
|
||||
finally
|
||||
SetLength(str1,0);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
71
public10/ThreeFun/Fun/U_printPdf.pas
Normal file
71
public10/ThreeFun/Fun/U_printPdf.pas
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
unit U_printPdf;
|
||||
interface
|
||||
uses
|
||||
Windows,forms;
|
||||
// formId =1 功能id
|
||||
//mRecid='文件表记录号'
|
||||
//printNumber=1 打印份数
|
||||
//printFlag=1 '打印预览;0立即打印
|
||||
//DataBaseStr
|
||||
function printPdf(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;mRecid:PChar;printNumber:Integer;printFlag:Integer;printer:integer;DataBaseStr:PChar):hwnd;stdcall;external 'pdfPrint.dll' Name 'GetDllForm' ;
|
||||
// formId =1 功能id
|
||||
//mRecid='文件表记录号'
|
||||
//printNumber=1 打印份数
|
||||
//printFlag=1 '打印预览;0立即打印
|
||||
//DataBaseStr
|
||||
function printReport(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;mRecid:PChar;printNumber:Integer;printFlag:Integer;printer:integer;DataBaseStr:PChar):hwnd;stdcall;external 'pdfPrint.dll' Name 'GetDllForm' ;
|
||||
// formId =1 功能id
|
||||
//mRecid='文件表记录号'
|
||||
//exportFileType=1 导出文件类型 pdf ,bmp ,jpg
|
||||
//DataBaseStr
|
||||
//返回结果,保存文件的记录号 主键
|
||||
function exportFile(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;mRecid:PChar;exportFileType:PChar;DataBaseStr:PChar):hwnd;stdcall;external 'pdfPrint.dll' Name 'ExportFile' ;
|
||||
|
||||
function printPdf1(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;mRecid:PChar;printNumber:Integer;printFlag:Integer;printer:integer;DataBaseStr:PChar):hwnd;
|
||||
|
||||
var
|
||||
newh:hwnd;
|
||||
implementation
|
||||
|
||||
|
||||
function printPdf1(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;mRecid:PChar;printNumber:Integer;printFlag:Integer;printer:integer;DataBaseStr:PChar):hwnd;
|
||||
type
|
||||
TMyFunc = function(App:Tapplication; FormID:integer;Title:PChar; GCode: PChar; GName: PChar;
|
||||
mRecid:PChar;printNumber:Integer;printFlag:Integer;printer:integer;DataBaseStr:PChar):hwnd;stdcall;
|
||||
|
||||
var
|
||||
Tf: TMyFunc;
|
||||
Tp: TFarProc;
|
||||
Th:Thandle;
|
||||
begin
|
||||
Th := LoadLibrary('pdfPrint.dll');
|
||||
if Th > 0 then
|
||||
begin
|
||||
try
|
||||
Tp := GetProcAddress(Th, 'GetDllForm');
|
||||
if Tp <> nil then
|
||||
begin
|
||||
Tf := TMyFunc(Tp);
|
||||
newh:=Tf(Application,1,
|
||||
Title,
|
||||
GCode,
|
||||
GName,
|
||||
mRecid,
|
||||
printNumber,printFlag,printer,DataBaseStr
|
||||
);
|
||||
end
|
||||
else
|
||||
begin
|
||||
//ShowMessage('打印执行错误');
|
||||
end;
|
||||
finally
|
||||
// FreeLibrary(Th);
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
// ShowMessage('找不到'+Trim(DllName.Text));
|
||||
end;
|
||||
end ;
|
||||
|
||||
end.
|
||||
157
public10/ThreeFun/Fun/uFomat_JSON.pas
Normal file
157
public10/ThreeFun/Fun/uFomat_JSON.pas
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
{格式化 JSON 单元
|
||||
}
|
||||
unit uFomat_JSON;
|
||||
|
||||
interface
|
||||
uses
|
||||
system.JSON,
|
||||
System.SysUtils, System.Variants, System.Classes;
|
||||
|
||||
|
||||
const
|
||||
Level_indent = 2;
|
||||
|
||||
|
||||
//格式化 JSON 字符串
|
||||
// JSONStr : 表示需要格式化的 JSON字符串
|
||||
// lv : 表示缩进层级
|
||||
function JSON_Format(JSONStr : string; lv : Word = 0) : string;
|
||||
|
||||
|
||||
//格式化数组, 缩进
|
||||
function JSON_Fromat_Array(ja : TJSONArray; lv : word = 0) : string;
|
||||
|
||||
//跨过的indent
|
||||
function LI(lv : Word) : string;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
//格式化 JSON 字符串
|
||||
// JSONStr : 表示需要格式化的 JSON字符串
|
||||
// Left_Space : 表示左边统一留多少个空格
|
||||
// Level_index :表示每级缩进多个个空格
|
||||
function JSON_Format(JSONStr : string; lv : Word = 0) : string;
|
||||
var
|
||||
S : string;
|
||||
jo : TJSONObject;
|
||||
jo1: TJSONObject;
|
||||
jp : TJSONPair;
|
||||
js : TJSONString;
|
||||
jn : TJSONNumber;
|
||||
jb : TJSONBool;
|
||||
ja : TJSONArray;
|
||||
jpe : TJSONObject.TEnumerator;
|
||||
|
||||
begin
|
||||
//1. 解析 JSONStr
|
||||
jo := TJSONObject.ParseJSONValue(JSONStr) as TJSONObject;
|
||||
if jo = nil then Exit(JSONStr);
|
||||
|
||||
Result := '{' + #13#10;
|
||||
try
|
||||
jpe := jo.GetEnumerator;
|
||||
if jpe = nil then Exit(JSONSTr);
|
||||
|
||||
while jpe.MoveNext do
|
||||
begin
|
||||
jp := jpe.Current;
|
||||
if jp.JsonValue.TryGetValue(jo1) then
|
||||
begin
|
||||
Result := Result + LI(lv + 1) + '"' + jp.JsonString.Value + '":'#13#10;
|
||||
Result := Result + LI(lv + 1) + JSON_Format(jo1.ToJSON,lv + 2);
|
||||
Continue;
|
||||
end
|
||||
else
|
||||
if jp.JsonValue.TryGetValue(jn) then //数字
|
||||
Result := Result + LI(lv + 1) + '"' + jp.JsonString.Value + '": ' + jn.Value + ','#13#10
|
||||
else
|
||||
if jp.JsonValue.TryGetValue(jb) then //Boolean
|
||||
Result := Result + LI(lv + 1) + '"' + jp.JsonString.Value + '": ' + jb.Value + ','#13#10
|
||||
else
|
||||
if jp.JsonValue.TryGetValue(ja) then //字符串
|
||||
begin
|
||||
Result := Result + LI(lv + 1) + '"' + jp.JsonString.Value + '": '#13#10;
|
||||
Result := Result + LI(lv + 1) + JSON_Fromat_Array(ja,lv + 1);
|
||||
end
|
||||
else
|
||||
if jp.JsonValue.TryGetValue(js) then //字符串
|
||||
Result := Result + LI(lv + 1) + '"' + jp.JsonString.Value + '": "' + js.Value + '",'#13#10
|
||||
end;
|
||||
//去掉最后一行的 ,
|
||||
S := Result.Substring(Length(Result) - 3,3);
|
||||
if S = ','#13#10 then
|
||||
Result := Result.Substring(0,Length(Result) - 3) + #13#10;
|
||||
//最后结果的 }
|
||||
if lv > 0 then
|
||||
begin
|
||||
lv := lv - 1;
|
||||
Result := Result + LI(lv) + '},'#13#10;
|
||||
end
|
||||
else
|
||||
Result := Result + LI(0) + '}'#13#10;
|
||||
finally
|
||||
if jo <> nil then
|
||||
jo.Free;
|
||||
if jpe <> nil then
|
||||
jpe.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
//格式化数组, 缩进
|
||||
function JSON_Fromat_Array(ja : TJSONArray; lv : word = 0) : string;
|
||||
var
|
||||
jae : TJSONArray.TEnumerator;
|
||||
jv : TJSONValue;
|
||||
js : TJSONString;
|
||||
jn : TJSONNumber;
|
||||
jb : TJSONBool;
|
||||
jo : TJSONObject;
|
||||
ja1 : TJSONArray;
|
||||
S : string;
|
||||
begin
|
||||
//
|
||||
Result := '['#13#10;
|
||||
jae := ja.GetEnumerator;
|
||||
if jae = nil then Exit('');
|
||||
|
||||
while jae.MoveNext do
|
||||
begin
|
||||
jv := jae.Current;
|
||||
//进行数据处理
|
||||
if jv.TryGetValue(jn) then //Number
|
||||
Result := Result + LI(lv + 1) + jn.Value + ','#13#10
|
||||
else
|
||||
if jv.TryGetValue(jb) then //Boolean
|
||||
Result := Result + LI(lv + 1) + jb.Value + ','#13#10
|
||||
else
|
||||
if jv.TryGetValue(jo) then //JSONObject
|
||||
begin
|
||||
Result := Result + LI(lv + 1) + JSON_Format(jo.ToString,lv + 2) ;
|
||||
end
|
||||
else
|
||||
if jv.TryGetValue(ja1) then //JSONArray
|
||||
Result := Result + LI(lv + 1) + JSON_Fromat_Array(ja1,lv + 1)
|
||||
else
|
||||
if jv.TryGetValue(js) then //string
|
||||
Result := Result + LI(lv + 1) + '"' + js.Value + '",'#13#10;
|
||||
end;
|
||||
//去掉最后一行的 ,
|
||||
S := Result.Substring(Length(Result) - 3,3);
|
||||
if S = ','#13#10 then
|
||||
Result := Result.Substring(0,Length(Result) - 3) + #13#10;
|
||||
Result := Result + LI(lv) + '],'#13#10;
|
||||
|
||||
if jae <> nil then
|
||||
jae.Free;
|
||||
end;
|
||||
|
||||
|
||||
//跨过的indent
|
||||
function LI(lv : Word) : string;
|
||||
begin
|
||||
Result := StringOfChar(' ', lv * Level_indent);
|
||||
end;
|
||||
|
||||
end.
|
||||
248
public10/ThreeFun/Fun/uSZHN_JSON.pas
Normal file
248
public10/ThreeFun/Fun/uSZHN_JSON.pas
Normal file
|
|
@ -0,0 +1,248 @@
|
|||
{**************************************
|
||||
时间:2021-06-18
|
||||
功能:1 实现delphi原生的JSON操作为 S[] 操作方式
|
||||
作者:sensor QQ:910731685
|
||||
}
|
||||
unit uSZHN_JSON;
|
||||
|
||||
interface
|
||||
uses
|
||||
//System.Classes,
|
||||
//System.Types,
|
||||
//System.DateUtil,
|
||||
//System.Generics.Collections,
|
||||
System.SysUtils,
|
||||
System.JSON;
|
||||
|
||||
type
|
||||
TJSONObjectHelper = class helper for TJSONObject
|
||||
private
|
||||
function Get_ValueS(PairName : string) : string;
|
||||
procedure Set_ValueS(PairName,PairValue : string);
|
||||
|
||||
function Get_ValueI(PairName : string) : Integer;
|
||||
procedure Set_ValueI(PairName : string; PairValue : Integer);
|
||||
|
||||
function Get_ValueI64(PairName : string) : Int64;
|
||||
procedure Set_ValueI64(PairName : string; PairValue : Int64);
|
||||
|
||||
function Get_ValueD(PairName : string) : TDateTime;
|
||||
procedure Set_ValueD(PairName : string; PairValue : TDateTime);
|
||||
|
||||
function Get_ValueB(PairName : string) : Boolean;
|
||||
procedure Set_ValueB(PairName : string; PairValue : Boolean);
|
||||
|
||||
function Get_ValueA(PairName : string) : TJSONArray;
|
||||
procedure Set_ValueA(PairName : string; PairValue : TJSONArray);
|
||||
|
||||
function Get_ValueO(PairName : string) : TJSONObject;
|
||||
procedure Set_ValueO(PairName : string; PairValue : TJSONObject);
|
||||
|
||||
public
|
||||
//判断某个字段是否存在
|
||||
function PairExists(PairName : string) : Boolean;
|
||||
procedure Remove(PairName : string);
|
||||
|
||||
//定义字段读取函数
|
||||
property S[PairName : string] : string read Get_ValueS write Set_ValueS;
|
||||
property I[PairName : string] : integer read Get_ValueI write Set_ValueI;
|
||||
property I64[PairName : string] : Int64 read Get_ValueI64 write Set_ValueI64;
|
||||
property D[PairName : string] : TDateTime read Get_ValueD write Set_ValueD;
|
||||
property B[PairName : string] : Boolean read Get_ValueB write Set_ValueB;
|
||||
property A[PairName : string] : TJSONArray read Get_ValueA write Set_ValueA;
|
||||
property O[PairName : string] : TJSONObject read Get_ValueO write Set_ValueO;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TJSONObjectHelper }
|
||||
|
||||
|
||||
|
||||
function TJSONObjectHelper.Get_ValueS(PairName: string): string;
|
||||
var
|
||||
js : TJSONString;
|
||||
begin
|
||||
if PairName = '' then Exit;
|
||||
if Self.TryGetValue(PairName,js) then
|
||||
Result := js.Value
|
||||
else
|
||||
Result := '';
|
||||
end;
|
||||
|
||||
function TJSONObjectHelper.PairExists(PairName: string): Boolean;
|
||||
begin
|
||||
Result := Self.Values[PairName] <> nil;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
procedure TJSONObjectHelper.Remove(PairName: string);
|
||||
begin
|
||||
Self.RemovePair(PairName).Free;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TJSONObjectHelper.Set_ValueS(PairName, PairValue: string);
|
||||
var
|
||||
js : TJSONString;
|
||||
begin
|
||||
//1. 首先查找有没有该字段, 如果有,则直接删除
|
||||
if Self.TryGetValue(PairName,js) then
|
||||
begin
|
||||
Self.RemovePair(PairName).Free; //如果没有free,就会产生内存泄露
|
||||
end;
|
||||
//2. 然后在增加
|
||||
Self.AddPair(PairName, PairValue);
|
||||
end;
|
||||
|
||||
function TJSONObjectHelper.Get_ValueI(PairName: string): Integer;
|
||||
var
|
||||
ji : TJSONNumber;
|
||||
begin
|
||||
if PairName = '' then Exit(0);
|
||||
|
||||
if Self.TryGetValue(PairName,ji) then
|
||||
Result := ji.AsInt
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
procedure TJSONObjectHelper.Set_ValueI(PairName: string; PairValue: Integer);
|
||||
var
|
||||
jn : TJSONNumber;
|
||||
begin
|
||||
//1. 首先查找有没有该字段, 如果有,则直接删除
|
||||
if Self.TryGetValue(PairName,jn) then
|
||||
Self.RemovePair(PairName).Free;
|
||||
//2. 然后在增加
|
||||
Self.AddPair(PairName, TJSONNumber.Create(PairValue));
|
||||
end;
|
||||
|
||||
function TJSONObjectHelper.Get_ValueD(PairName: string): TDateTime;
|
||||
var
|
||||
ji : TJSONNumber;
|
||||
begin
|
||||
if PairName = '' then Exit(0);
|
||||
|
||||
if Self.TryGetValue(PairName,ji) then
|
||||
Result := ji.AsDouble
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
procedure TJSONObjectHelper.Set_ValueD(PairName: string; PairValue: TDateTime);
|
||||
var
|
||||
jn : TJSONNumber;
|
||||
begin
|
||||
//1. 首先查找有没有该字段, 如果有,则直接删除
|
||||
if Self.TryGetValue(PairName,jn) then
|
||||
Self.RemovePair(PairName).Free;
|
||||
|
||||
Self.AddPair(PairName, TJSONNumber.Create(PairValue));
|
||||
end;
|
||||
|
||||
|
||||
function TJSONObjectHelper.Get_ValueB(PairName: string): Boolean;
|
||||
var
|
||||
jb : TJSONBool;
|
||||
begin
|
||||
if PairName = '' then Exit(False);
|
||||
|
||||
if Self.TryGetValue(PairName,jb) then
|
||||
Result := jb.AsBoolean
|
||||
else
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
procedure TJSONObjectHelper.Set_ValueB(PairName: string; PairValue: Boolean);
|
||||
var
|
||||
jb : TJSONBool;
|
||||
begin
|
||||
//1. 首先查找有没有该字段, 如果有,则直接删除
|
||||
if Self.TryGetValue(PairName,jb) then
|
||||
Self.RemovePair(PairName).Free;
|
||||
Self.AddPair(PairName, TJSONBool.Create(PairValue));
|
||||
end;
|
||||
|
||||
|
||||
function TJSONObjectHelper.Get_ValueI64(PairName: string): Int64;
|
||||
var
|
||||
ji : TJSONNumber;
|
||||
begin
|
||||
if PairName = '' then Exit(0);
|
||||
|
||||
if Self.TryGetValue(PairName,ji) then
|
||||
Result := ji.AsInt64
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
|
||||
procedure TJSONObjectHelper.Set_ValueI64(PairName: string; PairValue: Int64);
|
||||
var
|
||||
jn : TJSONNumber;
|
||||
begin
|
||||
//1. 首先查找有没有该字段, 如果有,则直接删除
|
||||
if Self.TryGetValue(PairName,jn) then
|
||||
Self.RemovePair(PairName).Free;
|
||||
Self.AddPair(PairName, TJSONNumber.Create(PairValue));
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function TJSONObjectHelper.Get_ValueA(PairName: string): TJSONArray;
|
||||
var
|
||||
ja : TJSONArray;
|
||||
begin
|
||||
if PairName = '' then Exit(nil);
|
||||
|
||||
Self.TryGetValue(PairName,Result);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
procedure TJSONObjectHelper.Set_ValueA(PairName: string; PairValue: TJSONArray);
|
||||
var
|
||||
ja : TJSONArray;
|
||||
begin
|
||||
//1. 首先查找有没有该字段, 如果有,则直接删除
|
||||
if Self.TryGetValue(PairName,ja) then
|
||||
Self.RemovePair(PairName).Free;
|
||||
|
||||
Self.AddPair(PairName, PairValue);
|
||||
end;
|
||||
|
||||
|
||||
function TJSONObjectHelper.Get_ValueO(PairName: string): TJSONObject;
|
||||
var
|
||||
jo : TJSONObject;
|
||||
begin
|
||||
if PairName = '' then Exit(nil);
|
||||
|
||||
if Self.TryGetValue(PairName,jo) then
|
||||
Result := jo
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
procedure TJSONObjectHelper.Set_ValueO(PairName: string; PairValue: TJSONObject);
|
||||
var
|
||||
jo : TJSONObject;
|
||||
begin
|
||||
//1. 首先查找有没有该字段, 如果有,则直接删除
|
||||
if Self.TryGetValue(PairName,jo) then
|
||||
Self.RemovePair(PairName).Free;
|
||||
Self.AddPair(PairName, PairValue as TJSONObject);
|
||||
end;
|
||||
|
||||
end.
|
||||
23
public10/design/Project1.dpr
Normal file
23
public10/design/Project1.dpr
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
program Project1;
|
||||
|
||||
uses
|
||||
Vcl.Forms,
|
||||
U_BaseInput in 'U_BaseInput.pas' {frmBaseInput},
|
||||
Unit1 in 'E:\test\xx\Unit1.pas' {frmBaseInput1},
|
||||
U_WindowFormdesign in 'U_WindowFormdesign.pas',
|
||||
U_cxGridCustomCss in 'U_cxGridCustomCss.pas',
|
||||
U_globalVar in 'U_globalVar.pas',
|
||||
U_DataLink in 'E:\test\xx\U_DataLink.pas' {DataLink_Company: TDataModule},
|
||||
U_Fun10 in '..\..\public2\ThreeFun\Fun\U_Fun10.pas',
|
||||
U_Fun in '..\..\public2\ThreeFun\Fun\U_Fun.pas';
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.MainFormOnTaskbar := True;
|
||||
Application.CreateForm(TfrmBaseInput, frmBaseInput);
|
||||
Application.CreateForm(TfrmBaseInput1, frmBaseInput1);
|
||||
Application.CreateForm(TDataLink_Company, DataLink_Company);
|
||||
Application.Run;
|
||||
end.
|
||||
928
public10/design/Project1.dproj
Normal file
928
public10/design/Project1.dproj
Normal file
|
|
@ -0,0 +1,928 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{4A13C1D8-92BC-4103-8B79-6191678CC58B}</ProjectGuid>
|
||||
<ProjectVersion>19.2</ProjectVersion>
|
||||
<FrameworkType>VCL</FrameworkType>
|
||||
<Base>True</Base>
|
||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||
<Platform Condition="'$(Platform)'==''">Win32</Platform>
|
||||
<TargetedPlatforms>1</TargetedPlatforms>
|
||||
<AppType>Application</AppType>
|
||||
<MainSource>Project1.dpr</MainSource>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
|
||||
<Base_Win32>true</Base_Win32>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
|
||||
<Base_Win64>true</Base_Win64>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
|
||||
<Cfg_1_Win32>true</Cfg_1_Win32>
|
||||
<CfgParent>Cfg_1</CfgParent>
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
|
||||
<Cfg_2_Win32>true</Cfg_2_Win32>
|
||||
<CfgParent>Cfg_2</CfgParent>
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base)'!=''">
|
||||
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
|
||||
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
|
||||
<DCC_E>false</DCC_E>
|
||||
<DCC_N>false</DCC_N>
|
||||
<DCC_S>false</DCC_S>
|
||||
<DCC_F>false</DCC_F>
|
||||
<DCC_K>false</DCC_K>
|
||||
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
|
||||
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
|
||||
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
|
||||
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
|
||||
<SanitizedProjectName>Project1</SanitizedProjectName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;DataSnapFireDAC;tethering;svnui;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;svn;DBXOracleDriver;inetdb;SysCoreEditor;RaizeComponentsVcl;FmxTeeUI;emsedge;RaizeComponentsVclDb;FireDACIBDriver;fmx;fmxdae;vcledge;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;FlatVcls;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;bindcompvclwinx;dsnapcon;FireDACMSAccDriver;FireDACInfxDriver;fmxFireDAC;vclimg;SysCorePrint;TeeDB;FireDAC;SysCoreEx;SysCore;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;SysCoreOther;DataSnapServer;xmlrtl;DataSnapNativeClient;ibxbindings;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;soapmidas;DBXSybaseASADriver;RTComboBoxPac;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;dclusr;TeeUI;FlatStyle;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;inetdbxpress;btneditpac;fmxase;$(DCC_UsePackage)</DCC_UsePackage>
|
||||
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||
<BT_BuildType>Debug</BT_BuildType>
|
||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base_Win64)'!=''">
|
||||
<DCC_UsePackage>DBXSqliteDriver;RESTComponents;DataSnapServerMidas;DBXDb2Driver;DBXInterBaseDriver;vclactnband;vclFireDAC;bindcompvclsmp;emsclientfiredac;DataSnapFireDAC;tethering;FireDACADSDriver;DBXMSSQLDriver;DatasnapConnectorsFreePascal;FireDACMSSQLDriver;vcltouch;vcldb;bindcompfmx;DBXOracleDriver;inetdb;FmxTeeUI;emsedge;FireDACIBDriver;fmx;fmxdae;vcledge;vclib;FireDACDBXDriver;dbexpress;IndyCore;vclx;dsnap;DataSnapCommon;emsclient;FireDACCommon;RESTBackendComponents;DataSnapConnectors;VCLRESTComponents;soapserver;vclie;bindengine;DBXMySQLDriver;CloudService;FireDACOracleDriver;FireDACMySQLDriver;DBXFirebirdDriver;FireDACCommonODBC;FireDACCommonDriver;DataSnapClient;inet;bindcompdbx;IndyIPCommon;vcl;DBXSybaseASEDriver;IndyIPServer;IndySystem;FireDACDb2Driver;bindcompvclwinx;dsnapcon;FireDACMSAccDriver;FireDACInfxDriver;fmxFireDAC;vclimg;TeeDB;FireDAC;emshosting;FireDACSqliteDriver;FireDACPgDriver;ibmonitor;FireDACASADriver;DBXOdbcDriver;FireDACTDataDriver;FMXTee;soaprtl;DbxCommonDriver;ibxpress;Tee;DataSnapServer;xmlrtl;DataSnapNativeClient;ibxbindings;fmxobj;vclwinx;FireDACDSDriver;rtl;emsserverresource;DbxClientDriver;soapmidas;DBXSybaseASADriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;DBXInformixDriver;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;FireDACODBCDriver;DataSnapIndy10ServerTransport;DataSnapProviderClient;dsnapxml;dbrtl;FireDACMongoDBDriver;IndyProtocols;inetdbxpress;fmxase;$(DCC_UsePackage)</DCC_UsePackage>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||
<DCC_DebugDCUs>true</DCC_DebugDCUs>
|
||||
<DCC_Optimize>false</DCC_Optimize>
|
||||
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
|
||||
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
|
||||
<DCC_RemoteDebug>true</DCC_RemoteDebug>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
|
||||
<DCC_RemoteDebug>false</DCC_RemoteDebug>
|
||||
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
|
||||
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
|
||||
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||
<DCC_DebugInformation>0</DCC_DebugInformation>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
|
||||
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
|
||||
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<DelphiCompile Include="$(MainSource)">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<DCCReference Include="U_BaseInput.pas">
|
||||
<Form>frmBaseInput</Form>
|
||||
<FormType>dfm</FormType>
|
||||
</DCCReference>
|
||||
<DCCReference Include="E:\test\xx\Unit1.pas">
|
||||
<Form>frmBaseInput1</Form>
|
||||
<FormType>dfm</FormType>
|
||||
</DCCReference>
|
||||
<DCCReference Include="U_WindowFormdesign.pas"/>
|
||||
<DCCReference Include="U_cxGridCustomCss.pas"/>
|
||||
<DCCReference Include="U_globalVar.pas"/>
|
||||
<DCCReference Include="E:\test\xx\U_DataLink.pas">
|
||||
<Form>DataLink_Company</Form>
|
||||
<FormType>dfm</FormType>
|
||||
<DesignClass>TDataModule</DesignClass>
|
||||
</DCCReference>
|
||||
<DCCReference Include="..\..\public2\ThreeFun\Fun\U_Fun10.pas"/>
|
||||
<DCCReference Include="..\..\public2\ThreeFun\Fun\U_Fun.pas"/>
|
||||
<BuildConfiguration Include="Release">
|
||||
<Key>Cfg_2</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Base">
|
||||
<Key>Base</Key>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Debug">
|
||||
<Key>Cfg_1</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||
<Borland.ProjectType>Application</Borland.ProjectType>
|
||||
<BorlandProject>
|
||||
<Delphi.Personality>
|
||||
<Source>
|
||||
<Source Name="MainSource">Project1.dpr</Source>
|
||||
</Source>
|
||||
</Delphi.Personality>
|
||||
<Deployment Version="3">
|
||||
<DeployFile LocalName="Win32\Debug\Project1.exe" Configuration="Debug" Class="ProjectOutput">
|
||||
<Platform Name="Win32">
|
||||
<RemoteName>Project1.exe</RemoteName>
|
||||
<Overwrite>true</Overwrite>
|
||||
</Platform>
|
||||
</DeployFile>
|
||||
<DeployClass Name="AdditionalDebugSymbols">
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidClassesDexFile">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>classes</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>classes</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidFileProvider">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\xml</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\xml</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidGDBServer">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidLibnativeArmeabiFile">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>library\lib\armeabi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\armeabi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidLibnativeMipsFile">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>library\lib\mips</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\mips</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidServiceOutput">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidServiceOutput_Android32">
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidSplashImageDef">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidSplashStyles">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="AndroidSplashStylesV21">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\values-v21</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\values-v21</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_Colors">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_DefaultAppIcon">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon144">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon192">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon36">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-ldpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-ldpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon48">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-mdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-mdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon72">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-hdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-hdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_LauncherIcon96">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_NotificationIcon24">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-mdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-mdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_NotificationIcon36">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-hdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-hdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_NotificationIcon48">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_NotificationIcon72">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_NotificationIcon96">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_SplashImage426">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-small</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-small</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_SplashImage470">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-normal</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-normal</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_SplashImage640">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-large</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-large</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_SplashImage960">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\drawable-xlarge</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\drawable-xlarge</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="Android_Strings">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>res\values</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="DebugSymbols">
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="DependencyFramework">
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.framework</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.framework</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="DependencyModule">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
<Extensions>.dll;.bpl</Extensions>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Required="true" Name="DependencyPackage">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
<Extensions>.dylib</Extensions>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
<Extensions>.bpl</Extensions>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="File">
|
||||
<Platform Name="Android">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iOS_AppStore1024">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_AppIcon152">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_AppIcon167">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Launch2x">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_LaunchDark2x">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Notification40">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_Setting58">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPad_SpotLight80">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_AppIcon120">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_AppIcon180">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch2x">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Launch3x">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_LaunchDark2x">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_LaunchDark3x">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Notification40">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Notification60">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Setting58">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Setting87">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Spotlight120">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="iPhone_Spotlight80">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectAndroidManifest">
|
||||
<Platform Name="Android">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectiOSDeviceDebug">
|
||||
<Platform Name="iOSDevice32">
|
||||
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectiOSEntitlements">
|
||||
<Platform Name="iOSDevice32">
|
||||
<RemoteDir>..\</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectiOSInfoPList">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectiOSLaunchScreen">
|
||||
<Platform Name="iOSDevice64">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen</RemoteDir>
|
||||
<Operation>64</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<RemoteDir>..\$(PROJECTNAME).launchscreen</RemoteDir>
|
||||
<Operation>64</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectiOSResource">
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectOSXDebug">
|
||||
<Platform Name="OSX64">
|
||||
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectOSXEntitlements">
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>..\</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<RemoteDir>..\</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectOSXInfoPList">
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>Contents</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<RemoteDir>Contents</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectOSXResource">
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>Contents\Resources</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<RemoteDir>Contents\Resources</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Required="true" Name="ProjectOutput">
|
||||
<Platform Name="Android">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSDevice64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="iOSSimulator">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Linux64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX32">
|
||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="OSX64">
|
||||
<RemoteDir>Contents\MacOS</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win32">
|
||||
<Operation>0</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectOutput_Android32">
|
||||
<Platform Name="Android64">
|
||||
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="ProjectUWPManifest">
|
||||
<Platform Name="Win32">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win64">
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="UWP_DelphiLogo150">
|
||||
<Platform Name="Win32">
|
||||
<RemoteDir>Assets</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win64">
|
||||
<RemoteDir>Assets</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<DeployClass Name="UWP_DelphiLogo44">
|
||||
<Platform Name="Win32">
|
||||
<RemoteDir>Assets</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
<Platform Name="Win64">
|
||||
<RemoteDir>Assets</RemoteDir>
|
||||
<Operation>1</Operation>
|
||||
</Platform>
|
||||
</DeployClass>
|
||||
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
|
||||
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
|
||||
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
|
||||
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
|
||||
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
|
||||
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
|
||||
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
|
||||
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
|
||||
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
|
||||
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
|
||||
</Deployment>
|
||||
<Platforms>
|
||||
<Platform value="Win32">True</Platform>
|
||||
<Platform value="Win64">False</Platform>
|
||||
</Platforms>
|
||||
</BorlandProject>
|
||||
<ProjectFileVersion>12</ProjectFileVersion>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
|
||||
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
|
||||
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
|
||||
</Project>
|
||||
20
public10/design/Project1.dproj.local
Normal file
20
public10/design/Project1.dproj.local
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<BorlandProject>
|
||||
<Transactions>
|
||||
<Transaction>2022/01/09 15:41:36.000.064,=C:\Users\Administrator\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
|
||||
<Transaction>2022/01/23 22:36:34.000.136,=C:\Users\Administrator\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
|
||||
<Transaction>2022/02/05 18:45:29.000.246,=C:\Users\Administrator\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
|
||||
<Transaction>2022/03/06 20:31:55.166,=C:\Users\Administrator\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
|
||||
<Transaction>2022/03/06 20:32:25.200,=E:\官工\public\design\U_BaseInput.pas</Transaction>
|
||||
<Transaction>2022/03/06 20:32:46.919,=C:\Users\Administrator\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
|
||||
<Transaction>2022/03/06 20:34:12.006,=E:\官工\public\design\U_WindowFormdesign.pas</Transaction>
|
||||
<Transaction>2022/03/06 20:34:38.658,=E:\官工\public\design\U_cxGridCustomCss.pas</Transaction>
|
||||
<Transaction>2022/03/06 20:35:26.997,=E:\官工\public\design\U_globalVar.pas</Transaction>
|
||||
<Transaction>2022/03/06 20:36:17.355,E:\test\xx\Unit1.pas=C:\Users\Administrator\Documents\Embarcadero\Studio\Projects\Unit1.pas</Transaction>
|
||||
<Transaction>2022/03/06 20:36:17.355,E:\test\xx\Unit1.dfm=C:\Users\Administrator\Documents\Embarcadero\Studio\Projects\Unit1.dfm</Transaction>
|
||||
<Transaction>2022/03/06 20:36:18.664,E:\官工\public\design\Project1.dproj=C:\Users\Administrator\Documents\Embarcadero\Studio\Projects\Project1.dproj</Transaction>
|
||||
<Transaction>2022/03/06 20:37:43.826,=E:\test\xx\U_DataLink.pas</Transaction>
|
||||
<Transaction>2022/03/06 20:38:17.714,=E:\官工\public2\ThreeFun\Fun\U_Fun10.pas</Transaction>
|
||||
<Transaction>2022/03/06 20:38:44.273,=E:\官工\public2\ThreeFun\Fun\U_Fun.pas</Transaction>
|
||||
</Transactions>
|
||||
</BorlandProject>
|
||||
BIN
public10/design/Project1.identcache
Normal file
BIN
public10/design/Project1.identcache
Normal file
Binary file not shown.
BIN
public10/design/Project1.res
Normal file
BIN
public10/design/Project1.res
Normal file
Binary file not shown.
5947
public10/design/U_BaseDataLink.dfm
Normal file
5947
public10/design/U_BaseDataLink.dfm
Normal file
File diff suppressed because it is too large
Load Diff
124
public10/design/U_BaseDataLink.pas
Normal file
124
public10/design/U_BaseDataLink.pas
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
unit U_BaseDataLink;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
System.SysUtils,windows,forms, System.Classes,
|
||||
dxSkinsDefaultPainters, dxCore, cxClasses,
|
||||
cxLookAndFeels, cxContainer, cxEdit,
|
||||
System.ImageList, Vcl.ImgList, Vcl.Controls, cxImageList, cxGraphics, cxStyles,
|
||||
dxLayoutLookAndFeels,cxLocalization, dxSkinsForm, dxSkinsCore, dxSkinWXI,
|
||||
dxSkinSharpPlus, dxSkinOffice2013White;
|
||||
|
||||
type
|
||||
TBaseDataLink = class(TDataModule)
|
||||
dxSkinController1: TdxSkinController;
|
||||
cxEditStyleController1: TcxEditStyleController;
|
||||
ThreeLookAndFeelCol: TcxLookAndFeelController;
|
||||
cxImageList_bar: TcxImageList;
|
||||
ThreeColorBase: TcxStyleRepository;
|
||||
dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList;
|
||||
dxLayoutSkinLookAndFeel1: TdxLayoutSkinLookAndFeel;
|
||||
cxLocalizer1: TcxLocalizer;
|
||||
grid_head_blue: TcxStyle;
|
||||
grid_head_red: TcxStyle;
|
||||
grid_head_green: TcxStyle;
|
||||
grid_head_yellow: TcxStyle;
|
||||
grid_head_cyan: TcxStyle;
|
||||
grid_head_purple: TcxStyle;
|
||||
grid_black_blue: TcxStyle;
|
||||
grid_black_pink: TcxStyle;
|
||||
grid_black_grey: TcxStyle;
|
||||
grid_black_green: TcxStyle;
|
||||
grid_black_yellow: TcxStyle;
|
||||
grid_black_cyan: TcxStyle;
|
||||
grid_head_black: TcxStyle;
|
||||
procedure DataModuleCreate(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
BaseDataLink: TBaseDataLink;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_globalVar,U_FormLayOutDesign;
|
||||
{%CLASSGROUP 'Vcl.Controls.TControl'}
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TBaseDataLink.DataModuleCreate(Sender: TObject);
|
||||
var
|
||||
str :String;
|
||||
pathStr:String;
|
||||
I: Integer;
|
||||
// thread:TThread;
|
||||
begin
|
||||
///////////////////
|
||||
// dxSkinController1.BeginUpdate;
|
||||
//////////////////////
|
||||
// thread:=TThread.CreateAnonymousThread(
|
||||
// procedure
|
||||
// begin
|
||||
|
||||
// if (fileexists(ExtractFilePath(Application.ExeName) + 'devchs.ini') = true)
|
||||
// then
|
||||
// begin
|
||||
// cxLocalizer1.FileName := ExtractFilePath(Application.ExeName) +
|
||||
// 'devchs.ini';
|
||||
// cxLocalizer1.Active := true;
|
||||
// cxLocalizer1.LanguageIndex := 1;
|
||||
// end;
|
||||
//
|
||||
// pathStr:=ExtractFilePath(Application.ExeName) + '\AllSkins.skinres';
|
||||
// if FileExists(pathStr) then
|
||||
// begin
|
||||
// dxSkinsUserSkinLoadFromFile(pathStr, 'WXI');
|
||||
// RootLookAndFeel.SkinName := sdxSkinsUserSkinName;
|
||||
// end;
|
||||
// end);
|
||||
|
||||
// thread.FreeOnTerminate := True;
|
||||
// thread.Start;
|
||||
|
||||
dxSkinController1.BeginUpdate;
|
||||
TRY
|
||||
RootLookAndFeel.NativeStyle := false;
|
||||
gFontSize:=0;
|
||||
|
||||
if (fileexists(ExtractFilePath(Application.ExeName) + 'devchs.ini') = true)
|
||||
then
|
||||
begin
|
||||
cxLocalizer1.FileName := ExtractFilePath(Application.ExeName) +
|
||||
'devchs.ini';
|
||||
cxLocalizer1.Active := true;
|
||||
cxLocalizer1.LanguageIndex := 1;
|
||||
end;
|
||||
|
||||
getSystemIni();
|
||||
if not gIsUseSkin then
|
||||
begin
|
||||
dxSkinController1.UseSkins:=false;
|
||||
dxSkinController1.SkinName:='';
|
||||
dxSkinController1.Kind:= lfStandard ;
|
||||
//RootLookAndFeel.NativeStyle := true;
|
||||
end
|
||||
else
|
||||
begin
|
||||
pathStr:=ExtractFilePath(Application.ExeName) + '\AllSkins.skinres';
|
||||
if FileExists(pathStr) then
|
||||
begin
|
||||
dxSkinsUserSkinLoadFromFile(pathStr, 'WXI');
|
||||
RootLookAndFeel.SkinName := sdxSkinsUserSkinName;
|
||||
end;
|
||||
end;
|
||||
FINALLY
|
||||
dxSkinController1.EndUpdate;
|
||||
END;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
3212
public10/design/U_BaseHelp.dfm
Normal file
3212
public10/design/U_BaseHelp.dfm
Normal file
File diff suppressed because it is too large
Load Diff
62
public10/design/U_BaseHelp.pas
Normal file
62
public10/design/U_BaseHelp.pas
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
unit U_BaseHelp;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, System.ImageList, Vcl.ImgList, Data.DB,
|
||||
Data.Win.ADODB,U_WindowFormdesign;
|
||||
|
||||
type
|
||||
TfrmBaseHelp = class(TForm)
|
||||
ADOQueryBaseCmd: TADOQuery;
|
||||
ADOQueryBaseTemp: TADOQuery;
|
||||
ImageList_new32: TImageList;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
private
|
||||
fWindowDesign:TWindowFormdesign;
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmBaseHelp: TfrmBaseHelp;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_RTFun ,U_globalVar,U_FormLayOutDesign;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmBaseHelp.FormCreate(Sender: TObject);
|
||||
var
|
||||
mFontSize:integer;
|
||||
begin
|
||||
// getSystemIni();
|
||||
if gFontSize<9 then
|
||||
begin
|
||||
mFontSize := 12;
|
||||
end
|
||||
else
|
||||
begin
|
||||
mFontSize:=gFontSize ;
|
||||
end;
|
||||
|
||||
self.Font.Size := gFontSize;
|
||||
if trim(gFontName)<>'' then
|
||||
self.Font.Name:=gFontName;
|
||||
fWindowDesign:=TWindowFormDeSign.Create();
|
||||
end;
|
||||
|
||||
procedure TfrmBaseHelp.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
fWindowDesign.free;
|
||||
end;
|
||||
|
||||
procedure TfrmBaseHelp.FormShow(Sender: TObject);
|
||||
begin
|
||||
fWindowDesign.FormStyleInit1(self,0,ADOQueryBaseTemp,ADOQueryBaseCmd);
|
||||
end;
|
||||
|
||||
end.
|
||||
8968
public10/design/U_BaseInput.dfm
Normal file
8968
public10/design/U_BaseInput.dfm
Normal file
File diff suppressed because it is too large
Load Diff
85
public10/design/U_BaseInput.pas
Normal file
85
public10/design/U_BaseInput.pas
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
unit U_BaseInput;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs,U_WindowFormdesign, Data.DB,
|
||||
Data.Win.ADODB, System.ImageList, Vcl.ImgList, Vcl.ToolWin, Vcl.ComCtrls,
|
||||
cxImageList, cxGraphics;
|
||||
|
||||
type
|
||||
TfrmBaseInput = class(TForm)
|
||||
ADOQueryBaseCmd: TADOQuery;
|
||||
ADOQueryBaseTemp: TADOQuery;
|
||||
ImageList_new32: TImageList;
|
||||
cxImageList_bar: TcxImageList;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
private
|
||||
fWindowDesign:TWindowFormdesign;
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmBaseInput: TfrmBaseInput;
|
||||
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_RTFun ,U_globalVar,U_dataLink,U_FormLayOutDesign;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmBaseInput.FormCreate(Sender: TObject);
|
||||
var
|
||||
mFontSize:integer;
|
||||
begin
|
||||
self.Color:=clBtnFace;
|
||||
//getSystemIni();
|
||||
self.DoubleBuffered:=gIsUseSkin;
|
||||
if gFontSize<9 then
|
||||
begin
|
||||
mFontSize := 9;
|
||||
end
|
||||
else
|
||||
begin
|
||||
mFontSize:=gFontSize ;
|
||||
end;
|
||||
if self.Font.Size<>gFontSize then
|
||||
self.Font.Size := gFontSize;
|
||||
if trim(gFontName)<>'' then
|
||||
self.Font.Name:=gFontName;
|
||||
fWindowDesign:=TWindowFormDeSign.Create();
|
||||
end;
|
||||
|
||||
procedure TfrmBaseInput.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
fWindowDesign.free;
|
||||
end;
|
||||
|
||||
procedure TfrmBaseInput.FormShow(Sender: TObject);
|
||||
//var
|
||||
// thread:TThread;
|
||||
begin
|
||||
// thread:=TThread.CreateAnonymousThread(
|
||||
// procedure
|
||||
// begin
|
||||
// TThread.Synchronize(nil,
|
||||
// procedure
|
||||
// begin
|
||||
if trim(gStructVer)='' then
|
||||
fWindowDesign.FormStyleInit1(self,0,ADOQueryBaseTemp,ADOQueryBaseCmd)
|
||||
else
|
||||
fWindowDesign.FormStyleInit(self,0,ADOQueryBaseTemp,ADOQueryBaseCmd) ;
|
||||
// end)
|
||||
// end);
|
||||
//
|
||||
// thread.FreeOnTerminate := True;
|
||||
// thread.Start;
|
||||
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
54
public10/design/U_BaseList.dfm
Normal file
54
public10/design/U_BaseList.dfm
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
object frmBaseList: TfrmBaseList
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'frmBaseList'
|
||||
ClientHeight = 349
|
||||
ClientWidth = 741
|
||||
Color = clWhite
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #24494#36719#38597#40657
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 17
|
||||
object loadProcess: TPanel
|
||||
Left = 288
|
||||
Top = 168
|
||||
Width = 169
|
||||
Height = 30
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = 'loading...'
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
end
|
||||
object cxProgressBar2: TcxProgressBar
|
||||
Left = 288
|
||||
Top = 112
|
||||
Enabled = False
|
||||
Style.LookAndFeel.NativeStyle = True
|
||||
StyleDisabled.LookAndFeel.NativeStyle = True
|
||||
StyleFocused.LookAndFeel.NativeStyle = True
|
||||
StyleHot.LookAndFeel.NativeStyle = True
|
||||
TabOrder = 1
|
||||
Visible = False
|
||||
Width = 177
|
||||
end
|
||||
object ADOQueryBaseCmd: TADOQuery
|
||||
Parameters = <>
|
||||
Left = 265
|
||||
Top = 200
|
||||
end
|
||||
object ADOQueryBaseTemp: TADOQuery
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 233
|
||||
Top = 121
|
||||
end
|
||||
end
|
||||
144
public10/design/U_BaseList.pas
Normal file
144
public10/design/U_BaseList.pas
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
unit U_BaseList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
|
||||
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB,
|
||||
Data.Win.ADODB, cxGraphics, U_WindowFormdesign, cxEdit, Vcl.ExtCtrls,
|
||||
cxControls, cxProgressBar, cxLookAndFeels, cxLookAndFeelPainters, cxContainer,
|
||||
dxSkinsCore, dxSkinsDefaultPainters, dxSkinWXI, dxSkinSharpPlus,
|
||||
System.JSON;
|
||||
|
||||
type
|
||||
TfrmBaseList = class(TForm)
|
||||
ADOQueryBaseCmd: TADOQuery;
|
||||
ADOQueryBaseTemp: TADOQuery;
|
||||
loadProcess: TPanel;
|
||||
cxProgressBar2: TcxProgressBar;
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
private
|
||||
fWindowDesign: TWindowFormdesign;
|
||||
protected
|
||||
fParameters1: string;
|
||||
fParameters2: string;
|
||||
fParameters3: string;
|
||||
fParameters4: string;
|
||||
fParameters5: string;
|
||||
fParameters10: string;
|
||||
public
|
||||
fFormId: integer;
|
||||
fIsCanDesign:boolean;
|
||||
fFormCaption:string;
|
||||
fFormRightButtons:string;
|
||||
fModuleId,fModuleSubId:string;
|
||||
constructor Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
|
||||
end;
|
||||
|
||||
var
|
||||
frmBaseList: TfrmBaseList;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
U_RTFun, U_globalVar, U_dataLink,U_FormLayOutDesign;
|
||||
{$R *.dfm}
|
||||
|
||||
constructor TfrmBaseList.Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
|
||||
var
|
||||
jsonObject: TJSONObject;
|
||||
jsonValue: TJSONValue;
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
|
||||
if ACaption <> '' then
|
||||
Caption := ACaption;
|
||||
|
||||
fFormCaption:=caption;
|
||||
fParameters1 := Parameters1;
|
||||
fParameters2 := Parameters2;
|
||||
fParameters3 := Parameters3;
|
||||
fParameters4 := Parameters4;
|
||||
fParameters5 := Parameters5;
|
||||
fParameters10 := Parameters10;
|
||||
if pos('{',fParameters10)>0 then
|
||||
begin
|
||||
try
|
||||
jsonValue := TJSONObject.ParseJSONValue(fParameters10);
|
||||
jsonObject := jsonValue as TJSONObject;
|
||||
|
||||
fModuleId:=StringReplace(Trim(jsonObject.GetValue('moduleId').ToString),'"','',[rfReplaceAll]);
|
||||
fModuleSubId:=StringReplace(trim(jsonObject.GetValue('moduleSubId').ToString),'"','',[rfReplaceAll]);
|
||||
gTeamWorker:=StringReplace(trim(jsonObject.GetValue('teamWorkerId').ToString),'"','',[rfReplaceAll]);
|
||||
if Parameters1='²éѯ' then
|
||||
fParameters10:='²éѯ'
|
||||
else
|
||||
fParameters10:='';
|
||||
finally
|
||||
jsonValue.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
fFormId:= FormID ;
|
||||
|
||||
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmBaseList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
if (fFormId>0) and (WriteCloseWin(ADOQueryBaseCmd, self.Caption, fFormId, gDllFileName)) then
|
||||
begin
|
||||
Sendmessage(application.MainForm.Handle, WM_CloseForm, 4, 0);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmBaseList.FormCreate(Sender: TObject);
|
||||
var
|
||||
mFontSize:integer;
|
||||
begin
|
||||
self.Color:=clBtnFace;
|
||||
//getSystemIni();
|
||||
self.DoubleBuffered:=gIsUseSkin;
|
||||
if gFontSize<9 then
|
||||
begin
|
||||
mFontSize := 9;
|
||||
end
|
||||
else
|
||||
begin
|
||||
mFontSize:=gFontSize ;
|
||||
end;
|
||||
if self.Font.Size<>gFontSize then
|
||||
self.Font.Size := gFontSize;
|
||||
if trim(gFontName)<>'' then
|
||||
self.Font.Name:=gFontName;
|
||||
// ´°¿Ú±³¾°É«
|
||||
fWindowDesign := TWindowFormdesign.Create();
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmBaseList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
fWindowDesign.free;
|
||||
end;
|
||||
|
||||
procedure TfrmBaseList.FormShow(Sender: TObject);
|
||||
begin
|
||||
fFormRightButtons:= fWindowDesign.geUsertFormButtons(ADOQueryBaseTemp,fFormId,fFormCaption,fModuleId,fModuleSubId);
|
||||
if DParameters8<>'1' then
|
||||
begin
|
||||
if trim(gStructVer)='' then
|
||||
fWindowDesign.FormStyleInit1(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10)
|
||||
else
|
||||
fWindowDesign.FormStyleInit(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10);
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
102
public10/design/U_BaseOneTableInput.dfm
Normal file
102
public10/design/U_BaseOneTableInput.dfm
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
object frmBaseOneTableInput: TfrmBaseOneTableInput
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'frmBaseOneTableInput'
|
||||
ClientHeight = 439
|
||||
ClientWidth = 736
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object ToolBar1: TToolBar
|
||||
Tag = 1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 736
|
||||
Height = 30
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 95
|
||||
Caption = 'ToolBar1'
|
||||
Color = clWhite
|
||||
EdgeInner = esNone
|
||||
EdgeOuter = esNone
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = #24494#36719#38597#40657
|
||||
Font.Style = []
|
||||
Images = DataLink_schedule.cxImageList_bar
|
||||
List = True
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384
|
||||
ImageIndex = 37
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object Tsj: TToolButton
|
||||
Left = 63
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384#35774#35745
|
||||
ImageIndex = 16
|
||||
Visible = False
|
||||
OnClick = TsjClick
|
||||
end
|
||||
object TgridSet: TToolButton
|
||||
Left = 150
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #34920#26684#21015#35774#32622
|
||||
ImageIndex = 16
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 249
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 7
|
||||
OnClick = TBCloseClick
|
||||
end
|
||||
end
|
||||
object dxLayoutControl_input: TdxLayoutControl
|
||||
Left = 32
|
||||
Top = 64
|
||||
Width = 681
|
||||
Height = 329
|
||||
TabOrder = 1
|
||||
OnDblClick = dxLayoutControl_inputDblClick
|
||||
object dxLayoutControl_inputGroup_Root: TdxLayoutGroup
|
||||
AlignHorz = ahLeft
|
||||
AlignVert = avTop
|
||||
Hidden = True
|
||||
ShowBorder = False
|
||||
Index = -1
|
||||
end
|
||||
end
|
||||
object ADOQueryBaseCmd: TADOQuery
|
||||
Parameters = <>
|
||||
Left = 105
|
||||
Top = 155
|
||||
end
|
||||
object ADOQueryBaseTemp: TADOQuery
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 217
|
||||
Top = 155
|
||||
end
|
||||
end
|
||||
164
public10/design/U_BaseOneTableInput.pas
Normal file
164
public10/design/U_BaseOneTableInput.pas
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
unit U_BaseOneTableInput;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.ToolWin, cxGraphics,
|
||||
cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
|
||||
dxSkinsDefaultPainters, dxSkinWXI, cxClasses, dxLayoutContainer,
|
||||
dxLayoutControl, Data.DB, Data.Win.ADODB,U_WindowFormdesign;
|
||||
|
||||
type
|
||||
TfrmBaseOneTableInput = class(TForm)
|
||||
ToolBar1: TToolBar;
|
||||
TBSave: TToolButton;
|
||||
Tsj: TToolButton;
|
||||
TBClose: TToolButton;
|
||||
dxLayoutControl_inputGroup_Root: TdxLayoutGroup;
|
||||
dxLayoutControl_input: TdxLayoutControl;
|
||||
ADOQueryBaseCmd: TADOQuery;
|
||||
ADOQueryBaseTemp: TADOQuery;
|
||||
TgridSet: TToolButton;
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure TsjClick(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure dxLayoutControl_inputDblClick(Sender: TObject);
|
||||
private
|
||||
fWindowDesign:TWindowFormdesign;
|
||||
fDesignCode:string;
|
||||
function SaveData(): Boolean;
|
||||
public
|
||||
fKeyNo:string;
|
||||
fTabelName:string;
|
||||
end;
|
||||
|
||||
var
|
||||
frmBaseOneTableInput: TfrmBaseOneTableInput;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_RTFun ,U_globalVar,U_dataLink,U_FormLayOutDesign;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmBaseOneTableInput.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmBaseOneTableInput.TBSaveClick(Sender: TObject);
|
||||
begin
|
||||
if not mustInCheck(application, dxLayoutControl_input,PWideChar('*')) then
|
||||
exit;
|
||||
if SaveData() then
|
||||
begin
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmBaseOneTableInput.TsjClick(Sender: TObject);
|
||||
begin
|
||||
saveLayOut(application,dxLayoutControl_input, ADOQueryBaseCmd,
|
||||
PWideChar( fDllFileName + '|' + SELF.Name + '|' + dxLayoutControl_input.Name+ '.ini'));
|
||||
end;
|
||||
|
||||
procedure TfrmBaseOneTableInput.dxLayoutControl_inputDblClick(Sender: TObject);
|
||||
begin
|
||||
layoutDesign(TdxLayoutControl(Sender),ADOQueryBaseCmd,PWideChar(dcode));
|
||||
end;
|
||||
|
||||
procedure TfrmBaseOneTableInput.FormCreate(Sender: TObject);
|
||||
var
|
||||
mFontSize:integer;
|
||||
begin
|
||||
getSystemIni();
|
||||
if gFontSize<9 then
|
||||
begin
|
||||
mFontSize := 12;
|
||||
end
|
||||
else
|
||||
begin
|
||||
mFontSize:=gFontSize ;
|
||||
end;
|
||||
|
||||
self.Font.Size := gFontSize;
|
||||
if trim(gFontName)<>'' then
|
||||
self.Font.Name:=gFontName;
|
||||
fWindowDesign:=TWindowFormDeSign.Create();
|
||||
end;
|
||||
|
||||
procedure TfrmBaseOneTableInput.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
fWindowDesign.free;
|
||||
end;
|
||||
|
||||
procedure TfrmBaseOneTableInput.FormShow(Sender: TObject);
|
||||
begin
|
||||
tGridSet.Visible:=gIsCanDesign;
|
||||
fWindowDesign.FormStyleInit10(self,0,ADOQueryBaseTemp,ADOQueryBaseCmd) ;
|
||||
if dxLayoutControl_input.Tag<>999 then
|
||||
readLayOut(dxLayoutControl_input,ADOQueryBaseTemp,PWideChar( fDllFileName+'|'+self.name+'|'+dxLayoutControl_input.Name+'.ini'));
|
||||
|
||||
Tsj.Visible:=gIsCanDesign;
|
||||
end;
|
||||
|
||||
function TfrmBaseOneTableInput.SaveData(): Boolean;
|
||||
var
|
||||
maxno, Smaxno, maxorderno, MaxFNo: string;
|
||||
begin
|
||||
try
|
||||
result := false;
|
||||
ADOQueryBaseCmd.Connection.BeginTrans;
|
||||
/// 保存主表
|
||||
if trim(fKeyNo) = '' then
|
||||
begin
|
||||
if GetLSNo(ADOQueryBaseCmd, maxno, '', fTabelName, 3, 1) = false then
|
||||
raise Exception.Create('取最大号失败!');
|
||||
end
|
||||
else
|
||||
begin
|
||||
maxno := trim(fKeyNo);
|
||||
end;
|
||||
with ADOQueryBaseCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select * from '+fTabelName);
|
||||
sql.Add('where recid=' +quotedstr(trim(fKeyNo)));
|
||||
end;
|
||||
with ADOQueryBaseCmd do
|
||||
begin
|
||||
if IsEmpty then
|
||||
begin
|
||||
Append;
|
||||
fieldbyname('FillId').Value := trim(DCode);
|
||||
fieldbyname('Filler').Value := trim(DName);
|
||||
fieldbyname('status').Value := '0';
|
||||
end
|
||||
else
|
||||
begin
|
||||
Edit;
|
||||
fieldbyname('EditId').Value := trim(DCode);
|
||||
fieldbyname('Editer').Value := trim(DName);
|
||||
fieldbyname('EditTime').Value := SGetServerDateTime(ADOQueryBaseTemp);
|
||||
end;
|
||||
LRTSetsavedata(ADOQueryBaseCmd, fTabelName, dxLayoutControl_input, 2);
|
||||
fieldbyname('recid').Value := trim(maxno);
|
||||
|
||||
Post;
|
||||
end;
|
||||
|
||||
fkeyNo := trim(maxno);
|
||||
ADOQueryBaseCmd.Connection.CommitTrans;
|
||||
result := True;
|
||||
except
|
||||
ADOQueryBaseCmd.Connection.RollbackTrans;
|
||||
Application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
442
public10/design/U_DetailBaseList.dfm
Normal file
442
public10/design/U_DetailBaseList.dfm
Normal file
|
|
@ -0,0 +1,442 @@
|
|||
object frmDetailBaseList: TfrmDetailBaseList
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'frmDetailBaseList'
|
||||
ClientHeight = 605
|
||||
ClientWidth = 1077
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #24494#36719#38597#40657
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 21
|
||||
object ToolBar3: TToolBar
|
||||
Tag = 1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1077
|
||||
Height = 30
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 115
|
||||
Caption = 'ToolBar1'
|
||||
GradientEndColor = clWindow
|
||||
Images = DataLink_schedule.cxImageList_bar
|
||||
List = True
|
||||
GradientDrawingOptions = [gdoHotTrack]
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object Trefresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26597#35810
|
||||
ImageIndex = 8
|
||||
OnClick = TrefreshClick
|
||||
end
|
||||
object Tprint: TToolButton
|
||||
Left = 71
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23548#20986'Excel'
|
||||
ImageIndex = 28
|
||||
OnClick = TprintClick
|
||||
end
|
||||
object TprintGrid: TToolButton
|
||||
Left = 180
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 21
|
||||
OnClick = TprintGridClick
|
||||
end
|
||||
object TsaveGrid: TToolButton
|
||||
Left = 251
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384#26684#24335
|
||||
ImageIndex = 30
|
||||
OnClick = TsaveGridClick
|
||||
end
|
||||
object TgridLiSet: TToolButton
|
||||
Left = 354
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #34920#26684#21015#35774#32622
|
||||
ImageIndex = 16
|
||||
OnClick = TgridLiSetClick
|
||||
end
|
||||
object Tclose: TToolButton
|
||||
Left = 473
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 7
|
||||
OnClick = TcloseClick
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 14
|
||||
Top = 161
|
||||
Width = 985
|
||||
Height = 224
|
||||
TabOrder = 1
|
||||
object tv1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
ScrollbarAnnotations.CustomAnnotations = <>
|
||||
OnFocusedRecordChanged = tv1FocusedRecordChanged
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Filter.AutoDataSetFilter = True
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsData.Inserting = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = tv1
|
||||
end
|
||||
end
|
||||
object dxLayoutControl_query: TdxLayoutControl
|
||||
Left = 0
|
||||
Top = 75
|
||||
Width = 1077
|
||||
Height = 45
|
||||
Align = alTop
|
||||
TabOrder = 2
|
||||
AutoSize = True
|
||||
LayoutLookAndFeel = BaseDataLink.dxLayoutSkinLookAndFeel1
|
||||
OptionsItem.SizableHorz = True
|
||||
OptionsItem.SizableVert = True
|
||||
OnDblClick = dxLayoutControl_queryDblClick
|
||||
object dxLayoutControl_queryGroup_Root: TdxLayoutGroup
|
||||
AlignHorz = ahParentManaged
|
||||
AlignVert = avParentManaged
|
||||
CaptionOptions.AlignVert = tavCenter
|
||||
SizeOptions.AssignedValues = [sovSizableHorz, sovSizableVert]
|
||||
SizeOptions.SizableHorz = True
|
||||
SizeOptions.SizableVert = True
|
||||
Hidden = True
|
||||
LayoutDirection = ldHorizontal
|
||||
Padding.Bottom = -5
|
||||
Padding.Top = -5
|
||||
Padding.AssignedValues = [lpavBottom, lpavTop]
|
||||
ShowBorder = False
|
||||
Index = -1
|
||||
end
|
||||
end
|
||||
object Panel_page: TPanel
|
||||
Left = 0
|
||||
Top = 120
|
||||
Width = 1077
|
||||
Height = 37
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 3
|
||||
DesignSize = (
|
||||
1077
|
||||
37)
|
||||
object LBCPAP: TLabel
|
||||
Left = 425
|
||||
Top = 8
|
||||
Width = 100
|
||||
Height = 20
|
||||
Alignment = taCenter
|
||||
Anchors = [akLeft]
|
||||
AutoSize = False
|
||||
Caption = #24403#21069#39029'/'#24635#39029#25968
|
||||
Layout = tlCenter
|
||||
ExplicitTop = 7
|
||||
end
|
||||
object Label31: TLabel
|
||||
Left = 14
|
||||
Top = 8
|
||||
Width = 96
|
||||
Height = 21
|
||||
Alignment = taCenter
|
||||
Anchors = [akLeft]
|
||||
Caption = #27599#39029#35760#24405#26465#25968
|
||||
Layout = tlCenter
|
||||
ExplicitTop = 7
|
||||
end
|
||||
object BTNP: TButton
|
||||
Left = 532
|
||||
Top = 5
|
||||
Width = 78
|
||||
Height = 30
|
||||
Anchors = [akLeft]
|
||||
Caption = #19979#19968#39029
|
||||
TabOrder = 0
|
||||
OnClick = BTNPClick
|
||||
end
|
||||
object BTLP: TButton
|
||||
Left = 338
|
||||
Top = 4
|
||||
Width = 78
|
||||
Height = 31
|
||||
Anchors = [akLeft]
|
||||
Caption = #19978#19968#39029
|
||||
TabOrder = 1
|
||||
OnClick = BTLPClick
|
||||
end
|
||||
object TCBNOR: TcxComboBox
|
||||
Tag = 2
|
||||
Left = 122
|
||||
Top = 2
|
||||
Properties.DropDownListStyle = lsEditFixedList
|
||||
Properties.Items.Strings = (
|
||||
'500'
|
||||
'1000'
|
||||
'5000'
|
||||
'10000')
|
||||
Properties.OnChange = TCBNORPropertiesChange
|
||||
TabOrder = 2
|
||||
Text = '500'
|
||||
Width = 94
|
||||
end
|
||||
end
|
||||
object cxSplitter1: TcxSplitter
|
||||
Left = 0
|
||||
Top = 401
|
||||
Width = 1077
|
||||
Height = 8
|
||||
HotZoneClassName = 'TcxMediaPlayer8Style'
|
||||
AlignSplitter = salBottom
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 409
|
||||
Width = 1077
|
||||
Height = 196
|
||||
Align = alBottom
|
||||
TabOrder = 5
|
||||
object TV2: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
ScrollbarAnnotations.CustomAnnotations = <>
|
||||
DataController.DataSource = DataSource2
|
||||
DataController.Filter.AutoDataSetFilter = True
|
||||
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
|
||||
DataController.Summary.DefaultGroupSummaryItems = <
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end
|
||||
item
|
||||
Format = '0'
|
||||
Position = spFooter
|
||||
end>
|
||||
DataController.Summary.FooterSummaryItems = <
|
||||
item
|
||||
Kind = skSum
|
||||
end
|
||||
item
|
||||
Kind = skSum
|
||||
end>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsBehavior.FocusCellOnTab = True
|
||||
OptionsBehavior.GoToNextCellOnEnter = True
|
||||
OptionsBehavior.FocusCellOnCycle = True
|
||||
OptionsCustomize.ColumnFiltering = False
|
||||
OptionsData.Deleting = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
Styles.UseOddEvenStyles = bFalse
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = TV2
|
||||
end
|
||||
end
|
||||
inline frmFrameDateSel1: TfrmFrameDateSel10
|
||||
Left = 0
|
||||
Top = 30
|
||||
Width = 1077
|
||||
Height = 45
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
Color = clBtnFace
|
||||
ParentBackground = False
|
||||
ParentColor = False
|
||||
TabOrder = 6
|
||||
ExplicitTop = 30
|
||||
ExplicitWidth = 1077
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 1077
|
||||
ExplicitWidth = 1077
|
||||
inherited BegDate: TcxDateEdit
|
||||
Left = 116
|
||||
Top = 11
|
||||
ExplicitLeft = 116
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited EndDate: TcxDateEdit
|
||||
Left = 265
|
||||
Top = 11
|
||||
ExplicitLeft = 265
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton1: TcxButton
|
||||
Left = 465
|
||||
Top = 11
|
||||
ExplicitLeft = 465
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton2: TcxButton
|
||||
Left = 625
|
||||
Top = 11
|
||||
ExplicitLeft = 625
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton3: TcxButton
|
||||
Left = 756
|
||||
Top = 11
|
||||
ExplicitLeft = 756
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cbbType: TcxComboBox
|
||||
Left = 705
|
||||
Top = 11
|
||||
ExplicitLeft = 705
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton4: TcxButton
|
||||
Left = 385
|
||||
Top = 11
|
||||
ExplicitLeft = 385
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton5: TcxButton
|
||||
Left = 545
|
||||
Top = 11
|
||||
ExplicitLeft = 545
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited TimeType: TcxComboBox
|
||||
Left = 16
|
||||
Top = 11
|
||||
ExplicitLeft = 16
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited jqModel: TcxCheckBox
|
||||
Left = 859
|
||||
Top = 11
|
||||
ExplicitLeft = 859
|
||||
ExplicitTop = 11
|
||||
ExplicitWidth = 82
|
||||
ExplicitHeight = 25
|
||||
end
|
||||
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
|
||||
ItemIndex = 1
|
||||
end
|
||||
inherited dxLayoutItem1: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem2: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem8: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem9: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem10: TdxLayoutItem
|
||||
ControlOptions.OriginalHeight = 25
|
||||
ControlOptions.OriginalWidth = 82
|
||||
end
|
||||
end
|
||||
end
|
||||
object cxProgressBar1: TMovePanel
|
||||
Left = 240
|
||||
Top = 224
|
||||
Width = 233
|
||||
Height = 49
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #24494#36719#38597#40657
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 7
|
||||
Visible = False
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_Main
|
||||
Left = 768
|
||||
Top = 296
|
||||
end
|
||||
object ADOQueryMain: TADOQuery
|
||||
Connection = DataLink_schedule.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 704
|
||||
Top = 368
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 208
|
||||
Top = 287
|
||||
end
|
||||
object ADOQueryBaseCmd: TADOQuery
|
||||
Connection = DataLink_schedule.ADOLink
|
||||
Parameters = <>
|
||||
Left = 281
|
||||
Top = 248
|
||||
end
|
||||
object ADOQueryBaseTemp: TADOQuery
|
||||
Connection = DataLink_schedule.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 201
|
||||
Top = 225
|
||||
end
|
||||
object CDS_Main: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 395
|
||||
Top = 280
|
||||
end
|
||||
object ADOQuerySub: TADOQuery
|
||||
Connection = DataLink_schedule.ADOLink
|
||||
Parameters = <>
|
||||
Left = 320
|
||||
Top = 513
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = CDS_Sub
|
||||
Left = 408
|
||||
Top = 505
|
||||
end
|
||||
object cxGridPopupMenu2: TcxGridPopupMenu
|
||||
Grid = cxGrid2
|
||||
PopupMenus = <>
|
||||
Left = 232
|
||||
Top = 383
|
||||
end
|
||||
object CDS_Sub: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 211
|
||||
Top = 504
|
||||
end
|
||||
end
|
||||
437
public10/design/U_DetailBaseList.pas
Normal file
437
public10/design/U_DetailBaseList.pas
Normal file
|
|
@ -0,0 +1,437 @@
|
|||
unit U_DetailBaseList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.ToolWin, cxGraphics,
|
||||
cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,U_WindowFormdesign,
|
||||
dxSkinsDefaultPainters, dxSkinWXI, cxStyles, cxCustomData, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, cxNavigator, dxDateRanges, dxScrollbarAnnotations,
|
||||
Data.DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxClasses, cxGridCustomView, cxGrid, Data.Win.ADODB,math,
|
||||
dxBarBuiltInMenu, cxGridCustomPopupMenu, cxGridPopupMenu, cxCheckBox,
|
||||
cxContainer, dxCore, cxDateUtils, dxLayoutcxEditAdapters, dxLayoutContainer,
|
||||
cxMaskEdit, cxDropDownEdit, cxCalendar, cxTextEdit, dxLayoutControl,
|
||||
FrameDateSel, Datasnap.DBClient, cxMemo, Vcl.StdCtrls, Vcl.ExtCtrls,
|
||||
cxGeometry, dxFramedControl, dxPanel, cxSplitter, cxButtonEdit, FrameDateSel10,
|
||||
MovePanel;
|
||||
|
||||
type
|
||||
TfrmDetailBaseList = class(TForm)
|
||||
ToolBar3: TToolBar;
|
||||
Trefresh: TToolButton;
|
||||
Tprint: TToolButton;
|
||||
TprintGrid: TToolButton;
|
||||
TsaveGrid: TToolButton;
|
||||
Tclose: TToolButton;
|
||||
cxGrid1: TcxGrid;
|
||||
tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryMain: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryBaseCmd: TADOQuery;
|
||||
ADOQueryBaseTemp: TADOQuery;
|
||||
dxLayoutControl_query: TdxLayoutControl;
|
||||
dxLayoutControl_queryGroup_Root: TdxLayoutGroup;
|
||||
CDS_Main: TClientDataSet;
|
||||
Panel_page: TPanel;
|
||||
BTNP: TButton;
|
||||
LBCPAP: TLabel;
|
||||
BTLP: TButton;
|
||||
TCBNOR: TcxComboBox;
|
||||
Label31: TLabel;
|
||||
cxSplitter1: TcxSplitter;
|
||||
cxGrid2: TcxGrid;
|
||||
TV2: TcxGridDBTableView;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
ADOQuerySub: TADOQuery;
|
||||
DataSource2: TDataSource;
|
||||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||||
CDS_Sub: TClientDataSet;
|
||||
TgridLiSet: TToolButton;
|
||||
frmFrameDateSel1: TfrmFrameDateSel10;
|
||||
cxProgressBar1: TMovePanel;
|
||||
procedure TrefreshClick(Sender: TObject);
|
||||
procedure TprintClick(Sender: TObject);
|
||||
procedure TprintGridClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TcloseClick(Sender: TObject);
|
||||
procedure TsaveGridClick(Sender: TObject);
|
||||
procedure BTLPClick(Sender: TObject);
|
||||
procedure BTNPClick(Sender: TObject);
|
||||
procedure TCBNORPropertiesChange(Sender: TObject);
|
||||
procedure tv1FocusedRecordChanged(Sender: TcxCustomGridTableView;
|
||||
APrevFocusedRecord, AFocusedRecord: TcxCustomGridRecord;
|
||||
ANewItemRecordFocusingChanged: Boolean);
|
||||
procedure TgridLiSetClick(Sender: TObject);
|
||||
procedure dxLayoutControl_queryDblClick(Sender: TObject);
|
||||
private
|
||||
fWindowDesign: TWindowFormdesign;
|
||||
fDesignCode:string;
|
||||
CurrentPage, RecordsNumber: Integer;
|
||||
procedure doQuery();
|
||||
procedure doQueryByCriteria();
|
||||
procedure initGrid();
|
||||
procedure InitSub();
|
||||
protected
|
||||
fParameters1: string;
|
||||
fParameters2: string;
|
||||
fParameters3: string;
|
||||
fParameters4: string;
|
||||
fParameters5: string;
|
||||
fParameters10: string;
|
||||
public
|
||||
fFormId: integer;
|
||||
fProcedureName:string; //存储过程名称
|
||||
fProcedureSubName:string; //子存储过程名称
|
||||
FLMType:string; //报表文件类型标志
|
||||
ftimeType:string; //日期类型
|
||||
fQueryType:String; //查询类型
|
||||
FFiltration1:string; //打印参数条件
|
||||
fCriteria:string; //条件参数
|
||||
constructor Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
frmDetailBaseList: TfrmDetailBaseList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_RTFun, U_globalVar,U_cxGridCustomSet, U_dataLink,U_FormLayOutDesign, U_LabelPrint;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmDetailBaseList.BTLPClick(Sender: TObject);
|
||||
begin
|
||||
if CurrentPage > 1 then
|
||||
CurrentPage := CurrentPage - 1;
|
||||
doQuery();
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.BTNPClick(Sender: TObject);
|
||||
begin
|
||||
if CurrentPage < cds_Main.FieldByName('TotalCount').AsInteger / RecordsNumber then
|
||||
CurrentPage := CurrentPage + 1;
|
||||
doQuery();
|
||||
end;
|
||||
|
||||
constructor TfrmDetailBaseList.Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
if ACaption <> '' then
|
||||
Caption := ACaption;
|
||||
|
||||
fParameters1 := Parameters1;
|
||||
fParameters2 := Parameters2;
|
||||
fParameters3 := Parameters3;
|
||||
fParameters4 := Parameters4;
|
||||
fParameters5 := Parameters5;
|
||||
fParameters10 := Parameters10;
|
||||
fFormId:= FormID ;
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.TCBNORPropertiesChange(Sender: TObject);
|
||||
begin
|
||||
RecordsNumber := StrToInt(TCBNOR.Text);
|
||||
CurrentPage := 1;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.TcloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.TgridLiSetClick(Sender: TObject);
|
||||
begin
|
||||
if cxgrid2.IsFocused then
|
||||
fWindowDesign.OpenGridDesignWin10(fDesignCode+'|'+'cxgrid2','cxgrid2',tv2)
|
||||
else
|
||||
fWindowDesign.OpenGridDesignWin10(fDesignCode+'|'+'cxgrid1','cxgrid1',tv1);
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.TprintClick(Sender: TObject);
|
||||
begin
|
||||
if cds_Main.IsEmpty then
|
||||
Exit;
|
||||
TcxGridToExcel(self.Caption, cxgrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.TprintGridClick(Sender: TObject);
|
||||
begin
|
||||
if cds_Main.IsEmpty then
|
||||
Exit;
|
||||
if trim(self.FLMType)='' then
|
||||
begin
|
||||
application.MessageBox('未设置打印报表类型,请先设置!','提示信息',0);
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
frmLabelPrint := TfrmLabelPrint.Create(Application);
|
||||
with frmLabelPrint do
|
||||
begin
|
||||
FLMType := self.FLMType;
|
||||
FFiltration1 := self.FFiltration1;
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
// Self.InitGrid();
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmLabelPrint.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.TrefreshClick(Sender: TObject);
|
||||
begin
|
||||
if frmFrameDateSel1.BegDate.Visible then
|
||||
begin
|
||||
frmFrameDateSel1.BegDate.SetFocus;
|
||||
end;
|
||||
CurrentPage := 1;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.TsaveGridClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, gDllFileCaption);
|
||||
if gIsCanDesign then
|
||||
begin
|
||||
saveLayOut(application, dxLayoutControl_query, ADOQueryBaseCmd,PWideChar( fDllFileName + '|' + Self.Name + '|' + dxLayoutControl_query.Name + '.ini'));
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.tv1FocusedRecordChanged(
|
||||
Sender: TcxCustomGridTableView; APrevFocusedRecord,
|
||||
AFocusedRecord: TcxCustomGridRecord; ANewItemRecordFocusingChanged: Boolean);
|
||||
begin
|
||||
InitSub();
|
||||
end;
|
||||
|
||||
////////////////////////////////////
|
||||
procedure TfrmDetailBaseList.doQuery();
|
||||
var
|
||||
strwhere: string;
|
||||
begin
|
||||
if fProcedureName='' then
|
||||
begin
|
||||
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
|
||||
exit;
|
||||
end;
|
||||
strwhere := GetProcedureParam(dxLayoutControl_query);
|
||||
|
||||
try
|
||||
Tv1.BeginUpdate();
|
||||
cds_Main.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
close;
|
||||
Filtered := false;
|
||||
sql.Clear;
|
||||
sql.Add('exec '+fProcedureName);
|
||||
sql.Add('@timeType='+quotedstr(fTimeType));
|
||||
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
|
||||
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
|
||||
if frmFrameDateSel1.jqModel.Checked then
|
||||
sql.Add(',@jqModel=1')
|
||||
else
|
||||
sql.Add(',@jqModel=0');
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
|
||||
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
|
||||
end;
|
||||
sql.Add(',@criteria='+ quotedstr(fcriteria));
|
||||
if strwhere<>'' then
|
||||
sql.Add(','+strwhere);
|
||||
// showMessage(sql.Text);
|
||||
//cxMemo1.Text:= sql.Text ;
|
||||
open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain, cds_Main);
|
||||
SInitCDSData(ADOQueryMain, cds_Main);
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_Main.FieldByName('TotalCount').AsInteger / RecordsNumber));
|
||||
end;
|
||||
finally
|
||||
cds_Main.EnableControls;
|
||||
Tv1.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////
|
||||
procedure TfrmDetailBaseList.doQueryByCriteria();
|
||||
var
|
||||
mSqlWhere: string;
|
||||
begin
|
||||
if fProcedureName='' then
|
||||
begin
|
||||
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
|
||||
exit;
|
||||
end;
|
||||
|
||||
mSqlWhere := SLGetFilters(dxLayoutControl_query, 1, 2);
|
||||
if trim(mSqlWhere) <> '' then
|
||||
begin
|
||||
mSqlWhere := ' and ' + trim(mSqlWhere);
|
||||
end;
|
||||
mSqlWhere:=fCriteria + ' ' + mSqlWhere ;
|
||||
try
|
||||
Tv1.BeginUpdate();
|
||||
CDS_Main.DisableControls;
|
||||
with ADOQueryMain do
|
||||
begin
|
||||
close;
|
||||
Filtered := false;
|
||||
sql.Clear;
|
||||
sql.Add('exec '+fProcedureName);
|
||||
sql.Add('@timeType='+quotedstr(fTimeType));
|
||||
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
|
||||
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
|
||||
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
|
||||
end;
|
||||
sql.Add(',@criteria='+ quotedstr(mSqlWhere));
|
||||
|
||||
//cxMemo1.Text:= sql.Text ;
|
||||
open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryMain, CDS_Main);
|
||||
SInitCDSData(ADOQueryMain, CDS_Main);
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(CDS_Main.FieldByName('TotalCount').AsInteger / RecordsNumber));
|
||||
end;
|
||||
finally
|
||||
CDS_Main.EnableControls;
|
||||
Tv1.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmDetailBaseList.dxLayoutControl_queryDblClick(Sender: TObject);
|
||||
begin
|
||||
layoutDesign(TdxLayoutControl(Sender),ADOQueryBaseCmd,PWideChar(dcode));
|
||||
end;
|
||||
|
||||
///
|
||||
procedure TfrmDetailBaseList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
|
||||
Sendmessage(application.MainForm.Handle, WM_CloseForm, 4, 0);
|
||||
|
||||
Action:=cafree;
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.FormCreate(Sender: TObject);
|
||||
var
|
||||
mFontSize:integer;
|
||||
begin
|
||||
getSystemIni();
|
||||
if gFontSize<9 then
|
||||
begin
|
||||
mFontSize := 12;
|
||||
end
|
||||
else
|
||||
begin
|
||||
mFontSize:=gFontSize ;
|
||||
end;
|
||||
|
||||
self.Font.Size := gFontSize;
|
||||
if trim(gFontName)<>'' then
|
||||
self.Font.Name:=gFontName;
|
||||
cxgrid1.Align:=alClient;
|
||||
CurrentPage := 1;
|
||||
RecordsNumber := 500;
|
||||
fWindowDesign := TWindowFormdesign.Create();
|
||||
frmFrameDateSel1.begdate.Date:=SGetServerDate(ADOQueryBaseTemp);
|
||||
frmFrameDateSel1.enddate.Date:=frmFrameDateSel1.begdate.Date;
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
fWindowDesign.free;
|
||||
end;
|
||||
|
||||
procedure TfrmDetailBaseList.FormShow(Sender: TObject);
|
||||
begin
|
||||
if DParameters8<>'1' then
|
||||
begin
|
||||
fWindowDesign.FormStyleInit10(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10);
|
||||
end;
|
||||
//
|
||||
if dxLayoutControl_query.Tag<>999 then
|
||||
readLayOut(dxLayoutControl_query,ADOQueryBaseTemp,PWideChar( fDllFileName+'|'+self.name+'|'+dxLayoutControl_query.Name+'.ini'));
|
||||
fWindowDesign.fProcedureName:=fProcedureName;
|
||||
TgridLiSet.Visible:=gIsCanDesign;
|
||||
fdesignCode := fDllFileName +'|'+self.name+ '|' + intTostr(fformId) ;
|
||||
CreateCxGridColumn( Tv1,ADOQueryBaseTemp,PWideChar(fdesignCode+'|cxgrid1'));
|
||||
CreateCxGridColumn( Tv1,ADOQueryBaseTemp,PWideChar(fdesignCode+'|cxgrid2'));
|
||||
//增加动态条件
|
||||
addQryContionByLay(ADOQueryBaseTemp,fformId,'cxgrid1',dxLayoutControl_query,7);
|
||||
ReadCxGrid(trim(self.Caption) + 'Tv1', Tv1, gDllFileCaption);
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
///////////////////////////////
|
||||
///
|
||||
procedure TfrmDetailBaseList.initGrid();
|
||||
begin
|
||||
if fProcedureName='' then exit;
|
||||
try
|
||||
cxProgressBar1.Visible:=true;
|
||||
cxProgressBar1.Refresh ;
|
||||
|
||||
if fQueryType='criteria' then
|
||||
begin
|
||||
doQueryByCriteria() ;
|
||||
end
|
||||
else
|
||||
begin
|
||||
frmFrameDateSel1.jqModel.Checked:=true;
|
||||
doQuery() ;
|
||||
end;
|
||||
|
||||
finally
|
||||
cxProgressBar1.Visible:=false;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
/////////////////////////
|
||||
procedure TfrmDetailBaseList.InitSub();
|
||||
begin ADOQuerySub.close;
|
||||
if fProcedureSubName='' then
|
||||
begin
|
||||
application.MessageBox('您还未设置子存储过程名称!','提示信息',0);
|
||||
exit;
|
||||
end;
|
||||
if CDS_Main.IsEmpty then
|
||||
Exit;
|
||||
try
|
||||
TV2.BeginUpdate();
|
||||
CDS_SUB.DisableControls;
|
||||
with ADOQuerySub do begin close;
|
||||
sql.Clear;
|
||||
sql.Add('exec '+fProcedureSubName);
|
||||
sql.Add('@mainId =' + quotedstr((CDS_Main.fieldbyname('mainID')
|
||||
.AsString)));
|
||||
Open;
|
||||
end;
|
||||
|
||||
SCreateCDS(ADOQuerySub, CDS_SUB);
|
||||
SInitCDSData(ADOQuerySub, CDS_SUB);
|
||||
finally
|
||||
CDS_SUB.EnableControls;
|
||||
TV2.EndUpdate;
|
||||
end;
|
||||
|
||||
//
|
||||
end;
|
||||
end.
|
||||
9
public10/design/U_FormDesign.pas
Normal file
9
public10/design/U_FormDesign.pas
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
unit U_FormDesign;
|
||||
|
||||
interface
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
|
||||
end.
|
||||
68
public10/design/U_FormInitThread.pas
Normal file
68
public10/design/U_FormInitThread.pas
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
unit U_FormInitThread;
|
||||
|
||||
interface
|
||||
uses
|
||||
Classes, SysUtils, Forms,U_WindowFormdesign,Messages,Data.DB,Data.Win.ADODB;
|
||||
type
|
||||
TFormInitThread = class(TThread)
|
||||
private
|
||||
fWindowDesign: TWindowFormdesign; // 替换为你的数据模块类型
|
||||
fForm:Tform;
|
||||
fFormId:integer;
|
||||
fADOTmp: TADOQuery;
|
||||
fADOQCmd: TADOQuery;
|
||||
fWhichFun:String;
|
||||
procedure LoadData;
|
||||
protected
|
||||
procedure Execute; override;
|
||||
public
|
||||
constructor Create( mWindowDesign: TWindowFormdesign;mForm: Tform; mFormId: integer; ADOTmp: TADOQuery; ADOQCmd: TADOQuery;mWhichFun:String);
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
constructor TFormInitThread.Create(mWindowDesign: TWindowFormdesign;mForm: Tform; mFormId: integer; ADOTmp: TADOQuery; ADOQCmd: TADOQuery;mWhichFun:String);
|
||||
begin
|
||||
inherited Create(False);
|
||||
fWindowDesign := mWindowDesign;
|
||||
fForm:= mForm ;
|
||||
fFormId:=mFormId;
|
||||
fADOTmp:= ADOTmp ;
|
||||
fADOQCmd:= ADOQCmd ;
|
||||
fWhichFun:= mWhichFun ;
|
||||
FreeOnTerminate := True; // 线程终止时自动释放
|
||||
end;
|
||||
|
||||
procedure TFormInitThread.Execute;
|
||||
var
|
||||
i:integer;
|
||||
begin
|
||||
// 在这里执行耗时的数据加载操作
|
||||
Synchronize(LoadData); // 使用 Synchronize 方法确保在主线程中更新 UI
|
||||
//LoadData();
|
||||
end;
|
||||
procedure TFormInitThread.LoadData;
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
// 这里是实际加载数据的代码
|
||||
// 假设你有一个方法叫 LoadDataFromDatabase 在数据模块中
|
||||
if fWhichFun='' then
|
||||
fWindowDesign.FormStyleInit1(fForm, fFormId, fADOTmp, fADOQCmd, '', '')
|
||||
else
|
||||
fWindowDesign.FormStyleInit(fForm, fFormId, fADOTmp, fADOQCmd, '', '');
|
||||
|
||||
// showMessage('44');
|
||||
// for I := 0 to 10000000000 do
|
||||
// begin
|
||||
// if I=1000000000 then
|
||||
// begin
|
||||
// application.MessageBox(pchar('444'),'',0);
|
||||
// end;
|
||||
//end;
|
||||
|
||||
// 如果需要更新 UI,可以在这里做,因为 Synchronize 保证了它在主线程中执行
|
||||
// 例如:YourForm.YourControl.Caption := 'Data Loaded';
|
||||
// 注意:确保 YourForm 和 YourControl 在此上下文中是有效的,或者通过其他方式传递引用
|
||||
end;
|
||||
end.
|
||||
718
public10/design/U_FormLayOutDesign.pas
Normal file
718
public10/design/U_FormLayOutDesign.pas
Normal file
|
|
@ -0,0 +1,718 @@
|
|||
unit U_FormLayOutDesign;
|
||||
interface
|
||||
uses
|
||||
Windows, SysUtils, Messages, Classes, Controls, StdCtrls, ComCtrls, Forms,
|
||||
ExtCtrls, ComObj, DXCORE, ActiveX, cxMemo, cxButtons, Graphics, IniFiles,
|
||||
Dialogs, Menus, DB, ADODB, cxLabel, BtnEdit, RTComboBox, cxTextEdit, cxMRUEdit,
|
||||
cxDBData, cxGridLevel, cxButtonEdit, cxCurrencyEdit, cxGridTableView, cxGrid,
|
||||
cxGridCustomTableView, cxGraphics, cxCalendar, cxCheckBox, cxGridDBTableView,StrUtils,
|
||||
cxGridDBBandedTableView, cxStyles, cxPc, cxGroupBox, dxLayoutContainer, U_dataLink,
|
||||
cxCustomData, cxClasses, cxTimeEdit, cxEdit, cxLookAndFeels, dxLayoutControl, TypInfo,
|
||||
cxLookAndFeelPainters, cxGridCustomView, Buttons, cxDropDownEdit;
|
||||
|
||||
|
||||
//function saveLayOut(dxLayoutControl1:TdxLayoutControl; ADOCmd: TADOQuery;mdesignCode:string):Boolean;
|
||||
function readLayOut(dxLayoutControl1:TdxLayoutControl; ADOTmp: TADOQuery;mdesignCode:string):Boolean;
|
||||
//function mustInCheck(dxLayoutControl1:TdxLayoutControl ;textFlag:string='*'):Boolean;
|
||||
//procedure SetFormOperRight(app:Tapplication;mParent: TwinControl; mRightCaptions: PWideChar)stdcall;external 'rtCommon.dll' Name 'SetFormOperRight_A';
|
||||
//function getSystemFontSize(ADOTmp: TADOQuery;mStyleCode:PWideChar): Integer;stdcall;external 'rtCommon.dll' Name 'getSystemFontSize_A';
|
||||
function mustInCheck(app:Tapplication;dxLayoutControl1:TdxLayoutControl;textFlag:string='*'):boolean;
|
||||
function mustInCheck_R(app:Tapplication;dxLayoutGroup:TdxLayoutGroup ;textFlag:string='*'):Boolean;
|
||||
//function isHasDesignRight(ADOTmp: TADOQuery;userId:PWideChar): boolean;stdcall;external 'rtCommon.dll' Name 'isHasDesignRight_A';
|
||||
//function isUseSkin(): boolean;stdcall;external 'rtCommon.dll' Name 'isUseSkin_A';
|
||||
//function isGridNativeSet(): boolean;stdcall;external 'rtCommon.dll' Name 'isGridNativeSet_A';
|
||||
//function readLayOut(app:Tapplication;dxLayoutControl1:TdxLayoutControl; ADOTmp: TADOQuery;mdesignCode:PWideChar):integer;stdcall;external 'rtCommon.dll' Name 'readLayOut_A';
|
||||
function saveLayOut(app:Tapplication;dxLayoutControl1:TdxLayoutControl; ADOCmd: TADOQuery;pdesignCode:PWideChar):boolean;
|
||||
procedure layoutDesign(dxLayoutControl1:TdxLayoutControl;ADOTmp: TADOQuery;userId:string );
|
||||
procedure SetShowModalHide(mHandle:Thandle;form:Tform);
|
||||
procedure InitStyleData( StyleRepository:TcxStyleRepository;mFontSize:integer);
|
||||
function GetsysParam(AdoTmp:Tadoquery;StyleRepository:TcxStyleRepository;muserId: pchar; fparam1: pchar): Boolean;
|
||||
//procedure addQryCondition1(Application:Tapplication;AdoTmp:Tadoquery;Panel_zdy:Tpanel;layOut: TdxLayoutControl;mdesignCode:PWideChar;rowCount:integer=4)stdcall;external 'rtCommon.dll' Name 'addQryCondition';
|
||||
procedure addQryCondition( AdoTmp:Tadoquery;formId:Integer;gridName:string;FlowPanel1:TFlowPanel;rowCount:integer=4);
|
||||
procedure addQryContionByLay(AdoTmp:Tadoquery;formId:Integer;gridName:string;layOut:TdxLayoutControl;rowCount:integer=4);
|
||||
procedure initWinData(AdoTmp:TadoQuery;obj:TwinControl;sqlStr:string);
|
||||
function GetProcedureParam(layoutControl: TdxLayoutControl; EquTag: Integer=0): string;
|
||||
procedure getSystemIni();
|
||||
function IsHasDesignRight(ADOTmp: TADOQuery;userId:String): boolean;
|
||||
function TryGetTextProperty(AComponent: TComponent; out Value: string): Boolean;
|
||||
procedure HideUnenabledButton(Toolbar: TToolbar);
|
||||
implementation
|
||||
uses
|
||||
U_globalVar;
|
||||
|
||||
//
|
||||
function readLayOut(dxLayoutControl1:TdxLayoutControl; ADOTmp: TADOQuery;mdesignCode:string):Boolean;
|
||||
var
|
||||
LayoutStream: TMemoryStream;
|
||||
begin
|
||||
LayoutStream := TMemoryStream.Create;
|
||||
try
|
||||
dxLayoutControl1.BeginUpdate ;
|
||||
with ADOTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* ');
|
||||
sql.Add('from SD_Design_FormLayout A');
|
||||
sql.Add('where A.designCode=' + quotedStr(mdesignCode));
|
||||
open;
|
||||
|
||||
if RecordCount>0 then
|
||||
begin
|
||||
TBlobField(FieldByName('fileContent')).SaveToStream(LayoutStream) ;
|
||||
LayoutStream.Seek(0,soFromBeginning);
|
||||
dxLayoutControl1.LoadFromStream(LayoutStream);
|
||||
end;
|
||||
Close;
|
||||
end;
|
||||
finally
|
||||
dxLayoutControl1.EndUpdate();
|
||||
LayoutStream.Free; // 释放内存流
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
procedure InitStyleData( StyleRepository:TcxStyleRepository;mFontSize:integer);
|
||||
var
|
||||
i:integer;
|
||||
begin
|
||||
if mFontSize<9 then mFontSize:=9;
|
||||
|
||||
for i := 0 to StyleRepository.Count-1 do
|
||||
begin
|
||||
TcxStyle( StyleRepository.Items[i] ).Font.Size:=mFontSize;
|
||||
end;
|
||||
end;
|
||||
|
||||
///
|
||||
function GetsysParam(AdoTmp:Tadoquery;StyleRepository:TcxStyleRepository;muserId: pchar; fparam1: pchar): Boolean;
|
||||
var
|
||||
i:integer;
|
||||
begin
|
||||
result := true;
|
||||
//////////////////////////////
|
||||
// shortDateFormat := 'yyyy-MM-dd';
|
||||
//服务器日期
|
||||
with AdoTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select getDate()as dt');
|
||||
open;
|
||||
DServerDate := fieldByName('dt').AsDatetime;
|
||||
end;
|
||||
|
||||
InitStyleData(StyleRepository,gFontSize);
|
||||
|
||||
result := true;
|
||||
end;
|
||||
|
||||
procedure addQryCondition( AdoTmp:Tadoquery;formId:Integer;gridName:string;FlowPanel1:TFlowPanel;rowCount:integer=4);
|
||||
var
|
||||
i,k:integer;
|
||||
textEdit:TcxTextEdit;
|
||||
combox:TcxCombobox;
|
||||
cxDateEdit:TcxDateEdit;
|
||||
cxButtonEdit:TcxButtonEdit;
|
||||
lable:Tlabel;
|
||||
rows:integer;
|
||||
mwidth:integer;
|
||||
mdesignCode :String;
|
||||
begin
|
||||
mdesignCode := fDllFileName +'|'+FlowPanel1.Parent.name+ '|' + intTostr(formId) + '|' + gridName;
|
||||
mwidth:=FlowPanel1.Width div rowCount ;
|
||||
FlowPanel1.AutoSize:=true;
|
||||
|
||||
with AdoTmp do begin close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* ');
|
||||
sql.Add('from SD_FormGrid_Design A');
|
||||
sql.Add('where A.designCode=' + quotedStr(mdesignCode));
|
||||
sql.Add('and columnQuery=1');
|
||||
sql.Add('order by queryControlOrder');
|
||||
open;
|
||||
if isEmpty then
|
||||
begin
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
AdoTmp.First;
|
||||
while not AdoTmp.eof do
|
||||
begin
|
||||
if FlowPanel1.Parent.FindComponent(trim(AdoTmp.FieldByName('fieldName').AsString))<>nil then
|
||||
begin
|
||||
AdoTmp.next;
|
||||
continue;
|
||||
end;
|
||||
lable:=Tlabel.Create(nil);
|
||||
lable.Alignment:=taCenter;
|
||||
lable.AlignWithMargins:=true;
|
||||
|
||||
lable.Caption:=trim(AdoTmp.FieldByName('caption').AsString)+'';
|
||||
lable.Parent:=FlowPanel1 ;
|
||||
|
||||
if trim(AdoTmp.FieldByName('queryControlType').AsString)='combox' then
|
||||
begin
|
||||
combox:= TcxCombobox.Create(nil);
|
||||
combox.Name:= trim(AdoTmp.FieldByName('fieldName').AsString);
|
||||
combox.Text:='';
|
||||
combox.Parent:= FlowPanel1 ;
|
||||
combox.AlignWithMargins:=true;
|
||||
combox.Width:= mwidth - lable.Width - mwidth div rowCount;
|
||||
//
|
||||
if trim(AdoTmp.FieldByName('sqlStr').AsString)<>'' then
|
||||
initWinData(AdoTmp,combox,trim(AdoTmp.FieldByName('sqlStr').AsString));
|
||||
end
|
||||
else if trim(AdoTmp.FieldByName('queryControlType').AsString)='date' then
|
||||
begin
|
||||
cxDateEdit:= TcxDateEdit.Create(nil);
|
||||
cxDateEdit.Name:= trim(AdoTmp.FieldByName('fieldName').AsString);
|
||||
cxDateEdit.Date:=date();
|
||||
cxDateEdit.Properties.ShowTime:=false;
|
||||
cxDateEdit.Parent:= FlowPanel1 ;
|
||||
cxDateEdit.AlignWithMargins:=true;
|
||||
cxDateEdit.Width:= mwidth - lable.Width - mwidth div rowCount;
|
||||
end
|
||||
else if trim(AdoTmp.FieldByName('queryControlType').AsString)='buttonedit' then
|
||||
begin
|
||||
cxButtonEdit:= TcxButtonEdit.Create(nil);
|
||||
cxButtonEdit.Name:= trim(AdoTmp.FieldByName('fieldName').AsString);
|
||||
cxButtonEdit.Text:='';
|
||||
cxButtonEdit.Parent:= FlowPanel1 ;
|
||||
cxButtonEdit.AlignWithMargins:=true;
|
||||
cxButtonEdit.Width:= mwidth - lable.Width - mwidth div rowCount;
|
||||
end
|
||||
else
|
||||
begin
|
||||
textEdit:= TcxTextEdit.Create(nil);
|
||||
textEdit.Name:= trim(AdoTmp.FieldByName('fieldName').AsString);
|
||||
textEdit.Text:='';
|
||||
textEdit.Parent:= FlowPanel1 ;
|
||||
textEdit.AlignWithMargins:=true;
|
||||
textEdit.Width:= mwidth - lable.Width - mwidth div rowCount;
|
||||
end;
|
||||
|
||||
|
||||
AdoTmp.Next ;
|
||||
end;
|
||||
end;
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
procedure addQryContionByLay(AdoTmp:Tadoquery;formId:Integer;gridName:string;layOut:TdxLayoutControl;rowCount:integer=4);
|
||||
var
|
||||
ALayoutGroup: TdxLayoutGroup;
|
||||
ALayoutGroup1: TdxLayoutGroup;
|
||||
ALayoutItem: TdxLayoutItem;
|
||||
itemGroup: TdxCustomLayoutItem ;
|
||||
textEdit:TcxTextEdit;
|
||||
combox:TcxCombobox;
|
||||
cxDateEdit:TcxDateEdit;
|
||||
cxButtonEdit:TcxButtonEdit;
|
||||
cxCheckBox:TcxCheckBox;
|
||||
mwidth,i,j,cnt:integer;
|
||||
mdesignCode :String;
|
||||
begin
|
||||
|
||||
mdesignCode := fDllFileName +'|'+layOut.Parent.name+ '|' + intTostr(formId) + '|' + gridName;
|
||||
|
||||
layOut.BeginUpdate; // Postpones updates
|
||||
try
|
||||
with AdoTmp do begin close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* ');
|
||||
sql.Add('from SD_FormGrid_Design A');
|
||||
sql.Add('where A.designCode=' + quotedStr(mdesignCode));
|
||||
sql.Add('and columnQuery=1');
|
||||
sql.Add('order by queryControlOrder');
|
||||
open;
|
||||
if isEmpty then
|
||||
begin
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
// Creates a child group within the root group
|
||||
for i := 0 to layOut.Items.Count - 1 do
|
||||
begin
|
||||
itemGroup := layOut.Items[i];
|
||||
// 检查项是否是组
|
||||
if itemGroup is TdxLayoutGroup then
|
||||
begin
|
||||
ALayoutGroup:= TdxLayoutGroup(itemGroup);
|
||||
break;
|
||||
end;
|
||||
|
||||
end;
|
||||
//
|
||||
if (ALayoutGroup=nil) or (ALayoutGroup.Count> rowCount) then
|
||||
ALayoutGroup := TdxLayoutGroup(layOut.CreateGroup(nil, layOut.Items));
|
||||
ALayoutGroup.LayoutDirection:=ldHorizontal;
|
||||
ALayoutGroup.Hidden:=true;
|
||||
// ALayoutGroup.Name:='zdygroup1';
|
||||
ALayoutGroup.CaptionOptions.Text := ''; // Specifies the group caption
|
||||
ALayoutGroup.Padding.Top:=-5;
|
||||
//
|
||||
AdoTmp.First;
|
||||
cnt:=1;
|
||||
while not AdoTmp.eof do
|
||||
begin
|
||||
if layOut.Parent.FindComponent(trim(AdoTmp.FieldByName('fieldName').AsString))<>nil then
|
||||
begin
|
||||
AdoTmp.next;
|
||||
continue;
|
||||
end;
|
||||
|
||||
ALayoutItem:= TdxLayoutItem( layOut.FindItem('item_'+trim(AdoTmp.FieldByName('fieldName').AsString))) ;
|
||||
|
||||
|
||||
if cnt mod rowCount=0 then
|
||||
begin
|
||||
ALayoutGroup:=TdxLayoutGroup(layOut.CreateGroup(nil, layOut.Items));
|
||||
ALayoutGroup.LayoutDirection:=ldHorizontal;
|
||||
ALayoutGroup.Hidden:=true;
|
||||
ALayoutGroup.CaptionOptions.Text := '';
|
||||
// ALayoutGroup.Padding.Top:=5;
|
||||
ALayoutGroup.Offsets.Top:=5;
|
||||
end;
|
||||
|
||||
if trim(AdoTmp.FieldByName('queryControlType').AsString)='combox' then
|
||||
begin
|
||||
combox:= TcxCombobox.Create(nil);
|
||||
combox.Name:= trim(AdoTmp.FieldByName('fieldName').AsString);
|
||||
combox.Text:='';
|
||||
combox.Style.Font.Size:=gFontSize;
|
||||
combox.AlignWithMargins:=true;
|
||||
combox.TabOrder:=cnt;
|
||||
combox.tag:=2;
|
||||
//
|
||||
if trim(AdoTmp.FieldByName('sqlStr').AsString)<>'' then
|
||||
initWinData(AdoTmp,combox,trim(AdoTmp.FieldByName('sqlStr').AsString));
|
||||
|
||||
if ALayoutItem=nil then
|
||||
ALayoutItem := TdxLayoutItem(layOut.CreateItem);
|
||||
ALayoutItem.Control := combox;
|
||||
ALayoutItem.CaptionOptions.Text:=trim(AdoTmp.FieldByName('caption').AsString) ;
|
||||
ALayoutItem.Parent := ALayoutGroup;
|
||||
ALayoutItem.Name:= 'item_'+trim(AdoTmp.FieldByName('fieldName').AsString) ;
|
||||
|
||||
end
|
||||
else if trim(AdoTmp.FieldByName('queryControlType').AsString)='checkBox' then
|
||||
begin
|
||||
cxCheckBox:= TcxCheckBox.Create(nil);
|
||||
cxCheckBox.Name:= trim(AdoTmp.FieldByName('fieldName').AsString);
|
||||
cxCheckBox.AlignWithMargins:=true;
|
||||
cxCheckBox.Style.Font.Size:=gFontSize;
|
||||
cxCheckBox.Caption:= trim(AdoTmp.FieldByName('caption').AsString) ;
|
||||
cxCheckBox.TabOrder:=cnt;
|
||||
cxCheckBox.Tag:=99;
|
||||
//
|
||||
if ALayoutItem=nil then
|
||||
ALayoutItem := TdxLayoutItem(layOut.CreateItem);
|
||||
ALayoutItem.Control := cxCheckBox;
|
||||
ALayoutItem.CaptionOptions.Text:='';//trim(AdoTmp.FieldByName('caption').AsString) ;
|
||||
ALayoutItem.Parent := ALayoutGroup;
|
||||
ALayoutItem.Name:= 'item_'+trim(AdoTmp.FieldByName('fieldName').AsString) ;
|
||||
|
||||
end
|
||||
else if trim(AdoTmp.FieldByName('queryControlType').AsString)='date' then
|
||||
begin
|
||||
cxDateEdit:= TcxDateEdit.Create(nil);
|
||||
cxDateEdit.Name:= trim(AdoTmp.FieldByName('fieldName').AsString);
|
||||
cxDateEdit.Date:=date();
|
||||
cxDateEdit.Properties.ShowTime:=false;
|
||||
cxDateEdit.AlignWithMargins:=true;
|
||||
cxDateEdit.Style.Font.Size:=gFontSize;
|
||||
cxDateEdit.TabOrder:=cnt;
|
||||
//
|
||||
if ALayoutItem=nil then
|
||||
ALayoutItem := TdxLayoutItem(layOut.CreateItem);
|
||||
ALayoutItem.Control := cxDateEdit;
|
||||
ALayoutItem.CaptionOptions.Text:=trim(AdoTmp.FieldByName('caption').AsString) ;
|
||||
ALayoutItem.Parent := ALayoutGroup;
|
||||
ALayoutItem.Name:= 'item_'+trim(AdoTmp.FieldByName('fieldName').AsString) ;
|
||||
|
||||
end
|
||||
else if trim(AdoTmp.FieldByName('queryControlType').AsString)='buttonedit' then
|
||||
begin
|
||||
cxButtonEdit:= TcxButtonEdit.Create(nil);
|
||||
cxButtonEdit.Name:= trim(AdoTmp.FieldByName('fieldName').AsString);
|
||||
cxButtonEdit.Text:='';
|
||||
cxButtonEdit.AlignWithMargins:=true;
|
||||
cxButtonEdit.Style.Font.Size:=gFontSize;
|
||||
cxButtonEdit.TabOrder:=cnt;
|
||||
cxButtonEdit.tag:=2;
|
||||
|
||||
//
|
||||
if ALayoutItem=nil then
|
||||
ALayoutItem := TdxLayoutItem(layOut.CreateItem);
|
||||
ALayoutItem.Control := cxButtonEdit;
|
||||
ALayoutItem.CaptionOptions.Text:=trim(AdoTmp.FieldByName('caption').AsString) ;
|
||||
ALayoutItem.Parent := ALayoutGroup;
|
||||
ALayoutItem.Name:= 'item_'+trim(AdoTmp.FieldByName('fieldName').AsString) ;
|
||||
|
||||
end
|
||||
else
|
||||
begin
|
||||
textEdit:= TcxTextEdit.Create(nil);
|
||||
textEdit.Name:= trim(AdoTmp.FieldByName('fieldName').AsString);
|
||||
textEdit.Text:='';
|
||||
textEdit.AlignWithMargins:=true;
|
||||
textEdit.Style.Font.Size:=gFontSize;
|
||||
// textEdit.Properties.OnEditValueChanged:=TfilterClick;
|
||||
textEdit.TabOrder:=cnt;
|
||||
textEdit.tag:=2;
|
||||
|
||||
//
|
||||
if ALayoutItem=nil then
|
||||
ALayoutItem := TdxLayoutItem(layOut.CreateItem);
|
||||
ALayoutItem.Control := textEdit;
|
||||
ALayoutItem.CaptionOptions.Text:=trim(AdoTmp.FieldByName('caption').AsString) ;
|
||||
ALayoutItem.Parent := ALayoutGroup;
|
||||
ALayoutItem.Name:= 'item_'+trim(AdoTmp.FieldByName('fieldName').AsString) ;
|
||||
end;
|
||||
|
||||
inc(cnt);
|
||||
|
||||
AdoTmp.Next ;
|
||||
end;
|
||||
//
|
||||
|
||||
|
||||
|
||||
for i := 0 to layOut.Items.Count - 1 do
|
||||
begin
|
||||
itemGroup := layOut.Items[i];
|
||||
// 检查项是否是组
|
||||
if itemGroup is TdxLayoutGroup then
|
||||
begin
|
||||
ALayoutGroup:= TdxLayoutGroup(itemGroup);
|
||||
|
||||
for j := ALayoutGroup.VisibleCount-1 downto 0 do
|
||||
begin
|
||||
if ALayoutGroup.VisibleItems[j] is TdxLayoutItem then
|
||||
begin
|
||||
if TdxLayoutItem( ALayoutGroup.VisibleItems[j] ).Control=nil then
|
||||
ALayoutGroup.VisibleItems[j].Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
finally
|
||||
layOut.EndUpdate; // Resumes updates, even if an exception occurs
|
||||
if layout.Items.VisibleCount=0 then layout.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
procedure initWinData(AdoTmp:TadoQuery;obj:TwinControl;sqlStr:string);
|
||||
var
|
||||
ado1:TadoQuery;
|
||||
begin
|
||||
try
|
||||
ado1:=TadoQuery.Create(nil);
|
||||
ado1.Connection:= AdoTmp.Connection;
|
||||
with ado1 do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.add(sqlStr);
|
||||
open;
|
||||
if RecordCount>0 then
|
||||
begin
|
||||
if obj is TcxCombobox then
|
||||
begin
|
||||
while not Eof do
|
||||
begin
|
||||
TcxCombobox(obj).Properties.Items.Add(trim(fields[0].AsString));
|
||||
next;
|
||||
end;
|
||||
end;
|
||||
close;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
ado1.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
//
|
||||
/// /////////////////////////////////////////
|
||||
/// /************获取存储过程参数***********/////
|
||||
/// /////////////////////////////////////////
|
||||
function GetProcedureParam(layoutControl: TdxLayoutControl; EquTag: Integer=0): string;
|
||||
var
|
||||
i, j, k: Integer;
|
||||
mControl:TControl;
|
||||
begin
|
||||
Result := '';
|
||||
with layoutControl do
|
||||
begin
|
||||
for i := 0 to layoutControl.ControlCount -1 do
|
||||
begin
|
||||
mControl:=layoutControl.Controls[i];
|
||||
if layoutControl.FindItem(mControl) =nil then continue;
|
||||
if not layoutControl.FindItem(mControl).Visible then continue;
|
||||
|
||||
if mControl is TLabel or (mControl.Tag=99) then
|
||||
continue;
|
||||
|
||||
if mControl is TcxTextEdit then
|
||||
begin
|
||||
Result := Result + ',@'+mControl.Name + '=' + quotedStr(Trim(TcxTextEdit(mControl).Text)) ;
|
||||
end
|
||||
else if mControl is TcxButtonEdit then
|
||||
begin
|
||||
if Trim(TBtnEditC(mControl).TxtCode) <> '' then
|
||||
begin
|
||||
Result := Result + ',@' + mControl.Name + '=' + quotedStr(Trim(TBtnEditC(mControl).TxtCode)) ;
|
||||
|
||||
end
|
||||
else
|
||||
begin
|
||||
Result := Result + ',@' + mControl.Name + '=' + quotedStr(Trim(TBtnEditC(mControl).Text)) ;
|
||||
end;
|
||||
end
|
||||
|
||||
else if mControl is TcxComboBox then
|
||||
begin
|
||||
Result := Result + ',@' + mControl.Name + '=' + quotedStr(Trim(TcxComboBox(mControl).Text)) ;
|
||||
|
||||
end
|
||||
else if mControl is TcxCheckBox then
|
||||
begin
|
||||
if TcxCheckBox(mControl).Checked then
|
||||
Result := Result + ',@' + mControl.Name + '=1'
|
||||
else
|
||||
Result := Result + ',@' + mControl.Name + '=0' ;
|
||||
|
||||
end
|
||||
end;
|
||||
end;
|
||||
if Trim(Result) <> '' then
|
||||
Result := Trim(RightStr(Result, Length(Result) - 1));
|
||||
end;
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
//
|
||||
procedure getSystemIni();
|
||||
var
|
||||
programIni: Tinifile; //配置文件名
|
||||
FileName: string;
|
||||
begin
|
||||
FileName := ExtractFilePath(Paramstr(0)) + 'SYSTEMSET.INI';
|
||||
if not FileExists(FileName) then
|
||||
exit;
|
||||
|
||||
try
|
||||
programIni := Tinifile.create(FileName);
|
||||
gIsUseSkin := programIni.ReadBool('窗口设置', 'skin',true);
|
||||
gIsCanDesign := programIni.ReadBool('窗口设置', 'design',false);
|
||||
gGridNativeSet := programIni.ReadBool('窗口设置', 'grid',true);
|
||||
gfontSize := programIni.ReadInteger('窗口设置', '字体大小', 12);
|
||||
gfontName := programIni.ReadString('窗口设置', '字体名称', '');
|
||||
gIsYsUse := programIni.ReadBool('窗口设置', 'stand', false);
|
||||
finally
|
||||
programIni.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
//必须输入控制
|
||||
function mustInCheck(app:Tapplication;dxLayoutControl1:TdxLayoutControl ;textFlag:string='*'):Boolean;
|
||||
var
|
||||
i:integer;
|
||||
j:Integer;
|
||||
mcatpion:string;
|
||||
mValue:string;
|
||||
layGroup:TdxLayoutGroup;
|
||||
begin
|
||||
result:=false;
|
||||
if textFlag='' then textFlag:='*';
|
||||
|
||||
for I := 0 to dxLayoutControl1.Items.Count-1 do
|
||||
begin
|
||||
// mcatpion:= TdxLayoutItem(dxLayoutControl1.Controls[i].Parent).caption ;
|
||||
// if pos(textFlag, mcatpion)>=0 then
|
||||
// begin
|
||||
// ShowMessage(dxLayoutControl1.Items[i].name);
|
||||
// end;
|
||||
//ShowMessage(mcatpion);
|
||||
if (dxLayoutControl1.Items[i] is TdxLayoutGroup) or (dxLayoutControl1.Items[i] is TdxLayoutAutoCreatedGroup) then
|
||||
begin
|
||||
if not mustInCheck_R(app,TdxLayoutGroup(dxLayoutControl1.Items[i]),textFlag) then
|
||||
Exit;
|
||||
end
|
||||
else if dxLayoutControl1.Items[i] is TdxLayoutItem then
|
||||
begin
|
||||
mcatpion:= TdxLayoutItem(dxLayoutControl1.Items[i]).Caption ;
|
||||
// ShowMessage(mcatpion);
|
||||
if pos(textFlag, mcatpion)>0 then
|
||||
begin
|
||||
if TryGetTextProperty(TComponent(TdxLayoutItem(dxLayoutControl1.Items[i]).Control),mValue) then
|
||||
begin
|
||||
if Trim(mValue)='' then
|
||||
begin
|
||||
mcatpion:=StringReplace(mcatpion,'[COLOR=#FF0000]*[/COLOR]','',[rfIgnoreCase]);
|
||||
ShowMessage('【'+mcatpion+'】,数据不能为空!');
|
||||
exit ;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
end;
|
||||
result:=true;
|
||||
end;
|
||||
///////////////////////////////////////////////////
|
||||
function mustInCheck_R(app:Tapplication;dxLayoutGroup:TdxLayoutGroup ;textFlag:string='*'):Boolean;
|
||||
var
|
||||
i:integer;
|
||||
j:Integer;
|
||||
mcatpion:string;
|
||||
mValue:string;
|
||||
begin
|
||||
result:=false;
|
||||
if textFlag='' then textFlag:='*';
|
||||
|
||||
for I := 0 to dxLayoutGroup.Count - 1 do
|
||||
begin
|
||||
if (dxLayoutGroup.Items[i] is TdxLayoutGroup) or (dxLayoutGroup.Items[i] is TdxLayoutAutoCreatedGroup) then
|
||||
begin
|
||||
if not mustInCheck_R(app,TdxLayoutGroup(dxLayoutGroup.Items[i]),textFlag) then
|
||||
Exit;
|
||||
end
|
||||
else if dxLayoutGroup.Items[i] is TdxLayoutItem then
|
||||
begin
|
||||
mcatpion:= TdxLayoutItem(dxLayoutGroup.Items[i]).Caption ;
|
||||
// ShowMessage(mcatpion);
|
||||
if pos(textFlag, mcatpion)>0 then
|
||||
begin
|
||||
if TryGetTextProperty(TComponent(TdxLayoutItem(dxLayoutGroup.Items[i]).Control),mValue) then
|
||||
begin
|
||||
if Trim(mValue)='' then
|
||||
begin
|
||||
mcatpion:=StringReplace(mcatpion,'[COLOR=#FF0000]*[/COLOR]','',[rfIgnoreCase]);
|
||||
ShowMessage('【'+mcatpion+'】,数据不能为空!');
|
||||
exit ;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
result:=true;
|
||||
end;
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
procedure SetShowModalHide(mHandle:Thandle;form:Tform);
|
||||
begin
|
||||
enablewindow(mHandle,true);
|
||||
|
||||
end;
|
||||
/////////////////////////////////
|
||||
procedure layoutDesign(dxLayoutControl1:TdxLayoutControl;ADOTmp: TADOQuery;userId:string );
|
||||
begin
|
||||
if not IsHasDesignRight(ADOTmp,PWideChar(userId)) then
|
||||
exit;
|
||||
dxLayoutControl1.Customization := True;
|
||||
end;
|
||||
/////////////////////////////////////
|
||||
function saveLayOut(app:Tapplication;dxLayoutControl1:TdxLayoutControl; ADOCmd: TADOQuery;pdesignCode:PWideChar):Boolean;
|
||||
var
|
||||
LayoutStream: TMemoryStream;
|
||||
mdesignCode:string;
|
||||
begin
|
||||
mdesignCode:= pdesignCode ;
|
||||
LayoutStream := TMemoryStream.Create;
|
||||
try
|
||||
dxLayoutControl1.SaveToStream(LayoutStream);
|
||||
with ADOCmd do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add('select A.* ');
|
||||
sql.Add('from SD_Design_FormLayout A');
|
||||
sql.Add('where A.designCode=' + quotedStr(mdesignCode));
|
||||
open;
|
||||
|
||||
if RecordCount>0 then
|
||||
begin
|
||||
edit;
|
||||
end
|
||||
else
|
||||
begin
|
||||
append;
|
||||
FieldByName('designCode').value:=mdesignCode;
|
||||
FieldByName('fileGroup').value:='1';
|
||||
FieldByName('height').value:=0;
|
||||
|
||||
end;
|
||||
TBlobField(FieldByName('fileContent')).LoadFromStream(LayoutStream);
|
||||
Post;
|
||||
end;
|
||||
finally
|
||||
LayoutStream.Free; // 释放内存流
|
||||
end;
|
||||
end;
|
||||
/// ///////////////////////////////////////////////////
|
||||
//
|
||||
/// ////////////////////////////////////////////////////
|
||||
function IsHasDesignRight(ADOTmp: TADOQuery;userId:String): boolean;
|
||||
begin
|
||||
result := false;
|
||||
try
|
||||
/// ////////////////////////////////////
|
||||
// 权限控制
|
||||
with ADOTmp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
Filtered := false;
|
||||
sql.Add('select count(userid) as cnt');
|
||||
sql.Add('from sy_user A');
|
||||
sql.Add('where userid=' + quotedStr(userId));
|
||||
sql.Add('and canDesign=1');
|
||||
sql.Add('and valid=''Y''');
|
||||
open;
|
||||
|
||||
if fieldByName('cnt').AsInteger > 0 then
|
||||
begin
|
||||
result := true;
|
||||
end;
|
||||
close;
|
||||
end;
|
||||
except
|
||||
application.MessageBox('获取操作权限时发生错误!', '警告信息', 0);
|
||||
end;
|
||||
end;
|
||||
/////////////////////////////////////////////////////////////
|
||||
//
|
||||
function TryGetTextProperty(AComponent: TComponent; out Value: string): Boolean;
|
||||
begin
|
||||
try
|
||||
Value := GetStrProp(AComponent, 'Text');
|
||||
Result := True;
|
||||
except
|
||||
Result := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
procedure HideUnenabledButton(Toolbar: TToolbar);
|
||||
var
|
||||
i:Integer;
|
||||
begin
|
||||
for i := 0 to Toolbar.ButtonCount - 1 do
|
||||
begin
|
||||
if not ToolBar.Buttons[i].Enabled and ToolBar.Buttons[i].Visible then
|
||||
begin
|
||||
ToolBar.Buttons[i].Visible := False;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
484
public10/design/U_MainBaseList.dfm
Normal file
484
public10/design/U_MainBaseList.dfm
Normal file
|
|
@ -0,0 +1,484 @@
|
|||
object frmMainBaseList: TfrmMainBaseList
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'frmMainBaseList'
|
||||
ClientHeight = 538
|
||||
ClientWidth = 1112
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #24494#36719#38597#40657
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
WindowState = wsMaximized
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 21
|
||||
object ToolBar3: TToolBar
|
||||
Tag = 1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1112
|
||||
Height = 60
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 115
|
||||
Caption = 'ToolBar1'
|
||||
GradientEndColor = clWindow
|
||||
Images = DataLink_schedule.cxImageList_bar
|
||||
List = True
|
||||
GradientDrawingOptions = [gdoHotTrack]
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object Trefresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 1
|
||||
OnClick = TrefreshClick
|
||||
end
|
||||
object Tadd: TToolButton
|
||||
Left = 71
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 9
|
||||
end
|
||||
object ToolButton2: TToolButton
|
||||
Left = 142
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 3
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 5
|
||||
end
|
||||
object Tcheck: TToolButton
|
||||
Left = 284
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #23457#26680
|
||||
ImageIndex = 12
|
||||
end
|
||||
object Tuncheck: TToolButton
|
||||
Left = 355
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #25764#38144#23457#26680
|
||||
ImageIndex = 11
|
||||
end
|
||||
object Tzdy1: TToolButton
|
||||
Left = 458
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #33258#23450#20041'1'
|
||||
Visible = False
|
||||
end
|
||||
object Tzdy2: TToolButton
|
||||
Left = 526
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #33258#23450#20041'2'
|
||||
Wrap = True
|
||||
Visible = False
|
||||
end
|
||||
object Tzdy3: TToolButton
|
||||
Left = 0
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #33258#23450#20041'3'
|
||||
Visible = False
|
||||
end
|
||||
object Tprint: TToolButton
|
||||
Left = 68
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #23548#20986'Excel'
|
||||
ImageIndex = 28
|
||||
OnClick = TprintClick
|
||||
end
|
||||
object TprintGrid: TToolButton
|
||||
Left = 177
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 21
|
||||
OnClick = TprintGridClick
|
||||
end
|
||||
object TsaveGrid: TToolButton
|
||||
Left = 248
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #20445#23384#26684#24335
|
||||
ImageIndex = 30
|
||||
OnClick = TsaveGridClick
|
||||
end
|
||||
object TgridSet: TToolButton
|
||||
Left = 351
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #34920#26684#21015#35774#32622
|
||||
ImageIndex = 16
|
||||
Visible = False
|
||||
OnClick = TgridSetClick
|
||||
end
|
||||
object Tclose: TToolButton
|
||||
Left = 470
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 7
|
||||
OnClick = TcloseClick
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 187
|
||||
Width = 1112
|
||||
Height = 351
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object tv1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
ScrollbarAnnotations.CustomAnnotations = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Filter.AutoDataSetFilter = True
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsData.Inserting = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
object tv1SSel: TcxGridDBColumn
|
||||
Caption = #36873#25321
|
||||
DataBinding.FieldName = 'SSel'
|
||||
DataBinding.IsNullValueType = True
|
||||
PropertiesClassName = 'TcxCheckBoxProperties'
|
||||
Properties.NullStyle = nssUnchecked
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Width = 57
|
||||
end
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = tv1
|
||||
end
|
||||
end
|
||||
object dxLayoutControl_query: TdxLayoutControl
|
||||
Left = 0
|
||||
Top = 105
|
||||
Width = 1112
|
||||
Height = 45
|
||||
Align = alTop
|
||||
TabOrder = 2
|
||||
AutoSize = True
|
||||
LayoutLookAndFeel = BaseDataLink.dxLayoutSkinLookAndFeel1
|
||||
OptionsItem.SizableHorz = True
|
||||
OptionsItem.SizableVert = True
|
||||
OnDblClick = dxLayoutControl_queryDblClick
|
||||
object custName: TcxTextEdit
|
||||
Tag = 2
|
||||
Left = 262
|
||||
Top = 11
|
||||
Style.HotTrack = False
|
||||
Style.TransparentBorder = False
|
||||
TabOrder = 1
|
||||
Width = 109
|
||||
end
|
||||
object ConNo: TcxTextEdit
|
||||
Tag = 2
|
||||
Left = 436
|
||||
Top = 11
|
||||
Style.HotTrack = False
|
||||
Style.TransparentBorder = False
|
||||
TabOrder = 2
|
||||
Width = 105
|
||||
end
|
||||
object OrderNo: TcxTextEdit
|
||||
Tag = 2
|
||||
Left = 72
|
||||
Top = 11
|
||||
Style.HotTrack = False
|
||||
Style.TransparentBorder = False
|
||||
TabOrder = 0
|
||||
Width = 109
|
||||
end
|
||||
object dxLayoutControl_queryGroup_Root: TdxLayoutGroup
|
||||
AlignHorz = ahParentManaged
|
||||
AlignVert = avParentManaged
|
||||
CaptionOptions.AlignVert = tavCenter
|
||||
SizeOptions.AssignedValues = [sovSizableHorz, sovSizableVert]
|
||||
SizeOptions.SizableHorz = True
|
||||
SizeOptions.SizableVert = True
|
||||
Hidden = True
|
||||
LayoutDirection = ldHorizontal
|
||||
Padding.Bottom = -5
|
||||
Padding.Top = -5
|
||||
Padding.AssignedValues = [lpavBottom, lpavTop]
|
||||
ShowBorder = False
|
||||
Index = -1
|
||||
end
|
||||
object dxLayoutItem1: TdxLayoutItem
|
||||
Parent = dxLayoutControl_queryGroup_Root
|
||||
CaptionOptions.Text = #35746#21333#21495
|
||||
Control = OrderNo
|
||||
ControlOptions.OriginalHeight = 33
|
||||
ControlOptions.OriginalWidth = 109
|
||||
ControlOptions.ShowBorder = False
|
||||
Index = 0
|
||||
end
|
||||
object dxLayoutItem2: TdxLayoutItem
|
||||
Parent = dxLayoutControl_queryGroup_Root
|
||||
CaptionOptions.Text = #23458#25143#21517#31216
|
||||
Control = custName
|
||||
ControlOptions.OriginalHeight = 33
|
||||
ControlOptions.OriginalWidth = 109
|
||||
ControlOptions.ShowBorder = False
|
||||
Index = 1
|
||||
end
|
||||
object dxLayoutItem_hth: TdxLayoutItem
|
||||
Parent = dxLayoutControl_queryGroup_Root
|
||||
CaptionOptions.Text = #21512#21516#21495
|
||||
Control = ConNo
|
||||
ControlOptions.OriginalHeight = 33
|
||||
ControlOptions.OriginalWidth = 105
|
||||
ControlOptions.ShowBorder = False
|
||||
Index = 2
|
||||
end
|
||||
end
|
||||
object Panel_page: TPanel
|
||||
Left = 0
|
||||
Top = 150
|
||||
Width = 1112
|
||||
Height = 37
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 3
|
||||
DesignSize = (
|
||||
1112
|
||||
37)
|
||||
object LBCPAP: TLabel
|
||||
Left = 425
|
||||
Top = 8
|
||||
Width = 100
|
||||
Height = 20
|
||||
Alignment = taCenter
|
||||
Anchors = [akLeft]
|
||||
AutoSize = False
|
||||
Caption = #24403#21069#39029'/'#24635#39029#25968
|
||||
Layout = tlCenter
|
||||
ExplicitTop = 7
|
||||
end
|
||||
object Label31: TLabel
|
||||
Left = 14
|
||||
Top = 8
|
||||
Width = 96
|
||||
Height = 21
|
||||
Alignment = taCenter
|
||||
Anchors = [akLeft]
|
||||
Caption = #27599#39029#35760#24405#26465#25968
|
||||
Layout = tlCenter
|
||||
ExplicitTop = 7
|
||||
end
|
||||
object BTNP: TButton
|
||||
Left = 532
|
||||
Top = 5
|
||||
Width = 78
|
||||
Height = 30
|
||||
Anchors = [akLeft]
|
||||
Caption = #19979#19968#39029
|
||||
TabOrder = 0
|
||||
OnClick = BTNPClick
|
||||
end
|
||||
object BTLP: TButton
|
||||
Left = 338
|
||||
Top = 4
|
||||
Width = 78
|
||||
Height = 31
|
||||
Anchors = [akLeft]
|
||||
Caption = #19978#19968#39029
|
||||
TabOrder = 1
|
||||
OnClick = BTLPClick
|
||||
end
|
||||
object TCBNOR: TcxComboBox
|
||||
Tag = 2
|
||||
Left = 122
|
||||
Top = 2
|
||||
Properties.DropDownListStyle = lsEditFixedList
|
||||
Properties.Items.Strings = (
|
||||
'500'
|
||||
'1000'
|
||||
'5000'
|
||||
'10000')
|
||||
Properties.OnChange = TCBNORPropertiesChange
|
||||
TabOrder = 2
|
||||
Text = '500'
|
||||
Width = 94
|
||||
end
|
||||
end
|
||||
inline frmFrameDateSel1: TfrmFrameDateSel10
|
||||
Left = 0
|
||||
Top = 60
|
||||
Width = 1112
|
||||
Height = 45
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
Color = clBtnFace
|
||||
ParentBackground = False
|
||||
ParentColor = False
|
||||
TabOrder = 4
|
||||
ExplicitTop = 60
|
||||
ExplicitWidth = 1112
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 1112
|
||||
ExplicitWidth = 1112
|
||||
inherited BegDate: TcxDateEdit
|
||||
Left = 116
|
||||
Top = 11
|
||||
ExplicitLeft = 116
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited EndDate: TcxDateEdit
|
||||
Left = 265
|
||||
Top = 11
|
||||
ExplicitLeft = 265
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton1: TcxButton
|
||||
Left = 465
|
||||
Top = 11
|
||||
ExplicitLeft = 465
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton2: TcxButton
|
||||
Left = 625
|
||||
Top = 11
|
||||
ExplicitLeft = 625
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton3: TcxButton
|
||||
Left = 756
|
||||
Top = 11
|
||||
ExplicitLeft = 756
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cbbType: TcxComboBox
|
||||
Left = 705
|
||||
Top = 11
|
||||
ExplicitLeft = 705
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton4: TcxButton
|
||||
Left = 385
|
||||
Top = 11
|
||||
ExplicitLeft = 385
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton5: TcxButton
|
||||
Left = 545
|
||||
Top = 11
|
||||
ExplicitLeft = 545
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited TimeType: TcxComboBox
|
||||
Left = 16
|
||||
Top = 11
|
||||
ExplicitLeft = 16
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited jqModel: TcxCheckBox
|
||||
Left = 859
|
||||
Top = 11
|
||||
ExplicitLeft = 859
|
||||
ExplicitTop = 11
|
||||
ExplicitWidth = 82
|
||||
ExplicitHeight = 25
|
||||
end
|
||||
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
|
||||
ItemIndex = 1
|
||||
end
|
||||
inherited dxLayoutItem1: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem2: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem8: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem9: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem10: TdxLayoutItem
|
||||
ControlOptions.OriginalHeight = 25
|
||||
ControlOptions.OriginalWidth = 82
|
||||
end
|
||||
end
|
||||
end
|
||||
object cxProgressBar1: TMovePanel
|
||||
Left = 292
|
||||
Top = 256
|
||||
Width = 233
|
||||
Height = 49
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #24494#36719#38597#40657
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 5
|
||||
Visible = False
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_List
|
||||
Left = 768
|
||||
Top = 296
|
||||
end
|
||||
object ADOQueryList: TADOQuery
|
||||
Connection = DataLink_schedule.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 704
|
||||
Top = 368
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
Grid = cxGrid1
|
||||
PopupMenus = <>
|
||||
Left = 208
|
||||
Top = 287
|
||||
end
|
||||
object ADOQueryBaseCmd: TADOQuery
|
||||
Parameters = <>
|
||||
Left = 281
|
||||
Top = 248
|
||||
end
|
||||
object ADOQueryBaseTemp: TADOQuery
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 201
|
||||
Top = 225
|
||||
end
|
||||
object CDS_List: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 395
|
||||
Top = 280
|
||||
end
|
||||
end
|
||||
393
public10/design/U_MainBaseList.pas
Normal file
393
public10/design/U_MainBaseList.pas
Normal file
|
|
@ -0,0 +1,393 @@
|
|||
unit U_MainBaseList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.ToolWin, cxGraphics,
|
||||
cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,U_WindowFormdesign,
|
||||
dxSkinsDefaultPainters, dxSkinWXI, cxStyles, cxCustomData, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, cxNavigator, dxDateRanges, dxScrollbarAnnotations,
|
||||
Data.DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxClasses, cxGridCustomView, cxGrid, Data.Win.ADODB,math,
|
||||
dxBarBuiltInMenu, cxGridCustomPopupMenu, cxGridPopupMenu, cxCheckBox,
|
||||
cxContainer, dxCore, cxDateUtils, dxLayoutcxEditAdapters, dxLayoutContainer,
|
||||
cxMaskEdit, cxDropDownEdit, cxCalendar, cxTextEdit, dxLayoutControl,
|
||||
FrameDateSel, Datasnap.DBClient, cxMemo, Vcl.StdCtrls, Vcl.ExtCtrls,
|
||||
cxGeometry, dxFramedControl, dxPanel, FrameDateSel10, MovePanel;
|
||||
|
||||
type
|
||||
TfrmMainBaseList = class(TForm)
|
||||
ToolBar3: TToolBar;
|
||||
Trefresh: TToolButton;
|
||||
Tprint: TToolButton;
|
||||
TprintGrid: TToolButton;
|
||||
TsaveGrid: TToolButton;
|
||||
Tclose: TToolButton;
|
||||
cxGrid1: TcxGrid;
|
||||
tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryList: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryBaseCmd: TADOQuery;
|
||||
ADOQueryBaseTemp: TADOQuery;
|
||||
tv1SSel: TcxGridDBColumn;
|
||||
dxLayoutControl_query: TdxLayoutControl;
|
||||
custName: TcxTextEdit;
|
||||
ConNo: TcxTextEdit;
|
||||
OrderNo: TcxTextEdit;
|
||||
dxLayoutControl_queryGroup_Root: TdxLayoutGroup;
|
||||
dxLayoutItem1: TdxLayoutItem;
|
||||
dxLayoutItem2: TdxLayoutItem;
|
||||
dxLayoutItem_hth: TdxLayoutItem;
|
||||
CDS_List: TClientDataSet;
|
||||
Panel_page: TPanel;
|
||||
BTNP: TButton;
|
||||
LBCPAP: TLabel;
|
||||
BTLP: TButton;
|
||||
TCBNOR: TcxComboBox;
|
||||
Label31: TLabel;
|
||||
frmFrameDateSel1: TfrmFrameDateSel10;
|
||||
TgridSet: TToolButton;
|
||||
Tadd: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton3: TToolButton;
|
||||
Tcheck: TToolButton;
|
||||
Tuncheck: TToolButton;
|
||||
Tzdy1: TToolButton;
|
||||
Tzdy2: TToolButton;
|
||||
Tzdy3: TToolButton;
|
||||
cxProgressBar1: TMovePanel;
|
||||
procedure TrefreshClick(Sender: TObject);
|
||||
procedure TprintClick(Sender: TObject);
|
||||
procedure TprintGridClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TcloseClick(Sender: TObject);
|
||||
procedure TsaveGridClick(Sender: TObject);
|
||||
procedure BTLPClick(Sender: TObject);
|
||||
procedure BTNPClick(Sender: TObject);
|
||||
procedure TCBNORPropertiesChange(Sender: TObject);
|
||||
procedure TgridSetClick(Sender: TObject);
|
||||
procedure dxLayoutControl_queryDblClick(Sender: TObject);
|
||||
private
|
||||
fWindowDesign: TWindowFormdesign;
|
||||
CurrentPage, RecordsNumber: Integer;
|
||||
fDesignCode:string;
|
||||
procedure doQuery();
|
||||
procedure doQueryByCriteria();
|
||||
procedure initGrid();
|
||||
protected
|
||||
fParameters1: string;
|
||||
fParameters2: string;
|
||||
fParameters3: string;
|
||||
fParameters4: string;
|
||||
fParameters5: string;
|
||||
fParameters10: string;
|
||||
public
|
||||
fFormId: integer;
|
||||
fProcedureName:string; //存储过程名称
|
||||
FLMType:string; //报表文件类型标志
|
||||
ftimeType:string; //日期类型
|
||||
fQueryType:String; //查询类型
|
||||
FFiltration1:string; //打印参数条件
|
||||
fCriteria:string; //条件参数
|
||||
constructor Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
frmMainBaseList: TfrmMainBaseList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_RTFun, U_globalVar, U_dataLink,U_FormLayOutDesign, U_LabelPrint;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmMainBaseList.BTLPClick(Sender: TObject);
|
||||
begin
|
||||
if CurrentPage > 1 then
|
||||
CurrentPage := CurrentPage - 1;
|
||||
doQuery();
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.BTNPClick(Sender: TObject);
|
||||
begin
|
||||
if CurrentPage < cds_List.FieldByName('TotalCount').AsInteger / RecordsNumber then
|
||||
CurrentPage := CurrentPage + 1;
|
||||
doQuery();
|
||||
end;
|
||||
|
||||
constructor TfrmMainBaseList.Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
if ACaption <> '' then
|
||||
Caption := ACaption;
|
||||
|
||||
fParameters1 := Parameters1;
|
||||
fParameters2 := Parameters2;
|
||||
fParameters3 := Parameters3;
|
||||
fParameters4 := Parameters4;
|
||||
fParameters5 := Parameters5;
|
||||
fParameters10 := Parameters10;
|
||||
fFormId:= FormID ;
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.TCBNORPropertiesChange(Sender: TObject);
|
||||
begin
|
||||
RecordsNumber := StrToInt(TCBNOR.Text);
|
||||
CurrentPage := 1;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.TcloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.TgridSetClick(Sender: TObject);
|
||||
begin
|
||||
fWindowDesign.OpenGridDesignWin10(fDesignCode,'cxgrid1',tv1);
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.TprintClick(Sender: TObject);
|
||||
begin
|
||||
if cds_List.IsEmpty then
|
||||
Exit;
|
||||
TcxGridToExcel(self.Caption, cxgrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.TprintGridClick(Sender: TObject);
|
||||
begin
|
||||
if cds_List.IsEmpty then
|
||||
Exit;
|
||||
if trim(self.FLMType)='' then
|
||||
begin
|
||||
application.MessageBox('未设置打印报表类型,请先设置!','提示信息',0);
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
frmLabelPrint := TfrmLabelPrint.Create(Application);
|
||||
with frmLabelPrint do
|
||||
begin
|
||||
FLMType := self.FLMType;
|
||||
FFiltration1 := self.FFiltration1;
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
// Self.InitGrid();
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmLabelPrint.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.TrefreshClick(Sender: TObject);
|
||||
begin
|
||||
if frmFrameDateSel1.BegDate.Visible then
|
||||
begin
|
||||
frmFrameDateSel1.BegDate.SetFocus;
|
||||
end;
|
||||
CurrentPage := 1;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.TsaveGridClick(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, gDllFileCaption);
|
||||
if gIsCanDesign then
|
||||
begin
|
||||
saveLayOut(application, dxLayoutControl_query, ADOQueryBaseCmd,PWideChar( fDllFileName + '|' + Self.Name + '|' + dxLayoutControl_query.Name + '.ini'));
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////
|
||||
procedure TfrmMainBaseList.doQuery();
|
||||
var
|
||||
strwhere: string;
|
||||
begin
|
||||
if fProcedureName='' then
|
||||
begin
|
||||
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
|
||||
exit;
|
||||
end;
|
||||
strwhere := GetProcedureParam(dxLayoutControl_query);
|
||||
|
||||
try
|
||||
Tv1.BeginUpdate();
|
||||
CDS_List.DisableControls;
|
||||
with ADOQueryList do
|
||||
begin
|
||||
close;
|
||||
Filtered := false;
|
||||
sql.Clear;
|
||||
sql.Add('exec '+fProcedureName);
|
||||
sql.Add('@timeType='+quotedstr(fTimeType));
|
||||
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
|
||||
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
|
||||
if frmFrameDateSel1.jqModel.Checked then
|
||||
sql.Add(',@jqModel=1')
|
||||
else
|
||||
sql.Add(',@jqModel=0');
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
|
||||
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
|
||||
end;
|
||||
sql.Add(',@criteria='+ quotedstr(fcriteria));
|
||||
if strwhere<>'' then
|
||||
sql.Add(','+strwhere);
|
||||
// showMessage(sql.Text);
|
||||
//cxMemo1.Text:= sql.Text ;
|
||||
open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryList, CDS_List);
|
||||
SInitCDSData(ADOQueryList, CDS_List);
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list.FieldByName('TotalCount').AsInteger / RecordsNumber));
|
||||
end;
|
||||
finally
|
||||
CDS_List.EnableControls;
|
||||
Tv1.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////
|
||||
procedure TfrmMainBaseList.doQueryByCriteria();
|
||||
var
|
||||
mSqlWhere: string;
|
||||
begin
|
||||
if fProcedureName='' then
|
||||
begin
|
||||
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
|
||||
exit;
|
||||
end;
|
||||
|
||||
mSqlWhere := SLGetFilters(dxLayoutControl_query, 1, 2);
|
||||
if trim(mSqlWhere) <> '' then
|
||||
begin
|
||||
mSqlWhere := ' and ' + trim(mSqlWhere);
|
||||
end;
|
||||
mSqlWhere:=fCriteria + ' ' + mSqlWhere ;
|
||||
try
|
||||
Tv1.BeginUpdate();
|
||||
CDS_List.DisableControls;
|
||||
with ADOQueryList do
|
||||
begin
|
||||
close;
|
||||
Filtered := false;
|
||||
sql.Clear;
|
||||
sql.Add('exec '+fProcedureName);
|
||||
sql.Add('@timeType='+quotedstr(fTimeType));
|
||||
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
|
||||
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
|
||||
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
|
||||
end;
|
||||
sql.Add(',@criteria='+ quotedstr(mSqlWhere));
|
||||
|
||||
//cxMemo1.Text:= sql.Text ;
|
||||
open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryList, CDS_List);
|
||||
SInitCDSData(ADOQueryList, CDS_List);
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list.FieldByName('TotalCount').AsInteger / RecordsNumber));
|
||||
end;
|
||||
finally
|
||||
CDS_List.EnableControls;
|
||||
Tv1.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
procedure TfrmMainBaseList.dxLayoutControl_queryDblClick(Sender: TObject);
|
||||
begin
|
||||
layoutDesign(TdxLayoutControl(Sender),ADOQueryBaseCmd,PWideChar(dcode));
|
||||
end;
|
||||
|
||||
///
|
||||
procedure TfrmMainBaseList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Sendmessage(application.MainForm.Handle, WM_CloseForm, 4, 0);
|
||||
|
||||
Action:=cafree;
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.FormCreate(Sender: TObject);
|
||||
var
|
||||
mFontSize:integer;
|
||||
begin
|
||||
getSystemIni();
|
||||
if gFontSize<9 then
|
||||
begin
|
||||
mFontSize := 12;
|
||||
end
|
||||
else
|
||||
begin
|
||||
mFontSize:=gFontSize ;
|
||||
end;
|
||||
|
||||
self.Font.Size := gFontSize;
|
||||
if trim(gFontName)<>'' then
|
||||
self.Font.Name:=gFontName;
|
||||
cxgrid1.Align:=alClient;
|
||||
CurrentPage := 1;
|
||||
RecordsNumber := 500;
|
||||
fWindowDesign := TWindowFormdesign.Create();
|
||||
frmFrameDateSel1.begdate.Date:=SGetServerDate(ADOQueryBaseTemp);
|
||||
frmFrameDateSel1.enddate.Date:=frmFrameDateSel1.begdate.Date;
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
fWindowDesign.free;
|
||||
end;
|
||||
|
||||
procedure TfrmMainBaseList.FormShow(Sender: TObject);
|
||||
var
|
||||
mdesignCode:string;
|
||||
begin
|
||||
fDesignCode := fDllFileName +'|'+self.name+ '|' + intTostr(fformId) + '|' + 'cxgrid1';
|
||||
if DParameters8<>'1' then
|
||||
begin
|
||||
fWindowDesign.FormStyleInit10(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10);
|
||||
end;
|
||||
TgridSet.Visible:=gIsCanDesign;
|
||||
mdesignCode := fDllFileName +'|'+self.name+ '|' + intTostr(fformId) + '|' + 'cxgrid1';
|
||||
//增加动态条件
|
||||
addQryContionByLay(ADOQueryBaseTemp,fformId,'cxgrid1',dxLayoutControl_query,7);
|
||||
ReadCxGrid(trim(self.Caption) + 'Tv1', Tv1, gDllFileCaption);
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
///////////////////////////////
|
||||
///
|
||||
procedure TfrmMainBaseList.initGrid();
|
||||
begin
|
||||
if fProcedureName='' then exit;
|
||||
try
|
||||
cxProgressBar1.Visible:=true;
|
||||
cxProgressBar1.Refresh ;
|
||||
|
||||
if fQueryType='criteria' then
|
||||
begin
|
||||
doQueryByCriteria() ;
|
||||
end
|
||||
else
|
||||
begin
|
||||
frmFrameDateSel1.jqModel.Checked:=true;
|
||||
doQuery() ;
|
||||
end;
|
||||
|
||||
finally
|
||||
cxProgressBar1.Visible:=false;
|
||||
end;
|
||||
|
||||
end;
|
||||
end.
|
||||
620
public10/design/U_PageBaseList.dfm
Normal file
620
public10/design/U_PageBaseList.dfm
Normal file
|
|
@ -0,0 +1,620 @@
|
|||
object frmPageBaseList: TfrmPageBaseList
|
||||
Left = 0
|
||||
Top = 0
|
||||
Caption = 'frmPageBaseList'
|
||||
ClientHeight = 538
|
||||
ClientWidth = 1112
|
||||
Color = clBtnFace
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -16
|
||||
Font.Name = #24494#36719#38597#40657
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
WindowState = wsMaximized
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 21
|
||||
object ToolBar3: TToolBar
|
||||
Tag = 1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1112
|
||||
Height = 60
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
ButtonWidth = 115
|
||||
Caption = 'ToolBar1'
|
||||
GradientEndColor = clWindow
|
||||
Images = DataLink_schedule.cxImageList_bar
|
||||
List = True
|
||||
GradientDrawingOptions = [gdoHotTrack]
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object Trefresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21047#26032
|
||||
ImageIndex = 1
|
||||
OnClick = TrefreshClick
|
||||
end
|
||||
object Tadd: TToolButton
|
||||
Left = 71
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26032#22686
|
||||
ImageIndex = 9
|
||||
Visible = False
|
||||
end
|
||||
object Tooledit: TToolButton
|
||||
Left = 142
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20462#25913
|
||||
ImageIndex = 3
|
||||
Visible = False
|
||||
end
|
||||
object ToolDel: TToolButton
|
||||
Left = 213
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #21024#38500
|
||||
ImageIndex = 5
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy1: TToolButton
|
||||
Left = 284
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = '1'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy2: TToolButton
|
||||
Left = 304
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = '2'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy3: TToolButton
|
||||
Left = 324
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = '3'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy4: TToolButton
|
||||
Left = 344
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = '4'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy5: TToolButton
|
||||
Left = 364
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = '5'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy6: TToolButton
|
||||
Left = 384
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = '6'
|
||||
Wrap = True
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy7: TToolButton
|
||||
Left = 0
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '7'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy8: TToolButton
|
||||
Left = 20
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '8'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy9: TToolButton
|
||||
Left = 40
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '9'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy10: TToolButton
|
||||
Left = 60
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '10'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy11: TToolButton
|
||||
Left = 89
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '11'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy12: TToolButton
|
||||
Left = 118
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '12'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy13: TToolButton
|
||||
Left = 147
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '13'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy14: TToolButton
|
||||
Left = 176
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '14'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy15: TToolButton
|
||||
Left = 205
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '15'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy16: TToolButton
|
||||
Left = 234
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '16'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy17: TToolButton
|
||||
Left = 263
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '17'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy18: TToolButton
|
||||
Left = 292
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '18'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy19: TToolButton
|
||||
Left = 321
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '19'
|
||||
Visible = False
|
||||
end
|
||||
object Toolzdy20: TToolButton
|
||||
Left = 350
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = '20'
|
||||
Visible = False
|
||||
end
|
||||
object Tprint: TToolButton
|
||||
Left = 379
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #23548#20986'Excel'
|
||||
ImageIndex = 28
|
||||
OnClick = TprintClick
|
||||
end
|
||||
object TprintGrid: TToolButton
|
||||
Left = 488
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #25171#21360
|
||||
ImageIndex = 21
|
||||
OnClick = TprintGridClick
|
||||
end
|
||||
object TsaveGrid: TToolButton
|
||||
Left = 559
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #20445#23384#26684#24335
|
||||
ImageIndex = 30
|
||||
OnClick = TsaveGridClick
|
||||
end
|
||||
object TgridSet: TToolButton
|
||||
Left = 662
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #34920#26684#21015#35774#32622
|
||||
ImageIndex = 16
|
||||
Visible = False
|
||||
OnClick = TgridSetClick
|
||||
end
|
||||
object Tclose: TToolButton
|
||||
Left = 781
|
||||
Top = 30
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 7
|
||||
OnClick = TcloseClick
|
||||
end
|
||||
end
|
||||
object Panel_page: TPanel
|
||||
Left = 0
|
||||
Top = 105
|
||||
Width = 1112
|
||||
Height = 37
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
TabOrder = 1
|
||||
DesignSize = (
|
||||
1112
|
||||
37)
|
||||
object LBCPAP: TLabel
|
||||
Left = 425
|
||||
Top = 8
|
||||
Width = 100
|
||||
Height = 20
|
||||
Alignment = taCenter
|
||||
Anchors = [akLeft]
|
||||
AutoSize = False
|
||||
Caption = #24403#21069#39029'/'#24635#39029#25968
|
||||
Layout = tlCenter
|
||||
ExplicitTop = 7
|
||||
end
|
||||
object Label31: TLabel
|
||||
Left = 14
|
||||
Top = 8
|
||||
Width = 96
|
||||
Height = 21
|
||||
Alignment = taCenter
|
||||
Anchors = [akLeft]
|
||||
Caption = #27599#39029#35760#24405#26465#25968
|
||||
Layout = tlCenter
|
||||
ExplicitTop = 7
|
||||
end
|
||||
object BTNP: TButton
|
||||
Left = 532
|
||||
Top = 5
|
||||
Width = 78
|
||||
Height = 30
|
||||
Anchors = [akLeft]
|
||||
Caption = #19979#19968#39029
|
||||
TabOrder = 0
|
||||
OnClick = BTNPClick
|
||||
end
|
||||
object BTLP: TButton
|
||||
Left = 338
|
||||
Top = 4
|
||||
Width = 78
|
||||
Height = 31
|
||||
Anchors = [akLeft]
|
||||
Caption = #19978#19968#39029
|
||||
TabOrder = 1
|
||||
OnClick = BTLPClick
|
||||
end
|
||||
object TCBNOR: TcxComboBox
|
||||
Tag = 2
|
||||
Left = 122
|
||||
Top = 2
|
||||
Properties.DropDownListStyle = lsEditFixedList
|
||||
Properties.Items.Strings = (
|
||||
'500'
|
||||
'1000'
|
||||
'5000'
|
||||
'10000')
|
||||
Properties.OnChange = TCBNORPropertiesChange
|
||||
TabOrder = 2
|
||||
Text = '500'
|
||||
Width = 94
|
||||
end
|
||||
end
|
||||
inline frmFrameDateSel1: TfrmFrameDateSel10
|
||||
Left = 0
|
||||
Top = 60
|
||||
Width = 1112
|
||||
Height = 45
|
||||
Align = alTop
|
||||
AutoSize = True
|
||||
Color = clBtnFace
|
||||
ParentBackground = False
|
||||
ParentColor = False
|
||||
TabOrder = 2
|
||||
ExplicitTop = 60
|
||||
ExplicitWidth = 1112
|
||||
inherited dxLayoutControl1: TdxLayoutControl
|
||||
Width = 1112
|
||||
ExplicitWidth = 1112
|
||||
inherited BegDate: TcxDateEdit
|
||||
Left = 116
|
||||
Top = 11
|
||||
ExplicitLeft = 116
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited EndDate: TcxDateEdit
|
||||
Left = 265
|
||||
Top = 11
|
||||
ExplicitLeft = 265
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton1: TcxButton
|
||||
Left = 465
|
||||
Top = 11
|
||||
ExplicitLeft = 465
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton2: TcxButton
|
||||
Left = 625
|
||||
Top = 11
|
||||
ExplicitLeft = 625
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton3: TcxButton
|
||||
Left = 756
|
||||
Top = 11
|
||||
ExplicitLeft = 756
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cbbType: TcxComboBox
|
||||
Left = 705
|
||||
Top = 11
|
||||
ExplicitLeft = 705
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton4: TcxButton
|
||||
Left = 385
|
||||
Top = 11
|
||||
ExplicitLeft = 385
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited cxButton5: TcxButton
|
||||
Left = 545
|
||||
Top = 11
|
||||
ExplicitLeft = 545
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited TimeType: TcxComboBox
|
||||
Left = 16
|
||||
Top = 11
|
||||
ExplicitLeft = 16
|
||||
ExplicitTop = 11
|
||||
end
|
||||
inherited jqModel: TcxCheckBox
|
||||
Left = 859
|
||||
Top = 11
|
||||
ExplicitLeft = 859
|
||||
ExplicitTop = 11
|
||||
ExplicitWidth = 82
|
||||
ExplicitHeight = 25
|
||||
end
|
||||
inherited dxLayoutControl1Group_Root: TdxLayoutGroup
|
||||
ItemIndex = 1
|
||||
end
|
||||
inherited dxLayoutItem1: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem2: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem8: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem9: TdxLayoutItem
|
||||
CaptionOptions.Text = 'New Item'
|
||||
end
|
||||
inherited dxLayoutItem10: TdxLayoutItem
|
||||
ControlOptions.OriginalHeight = 25
|
||||
ControlOptions.OriginalWidth = 82
|
||||
end
|
||||
end
|
||||
end
|
||||
object cxPageControl1: TcxPageControl
|
||||
Left = 56
|
||||
Top = 148
|
||||
Width = 569
|
||||
Height = 353
|
||||
TabOrder = 3
|
||||
Properties.ActivePage = cxTabSheet2
|
||||
Properties.CustomButtons.Buttons = <>
|
||||
ClientRectBottom = 351
|
||||
ClientRectLeft = 2
|
||||
ClientRectRight = 567
|
||||
ClientRectTop = 36
|
||||
object cxTabSheet1: TcxTabSheet
|
||||
Caption = 'cxTabSheet1'
|
||||
ImageIndex = 0
|
||||
object dxLayoutControl1: TdxLayoutControl
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 565
|
||||
Height = 57
|
||||
Align = alTop
|
||||
TabOrder = 0
|
||||
AutoSize = True
|
||||
LayoutLookAndFeel = BaseDataLink.dxLayoutSkinLookAndFeel1
|
||||
OptionsItem.SizableHorz = True
|
||||
OptionsItem.SizableVert = True
|
||||
OnDblClick = dxLayoutControl2DblClick
|
||||
object dxLayoutGroup1: TdxLayoutGroup
|
||||
AlignHorz = ahParentManaged
|
||||
AlignVert = avParentManaged
|
||||
CaptionOptions.AlignVert = tavCenter
|
||||
SizeOptions.AssignedValues = [sovSizableHorz, sovSizableVert]
|
||||
SizeOptions.SizableHorz = True
|
||||
SizeOptions.SizableVert = True
|
||||
Hidden = True
|
||||
LayoutDirection = ldHorizontal
|
||||
Padding.Bottom = -5
|
||||
Padding.Top = -5
|
||||
Padding.AssignedValues = [lpavBottom, lpavTop]
|
||||
ShowBorder = False
|
||||
Index = -1
|
||||
end
|
||||
end
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 0
|
||||
Top = 57
|
||||
Width = 565
|
||||
Height = 258
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object tv1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
ScrollbarAnnotations.CustomAnnotations = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Filter.AutoDataSetFilter = True
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsData.Inserting = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
end
|
||||
object cxGrid1Level1: TcxGridLevel
|
||||
GridView = tv1
|
||||
end
|
||||
end
|
||||
end
|
||||
object cxTabSheet2: TcxTabSheet
|
||||
Caption = 'cxTabSheet2'
|
||||
ImageIndex = 1
|
||||
object dxLayoutControl2: TdxLayoutControl
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 565
|
||||
Height = 57
|
||||
Align = alTop
|
||||
TabOrder = 0
|
||||
AutoSize = True
|
||||
LayoutLookAndFeel = BaseDataLink.dxLayoutSkinLookAndFeel1
|
||||
OptionsItem.SizableHorz = True
|
||||
OptionsItem.SizableVert = True
|
||||
OnDblClick = dxLayoutControl2DblClick
|
||||
object dxLayoutControl2Group_Root: TdxLayoutGroup
|
||||
AlignHorz = ahParentManaged
|
||||
AlignVert = avParentManaged
|
||||
CaptionOptions.AlignVert = tavCenter
|
||||
SizeOptions.AssignedValues = [sovSizableHorz, sovSizableVert]
|
||||
SizeOptions.SizableHorz = True
|
||||
SizeOptions.SizableVert = True
|
||||
Hidden = True
|
||||
LayoutDirection = ldHorizontal
|
||||
Padding.Bottom = -5
|
||||
Padding.Top = -5
|
||||
Padding.AssignedValues = [lpavBottom, lpavTop]
|
||||
ShowBorder = False
|
||||
Index = -1
|
||||
end
|
||||
end
|
||||
object cxGrid2: TcxGrid
|
||||
Left = 0
|
||||
Top = 57
|
||||
Width = 565
|
||||
Height = 258
|
||||
Align = alClient
|
||||
TabOrder = 1
|
||||
object tv2: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
ScrollbarAnnotations.CustomAnnotations = <>
|
||||
DataController.DataSource = DataSource1
|
||||
DataController.Filter.AutoDataSetFilter = True
|
||||
DataController.Summary.DefaultGroupSummaryItems = <>
|
||||
DataController.Summary.FooterSummaryItems = <>
|
||||
DataController.Summary.SummaryGroups = <>
|
||||
OptionsData.Deleting = False
|
||||
OptionsData.DeletingConfirmation = False
|
||||
OptionsData.Inserting = False
|
||||
OptionsView.Footer = True
|
||||
OptionsView.GroupByBox = False
|
||||
end
|
||||
object cxGridLevel1: TcxGridLevel
|
||||
GridView = tv2
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
object cxProgressBar1: TMovePanel
|
||||
Left = 408
|
||||
Top = 256
|
||||
Width = 233
|
||||
Height = 49
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
Caption = #27491#22312#26597#35810#25968#25454#65292#35831#31245#21518#12290#12290#12290
|
||||
Color = clSkyBlue
|
||||
Font.Charset = GB2312_CHARSET
|
||||
Font.Color = clRed
|
||||
Font.Height = -16
|
||||
Font.Name = #24494#36719#38597#40657
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 4
|
||||
Visible = False
|
||||
end
|
||||
object DataSource1: TDataSource
|
||||
DataSet = CDS_List1
|
||||
Left = 768
|
||||
Top = 296
|
||||
end
|
||||
object ADOQueryList1: TADOQuery
|
||||
Connection = DataLink_schedule.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 704
|
||||
Top = 368
|
||||
end
|
||||
object cxGridPopupMenu1: TcxGridPopupMenu
|
||||
PopupMenus = <>
|
||||
Left = 992
|
||||
Top = 111
|
||||
end
|
||||
object ADOQueryBaseCmd: TADOQuery
|
||||
Parameters = <>
|
||||
Left = 281
|
||||
Top = 248
|
||||
end
|
||||
object ADOQueryBaseTemp: TADOQuery
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 673
|
||||
Top = 161
|
||||
end
|
||||
object CDS_List1: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 395
|
||||
Top = 280
|
||||
end
|
||||
object DataSource2: TDataSource
|
||||
DataSet = CDS_List1
|
||||
Left = 832
|
||||
Top = 304
|
||||
end
|
||||
object ADOQueryList2: TADOQuery
|
||||
Connection = DataLink_schedule.ADOLink
|
||||
LockType = ltReadOnly
|
||||
Parameters = <>
|
||||
Left = 816
|
||||
Top = 400
|
||||
end
|
||||
object CDS_List2: TClientDataSet
|
||||
Aggregates = <>
|
||||
Params = <>
|
||||
Left = 467
|
||||
Top = 320
|
||||
end
|
||||
end
|
||||
559
public10/design/U_PageBaseList.pas
Normal file
559
public10/design/U_PageBaseList.pas
Normal file
|
|
@ -0,0 +1,559 @@
|
|||
unit U_PageBaseList;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
||||
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.ToolWin, cxGraphics,
|
||||
cxControls, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,U_WindowFormdesign,
|
||||
dxSkinsDefaultPainters, dxSkinWXI, cxStyles, cxCustomData, cxFilter, cxData,
|
||||
cxDataStorage, cxEdit, cxNavigator, dxDateRanges, dxScrollbarAnnotations,
|
||||
Data.DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
|
||||
cxGridDBTableView, cxClasses, cxGridCustomView, cxGrid, Data.Win.ADODB,math,
|
||||
dxBarBuiltInMenu, cxGridCustomPopupMenu, cxGridPopupMenu, cxCheckBox,
|
||||
cxContainer, dxCore, cxDateUtils, dxLayoutcxEditAdapters, dxLayoutContainer,
|
||||
cxMaskEdit, cxDropDownEdit, cxCalendar, cxTextEdit, dxLayoutControl,
|
||||
FrameDateSel, Datasnap.DBClient, cxMemo, Vcl.StdCtrls, Vcl.ExtCtrls,
|
||||
cxGeometry, dxFramedControl, dxPanel, FrameDateSel10, cxPC, MovePanel;
|
||||
|
||||
type
|
||||
TfrmPageBaseList = class(TForm)
|
||||
ToolBar3: TToolBar;
|
||||
Trefresh: TToolButton;
|
||||
Tprint: TToolButton;
|
||||
TprintGrid: TToolButton;
|
||||
TsaveGrid: TToolButton;
|
||||
Tclose: TToolButton;
|
||||
DataSource1: TDataSource;
|
||||
ADOQueryList1: TADOQuery;
|
||||
cxGridPopupMenu1: TcxGridPopupMenu;
|
||||
ADOQueryBaseCmd: TADOQuery;
|
||||
ADOQueryBaseTemp: TADOQuery;
|
||||
CDS_List1: TClientDataSet;
|
||||
Panel_page: TPanel;
|
||||
BTNP: TButton;
|
||||
LBCPAP: TLabel;
|
||||
BTLP: TButton;
|
||||
TCBNOR: TcxComboBox;
|
||||
Label31: TLabel;
|
||||
frmFrameDateSel1: TfrmFrameDateSel10;
|
||||
TgridSet: TToolButton;
|
||||
Tadd: TToolButton;
|
||||
Tooledit: TToolButton;
|
||||
ToolDel: TToolButton;
|
||||
Toolzdy4: TToolButton;
|
||||
Toolzdy5: TToolButton;
|
||||
Toolzdy1: TToolButton;
|
||||
Toolzdy2: TToolButton;
|
||||
Toolzdy3: TToolButton;
|
||||
cxPageControl1: TcxPageControl;
|
||||
cxTabSheet1: TcxTabSheet;
|
||||
cxTabSheet2: TcxTabSheet;
|
||||
dxLayoutControl2: TdxLayoutControl;
|
||||
dxLayoutControl2Group_Root: TdxLayoutGroup;
|
||||
dxLayoutControl1: TdxLayoutControl;
|
||||
dxLayoutGroup1: TdxLayoutGroup;
|
||||
cxGrid1: TcxGrid;
|
||||
tv1: TcxGridDBTableView;
|
||||
cxGrid1Level1: TcxGridLevel;
|
||||
cxGrid2: TcxGrid;
|
||||
tv2: TcxGridDBTableView;
|
||||
cxGridLevel1: TcxGridLevel;
|
||||
DataSource2: TDataSource;
|
||||
ADOQueryList2: TADOQuery;
|
||||
CDS_List2: TClientDataSet;
|
||||
cxProgressBar1: TMovePanel;
|
||||
Toolzdy6: TToolButton;
|
||||
Toolzdy7: TToolButton;
|
||||
Toolzdy8: TToolButton;
|
||||
Toolzdy9: TToolButton;
|
||||
Toolzdy10: TToolButton;
|
||||
Toolzdy11: TToolButton;
|
||||
Toolzdy12: TToolButton;
|
||||
Toolzdy13: TToolButton;
|
||||
Toolzdy14: TToolButton;
|
||||
Toolzdy15: TToolButton;
|
||||
Toolzdy16: TToolButton;
|
||||
Toolzdy17: TToolButton;
|
||||
Toolzdy18: TToolButton;
|
||||
Toolzdy19: TToolButton;
|
||||
Toolzdy20: TToolButton;
|
||||
procedure TrefreshClick(Sender: TObject);
|
||||
procedure TprintClick(Sender: TObject);
|
||||
procedure TprintGridClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure TcloseClick(Sender: TObject);
|
||||
procedure TsaveGridClick(Sender: TObject);
|
||||
procedure BTLPClick(Sender: TObject);
|
||||
procedure BTNPClick(Sender: TObject);
|
||||
procedure TCBNORPropertiesChange(Sender: TObject);
|
||||
procedure TgridSetClick(Sender: TObject);
|
||||
procedure dxLayoutControl2DblClick(Sender: TObject);
|
||||
private
|
||||
fWindowDesign: TWindowFormdesign;
|
||||
CurrentPage, RecordsNumber: Integer;
|
||||
fDesignCode:string;
|
||||
procedure doQuery1();
|
||||
procedure doQuery1ByCriteria();
|
||||
procedure doQuery2();
|
||||
procedure doQuery2ByCriteria();
|
||||
procedure initGrid();
|
||||
protected
|
||||
fParameters1: string;
|
||||
fParameters2: string;
|
||||
fParameters3: string;
|
||||
fParameters4: string;
|
||||
fParameters5: string;
|
||||
fParameters10: string;
|
||||
public
|
||||
fFormId: integer;
|
||||
fProcedureName1:string; //存储过程名称1
|
||||
fProcedureName2:string; //存储过程名称2
|
||||
FLMType:string; //报表文件类型标志
|
||||
ftimeType:string; //日期类型
|
||||
fQueryType:String; //查询类型
|
||||
FFiltration1:string; //打印参数条件
|
||||
fCriteria:string; //条件参数
|
||||
constructor Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
frmPageBaseList: TfrmPageBaseList;
|
||||
|
||||
implementation
|
||||
uses
|
||||
U_RTFun, U_globalVar, U_dataLink,U_FormLayOutDesign, U_LabelPrint;
|
||||
{$R *.dfm}
|
||||
|
||||
procedure TfrmPageBaseList.BTLPClick(Sender: TObject);
|
||||
begin
|
||||
if CurrentPage > 1 then
|
||||
CurrentPage := CurrentPage - 1;
|
||||
|
||||
if cxPageControl1.ActivePageIndex=0 then
|
||||
doQuery1()
|
||||
else
|
||||
doQuery2() ;
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.BTNPClick(Sender: TObject);
|
||||
begin
|
||||
if cxPageControl1.ActivePageIndex=0 then
|
||||
begin
|
||||
if CurrentPage < cds_List1.FieldByName('TotalCount').AsInteger / RecordsNumber then
|
||||
CurrentPage := CurrentPage + 1;
|
||||
doQuery1();
|
||||
end
|
||||
else
|
||||
begin
|
||||
if CurrentPage < cds_List2.FieldByName('TotalCount').AsInteger / RecordsNumber then
|
||||
CurrentPage := CurrentPage + 1;
|
||||
doQuery2();
|
||||
end;
|
||||
end;
|
||||
|
||||
constructor TfrmPageBaseList.Create(AOwner: TComponent; ACaption: string=''; Parameters1: string=''; Parameters2: string=''; Parameters3: string=''; Parameters4: string=''; Parameters5: string=''; Parameters10: string='';FormID:Integer=0);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
if ACaption <> '' then
|
||||
Caption := ACaption;
|
||||
|
||||
fParameters1 := Parameters1;
|
||||
fParameters2 := Parameters2;
|
||||
fParameters3 := Parameters3;
|
||||
fParameters4 := Parameters4;
|
||||
fParameters5 := Parameters5;
|
||||
fParameters10 := Parameters10;
|
||||
fFormId:= FormID ;
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.TCBNORPropertiesChange(Sender: TObject);
|
||||
begin
|
||||
RecordsNumber := StrToInt(TCBNOR.Text);
|
||||
CurrentPage := 1;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.TcloseClick(Sender: TObject);
|
||||
begin
|
||||
close;
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.TgridSetClick(Sender: TObject);
|
||||
begin
|
||||
fWindowDesign.OpenGridDesignWin10(fDesignCode,'cxgrid1',tv1);
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.TprintClick(Sender: TObject);
|
||||
begin
|
||||
if cds_List1.IsEmpty then
|
||||
Exit;
|
||||
TcxGridToExcel(self.Caption, cxgrid1);
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.TprintGridClick(Sender: TObject);
|
||||
begin
|
||||
if cds_List1.IsEmpty then
|
||||
Exit;
|
||||
if trim(self.FLMType)='' then
|
||||
begin
|
||||
application.MessageBox('未设置打印报表类型,请先设置!','提示信息',0);
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
frmLabelPrint := TfrmLabelPrint.Create(Application);
|
||||
with frmLabelPrint do
|
||||
begin
|
||||
FLMType := self.FLMType;
|
||||
FFiltration1 := self.FFiltration1;
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
// Self.InitGrid();
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
frmLabelPrint.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.TrefreshClick(Sender: TObject);
|
||||
begin
|
||||
if frmFrameDateSel1.BegDate.Visible then
|
||||
begin
|
||||
frmFrameDateSel1.BegDate.SetFocus;
|
||||
end;
|
||||
CurrentPage := 1;
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.TsaveGridClick(Sender: TObject);
|
||||
begin
|
||||
if cxPageControl1.ActivePageIndex=0 then
|
||||
WriteCxGrid(trim(self.Caption) + 'Tv1', Tv1, gDllFileCaption)
|
||||
else
|
||||
WriteCxGrid(trim(self.Caption) + 'Tv2', Tv2, gDllFileCaption) ;
|
||||
if gIsCanDesign then
|
||||
begin
|
||||
if cxPageControl1.ActivePageIndex=0 then
|
||||
saveLayOut(application, dxLayoutControl1, ADOQueryBaseCmd,PWideChar( fDllFileName + '|' + Self.Name + '|' + dxLayoutControl1.Name + '.ini'))
|
||||
else
|
||||
saveLayOut(application, dxLayoutControl2, ADOQueryBaseCmd,PWideChar( fDllFileName + '|' + Self.Name + '|' + dxLayoutControl2.Name + '.ini'));
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////
|
||||
procedure TfrmPageBaseList.doQuery1();
|
||||
var
|
||||
strwhere: string;
|
||||
begin
|
||||
if fProcedureName1='' then
|
||||
begin
|
||||
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
|
||||
exit;
|
||||
end;
|
||||
strwhere := GetProcedureParam(dxLayoutControl1);
|
||||
|
||||
try
|
||||
cxProgressBar1.Visible:=true;
|
||||
cxProgressBar1.Refresh ;
|
||||
Tv1.BeginUpdate();
|
||||
CDS_List1.DisableControls;
|
||||
with ADOQueryList1 do
|
||||
begin
|
||||
close;
|
||||
Filtered := false;
|
||||
sql.Clear;
|
||||
sql.Add('exec '+fProcedureName1);
|
||||
sql.Add('@timeType='+quotedstr(fTimeType));
|
||||
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
|
||||
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
|
||||
if frmFrameDateSel1.jqModel.Checked then
|
||||
sql.Add(',@jqModel=1')
|
||||
else
|
||||
sql.Add(',@jqModel=0');
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
|
||||
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
|
||||
end;
|
||||
sql.Add(',@criteria='+ quotedstr(fcriteria));
|
||||
if strwhere<>'' then
|
||||
sql.Add(','+strwhere);
|
||||
// showMessage(sql.Text);
|
||||
//cxMemo1.Text:= sql.Text ;
|
||||
open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryList1, CDS_List1);
|
||||
SInitCDSData(ADOQueryList1, CDS_List1);
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list1.FieldByName('TotalCount').AsInteger / RecordsNumber));
|
||||
end;
|
||||
finally
|
||||
CDS_List1.EnableControls;
|
||||
Tv1.EndUpdate;
|
||||
cxProgressBar1.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////
|
||||
procedure TfrmPageBaseList.doQuery2();
|
||||
var
|
||||
strwhere: string;
|
||||
begin
|
||||
if fProcedureName2='' then
|
||||
begin
|
||||
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
|
||||
exit;
|
||||
end;
|
||||
strwhere := GetProcedureParam(dxLayoutControl2);
|
||||
|
||||
try
|
||||
cxProgressBar1.Visible:=true;
|
||||
cxProgressBar1.Refresh ;
|
||||
Tv2.BeginUpdate();
|
||||
CDS_List2.DisableControls;
|
||||
with ADOQueryList2 do
|
||||
begin
|
||||
close;
|
||||
Filtered := false;
|
||||
sql.Clear;
|
||||
sql.Add('exec '+fProcedureName1);
|
||||
sql.Add('@timeType='+quotedstr(fTimeType));
|
||||
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
|
||||
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
|
||||
if frmFrameDateSel1.jqModel.Checked then
|
||||
sql.Add(',@jqModel=1')
|
||||
else
|
||||
sql.Add(',@jqModel=0');
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
|
||||
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
|
||||
end;
|
||||
sql.Add(',@criteria='+ quotedstr(fcriteria));
|
||||
if strwhere<>'' then
|
||||
sql.Add(','+strwhere);
|
||||
// showMessage(sql.Text);
|
||||
//cxMemo1.Text:= sql.Text ;
|
||||
open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryList2, CDS_List2);
|
||||
SInitCDSData(ADOQueryList2, CDS_List2);
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list2.FieldByName('TotalCount').AsInteger / RecordsNumber));
|
||||
end;
|
||||
finally
|
||||
CDS_List2.EnableControls;
|
||||
Tv2.EndUpdate;
|
||||
cxProgressBar1.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
procedure TfrmPageBaseList.doQuery1ByCriteria();
|
||||
var
|
||||
mSqlWhere: string;
|
||||
begin
|
||||
if fProcedureName1='' then
|
||||
begin
|
||||
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
|
||||
exit;
|
||||
end;
|
||||
|
||||
mSqlWhere := SLGetFilters(dxLayoutControl1, 1, 2);
|
||||
if trim(mSqlWhere) <> '' then
|
||||
begin
|
||||
mSqlWhere := ' and ' + trim(mSqlWhere);
|
||||
end;
|
||||
mSqlWhere:=fCriteria + ' ' + mSqlWhere ;
|
||||
try
|
||||
cxProgressBar1.Visible:=true;
|
||||
cxProgressBar1.Refresh ;
|
||||
Tv1.BeginUpdate();
|
||||
CDS_List1.DisableControls;
|
||||
with ADOQueryList1 do
|
||||
begin
|
||||
close;
|
||||
Filtered := false;
|
||||
sql.Clear;
|
||||
sql.Add('exec '+fProcedureName1);
|
||||
sql.Add('@timeType='+quotedstr(fTimeType));
|
||||
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
|
||||
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
|
||||
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
|
||||
end;
|
||||
sql.Add(',@criteria='+ quotedstr(mSqlWhere));
|
||||
|
||||
//cxMemo1.Text:= sql.Text ;
|
||||
open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryList1, CDS_List1);
|
||||
SInitCDSData(ADOQueryList1, CDS_List1);
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list1.FieldByName('TotalCount').AsInteger / RecordsNumber));
|
||||
end;
|
||||
finally
|
||||
CDS_List1.EnableControls;
|
||||
Tv1.EndUpdate;
|
||||
cxProgressBar1.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
////////////////////////////////////
|
||||
procedure TfrmPageBaseList.doQuery2ByCriteria();
|
||||
var
|
||||
mSqlWhere: string;
|
||||
begin
|
||||
if fProcedureName2='' then
|
||||
begin
|
||||
application.MessageBox('存储过程名称参数不能为空!','警告信息',0);
|
||||
exit;
|
||||
end;
|
||||
|
||||
mSqlWhere := SLGetFilters(dxLayoutControl2, 1, 2);
|
||||
if trim(mSqlWhere) <> '' then
|
||||
begin
|
||||
mSqlWhere := ' and ' + trim(mSqlWhere);
|
||||
end;
|
||||
mSqlWhere:=fCriteria + ' ' + mSqlWhere ;
|
||||
try
|
||||
cxProgressBar1.Visible:=true;
|
||||
cxProgressBar1.Refresh ;
|
||||
Tv2.BeginUpdate();
|
||||
CDS_List2.DisableControls;
|
||||
with ADOQueryList2 do
|
||||
begin
|
||||
close;
|
||||
Filtered := false;
|
||||
sql.Clear;
|
||||
sql.Add('exec '+fProcedureName1);
|
||||
sql.Add('@timeType='+quotedstr(fTimeType));
|
||||
sql.Add(',@begDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.begdate.Date)));
|
||||
sql.Add(',@endDate='+quotedstr(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date+1)));
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
sql.Add(',@pageIndex=' + inttostr(CurrentPage));
|
||||
sql.Add(',@pageSize=' + inttostr(RecordsNumber));
|
||||
end;
|
||||
sql.Add(',@criteria='+ quotedstr(mSqlWhere));
|
||||
|
||||
//cxMemo1.Text:= sql.Text ;
|
||||
open;
|
||||
end;
|
||||
SCreateCDS(ADOQueryList2, CDS_List2);
|
||||
SInitCDSData(ADOQueryList2, CDS_List2);
|
||||
if Panel_page.Visible then
|
||||
begin
|
||||
LBCPAP.Caption := inttostr(CurrentPage) + '/' + inttostr(ceil(cds_list2.FieldByName('TotalCount').AsInteger / RecordsNumber));
|
||||
end;
|
||||
finally
|
||||
CDS_List2.EnableControls;
|
||||
Tv2.EndUpdate;
|
||||
cxProgressBar1.Visible:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.dxLayoutControl2DblClick(Sender: TObject);
|
||||
begin
|
||||
layoutDesign(TdxLayoutControl(Sender),ADOQueryBaseCmd,PWideChar(dcode));
|
||||
end;
|
||||
|
||||
///
|
||||
procedure TfrmPageBaseList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
begin
|
||||
Sendmessage(application.MainForm.Handle, WM_CloseForm, 4, 0);
|
||||
|
||||
Action:=cafree;
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.FormCreate(Sender: TObject);
|
||||
var
|
||||
mFontSize:integer;
|
||||
begin
|
||||
getSystemIni();
|
||||
if gFontSize<9 then
|
||||
begin
|
||||
mFontSize := 12;
|
||||
end
|
||||
else
|
||||
begin
|
||||
mFontSize:=gFontSize ;
|
||||
end;
|
||||
|
||||
self.Font.Size := gFontSize;
|
||||
if trim(gFontName)<>'' then
|
||||
self.Font.Name:=gFontName;
|
||||
|
||||
cxPageControl1.Align:=alClient;
|
||||
CurrentPage := 1;
|
||||
RecordsNumber := 500;
|
||||
fWindowDesign := TWindowFormdesign.Create();
|
||||
frmFrameDateSel1.begdate.Date:=SGetServerDate(ADOQueryBaseTemp);
|
||||
frmFrameDateSel1.enddate.Date:=frmFrameDateSel1.begdate.Date;
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.FormDestroy(Sender: TObject);
|
||||
begin
|
||||
fWindowDesign.free;
|
||||
end;
|
||||
|
||||
procedure TfrmPageBaseList.FormShow(Sender: TObject);
|
||||
begin
|
||||
fDesignCode := fDllFileName +'|'+self.name+ '|' + intTostr(fformId);
|
||||
if DParameters8<>'1' then
|
||||
begin
|
||||
fWindowDesign.FormStyleInit10(self, fFormId, ADOQueryBaseTemp, ADOQueryBaseCmd, '', fParameters10);
|
||||
end;
|
||||
TgridSet.Visible:=gIsCanDesign;
|
||||
|
||||
//增加动态条件
|
||||
addQryContionByLay(ADOQueryBaseTemp,fformId,'cxgrid1',dxLayoutControl1,7);
|
||||
addQryContionByLay(ADOQueryBaseTemp,fformId,'cxgrid2',dxLayoutControl2,7);
|
||||
ReadCxGrid(trim(self.Caption) + 'Tv1', Tv1, gDllFileCaption);
|
||||
ReadCxGrid(trim(self.Caption) + 'Tv2', Tv2, gDllFileCaption);
|
||||
initGrid();
|
||||
end;
|
||||
|
||||
///////////////////////////////
|
||||
///
|
||||
procedure TfrmPageBaseList.initGrid();
|
||||
begin
|
||||
if fProcedureName1='' then exit;
|
||||
if fProcedureName2='' then exit;
|
||||
if cxPageControl1.ActivePageIndex=0 then
|
||||
begin
|
||||
if fQueryType='criteria' then
|
||||
begin
|
||||
doQuery1ByCriteria() ;
|
||||
end
|
||||
else
|
||||
begin
|
||||
frmFrameDateSel1.jqModel.Checked:=true;
|
||||
doQuery1() ;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if fQueryType='criteria' then
|
||||
begin
|
||||
doQuery2ByCriteria() ;
|
||||
end
|
||||
else
|
||||
begin
|
||||
frmFrameDateSel1.jqModel.Checked:=true;
|
||||
doQuery2() ;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user