?? default.asp
字號:
<!-- #include virtual="/eB3KTransaction.asp" --><!-- #include virtual="/Server/ebo.asp" --><!-- #include virtual="/Server/cblib.asp" --><!-- #include file="../Common.asp" -->
<HTML><script src="/client/Request.js"></script><script src="/client/IClient.js"></script><BODY><%
Server.ScriptTimeout=600
dim biMap, biTableName,TitleAndCodedim SubjectCode, SubjectTitle, SubjectType, CurrencyType, BalanceDirect, SubjectRootID, SubjectParentID, SubjectMapID'eboRegeboReg 1,"SubjectCode","Code","","cbLocalVariable"eboReg 1,"SubjectTitle","Title","","cbLocalVariable"eboReg 1,"","SearchCode2","","cbRSSubjectGetTitle"
eboReg 1,"","SearchCode1","","cbRSSubjectGetTitlePy"eboReg 1,"SubjectType","bigint1","","cbLocalVariable"eboReg 1,"CurrencyType","bigint2","","cbLocalVariable"eboReg 1,"BalanceDirect","int1","","cbLocalVariable"eboReg 1,"AccountID","AccountID","","cbLocalVariable"eboReg 1,"Owner","Owner","","cbLocalVariable"eboReg 1,"SubjectRootID","RootID","","cbLocalVariable"eboReg 1,"SubjectParentID","ParentID","","cbLocalVariable"eboReg 1,"biMap","int4","","cbLocalVariable"eboReg 1,"SubjectMapID","bigint4","","cbLocalVariable"'Endfunction biSave(biType, biTableName, rsBI) eboSet 1, rsBI, nothingend functionfunction SubjectAdd(SubjectID, Code, Title, MapID) SubjectCode=Code SubjectTitle=Title SubjectMapID=MapID x = eBI.biSave(SubjectID, 10, me) if Cstr(x)="0" then err.raise 10000,"Mapping",eBI.GetLastError()end functionfunction SubjectCheck(Code) dim szSQL, rsCheck szSQL = "SELECT COUNT(*) AS rc FROM [biSubject] WHERE [InfoType]=10 AND ([AccountID]=(SELECT RootID FROM [biCorperation] WHERE AccountID="&AccountID&") OR AccountID="&AccountID&") AND Code='"&Code&"'" rsCheck = Conn.Execute(szSQL) SubjectCheck = rsCheck("rc") set rsCheck = nothingend functionfunction SubjectRemapping(Title, MapID)
dim szSQL, rsCheck szSQL = "SELECT COUNT(*) AS rc FROM [biSubject] WHERE [InfoType]=10 AND AccountID="&AccountID&" AND ParentID="&SubjectID&" AND [int4]="&biMap&" AND [bigint4]="&MapID rsCheck = Conn.Execute(szSQL) if rsCheck("rc")>0 then
szSQL = "SELECT [ID],[Code] FROM [biSubject] WHERE [InfoType]=10 AND AccountID="&AccountID&" AND ParentID="&SubjectID&" AND [int4]="&biMap&" AND [bigint4]="&MapID rsCheck = Conn.Execute(szSQL) SubjectAdd rsCheck("ID"), rsCheck("Code"), Title, MapID SubjectRemapping=1
else
szSQL = "SELECT COUNT(*) AS rc FROM [biSubject] WHERE [InfoType]=10 AND [AccountID]=(SELECT RootID FROM [biCorperation] WHERE AccountID="&AccountID&") AND ParentID="&SubjectID&" AND [int4]="&biMap&" AND [bigint4]="&MapID rsCheck = Conn.Execute(szSQL) if rsCheck("rc")>0 then SubjectRemapping=1
else SubjectRemapping=0 end if
end if
end function
function MapCommon(SubjectID, biType, biCountSQL, biSQL) dim szSQL, rsCheck,rs dim i, iInfo, iSubjectChildExsit, iSubjectChildInfo, iChildCodeLen, iSubjectChildTotal dim SubjectLevel, Code, MaxID dim Lv() dim iMaxLv iMaxLv=9 MapCommon = 0 rsCheck = Conn.Execute(biCountSQL) iInfo = rsCheck("rc") szSQL = "SELECT COUNT(*) AS rc FROM [biSubject] WHERE [InfoType]=10 AND ([AccountID]=(SELECT RootID FROM [biCorperation] WHERE AccountID="&AccountID&") OR AccountID="&AccountID&") AND ParentID="&SubjectID rsCheck = Conn.Execute(szSQL) iSubjectChildExsit = rsCheck("rc") szSQL = "SELECT COUNT(*) AS rc FROM [biSubject] WHERE [InfoType]=10 AND ([AccountID]=(SELECT RootID FROM [biCorperation] WHERE AccountID="&AccountID&") OR AccountID="&AccountID&") AND ParentID="&SubjectID&" AND [int4]="&biType rsCheck = Conn.Execute(szSQL) iSubjectChildInfo = rsCheck("rc") redim Lv(iMaxLv) szSQL="SELECT * FROM [biAccountInfo] WHERE [InfoType]=15 AND AccountID=(SELECT RootID FROM [biCorperation] WHERE ID=" & AccountID & ")" rsCheck=Conn.Execute(szSQL) Lv(0)=0 for i=1 to iMaxLv Lv(i)=rsCheck("Int"&i)+Lv(i-1) next szSQL="SELECT Code FROM [biSubject] WHERE [InfoType]=10 AND ID=" & SubjectID rsCheck=Conn.Execute(szSQL) Code=rsCheck("Code") SubjectLevel=0 for i=1 to iMaxLv if Len(Code)=Lv(i) then SubjectLevel=i exit for end if next iChildCodeLen = Lv(SubjectLevel+1)-Lv(SubjectLevel) iSubjectChildTotal=10^iChildCodeLen-1 if iSubjectChildTotal-iSubjectChildExsit<iInfo-iSubjectChildInfo then err.raise 10000,"Mapping","不夠長度!" Exit Function end if 'if iSubjectChildInfo>0 then ' szSQL = "SELECT MAX(bigint4) AS ProductID FROM [biSubject] WHERE [InfoType]=10 AND ([AccountID]=(SELECT RootID FROM [biCorperation] WHERE AccountID="&AccountID&") OR AccountID="&AccountID&") AND ParentID="&SubjectID&" AND [int4]="&biType ' rsCheck = Conn.Execute(szSQL) ' MaxID = rsCheck("ProductID") 'else ' MaxID = 0 'end if 'szSQL = biSQL & " AND ID>"&MaxID
szSQL = biSQL
Set rs = Server.CreateObject("ADODB.RecordSet") rs.open szSQL, Conn, 1, 1 i=0 do while not rs.eof TitleAndCode=rs("Code") & rs("Title")
if SubjectRemapping(TitleAndCode, rs("ID"))=0 then
do
i=i+1 if i>iSubjectChildTotal then err.raise 10000,"Mapping","不夠長度!" SubjectCode=Code&Right(String(iChildCodeLen,"0")&i,iChildCodeLen) if SubjectCheck(SubjectCode)=0 then
SubjectAdd 0, SubjectCode, TitleAndCode, rs("ID")
exit do end if loop
end if rs.movenext loop rs.close()
Set rs = nothing MapCommon = 1end functionfunction Mapping(SubjectID, biMapping, biTableName) dim biCountSQL, biSQL, biMappingReal Select Case biMap Case 2 'biProduct biCountSQL="SELECT COUNT(*) AS rc FROM ["&biTableName&"] WHERE [InfoType]="&biMapping&" AND [AccountID]=(SELECT RootID FROM [biCorperation] WHERE AccountID="&AccountID&")" biSQL="SELECT [ID] AS [ID], [Title]+'('+[nvarchar1]+')' AS [Title],[Code] AS [Code] FROM ["&biTableName&"] WHERE [InfoType]="&biMapping&" AND [AccountID]=(SELECT RootID FROM [biCorperation] WHERE AccountID="&AccountID&")" Case 101 '進銷部供應商 biMappingReal=1 biCountSQL="SELECT COUNT(*) AS rc FROM ["&biTableName&"] WHERE [InfoType]=" & biMappingReal & " and RootID=(SELECT RootID FROM ["&biTableName&"] WHERE ID=" & AccountID & ") AND [Type]=1" biSQL="SELECT * FROM ["&biTableName&"] WHERE [InfoType]=" & biMappingReal & " and RootID=(SELECT RootID FROM ["&biTableName&"] WHERE ID=" & AccountID & ") AND [Type]=1" Case Else biCountSQL="SELECT COUNT(*) AS rc FROM ["&biTableName&"] WHERE [InfoType]="&biMapping&" AND AccountID="&AccountID biSQL="SELECT * FROM ["&biTableName&"] WHERE [InfoType]="&biMapping&" AND [AccountID]="&AccountID End Select Mapping=MapCommon(SubjectID, biMapping, biCountSQL, biSQL)end function dim SubjectID,szSQL,rsCheck,eBI,xSubjectID=Request("Subject")biMap=CLng(Request("biType"))szSQL = "SELECT COUNT(*) AS rc FROM [biSubject] WHERE [InfoType]=10 AND ([AccountID]=(SELECT RootID FROM [biCorperation] WHERE AccountID="&AccountID&") OR AccountID="&AccountID&") AND ID="& SQLInputParam(SubjectID)rsCheck = Conn.Execute(szSQL)if rsCheck("rc")=0 then err.raise 10000,"Mapping","科目不存在!"szSQL = "SELECT * FROM [biSubject] WHERE [InfoType]=10 AND ([AccountID]=(SELECT RootID FROM [biCorperation] WHERE AccountID="&AccountID&") OR AccountID="&AccountID&") AND ID="& SQLInputParam(SubjectID)rsCheck = Conn.Execute(szSQL)CurrencyType=rsCheck("bigint2")BalanceDirect=rsCheck("int1")SubjectType=rsCheck("bigint1")SubjectParentID=rsCheck("ID")SubjectRootID=rsCheck("RootID")Set eBI = Server.CreateObject("eB3KCommon.BaseInfo")x = eBI.biGetDetailByType(Conn, CLng(biMap), rsCheck)if Cstr(x)="0" then err.raise 10000,"Mapping",eBI.GetLastError()biTableName=CStr(rsCheck("TableName"))x=Mapping(SubjectID, biMap, biTableName)set eBI = Nothing%></BODY><script>IClient('data','<%=x%>');IClient('end','');</script></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -