📄 s_expcalendar.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 ExpReserve;
public partial class S_ExpCalendar : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Admin aAdmin = (Admin)this.Master;
aAdmin.ManageTitle = "实验课表";
aAdmin.MenuSelectedValue = "SExpCalendar";
lblCurrentTerm.Text = SingleInitials.DbAccess.GetActiveTerm();
BindDisplayList(0,"");
}
}
#region 属性
static int m_ColID = 0;
public string CurrentTerm
{
get
{
return this.lblCurrentTerm.Text;
}
}
public long CurrentStudentID
{
get
{
return long.Parse(Users.GetCurrentTableID());
}
}
#endregion
/// <summary>
/// 返回所有的实验项目批次
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="sortExpression">要排序的字段</param>
private void BindDisplayList(int pageIndex, string sortExpression)
{
BatchList.Columns[m_ColID].Visible = true;
BatchList.SelectedIndex = -1;
DataTable dt = SingleInitials.DbAccess.GetStudentExpCalendar(CurrentStudentID,CurrentTerm).Tables[0];
if (sortExpression == null || sortExpression == string.Empty)
{
JKLib.Web.GridViewOperation.BindPagingGridView(BatchList, dt.DefaultView, pageIndex);
}
else
{
JKLib.Web.GridViewOperation.BindPagingGridView(BatchList, dt.DefaultView, pageIndex, sortExpression, true, JKLib.Web.GridViewOperation.BindPagingGridViewType.Sorting);
}
BatchList.Columns[m_ColID].Visible = false;
}
#region 表格处理
protected void BatchList_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
BindDisplayList(e.NewPageIndex, null);
}
protected void BatchList_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "CancelBatch")
{
}
}
protected void BatchList_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Pager)
JKLib.Web.GridViewOperation.GridRowCreated(sender, e);
}
protected void BatchList_RowDataBound(object sender, GridViewRowEventArgs e)
{
////Button btn = (Button)e.Row.Cells[2].Controls[0];
////btn.Attributes.Add("onclick","return confirm('您真的要删除吗?');");
//LinkButton btn = (LinkButton)e.Row.Cells[2].Controls[0];
//btn.Attributes.Add("onclick", "return confirm('您真的要删除吗?');");
}
protected void BatchList_Sorting(object sender, GridViewSortEventArgs e)
{
BindDisplayList(BatchList.PageIndex, e.SortExpression);
}
#endregion
protected void btnRefresh_Click(object sender, EventArgs e)
{
BindDisplayList(0, "");
}
protected void btnPrint_Click(object sender, EventArgs e)
{
UIControls.ExportExcelFromDataGrid("课程表.xls",this.BatchList,this);
}
public override void VerifyRenderingInServerForm(Control control)
{
//base.VerifyRenderingInServerForm(control);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -