1、js代码如下:
复制代码代码如下:
<%-实现班级跳转div - %>
<div id = "displayclassdiv" style = "display:none;">
<ul>
<%
for(int i = 0; i <dtptc.rows.count; i ++)
{
if(dtptc.rows [i] ["ispro"]。toString()== "1")
{
%>
<li>
<h1>
<span id = '<%= dtptc.rows [i] ["projectid"]。toString()%>'> <%= dtptc.rows [i] ["projectname"]。toString()%> </span > </h1>
<%
for(int j = 0; j <dtptc.rows.count; j ++)
{
if(dtptc.rows [i] ["projectid"]。toString()== dtptc.rows [j] ["projecid"]。toString()&& dtptc.rows [j] ["ispro"]。 == "2")
{
%>
<dl>
<dt id = '<%= dtptc.rows [j] ["termid"]。toString()%>'> <%= dtptc.rows [j] ["termname"]。toString()。トリム()% > </dt>
<dd>
<%
int p_count = 0;
for(int k = 0; k <dtptc.rows.count; k ++)
{
if(dtptc.rows [k] ["ispro"]。toString()== "3" && dtptc.rows [j] ["termid"]。toString()== dtptc.rows [k] ["termid" " ] .toString())
{
p_count ++;
if(dtptc.rows [k] ["classid"]。toString()== session ["classid"]。toString())
{
%>
<input id = '<%= dtptc.rows [k] ["classid"]。toString()%>' type = "radio" name "rd_class" value = '<%= dtptc.rows [k] [" classid "]。toString()%> 'checked /> <%= dtptc.rows [k] [" className "]。toString()%>
<%} else
{
%>
<input id = '<%= dtptc.rows [k] ["classid"]。toString()%>' type = "radio" name "rd_class" value = '<%= dtptc.rows [k] [" classid "]。toString()%> ' /> <%= dtptc.rows [k] [" className "]。toString()%>
<%
}
if(p_count%2 == 0)
{
%> <br /> <%
}
}
}
%>
</dd>
</dl>
<%
}
}
%>
</li>
<%
}
}
%>
</ul>
</div>
<script type = "text/javascript">
//显示班级信息的函数
関数showclassinfo(){
//弹出对话框
$( "#displayclassdiv")。ダイアログ({
モーダル:本当、
幅: '700'、
高さ: '400'、
タイトル: "请选择跳转班级:"、
オーバーレイ:{不透明:0.5、背景: "ブラック"}、
ボタン:{
「确定」:function(){submitclassinfo(); }、
「取消」:function(){$(this).dialog( "Destroy"); }
}、
close:function(event、ui){$(this).dialog( "Destroy"); }
});
}
関数submitclassinfo(){
var objclass = $( '[name = rd_class]:checked');
var classid = objclass.val();
window.location.href = '../classportal/classportal.aspx?class_id='+Classid;
}
</script>
2、CS文件代码:
复制代码代码如下:
public datatable dtptc = new datatable(); //保存项目保存项目班级信息
public datatable dtprojectinfo = new Datatable(); //保存项目信息
保護されたvoid page_load(オブジェクト送信者、eventargs e)
{
//原框架トップ页面信息开始
//USER.ISSESSIONINVALID();
clscurrentuser user = mm.getSession();
user_id = int.parse(user.userid);
if(request.querystring ["classid"]!= null)
{
session ["classid"] = request.querystring ["classid"]。toString();
classID = session ["classId"]。toString();
getClassInfo();
}
それ以外
{
classID = session ["classId"]。toString();
getClassInfo();
}
// username = user.getRealName();
username = user.userrealname;
time = datetime.now.tostring( "yyyy年mm
// classInfo = getClassInfo(classID);
// dtpd = dba.selectt_learning_project(convert.toint32(session ["project_id"]。toString()。trim()));
// homepage = dtpd.rows [0] ["Homepage"]。toString()。trim();
//原框架トップ页面信息结束
//获取当前用记在本班中的权限。
string sqlrole = "select ctype from t_pub_user_class where classid =" + session ["classid"]。toString() + "およびuserId =" + mm.userid;
Datatable dtrole = bdb.runquery(sqlrole);
if(dtrole.rows.count> 0)
{
role = dtrole.rows [0] ["ctype"]。toString();
}
getallinfo(); //根据用户ID 分别获取项目、项目分期、班级信息
getProjectInfo(); //根据用户id分别获取项目
}
/// <summary>
///
/// </summary>
保護されたvoid getallinfo()
{
int userid = convert.toint32(mm.getSession()。userid);
string procname = "hzx_selectclass_byuserid";
sqlParameter [] sp = new sqlParameter [] {new SqlParameter( "@user_id"、userId)};
試す
{
dtptc = bdb.runprocquery(procname、sp);
}
キャッチ(例外EE)
{
Response.Redirect( "../..// Errorpage.aspx");
}
}