1、 JS 代码如下:
复制代码代码如下:
<%-实现班级跳转 div-%>
<div id = "displayclassDiv" style = "แสดง: ไม่มี;">
<ul>
-
สำหรับ (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>
-
สำหรับ (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;
สำหรับ (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 ())
-
-
<อินพุต id = '<%= dtptc.rows [k] ["classid"]. toString ()%>' type = "วิทยุ" ชื่อ = "rd_class" value = '<%= dtptc.rows [k] [" ClassId "]. ToString () %> 'ตรวจสอบ /> < %= dtptc.rows [k] [" classname "]. toString () %> %>
<%} อื่น
-
-
<อินพุต id = '<%= dtptc.rows [k] ["classid"]. toString ()%>' type = "วิทยุ" ชื่อ = "rd_class" value = '<%= dtptc.rows [k] [" ClassId "]. ToString () %> ' /> < %= dtptc.rows [k] [" classname "]. toString () %>
-
-
ถ้า (p_count % 2 == 0)
-
%> <br /> <%
-
-
-
-
</dd>
</dl>
-
-
-
-
</li>
-
-
-
-
</ul>
</div>
<script type = "text/javascript">
// 显示班级信息的函数
ฟังก์ชั่น showclassinfo () {
// 弹出对话框
$ ("#displayclassDiv"). กล่องโต้ตอบ ({
Modal: จริง
ความกว้าง: '700',
ความสูง: '400',
ชื่อเรื่อง: "请选择跳转班级:",
ซ้อนทับ: {ความทึบ: 0.5, พื้นหลัง: "ดำ"},
ปุ่ม: {
"确定": function () {submitclassinfo (); -
"取消": function () {$ (นี่) .dialog ("ทำลาย"); -
-
ปิด: ฟังก์ชั่น (เหตุการณ์, ui) {$ (นี่) .dialog ("ทำลาย"); -
-
-
ฟังก์ชั่น submentclassinfo () {
var objclass = $ ('[name = rd_class]: ตรวจสอบ');
var cassid = objclass.val ();
window.location.href = '../classportal/classportal.aspx?class_id='+classid;
-
</script>
2、 CS 文件代码:
复制代码代码如下:
Public DataTable DTPTC = ใหม่ dataTable (); // 保存项目项目分期班级信息
dataTable datatable dtprojectInfo = new dataTable (); // 保存项目信息
void page_load ที่ได้รับการป้องกัน (ผู้ส่งวัตถุ EventArgs E)
-
// 原框架ด้านบน页面信息开始
//user.issessionInvalid ();
ผู้ใช้ clscurrentuser = 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 日", datetimeformatinfo.invariantinfo);
// classInfo = getClassInfo (classID);
// dtpd = dba.selectt_learning_project (convert.toint32 (เซสชัน ["project_id"]. toString (). trim ()));
// homepage = dtpd.rows [0] ["homepage"]. toString (). trim ();
// 原框架ด้านบน页面信息结束
// 获取当前用记在本班中的权限。
String sqlrole = "เลือก ctype จาก t_pub_user_class โดยที่ classid =" + เซสชัน ["classid"]. toString () + "และ userId =" + mm.userid;
dataTable dtrole = bdb.runQuery (sqlrole);
if (dtrole.rows.count> 0)
-
role = dtrole.rows [0] ["ctype"]. toString ();
-
getAllInfo (); // 根据用户 id 分别获取项目、项目分期、班级信息
getProjectInfo (); // 根据用户 id 分别获取项目
-
/// <summary>
/// 根据用户 id 分别获取项目、项目分期、班级信息
/// </summary>
เป็นโมฆะป้องกัน getAllinfo ()
-
int userId = Convert.toint32 (mm.getSession (). userId);
สตริง procname = "hzx_selectclass_byuserid";
sqlParameter [] sp = ใหม่ sqlparameter [] {ใหม่ sqlparameter ("@user_id", userId)};
พยายาม
-
dtptc = bdb.runprocQuery (procname, sp);
-
จับ (ข้อยกเว้น ee)
-
Response.redirect ("../../../ ErrorPage.aspx");
-
-