⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dictitemmap.asp

📁 学生档案与成绩管理(1)学生档案管理:记录每个学生的档案信息
💻 ASP
字号:
<!-- #include file = "../include/asphead.asp" -->
<!-- #include file = "../include/function.asp" -->
<%CheckUser()%>
<link href="../include/main.css" rel="stylesheet" type="text/css">
<script src="../include/function.js" type="text/javascript"></script>
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--

	function Next()
	{
		if(HasExtItem.value==0)
		{	
			DisableButton();
			window.parent.navigate("importstep6.asp")
		}
		else
			if(LocalDC()==true)
			{
				DisableButton();
				document.frmData.OptionID.value =OptionID;
				document.frmData.ExtItemCount.value =ExtItemCount;
				document.frmData.target ="SaveArea";
				document.frmData.action="savedictitemMap.asp";
				document.frmData.submit();
			}
	}

	function LocalDC()
	{
		//所有的excel数据内容必须选择了对应的字典项目
		if(ExcelDictCount>0)
		{
			for(var i=1;i<=ExcelDictCount;i++)
			{
				for(var j=1;j<=ExtItemCount[i-1];j++)
				{
					var strExec,value;
					strExec="value=frmData.IntItemID"+i+JoinChar+j+".selectedIndex";
					eval(strExec);
					if(value==0 && NotNull[i-1]=='1')
					{
						strExec="value=frmData.ExtItem"+i+JoinChar+j+".value";
						eval(strExec);
						alert(value+"未选择对应的字典项目,其对应字段是必填的,请选择。")
						return(false);
					}
				}
			}
		}
		return true;
	}

	function InitParentButton()
	{
		if(HasExtItem.value>=0)
			window.parent.document.all['btnNext'].disabled =false;
	}

	function DisableButton() 
	{
		window.parent.document.all['btnCancel'].disabled =true;
		window.parent.document.all['btnPre'].disabled =true;
		window.parent.document.all['btnNext'].disabled =true;
	}
//-->
</script>

<%
	dim WExcel
	set WExcel=server.CreateObject("WExcel.ImExport")

	dim SheetID,ExcelSheet,Head,ItemMapCount,ItemMapRow,ArrayData
	dim strResult,GetExtItem,HasExtItem

	strResult=""
	ExcelSheet=Request.Cookies("ImExport")("ExcelSheet")
	Head=Request.Cookies("ImExport")("Head")
	if Request.Cookies("Temp")("ImportFor")="useraccount" then
		GetExtItem=WExcel.GetDictItemMapPageForUserAccount(cint(UserID),cstr(ExcelSheet),cint(Head),ItemMapCount,ItemMapRow,ArrayData)
	else
		SheetID=Request.Cookies("Temp")("SheetID")
		GetExtItem=WExcel.GetDictItemMapPage(cint(UserID),cint(SheetID),cstr(ExcelSheet),cint(Head),ItemMapCount,ItemMapRow,ArrayData)
	end if
	if GetExtItem=true then
		if ItemMapCount<=0 then
			HasExtItem=0
			strResult="对应于选择型字段的列没有数据,请直接进入下一步。"
		else
			HasExtItem=1
			Response.Write ArrayData
		end if
	else
		HasExtItem=-1
		strResult="建立字典项目的对应关系失败,请检查 Excel 中对应于选择项的内容是否合法。"
	end if
	CheckErr			
%>

<HTML>
<HEAD>
	<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</HEAD>
<BODY LANGUAGE=javascript onload="return InitParentButton()">
	<form METHOD="post" name="frmData">
		<%if HasExtItem<=0 then%>
			<table align=center width="60%" border=0 CELLSPACING="1" CELLPADDING="0">
				<tr>
					<td><%=strResult%></td>
				</tr>
			</table>
		<%else%>
			<table width="100%" border=0 CELLSPACING="1" CELLPADDING="0" bgcolor=999999>
				<tr>
					<td bgcolor=white colspan=2>Excel 数据</td>
					<td bgcolor=white colspan=2>对应字典项目</td>
				</tr>
				<tr>
					<td bgcolor=white width=22%>列标题</td>
					<td bgcolor=white width=26%>列数据</td>
					<td bgcolor=white width=22%>对应字段</td>
					<td bgcolor=white width=30%>对应字典项目</td>
				</tr>
				<%for i=1 to ItemMapCount
						Response.Write ItemMapRow(i-1)
					next
				%>
			</table>
		<%end if%>
		<iframe id="SaveArea" name="SaveArea" style="visibility:hidden" width="0" height="0" frameborder="0" src="">
		</iframe>
		<input TYPE="hidden" NAME="OptionID">
		<input TYPE="hidden" NAME="ExtItemCount">
	</form>
	<input TYPE="hidden" NAME="HasExtItem" value=<%=HasExtItem%>>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -