1 、 JS 代码如下:
复制代码代码如下:
<%-实现班级跳转 Div-%>
<div id = "displayclassDiv" style = "display: nenhum;">
<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"]. == "2")
{
%>
<Dl>
<dt id = '< %= dtptc.rows [j] ["terrid"]. > </dt>
<DD>
<%
int p_count = 0;
for (int k = 0; k <dtptc.rows.count; k ++)
{
if (dtptc.rows [k] ["isPro"]. ] .ToString ())
{
p_count ++;
if (dtptc.rows [k] ["ClassID"].
{
%>
<entrada de entrada = '<%= dtptc.rows [k] ["classid"]. tostring ()%>' type = "radio" name = "rd_class" value = '<%= dtptc.rows [k] [" Classid "].
<%} else
{
%>
<entrada de entrada = '<%= dtptc.rows [k] ["classid"]. tostring ()%>' type = "radio" name = "rd_class" value = '<%= dtptc.rows [k] [" Classid "].
<%
}
if (p_count % 2 == 0)
{
%> <r /> <%
}
}
}
%>
</dd>
</dl>
<%
}
}
%>
</li>
<%
}
}
%>
</ul>
</div>
<script type = "text/javascript">
// 显示班级信息的函数
função showclassinfo () {
// 弹出对话框
$ ("#DisplayClassDiv"). Caixa de diálogo ({
modal: verdadeiro,
Largura: '700',
Altura: '400',
Título: "请选择跳转班级 ::",
Sobreposição: {Opacity: 0.5, Antecedentes: "Black"},
Botões: {
"确定": function () {submitclassinfo (); },
"取消": function () {$ (this) .Dialog ("Destroy"); }
},
Close: function (evento, UI) {$ (this) .dialog ("Destroy"); }
});
}
função submitclassinfo () {
var objClass = $ ('[nome = rd_class]: verificado');
var classID = objClass.val ();
window.Location.href = '../classportal/classportal.aspx?class_id='+classid;
}
</script>
2 、 CS 文件代码:
复制代码代码如下:
publicable publicable dtptc = new Datatable (); // 保存项目 项目分期 班级信息 班级信息
publicable publicable dtProjectInfo = new Datatable (); // 保存项目信息
Void Page_load protegido (remetente de objeto, EventArgs e)
{
// 原框架 TOP 页面信息开始
//User.issessionInValid ();
usuário clsCurrentUser = mm.getSession ();
User_id = int.parse (user.UserID);
if (request.QueryString ["ClassId"]! = NULL)
{
Sessão ["ClassID"] = request.QueryString ["ClassID"]. ToString ();
ClassID = sessão ["ClassID"]. ToString ();
getClassinfo ();
}
outro
{
ClassID = sessão ["ClassID"]. ToString ();
getClassinfo ();
}
// nome de usuário = user.getRealName ();
nome de usuário = 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] ["Página inicial"]. ToString (). TRIM ();
// 原框架 TOP 页面信息结束
// 获取当前用记在本班中的权限。
String sqlRole = "Selecione Ctype em T_PUB_USER_CLASS WHERE Classid =" + Session ["ClassId"].
Datatable dtrole = bdb.runQuery (sqlRole);
if (dtrole.rows.count> 0)
{
função = dtrole.rows [0] ["ctype"]. tostring ();
}
getallinfo (); // 根据用户 id 分别获取项目、项目分期、班级信息
getProjectInfo (); // 根据用户 id 分别获取项目
}
/// <summary>
/// 根据用户 id 分别获取项目、项目分期、班级信息
/// </summary>
Void protegido getallinfo ()
{
int userID = convert.toint32 (mm.getSession (). userID);
string procname = "hzx_selectClass_byuserId";
SqlParameter [] sp = novo sqlparameter [] {new SQLParameter ("@user_id", userID)};
tentar
{
dtptc = bdb.runprocQuery (procname, sp);
}
Catch (exceção ee)
{
Response.Redirect ("../../../ errorpage.aspx");
}
}