1、js代码如下:
复制代码 代码如下:
for(int i=0;i{
if (dtptc.rows[i][ispro].tostring() == 1)
{
%>
for (int j = 0; j {
if (dtptc.rows[i][projectid].tostring() == dtptc.rows[j][projectid].tostring() && dtptc.rows[j][ispro].tostring() == 2)
{
%>
int p_count = 0;
for (int k = 0; 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())
{
%>
{
%>
}
if (p_count % 2 == 0)
{
%>
}
}
}
%>
}
}
%>
}
}
%>
2、cs文件代码:
复制代码 代码如下:
public datatable dtptc = new datatable();//保存项目 项目分期 班级信息
public datatable dtprojectinfo = new datatable();//保存项目信息
protected void page_load(object sender, eventargs e)
{
//原框架top页面信息开始
//user.issessioninvalid();
clscurrentuser user = mm.getsession();
user_id = int.parse(user.userid);
if (request.querystring[classid] != null)
{
session[classid] = request.querystring[classid].tostring();
classid=session[classid].tostring();
getclassinfo();
}
else
{
classid = session[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(session[project_id].tostring().trim()));
//homepage = dtpd.rows[0][homepage].tostring().trim();
//原框架top页面信息结束
//获取当前用记在本班中的权限。
string sqlrole = select ctype from t_pub_user_class where classid= + session[classid].tostring() + and userid= + mm.userid;
datatable dtrole = bdb.runquery(sqlrole);
if (dtrole.rows.count > 0)
{
role = dtrole.rows[0][ctype].tostring();
}
getallinfo(); //根据用户id分别获取项目、项目分期、班级信息
getprojectinfo();//根据用户id分别获取项目
}
///
/// 根据用户id分别获取项目、项目分期、班级信息
///
protected void getallinfo()
{
int userid = convert.toint32(mm.getsession().userid);
string procname = hzx_selectclass_byuserid;
sqlparameter[] sp = new sqlparameter[] { new sqlparameter(@user_id, userid) };
try
{
dtptc = bdb.runprocquery(procname, sp);
}
catch (exception ee)
{
response.redirect(../../../errorpage.aspx);
}
}