1 、 JS 代码如下 :
复制代码代码如下:
<%-实现班级跳转 div-%>
<div id = "DisplayClassDiv" style = "Display: None;">
<ul>
<%
para (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>
<%
para (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] ["termid"]. toString () %>'> < %= dtptc.rows [j] ["termname"]. toString (). trim () % > </dt>
<dd>
<%
int p_count = 0;
para (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" valor = '<%= dtptc.rows [k] ["" Classid "]. ToString () %> 'checked /> < %= dtptc.rows [k] [" classname "]. ToString () %>
<%} else
{
%>
<input id = '<%= dtptc.rows [k] ["classid"]. toString ()%>' type = "radio" name = "rd_class" valor = '<%= 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">
// 显示班级信息的函数
función showClassInfo () {
// 弹出对话框
$ ("#DisplayClassDiv"). Dialog ({
modal: verdadero,
Ancho: '700',
Altura: '400',
Título: "请选择跳转班级 :",
Overlay: {opacidad: 0.5, fondo: "negro"},
Botones: {
"确定": function () {SubtClassInfo (); },
"取消": function () {$ (this) .dialog ("destruir"); }
},
Close: function (evento, ui) {$ (this) .dialog ("destruir"); }
});
}
función SubtClassInfo () {
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 (); // 保存项目信息
protegido void page_load (remitente de objeto, EventArgs e)
{
// 原框架 Top 页面信息开始
//User.issessionInvalid ();
CLSCURRENTUSER USER = MM.GetSession ();
User_id = int.parse (user.userid);
if (request.querystring ["classid"]! = NULL)
{
Sesión ["classid"] = request.queryString ["classid"]. ToString ();
classid = session ["classid"]. toString ();
getClassInfo ();
}
demás
{
classid = session ["classid"]. toString ();
getClassInfo ();
}
// username = user.getRealName ();
UserName = user.UsreRealName;
TIME = DateTime.Now.ToString ("yyyy 年 mm 月 dd 日", dateTimeFormatInfo.InvariantInfo);
// classInfo = getClassInfo (classID);
// dtpd = dba.selectt_learning_project (convert.toint32 (sesión ["Project_id"]. ToString (). Trim ()));
// homePage = dtpd.rows [0] ["Página de inicio"]. ToString (). Trim ();
// 原框架 Top 页面信息结束
// 获取当前用记在本班中的权限。
String sqlrole = "Seleccione ctype de t_pub_user_class donde ClassID =" + session ["classid"]. toString () + "y userId =" + mm.userId;
DataTable dtrole = bdb.runQuery (sqlrole);
if (dtrole.rows.count> 0)
{
rol = dtrole.rows [0] ["ctype"]. toString ();
}
getAllinfo (); // 根据用户 ID 分别获取项目、项目分期、班级信息
getProjectInfo (); // 根据用户 ID 分别获取项目
}
/// <summary>
/// 根据用户 ID 分别获取项目、项目分期、班级信息
/// </summary>
vacío protegido getallinfo ()
{
int userId = convert.Toint32 (mm.getSession (). userId);
String PROCNAME = "HZX_SELECTCLASS_BYUSERID";
SqlParameter [] sp = new SqlParameter [] {new SqlParameter ("@user_id", userId)};
intentar
{
dtptc = bdb.runprocquery (procname, sp);
}
Catch (excepción ee)
{
Response.Redirect ("../../../ ErrorPage.aspx");
}
}