1 代码如下 JS s :
复制代码代码如下 :
<%--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] [ "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;
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 () == 세션 [ "classId"]. tostring ())
{
%>
<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>
<script type = "text/javaScript">
// 显示班级信息的函数
함수 showclassInfo () {
// 弹出对话框
$ ( "#displayClassDiv"). 대화 상자 ({
모달 : 사실,
너비 : '700',
높이 : '400',
제목 : ": :",
오버레이 : {불투명도 : 0.5, 배경 : "검은 색"},
버튼 : {
")": function () {submitclassinfo (); },
")": function () {$ (this) .dialog ( "Destroy"); }
},
닫기 : 함수 (이벤트, ui) {$ (this) .dialog ( "Destrous"); }
});
}
함수 제출 classInfo () {
var objclass = $ ( '[name = rd_class] : checked');
var classid = objclass.val ();
window.location.href = '../classportal/classportal.aspx?class_id='+ classid;
}
</스크립트>
2 文件代码 CS s :
复制代码代码如下 :
public dataTable dtptc = new DataTable (); // 保存项目 项目分期 班级信息
public datatable dtprojectinfo = new DataTable (); // 保存项目信息
보호 된 void page_load (Object Sender, Eventargs e)
{
// 原框架 상단 原框架
//user.issessioninValid ();
clscurrentUser user = mm.getSession ();
user_id = int.parse (user.userid);
if (request.querystring [ "classId"]! = null)
{
세션 [ "classId"] = request.queryString [ "classId"]. toString ();
classId = 세션 [ "classId"]. toString ();
getClassInfo ();
}
또 다른
{
classId = 세션 [ "classId"]. toString ();
getClassInfo ();
}
// username = user.getRealName ();
username = user.userrealName;
time = datetime.now.tostring ( "yyyy 年 mm 月 dd 日", dateTimeOrmatInfo.invariantinfo);
// classInfo = getClassInfo (classId);
// dtpd = dba.selectt_learning_project (convert.toint32 (세션 [ "project_id"]. toString (). trim ()));
// homePage = dtpd.rows [0] [ "HomePage"]. toString (). trim ();
// 原框架 상단 原框架
// 获取当前用记在本班中的权限。
문자열 sqlrole = "t_pub_user_class에서 ctype를 선택하십시오. 여기서 classid =" + session [ "classId"]. toString () + "및 userId =" + mm.userid;
DataTable dtrole = bdb.runquery (sqlrole);
if (dtrole.rows.count> 0)
{
역할 = dtrole.rows [0] [ "ctype"]. toString ();
}
getAllInfo (); // 根据用户 ID 根据用户
getProjectInfo (); // 根据用户 id 分别获取项目
}
/// <요약>
/// 分别获取项目、项目分期、班级信息 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");
}
}