1,js::
複製代碼代碼如下:
<% - 實現班級跳轉div - %>
<div ID =“ displayClassDiv”樣式=“ 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”]。 > </h1>
<%
for(int j = 0; j <dtptc.rows.count; j ++)
{
if(dtptc.Rows [i] [“ projectId”]。tostring()== dtptc.Rows [j] [“ projectid”]。tostring()&& dtptc.rows [j] [ispro“ ispro”]。 == “ 2”)
{
%>
<dl>
<dt ID ='<%= dtptc.Rows [j] [“ termid”]。 > </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] [j] [“ termid”]。toString()== dtptc.Rows [k] [ k] [“ termid” ] .tostring())
{
p_count ++;
if(dtptc.Rows [k] [“ classid”]。
{
%>
<input ID ='<%= dtptc.Rows [k] [“ classID”]。toString()%>'type =“ radio” name =“ rd_class” value ='<%= dtptc.rows [k] [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] [k ] [ classID”]。toString()%>' /> <%= dtptc.Rows [k] [className“]。toString()%>
<%
}
if(p_count%2 == 0)
{
%> <br /> <%
}
}
}
%>
</dd>
</dl>
<%
}
}
%>
</li>
<%
}
}
%>
</ul>
</div>
<腳本類型=“ text/javascript”>
//顯示班級信息的函數
函數showclassinfo(){
//彈出對話框
$(“#displayClassDiv”)。dialog({
模式:是的,
寬度:'700',
身高:'400',
標題:“請選擇跳轉班級:”,
覆蓋:{不透明:0.5,背景:“黑色”},
按鈕:{
“確定”:function(){submitClassInfo(); },,
“取消”:function(){$(this).dialog(“ destroy”); }
},,
關閉:函數(event,ui){$(this).dialog(“ destroy”); }
});
}
功能submistClassInfo(){
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)
{
// top頁面信息開始
//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();
}
//用戶名= user.getRealName();
用戶名= user.userrealname;
time = dateTime.now.tostring(“ yyyy年mm月dd日”,dateTimeFormatInfo.invariantInfo);
// classInfo = getClassInfo(classID);
// dtpd = dba.Selectt_learning_project(convert.Toint32(session [“ project_id”]。toString()。trim()));
// homepage = dtpd.Rows [0] [“ homepage”]。toString()。trim();
// top頁面信息結束
//獲取當前用記在本班中的權限。
字符串sqlrole =“從t_pub_user_class中選擇ctype classID =” + session [classID“]。toString() +“ and userId =” + mm.userid;
dataTable dtrole = bdb.runquery(sqlrole);
if(dtrole.Rows.Count> 0)
{
角色= dtrole.Rows [0] [“ ctype”]。toString();
}
getallinfo(); // ID 分別獲取項目、項目分期、班級信息
getProjectInfInfo(); //根據用戶ID分別獲取項目
}
/// <summary>
/// ID 分別獲取項目、項目分期、班級信息
/// </summary>
受保護的void getallinfo()
{
int userId = convert.toint32(mm.getSession()。userId);
字符串procname =“ hzx_selectclass_byuserid”;
sqlparameter [] sp = new SQLParameter [] {new SQLParameter(“@user_id”,userId)};
嘗試
{
dtptc = bdb.runprocquery(procname,sp);
}
捕獲(異常EE)
{
response.redirect(“ ../../../../ errorpage.aspx”);
}
}