1157 lines
32 KiB
ObjectPascal
1157 lines
32 KiB
ObjectPascal
unit U_GetDllForm;
|
||
|
||
interface
|
||
|
||
uses
|
||
Windows, Messages, forms, OleCtnrs, DateUtils, SysUtils, ADODB, IniFiles,
|
||
Dxcore, activex;
|
||
|
||
function GetDllForm(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; export; stdcall;
|
||
|
||
function ConnData(): Boolean;
|
||
|
||
implementation
|
||
|
||
uses
|
||
U_DataLink, U_Fun, U_YFCR, U_FKCR, U_YFFKList, U_YSCR, U_SKCR, U_YSSKList,
|
||
U_YSCRJZC, U_YSCR_Gd, U_SKCR_Gd, U_YFZDList_MX, U_YSZDList_MX, U_YFMXlist,
|
||
U_YSMXlist, U_YFCRMXList, U_FDINVOICE, U_FPINVOICE_TJ, U_FDINVOICE_X,
|
||
U_FDINVOICE_XMX, U_FDINVOICE_S, U_YF_Money_LL, U_YF_Money_LL_list,
|
||
U_XXFPINVOICE_TJ, U_CostCR, U_YSCRMXList, U_YSMXlist2, U_YSKtjlist,
|
||
U_YSMXlist3, U_OtherFeeSave, U_OtherFeeLIST, U_YYFeeLIST;
|
||
|
||
/////////////////////////////////////////////////////////////////
|
||
// 功能说明:取Dll中得窗体 //
|
||
// 参数说明:App>>调用应用程序; //
|
||
// FormH>>调用窗口句柄 ; //
|
||
// FormID>>窗口号; //
|
||
// Language>>语言种类; //
|
||
// WinStyle>>窗口类型; //
|
||
/////////////////////////////////////////////////////////////////
|
||
var
|
||
frmYSSKListcx, frmYSSKList: TfrmYSSKList;
|
||
frmYSKtjlistyw, frmYSKtjlist, frmYSKtjlistzz: TfrmYSKtjlist;
|
||
frmOtherFeeSaveLR, frmOtherFeeSaveGL, frmOtherFeeSaveJL, frmOtherFeeSavecw: TfrmOtherFeeSave;
|
||
frmOtherFeelistLr, frmOtherFeelistGL, frmOtherFeeLISTXZ, frmOtherFeeLISTjl, frmOtherFeeLISTcw: TfrmOtherFeelist;
|
||
frmYYFeelistLr, frmYYFeelistGL, frmYYFeelistCX: TfrmYYFeelist;
|
||
frmSKCRCX, frmSKCRGL: TfrmSKCR;
|
||
|
||
function GetDllForm(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;
|
||
var
|
||
i: Integer;
|
||
bFound: Boolean;
|
||
mnewHandle: hwnd;
|
||
mstyle: TFormStyle; // 0:子窗口; 1:普通窗口
|
||
mstate: TWindowState;
|
||
mborderstyle: TFormBorderStyle;
|
||
begin
|
||
mnewHandle := 0;
|
||
DName := GName;
|
||
DCode := GCode;
|
||
DdataBase := DataBase;
|
||
DTitCaption := Title;
|
||
DParameters1 := Parameters1;
|
||
DParameters2 := Parameters2;
|
||
DParameters3 := Parameters3;
|
||
DParameters4 := Parameters4;
|
||
DParameters5 := Parameters5;
|
||
DParameters6 := Parameters6;
|
||
DParameters7 := Parameters7;
|
||
DParameters8 := Parameters8;
|
||
DParameters9 := Parameters9;
|
||
DParameters10 := Parameters10;
|
||
|
||
MainApplication := App;
|
||
DCurHandle := FormH;
|
||
IsDelphiLanguage := Language;
|
||
|
||
Application := TApplication(App);
|
||
DCurHandle := 0;
|
||
|
||
|
||
//赋值链接字符串
|
||
SetLength(server, 255);
|
||
SetLength(dtbase, 255);
|
||
SetLength(user, 255);
|
||
SetLength(pswd, 255);
|
||
|
||
server := '47.103.192.8,7781';
|
||
// server := '.';
|
||
dtbase := 'yushangdata';
|
||
// user := 'sa';
|
||
user := 'yushangsa';
|
||
pswd := 'rightsoft@7112';
|
||
// pswd := 'rightsoft';
|
||
DConString := 'Provider=SQLOLEDB.1;Password=' + pswd + ';Persist Security Info=True;User ID=' + user + ';Initial Catalog=' + dtbase + ';Data Source=' + server;
|
||
DConString := DataBaseStr;
|
||
// DName := '袁玲 ';
|
||
if not ConnData() then
|
||
begin
|
||
result := 0;
|
||
exit;
|
||
end;
|
||
{ if IsINIFile() then
|
||
ReadINIFile()
|
||
else
|
||
WriteINIFile ;}
|
||
// 定义窗口类型 、状态
|
||
if WinStyle = 0 then
|
||
begin
|
||
mstyle := fsMDIChild;
|
||
mstate := wsMaximized;
|
||
mborderstyle := bsSizeable;
|
||
end
|
||
else
|
||
begin
|
||
mstyle := fsNormal;
|
||
mstate := wsNormal;
|
||
mborderstyle := bsSizeable;
|
||
end;
|
||
|
||
//调用子模块窗口
|
||
case FormID of
|
||
|
||
11: //物流费用登记
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '物流费用登记' then
|
||
begin
|
||
BringWindowToTop(frmOtherFeeSaveLR.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmOtherFeeSaveLR := TfrmOtherFeeSave.Create(application.MainForm);
|
||
with frmOtherFeeSaveLR do
|
||
begin
|
||
Title := '物流费用登记';
|
||
canshu1 := '登记';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmOtherFeeSaveLR.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmOtherFeeSaveLR.Handle;
|
||
end;
|
||
|
||
12: //物流费用管理
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '物流费用管理' then
|
||
begin
|
||
BringWindowToTop(frmOtherFeeSaveGL.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmOtherFeeSaveGL := TfrmOtherFeeSave.Create(application.MainForm);
|
||
with frmOtherFeeSaveGL do
|
||
begin
|
||
Title := '物流费用管理';
|
||
canshu1 := '管理';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmOtherFeeSaveGL.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmOtherFeeSaveGL.Handle;
|
||
end;
|
||
|
||
21: //物流费用总经理
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '物流费用(总经理)' then
|
||
begin
|
||
BringWindowToTop(frmOtherFeeSaveJL.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmOtherFeeSaveJL := TfrmOtherFeeSave.Create(application.MainForm);
|
||
with frmOtherFeeSaveJL do
|
||
begin
|
||
Title := '物流费用(总经理)';
|
||
canshu1 := '总经理';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmOtherFeeSaveJL.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmOtherFeeSaveJL.Handle;
|
||
end;
|
||
22: //物流费用(财务)
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '物流费用(财务)' then
|
||
begin
|
||
BringWindowToTop(frmOtherFeeSavecw.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmOtherFeeSavecw := TfrmOtherFeeSave.Create(application.MainForm);
|
||
with frmOtherFeeSavecw do
|
||
begin
|
||
Title := '物流费用(财务)';
|
||
canshu1 := '财务';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmOtherFeeSavecw.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmOtherFeeSavecw.Handle;
|
||
end;
|
||
|
||
13: //业务员费用登记
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '业务员费用登记' then
|
||
begin
|
||
BringWindowToTop(frmOtherFeelistLR.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmOtherFeelistLR := TfrmOtherFeelist.Create(application.MainForm);
|
||
with frmOtherFeelistLR do
|
||
begin
|
||
Title := '业务员费用登记';
|
||
canshu1 := '登记';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmOtherFeelistLR.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmOtherFeelistLR.Handle;
|
||
end;
|
||
|
||
14: //业务员费用管理
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '业务员费用管理' then
|
||
begin
|
||
BringWindowToTop(frmOtherFeeLISTGL.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmOtherFeeLISTGL := TfrmOtherFeelist.Create(application.MainForm);
|
||
with frmOtherFeeLISTGL do
|
||
begin
|
||
Title := '业务员费用管理';
|
||
canshu1 := '管理';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmOtherFeeLISTGL.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmOtherFeeLISTGL.Handle;
|
||
end;
|
||
31: //业务员费用(行政)
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '业务员费用(行政)' then
|
||
begin
|
||
BringWindowToTop(frmOtherFeeLISTXZ.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmOtherFeeLISTXZ := TfrmOtherFeelist.Create(application.MainForm);
|
||
with frmOtherFeeLISTXZ do
|
||
begin
|
||
Title := '业务员费用(行政)';
|
||
canshu1 := '行政';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmOtherFeeLISTXZ.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmOtherFeeLISTXZ.Handle;
|
||
end;
|
||
32: //业务员费用(总经理)
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '业务员费用(总经理)' then
|
||
begin
|
||
BringWindowToTop(frmOtherFeeLISTJL.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmOtherFeeLISTJL := TfrmOtherFeelist.Create(application.MainForm);
|
||
with frmOtherFeeLISTJL do
|
||
begin
|
||
Title := '业务员费用(总经理)';
|
||
canshu1 := '总经理';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmOtherFeeLISTJL.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmOtherFeeLISTJL.Handle;
|
||
end;
|
||
33: //业务员费用(财务)
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '业务员费用(财务)' then
|
||
begin
|
||
BringWindowToTop(frmOtherFeeLISTJL.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmOtherFeeLISTJL := TfrmOtherFeelist.Create(application.MainForm);
|
||
with frmOtherFeeLISTJL do
|
||
begin
|
||
Title := '业务员费用(财务)';
|
||
canshu1 := '财务';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmOtherFeeLISTJL.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmOtherFeeLISTJL.Handle;
|
||
end;
|
||
|
||
15: //样衣登记
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '样衣费用登记' then
|
||
begin
|
||
BringWindowToTop(frmYYFeelistLR.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmYYFeelistLR := TfrmYYFeelist.Create(application.MainForm);
|
||
with frmYYFeelistLR do
|
||
begin
|
||
Title := '样衣费用登记';
|
||
canshu1 := '登记';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYYFeelistLR.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYYFeelistLR.Handle;
|
||
end;
|
||
|
||
16: //样衣费用管理
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '样衣费用管理' then
|
||
begin
|
||
BringWindowToTop(frmYYFeelistGL.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmYYFeelistGL := tfrmYYFeelist.Create(application.MainForm);
|
||
with frmYYFeelistGL do
|
||
begin
|
||
Title := '样衣费用管理';
|
||
canshu1 := '管理';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYYFeelistGL.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYYFeelistGL.Handle;
|
||
end;
|
||
|
||
17: //样衣费用查询
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '样衣费用查询' then
|
||
begin
|
||
BringWindowToTop(frmYYFeelistCX.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmYYFeelistCX := tfrmYYFeelist.Create(application.MainForm);
|
||
with frmYYFeelistCX do
|
||
begin
|
||
Title := '样衣费用查询';
|
||
canshu1 := '查询';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYYFeelistCX.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYYFeelistCX.Handle;
|
||
end;
|
||
18: //样衣费用财务
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '样衣费用(财务)' then
|
||
begin
|
||
BringWindowToTop(frmYYFeelistCX.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
//if frmBaoGuanListBGZL=nil then
|
||
begin
|
||
frmYYFeelistCX := tfrmYYFeelist.Create(application.MainForm);
|
||
with frmYYFeelistCX do
|
||
begin
|
||
Title := '样衣费用(财务)';
|
||
canshu1 := '财务';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYYFeelistCX.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYYFeelistCX.Handle;
|
||
end;
|
||
|
||
111: //应付款登记
|
||
begin
|
||
if frmYFCR = nil then
|
||
begin
|
||
frmYFCR := TfrmYFCR.Create(application.MainForm);
|
||
with frmYFCR do
|
||
begin
|
||
caption := Trim(Title);
|
||
fmanage := trim(Parameters1);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYFCR.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYFCR.Handle;
|
||
end;
|
||
112: //应付款明细查询
|
||
begin
|
||
if frmYFCRMXList = nil then
|
||
begin
|
||
frmYFCRMXList := TfrmYFCRMXList.Create(application.MainForm);
|
||
with frmYFCRMXList do
|
||
begin
|
||
fmanage := trim(Parameters1);
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYFCRMXList.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYFCRMXList.Handle;
|
||
end;
|
||
121: //付款登记
|
||
begin
|
||
if frmFKCR = nil then
|
||
begin
|
||
frmFKCR := TfrmFKCR.Create(application.MainForm);
|
||
with frmFKCR do
|
||
begin
|
||
caption := Trim(Title);
|
||
fmanage := trim(Parameters1);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmFKCR.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmFKCR.Handle;
|
||
end;
|
||
|
||
131: //应付款付款统计
|
||
begin
|
||
if frmYFFKList = nil then
|
||
begin
|
||
frmYFFKList := TfrmYFFKList.Create(application.MainForm);
|
||
with frmYFFKList do
|
||
begin
|
||
caption := Trim(Title);
|
||
fDParameters1 := trim(DParameters1);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYFFKList.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYFFKList.Handle;
|
||
end;
|
||
141: //应付对账单
|
||
begin
|
||
if frmYFMXlist = nil then
|
||
begin
|
||
frmYFMXlist := TfrmYFMXlist.Create(application.MainForm);
|
||
with frmYFMXlist do
|
||
begin
|
||
caption := Trim(Title);
|
||
fType := trim(DataBase);
|
||
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYFMXlist.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYFMXlist.Handle;
|
||
|
||
end;
|
||
211: //应收款登记
|
||
begin
|
||
if frmYSCR = nil then
|
||
begin
|
||
frmYSCR := TfrmYSCR.Create(application.MainForm);
|
||
with frmYSCR do
|
||
begin
|
||
fmanage := trim(Parameters1);
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYSCR.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYSCR.Handle;
|
||
end;
|
||
212: //应收款明细查询
|
||
begin
|
||
if frmYSCRMXList = nil then
|
||
begin
|
||
frmYSCRMXList := TfrmYSCRMXList.Create(application.MainForm);
|
||
with frmYSCRMXList do
|
||
begin
|
||
fmanage := trim(Parameters1);
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYSCRMXList.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYSCRMXList.Handle;
|
||
end;
|
||
|
||
221: //收款登记
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '收款管理' then
|
||
begin
|
||
BringWindowToTop(frmSKCRGL.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
begin
|
||
frmSKCRGL := TfrmSKCR.Create(application.MainForm);
|
||
with frmSKCRGL do
|
||
begin
|
||
fmanage := '高权限';
|
||
Title := '收款管理';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmSKCRGL.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmSKCRGL.Handle;
|
||
end;
|
||
|
||
222: //收款查询
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '收款查询' then
|
||
begin
|
||
BringWindowToTop(frmSKCRCX.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
begin
|
||
frmSKCRCX := TfrmSKCR.Create(application.MainForm);
|
||
with frmSKCRCX do
|
||
begin
|
||
fmanage := '查询';
|
||
Title := '收款查询';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmSKCRCX.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmSKCRCX.Handle;
|
||
end;
|
||
|
||
231: //应收款收款统计
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '应收款收款统计' then
|
||
begin
|
||
BringWindowToTop(frmYSSKList.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
begin
|
||
frmYSSKList := TfrmYSSKList.Create(application.MainForm);
|
||
with frmYSSKList do
|
||
begin
|
||
canshu1 := '高权限';
|
||
Title := '应收款收款统计';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYSSKList.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYSSKList.Handle;
|
||
end;
|
||
|
||
232: //应收款收款统计(业务员)
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '应收款收款统计(业务员)' then
|
||
begin
|
||
BringWindowToTop(frmYSSKListcx.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
begin
|
||
frmYSSKListcx := TfrmYSSKList.Create(application.MainForm);
|
||
with frmYSSKListcx do
|
||
begin
|
||
canshu1 := '查询';
|
||
Title := '应收款收款统计(业务员)';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYSSKListcx.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYSSKListcx.Handle;
|
||
end;
|
||
|
||
251: //应收账期统计
|
||
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '应收账期统计(管理)' then
|
||
begin
|
||
BringWindowToTop(frmYSKtjlist.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
begin
|
||
frmYSKtjlist := TfrmYSKtjlist.Create(application.MainForm);
|
||
with frmYSKtjlist do
|
||
begin
|
||
canshu1 := '管理';
|
||
Title := '应收账期统计(管理)';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYSKtjlist.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYSKtjlist.Handle;
|
||
end;
|
||
|
||
252: //应收账期统计(业务员)
|
||
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '应收账期统计(业务员)' then
|
||
begin
|
||
BringWindowToTop(frmYSKtjlistyw.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
begin
|
||
frmYSKtjlistyw := TfrmYSKtjlist.Create(application.MainForm);
|
||
with frmYSKtjlistyw do
|
||
begin
|
||
canshu1 := '业务员';
|
||
Title := '应收账期统计(业务员)';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYSKtjlistyw.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYSKtjlistyw.Handle;
|
||
end;
|
||
|
||
253: //应收账期统计(组长)
|
||
|
||
begin
|
||
bFound := FALSE;
|
||
for i := (App.MainForm.MDIChildCount - 1) downto 0 do
|
||
begin
|
||
if App.MainForm.MDIChildren[i].Caption = '应收账期统计(组长)' then
|
||
begin
|
||
BringWindowToTop(frmYSKtjlistzz.Handle);
|
||
bFound := TRUE;
|
||
Break;
|
||
end;
|
||
end;
|
||
if not bFound then
|
||
begin
|
||
frmYSKtjlistzz := TfrmYSKtjlist.Create(application.MainForm);
|
||
with frmYSKtjlistzz do
|
||
begin
|
||
canshu1 := '组长';
|
||
Title := '应收账期统计(组长)';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYSKtjlistzz.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYSKtjlistzz.Handle;
|
||
end;
|
||
243: //应收对账单 (组长)
|
||
begin
|
||
if frmYSMXlist3 = nil then
|
||
begin
|
||
frmYSMXlist3 := TfrmYSMXlist3.Create(application.MainForm);
|
||
with frmYSMXlist3 do
|
||
begin
|
||
caption := Trim(Title);
|
||
// fType:='0';
|
||
fType := trim(DataBase);
|
||
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYSMXlist3.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYSMXlist3.Handle;
|
||
end;
|
||
242: //应收对账单 (业务员)
|
||
begin
|
||
if frmYSMXlist2 = nil then
|
||
begin
|
||
frmYSMXlist2 := TfrmYSMXlist2.Create(application.MainForm);
|
||
with frmYSMXlist2 do
|
||
begin
|
||
caption := Trim(Title);
|
||
// fType:='0';
|
||
fType := trim(DataBase);
|
||
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYSMXlist2.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYSMXlist2.Handle;
|
||
end;
|
||
241: //应收对账单
|
||
begin
|
||
if frmYSMXlist = nil then
|
||
begin
|
||
frmYSMXlist := TfrmYSMXlist.Create(application.MainForm);
|
||
with frmYSMXlist do
|
||
begin
|
||
caption := Trim(Title);
|
||
// fType:='0';
|
||
fType := trim(DataBase);
|
||
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmYSMXlist.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmYSMXlist.Handle;
|
||
end;
|
||
311: //进项发票管理
|
||
begin
|
||
if frmFDINVOICE = nil then
|
||
begin
|
||
frmFDINVOICE := TfrmFDINVOICE.Create(application.MainForm);
|
||
with frmFDINVOICE do
|
||
begin
|
||
fInvoiceFlag := '0';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmFDINVOICE.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmFDINVOICE.Handle;
|
||
end;
|
||
|
||
321: //进项发票统计查询
|
||
begin
|
||
if frmFPInvoice_TJ = nil then
|
||
begin
|
||
frmFPInvoice_TJ := TfrmFPInvoice_TJ.Create(application.MainForm);
|
||
with frmFPInvoice_TJ do
|
||
begin
|
||
fInvoiceFlag := '0';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmFPInvoice_TJ.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmFPInvoice_TJ.Handle;
|
||
end;
|
||
411: //销项发票
|
||
begin
|
||
if frmFDINVOICE_X = nil then
|
||
begin
|
||
frmFDINVOICE_X := TfrmFDINVOICE_X.Create(application.MainForm);
|
||
with frmFDINVOICE_X do
|
||
begin
|
||
fInvoiceFlag := '1';
|
||
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmFDINVOICE_X.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmFDINVOICE_X.Handle;
|
||
end;
|
||
412: //销项发票明细
|
||
begin
|
||
if frmFDINVOICE_XMX = nil then
|
||
begin
|
||
frmFDINVOICE_XMX := TfrmFDINVOICE_XMX.Create(application.MainForm);
|
||
with frmFDINVOICE_XMX do
|
||
begin
|
||
fInvoiceFlag := '1';
|
||
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmFDINVOICE_XMX.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmFDINVOICE_XMX.Handle;
|
||
end;
|
||
421: //销项发票统计查询
|
||
begin
|
||
if frmXXFPInvoice_TJ = nil then
|
||
begin
|
||
frmXXFPInvoice_TJ := TfrmXXFPInvoice_TJ.Create(application.MainForm);
|
||
with frmXXFPInvoice_TJ do
|
||
begin
|
||
fInvoiceFlag := '1';
|
||
caption := Trim(Title);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmXXFPInvoice_TJ.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmXXFPInvoice_TJ.Handle;
|
||
end;
|
||
|
||
511: //费用登记
|
||
begin
|
||
if frmCostCR = nil then
|
||
begin
|
||
frmCostCR := TfrmCostCR.Create(application.MainForm);
|
||
with frmCostCR do
|
||
begin
|
||
caption := Trim(Title);
|
||
fflag := strtointdef(trim(DataBase), 0);
|
||
fmanage := trim(Parameters1);
|
||
FormStyle := mstyle;
|
||
windowState := mstate;
|
||
BorderStyle := mborderstyle;
|
||
//show;
|
||
end;
|
||
end
|
||
else
|
||
frmCostCR.BringToFront;
|
||
//句柄
|
||
mnewHandle := frmCostCR.Handle;
|
||
|
||
end;
|
||
end; // end case
|
||
|
||
Result := mnewHandle;
|
||
// NewDllApp := Application;
|
||
end;
|
||
//===========================================================
|
||
//建立数据库连接池
|
||
//===========================================================
|
||
|
||
function ConnData(): Boolean;
|
||
var
|
||
IniFile: TIniFile;
|
||
begin
|
||
try
|
||
IniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'SYSTEMSET.INI');
|
||
PicSvr := IniFile.ReadString('SERVER', '服务器地址', '127.0.0.1');
|
||
finally
|
||
IniFile.Free;
|
||
end;
|
||
if not Assigned(DataLink_YSYF) then
|
||
DataLink_YSYF := TDataLink_YSYF.Create(Application);
|
||
try
|
||
with DataLink_YSYF.ADOLink do
|
||
begin
|
||
// if not Connected then
|
||
begin
|
||
Connected := false;
|
||
ConnectionString := DConString;
|
||
LoginPrompt := false;
|
||
Connected := true;
|
||
end;
|
||
end;
|
||
Result := true;
|
||
except
|
||
Result := false;
|
||
application.MessageBox('数据库连接失败!', '错误', mb_Ok + MB_ICONERROR);
|
||
end;
|
||
end;
|
||
|
||
initialization
|
||
CoInitialize(nil);
|
||
dxUnitsLoader.Initialize;
|
||
|
||
|
||
finalization
|
||
DataLink_YSYF.Free;
|
||
application := NewDllApp;
|
||
dxUnitsLoader.Finalize;
|
||
//initialization
|
||
// OldDllApp := Application;
|
||
//
|
||
//finalization
|
||
// DataLink_YSYF.Free;
|
||
// Application := OldDllApp;
|
||
|
||
end.
|
||
|