⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manager.aspx.cs

📁 自己写的一个网上图书馆 可实现图书上传借阅等功能
💻 CS
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace e_librarys
{
	/// <summary>
	/// Manager 的摘要说明。
	/// </summary>
	public partial class Manager : System.Web.UI.Page
	{
	
		protected void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    

		}
		#endregion



		private void Linkbutton12_Click(object sender, System.EventArgs e)
		{
			
			string StrSql="select * from Book_Info ";
			Session["StrSql"]=StrSql;
			Response.Redirect("M_BookInfo");
		}

		private void LinkButton4_Click(object sender, System.EventArgs e)
		{
		
		}

		

//		private void LinkButton5_Click(object sender, System.EventArgs e)
//		{
//			SqlConnection Conn = new SqlConnection("server=(local);database=e_library;uid=sa;pwd=");
//			Conn.Open();
//			SqlDataAdapter Da = new SqlDataAdapter("select * from Book_Info,Tenancy where T_Status=2 and T_Return=0 and T_B_ID=B_ID",Conn);
//			DataSet Ds = new DataSet();
//			Da.Fill(Ds);
//			DataGrid1.DataSource = Ds.Tables[0];
//			DataGrid1.DataBind();
//			Conn.Close();
//		}
//
//		private void LinkButton6_Click(object sender, System.EventArgs e)
//		{
//			SqlConnection Conn = new SqlConnection("server=(local);database=e_library;uid=sa;pwd=");
//			Conn.Open();
//			SqlDataAdapter Da = new SqlDataAdapter("select * from Book_Info,Tenancy where T_Status=1 and T_Return=0 and T_B_ID=B_ID",Conn);
//			DataSet Ds = new DataSet();
//			Da.Fill(Ds);
//			DataGrid1.DataSource = Ds.Tables[0];
//			DataGrid1.DataBind();
//			Conn.Close();
//		}
//
//		private void Linkbutton7_Click(object sender, System.EventArgs e)
//		{
//			SqlConnection Conn = new SqlConnection("server=(local);database=e_library;uid=sa;pwd=");
//			Conn.Open();
//			SqlDataAdapter Da = new SqlDataAdapter("select * from Book_Info,Tenancy where and T_Return=0 and T_TimeOut=1 and T_B_ID=B_ID",Conn);
//			DataSet Ds = new DataSet();
//			Da.Fill(Ds);
//			DataGrid1.DataSource = Ds.Tables[0];
//			DataGrid1.DataBind();
//			Conn.Close();
//		}
//
//		private void Linkbutton8_Click(object sender, System.EventArgs e)
//		{
//			SqlConnection Conn = new SqlConnection("server=(local);database=e_library;uid=sa;pwd=");
//			Conn.Open();
//			SqlDataAdapter Da = new SqlDataAdapter("select * from Book_Info where B_RentCount>0",Conn);
//			DataSet Ds = new DataSet();
//			Da.Fill(Ds);
//			DataGrid1.DataSource = Ds.Tables[0];
//			DataGrid1.DataBind();
//			Conn.Close();
//		}
//
//		//分页
//		private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
//		{
//			DataGrid1.CurrentPageIndex = e.NewPageIndex;
//			DataGrid1.DataBind();
//		}
//
//		//取消
//		private void DataGrid1_CancelCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
//		{
//			DataGrid1.EditItemIndex = -1;
//			DataGrid1.DataBind();
//		}
//
//		private void DataGrid1_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
//		{
//			DataGrid1.EditItemIndex = e.Item.ItemIndex;			
//			DataGrid1.DataBind();
//		}

		

//		private void DataGrid1_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
//		{
//			string id = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
//			string strSQL = "delete from books where B_ID='"+id+"'";
//			pro.RunSql(strSQL);
//			
//			DataGrid1.DataSource = pro.GetSqlData("select * from books").Tables[0].DefaultView;
//			DataGrid1.DataBind();
//		}
        protected void Linkbutton9_Click(object sender, EventArgs e)
        {
            string StrSql = "select * from Book_Info where B_AddTime!=2008-6-11";
            Session["StrSql"] = StrSql;
            Response.Write("<script language=javascript>parent.main.location.href='M_BeginMasssage.aspx';</script>");
           
        }
        protected void Linkbutton10_Click(object sender, EventArgs e)
        {
            string StrSql = "select top 10 * from Book_Info order by B_RentCount desc";
            Session["StrSql"] = StrSql;
            Response.Write("<script language=javascript>parent.main.location.href='M_BeginMasssage.aspx';</script>");
        }
        protected void Linkbutton11_Click(object sender, EventArgs e)
        {
            string StrSql = "select top 10 * from Book_Info order by B_Count desc";
            Session["StrSql"] = StrSql;
            Response.Write("<script language=javascript>parent.main.location.href='M_BeginMasssage.aspx';</script>");
        }
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -