📄 coursepanel.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Services;
using Entities;
public partial class CoursePanel : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.lbDate.Text = System.DateTime.Now.Year.ToString() + "年" + System.DateTime.Now.Month + "月";
//BLL.BClass bClass = new BLL.BClass();
//ArrayList clses=bClass.Select();
//BindClass(clses);
this.ClassAccordion.DataSource=GetTermInfo();
this.ClassAccordion.DataBind();
}
private ArrayList GetTermInfo()
{
ArrayList terms=new ArrayList();
BLL.BClass bClass = new BLL.BClass();
ArrayList clses=bClass.Select();
foreach (Class cls in clses)
{
TermInfo tempTerm=null;
foreach(TermInfo termInfo in terms)
{
if (cls.Term.TermName == termInfo.Name)
{
tempTerm = termInfo;
break;
}
}
if (tempTerm == null)
{
tempTerm = new TermInfo();
tempTerm.Name = cls.Term.TermName;
terms.Add(tempTerm);
}
ClassInfo clsInfo = new ClassInfo();
clsInfo.ID = cls.ClassID;
clsInfo.ClassName = cls.ClassName;
tempTerm.Classes.Add(clsInfo);
}
return terms;
}
//private void BindClass(ArrayList clses)
//{
// for(int i=0;i<clses.Count;i++)
// {
// Entities.Class cls = clses[i] as Entities.Class;
// TableRow row = new TableRow();
// TableCell cell = new TableCell();
// cell.Text = cls.ClassName;
// cell.Attributes.Add("style", "cursor:hand");
// cell.Attributes.Add("onmouseover", "this.style.backgroundColor='gray'");
// cell.Attributes.Add("onmouseout", "if(this.selected!='true') this.style.backgroundColor=''");
// cell.Attributes.Add("onclick", "for(var i=0;i<tabClass.rows.length;i++){tabClass.rows[i].cells[0].selected='false';tabClass.rows[i].cells[0].style.backgroundColor='';} this.selected='true';this.style.backgroundColor='gray';showClassPlan();");
// cell.Attributes.Add("courseID", cls.ClassID.ToString());
// if (i == 0)
// {
// cell.Attributes.Add("selected", "true");
// cell.Attributes.Add("style","background-color:gray");
// }
// else
// {
// cell.Attributes.Add("selected", "false");
// }
// row.Cells.Add(cell);
// this.tabClass.Rows.Add(row);
// }
//}
[WebMethod]
public static ArrayList GetCourseInfo(int clsID, int year, int month)
{
BLL.BTeachPlan teachPlan = new BLL.BTeachPlan();
ArrayList plans = teachPlan.GetClassTechPlan(clsID, year, month);
return plans;
}
}
class TermInfo
{
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
private ArrayList classes=new ArrayList();
public ArrayList Classes
{
get { return classes; }
set { classes = value; }
}
}
class ClassInfo
{
private int id;
public int ID
{
get { return id; }
set { id = value; }
}
private string name;
public string ClassName
{
get { return name; }
set { name = value; }
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -