




已阅读5页,还剩22页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
代码设计1.1 default.aspx 燕山?大学教学管理系统3 1.2 default.aspx.csusing System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class _Default : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void login_Click(object sender, EventArgs e) string name = username.Text; string pwd = password.Text; string WelStr = 欢?迎-登?录?燕山?大学教学管理中D心?,?现?在时间?是?:o + DateTime.Now.ToString(); string ErrorStr = 对?不?起e,?您的?用?户名?或密码?错误,?请?重?新?登?录?!?; if(Test.isLogin(name, pwd) Response.Redirect(用?户中D心?.aspx); else Response.Write(ErrorStr); protected void reset_Click(object sender, EventArgs e) username.Text = ; password.Text = ; 2.1 用户中心.aspx 用?户中D心? 2.2 用户中心.aspx.csusing System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class 用?户中D心? : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void checkall_Click(object sender, EventArgs e) Response.Redirect(查看所有D.aspx); protected void manageT_Click(object sender, EventArgs e) Response.Redirect(管理教师|信?息.aspx); protected void search_Click(object sender, EventArgs e) Response.Redirect(精?确查询.aspx); protected void manageC_Click(object sender, EventArgs e) Response.Redirect(管理课?程信?息.aspx); 3.1 查看所有.aspx 查看所有D 教学信?息 点?击返回?用?户中D心? 3.2 查看所有.aspx.csusing System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;public partial class 查看所有D : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) if (!IsPostBack) DataBindgv(); private void DataBindgv() string StrSql = select * from T,C where T.T#=C.T#; DBConn DB = new DBConn(); DataSet ds = DB.Getds(StrSql); gridview1.DataSource = ds.Tables0.DefaultView; gridview1.DataBind(); 4.1 管理教师信息.aspx 管理教师|信?息 管理教师|信?息 asp:SqlDataSource id=SqlDataSource1 runat=server ConnectionString= SelectCommand=SELECT * FROM T InsertCommand=INSERT INTO T(T#,TNAME,TITLE,GENDER,AGE) VALUES(T#,TNAME,TITLE,GENDER,AGE) 点?击返回?用?户中D心? 4.2 管理教师信息.aspx.csusing System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;using System.Configuration;public partial class 管理教师|信?息 : System.Web.UI.Page /private string StrSql = ConfigurationManager.ConnectionStrings教务?管理Conn.ConnectionString.ToString(); protected void Page_Load(object sender, EventArgs e) if (!IsPostBack) string Sqlstr = select * from T; DataBindgv(Sqlstr); private void DataBindgv(string Sqlstr) /string StrSql = select * from T; /DBConn DB = new DBConn(); /DataSet ds = DB.Getds(StrSql); string StrSql = Data Source=lenghui-PClenghui;Initial Catalog=教务?管理;Integrated Security=True; SqlConnection con = new SqlConnection(StrSql); con.Open(); SqlCommand cmd = new SqlCommand(Sqlstr,con); SqlDataAdapter sda = new SqlDataAdapter(); sda.SelectCommand = cmd; DataSet ds = new DataSet(); sda.Fill(ds); con.Close(); gridview1.DataSource = ds.Tables0.DefaultView; gridview1.DataBind(); protected void gridview1_PageIndexChanging1(object sender, GridViewPageEventArgs e) string SqlStr = select * from T; gridview1.PageIndex = e.NewPageIndex; try if (ViewStateSort.ToString().Length 0) SqlStr = SqlStr + order by + ViewStateSort.ToString(); catch (System.Exception ex) DataBindgv(SqlStr); protected void gridview1_Sorting(object sender, GridViewSortEventArgs e) ViewStateSort = e.SortExpression.ToString().ToString(); string SqlStr = select * from T order by + ViewStateSort.ToString(); DataBindgv(SqlStr); protected void gridview1_RowEditing(object sender, GridViewEditEventArgs e) gridview1.EditIndex = e.NewEditIndex; string SqlStr = select * from T; DataBindgv(SqlStr); protected void gridview1_RowUpdating(object sender,GridViewUpdateEventArgs e) string id=gridview1.DataKeyse.RowIndex.Value.ToString(); string name = (TextBox)gridview1.Rowse.RowIndex.Cells1.Controls0).Text; string gender=(TextBox)gridview1.Rowse.RowIndex.Cells2.Controls0).Text; string age=(TextBox)gridview1.Rowse.RowIndex.Cells3.Controls0).Text; string title = (TextBox)gridview1.Rowse.RowIndex.Cells4.Controls0).Text; string StrSql = Data Source=lenghui-PClenghui;Initial Catalog=教务?管理;Integrated Security=True; SqlConnection con = new SqlConnection(StrSql); con.Open(); string SqlStr = update T set TNAME=+name+,GENDER=+gender+,AGE=+age+,TITLE=+title+ where T#= + id; SqlCommand cmd = new SqlCommand(SqlStr,con); cmd.ExecuteNonQuery(); con.Close(); gridview1.EditIndex = -1; SqlStr = select * from T; DataBindgv(SqlStr); protected void gridview1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) gridview1.EditIndex = -1; string SqlStr = select * from T; DataBindgv(SqlStr); protected void gridview1_RowDeleting(object sender, GridViewDeleteEventArgs e) string id = gridview1.DataKeyse.RowIndex.Value.ToString(); string StrSql = Data Source=lenghui-PClenghui;Initial Catalog=教务?管理;Integrated Security=True; SqlConnection con = new SqlConnection(StrSql); con.Open(); string Sql = delete from T where T#= + id; SqlCommand cmd = new SqlCommand(Sql, con); cmd.ExecuteNonQuery(); con.Close(); string SqlStr = select * from T; DataBindgv(SqlStr); protected void gridview1_RowCommand(object sender, GridViewCommandEventArgs e) if (e.CommandName = Insert) /gridview1.DataSourceID = ; /gridview1.DataBind(); string StrSqlt = Data Source=lenghui-PClenghui;Initial Catalog=LENGHUI;Integrated Security=True; DataBindif(StrSqlt); protected void detailsview1_ItemInserted(object sender, DetailsViewInsertedEventArgs e) /gridview1.DataSourceID = SqlDataSource1; /gridview1.DataBind(); string StrSqlt = Data Source=lenghui-PClenghui;Initial Catalog=教务?管理;Integrated Security=True; DataBindif(StrSqlt); protected void detailsview1_ItemCommand(object sender, DetailsViewCommandEventArgs e) if (e.CommandName = Cancel) /gridview1.DataSourceID = SqlDataSource1; /gridview1.DataBind(); string StrSqlt = Data Source=lenghui-PClenghui;Initial Catalog=教务?管理;Integrated Security=True; DataBindif(StrSqlt); protected void DataBindif(string StrSqlt) /string StrSql = Data Source=lenghui-PClenghui;Initial Catalog=教务?管理;Integrated Security=True; SqlConnection con = new SqlConnection(StrSqlt); con.Open(); SqlCommand cmd = new SqlCommand(select * from T, con); SqlDataAdapter sda = new SqlDataAdapter(); sda.SelectCommand = cmd; DataSet ds = new DataSet(); sda.Fill(ds); con.Close(); gridview1.DataSource = ds.Tables0.DefaultView; gridview1.DataBind(); 5.1 管理课程信息.aspx 管理课?程信?息 管理课?程信?息 asp:SqlDataSource id=SqlDataSource1 runat=server ConnectionString= SelectCommand=SELECT * FROM C ORDER BY C#, T#, TERM InsertCommand=INSERT INTO C (C#, CNAME, T#, TERM) VALUES (column1, CNAME, column2, TERM) 点?击返回?用?户中D心? 5.2 管理课程信息.aspx.csusing System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Data.SqlClient;using System.Configuration;public partial class 管理课?程信?息 : System.Web.UI.Page /private string StrSql = ConfigurationManager.ConnectionStrings教务?管理Conn.ConnectionString.ToString(); protected void Page_Load(object sender, EventArgs e) if (!IsPostBack) string Sqlstr = select * from C; Data
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 幼儿园小班艺术教案小蜡笔
- 2025年业务精英招募与团队互动管理服务合同
- 2025年企业员工跨文化沟通能力培养合同书
- 2025年度中小学校园电子产品租赁与零售服务合同
- 2025年白糖期货交割运输损失赔偿及风险控制协议
- 2025年度绿色节能停车位租赁及维护保养服务协议
- 2025年原油现货交易与全球海上货物运输保险综合服务合同
- 2025年智能家居系统定制与别墅装修一体化工程合同
- 2025多功能展厅升级改造合同(含展品搬运与布展服务)
- 2025年生态保护区土地征收拆迁补偿及生态修复工程合同
- 2025年教师招聘小学语文真题及答案
- 2025年(完整版)十八项核心制度培训考核试题(含答案)
- 2025年低压电工理论考试1000题(附答案)
- 2025年益阳市融资担保有限责任公司招聘考试笔试试卷【附答案】
- 【湖南】2025年高考湖南卷化学高考真题+答案
- 2025年中国LCP料数据监测报告
- DGTJ08-2093-2019 电动汽车充电基础设施建设技术标准 含2021年局部修订
- 民政知识教学课件
- DB1301∕T494-2023 城市非机动车停放设施建设及管理规范
- KET教学课件新版
- 乳房恶性肿瘤放疗护理查房
评论
0/150
提交评论