1 、 js 代码如下 :
复制代码代码如下::
<%-实现班级跳转 div-%>
<div id = "displayClassDiv" style = "display: keine;">
<ul>
<%
für (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>
<%
für (int j = 0; j <dtptc.rows.count; j ++)
{
if (dtptc.rows [i] ["projectId"]. toString () == dtptc.rows [j] ["projectId"]. toString () && dtptc.rows [j] ["iSpro"]. ToString () == "2")
{
%>
<dl>
<dt id = '< %= dtptc.rows [j] ["Terminid"]. toString () %>'> < %= dtptc.rows [j] ["Termname"]. toString (). TRIM () % > </dt>
<dd>
<%
int p_count = 0;
für (int k = 0; k <dtptc.rows.count; K ++)
{
if (dtptc.rows [k] ["ispro"]. toString () == "3" && dtptc.rows [j] ["Termin"]. toString () == DTPTC.ROWS [k] ["Terminid" ] .ToString ())
{
p_count ++;
if (dtptc.rows [k] ["classId"]. toString () == Session ["classId"]. toString ()))
{
%>
<Eingabe -ID = '<%= dtptc.rows [k] ["classid"]. toString ()%>' type = "radio" name = "rd_class" value = '<%= dtptc.rows [k] [" ClassId "]. ToString () %> 'checked /> < %= dtptc.rows [k] [" className "]. ToString () %>
<%} sonst
{
%>
<Eingabe -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">
// 显示班级信息的函数
Funktion showClassinfo () {
// 弹出对话框
$ ("#displayClassDiv"). Dialog ({{
Modal: wahr,
Breite: '700',
Höhe: '400',
Titel: "请选择跳转班级 :",
Overlay: {Opazität: 0,5, Hintergrund: "Schwarz"},
Schaltflächen: {
"确定": function () {subledClasssinfo (); },
"取消": function () {$ (this) .Dialog ("zerstören"); }
},
Close: Funktion (Ereignis, ui) {$ (this) .Dialog ("zerstören"); }
});
}
Funktion SublectCassinfo () {
var objclass = $ ('[name = rd_class]: checked');
var classId = objclass.val ();
window.location.href = '../classsportal/classsportal.aspx?class_id='+ Classid;
}
</script>
2 、 cs 文件代码 :
复制代码代码如下::
public DataTable dtptc = new DataTable (); // 保存项目 项目分期 班级信息
public DataTable dtProjectInfo = new DataTable (); // 保存项目信息
Protected void page_load (Objektabsender, EventArgs e)
{
// 原框架 oben 页面信息开始
//User.ISSessioninvalid ();
clscurrentuser user = mm.getSession ();
User_id = int.parse (user.userId);
if (request.queryString ["classId"]! = null)
{
Sitzung ["classId"] = request.queryString ["classId"]. ToString ();
classId = session ["classId"]. toString ();
getClassSinfo ();
}
anders
{
classId = session ["classId"]. toString ();
getClassSinfo ();
}
// userername = user.getRealName ();
userername = user.userRealName;
time = datetime.now.toString ("yyyy 年 mm 月 dd 日", DateTimeFormatinfo.invariantInfo);
// classInfo = getCassinfo (classId);
// dtpd = dba.selectt_learning_project (convert.toint32 (Session ["project_id"]. ToString (). Trim ());
// homepage = dtpd.rows [0] ["homepage"]. toString (). trim ();
// 原框架 oben 页面信息结束
// 获取当前用记在本班中的权限。
String SQLROLE = "Wählen Sie CTYPE aus t_pub_user_class wob
DataTable Dtrole = bdb.runQuery (SQLROLE);
if (dtrole.rows.count> 0)
{
rollen = dtrol.rows [0] ["cType"]. toString ();
}
getAllinfo (); // 根据用户 id 分别获取项目、项目分期、班级信息
GetProjectInfo (); // 根据用户 id 分别获取项目
}
/// <summary>
/// 根据用户 id 分别获取项目、项目分期、班级信息
/// </summary>
geschützte Leere getAllinfo ()
{
int userID = convert.toint32 (mm.getSession (). UserId);
String procname = "hzx_selectClass_ByUserid";
SQLParameter [] sp = new SQLParameter [] {new SQLParameter ("@user_id", userId)};
versuchen
{
dtptc = bdb.runprocQuery (procname, sp);
}
fangen (Ausnahme EE)
{
Antwort.Redirect ("../../../ errorPage.aspx");
}
}