书签 分享 收藏 举报 版权申诉 / 29

类型ASPNET课程设计报告小.docx

  • 文档编号:12505683
  • 上传时间:2023-04-19
  • 格式:DOCX
  • 页数:29
  • 大小:1.26MB

ContentPlaceHolderid="ContentPlaceHolder1"runat="server">

ContentPlaceHolder>

C#:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Web;

usingSystem.Web.UI;

usingSystem.Web.UI.WebControls;

usingSystem.Data.SqlClient;

usingSystem.Data;

publicpartialclassMasterPage:

System.Web.UI.MasterPage

{

stringduty;

stringconstring="DataSource=SDWM-20130407KX\\SQLEXPRESS;InitialCatalog=RemoteEdu;IntegratedSecurity=true;MultipleActiveResultSets=True";

SqlConnectioncon;

protectedvoidPage_Load(objectsender,EventArgse)

{

con=newSqlConnection();

con.ConnectionString=constring;

con.Open();

}

protectedvoidRadioButtonList1_SelectedIndexChanged(objectsender,EventArgse)

{

if(RadioButtonList1.Text.Equals("学生"))

{

duty="学生";

}

if(RadioButtonList1.Text.Equals("教师"))

{

duty="教师";

}

if(RadioButtonList1.Text.Equals("管理员"))

{

duty="管理员";

}

}

SqlCommandcmd=newSqlCommand("selectAccount,PasswordfromUserAccount",con);

SqlDataReaderdr=cmd.ExecuteReader();

while(dr.Read())

{

if(dr[0].ToString().Equals(TextBox1.Text))

{

if(duty.Equals("学生"))

{

stringstr_id=TextBox1.Text;

Session["ID"]=str_id;

Response.Redirect("StudentInterface.aspx");

}

if(duty.Equals("教师"))

{

stringstr_id=TextBox1.Text;

Session["ID"]=str_id;

Response.Redirect("TeacherInterface.aspx");

}

if(duty.Equals("管理员"))

{

stringstr_id=TextBox1.Text;

Session["ID"]=str_id;

Response.Redirect("ManagerInterface.aspx");

}

}

}

Response.Write("输入不正确¨");

}

}

3.2.2部分功能

设置一个Banner盒子,用来显示系统的标识;一个SiteMap盒子,用来显示整个系统路径;一个Footer盒子,用来显示系统制作这的信息。

点击“登录”,弹出登录对话框,根据输的信息进入不同的用户界面。

3.2.3截图

 

图3-2母版页

3.3学生界面

3.3.1主要代码

html:

200px;height:

500px;float:

left;position:

relative;background-color:

#B9B9FF;">

我的选课信息

我的账户管理

收到的信息

的收藏

我的笔录

选择课程

上课

资料下载

$(function(){

$("#登录").click(function(){

$("#登录界面").toggle();

});

$("#我的选课信息").click(function(){

$("#收到信息").hide();

$("#gridView1").show();

$("#区域二").hide();

$("#区域四").hide();

$("#区域五").hide();

$("#区域六¨´").hide();

$("#区域七").hide();

$("#区域八").hide();

$("#默认").hide();

});

});

C#:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Web;

usingSystem.Web.UI;

usingSystem.Web.UI.WebControls;

usingSystem.Data.SqlClient;

usingSystem.Data;

publicpartialclassStudentInterface:

System.Web.UI.Page

{

stringconstring="DataSource=SDWM-20130407KX\\SQLEXPRESS;InitialCatalog=RemoteEdu;IntegratedSecurity=true;MultipleActiveResultSets=True";

SqlConnectioncon;

protectedvoidPage_Load(objectsender,EventArgse)

{

con=newSqlConnection();

con.ConnectionString=constring;

con.Open();

SqlCommandcmd=newSqlCommand("selectUserAccount.Name,UserAccount.Account,Sex,PhoneNum,UserAccount.Duty,IdentityNo,Birth,Password,EmailfromUserAccountjoinStudentInfoonUserAccount.Account=StudentInfo.AccountwhereUserAccount.Account='"+Session["ID"].ToString()+"'",con);

DataSetds=newDataSet();

SqlDataAdapterda=newSqlDataAdapter("selectSelectCourse.CourseNo,CourseName,CourseDescribe,Price,TypefromSelectCoursejoinCourseonSelectCourse.CourseNo=Course.CourseNojoinStudentInfoonStudentInfo.IdentityNo=SelectCourse.IdentityNowhereStudentInfo.Account='"+Session["ID"].ToString()+"'",con);

da.Fill(ds);

GridView1.DataSource=ds;

GridView1.DataBind();

DataSetds2=newDataSet();

SqlDataAdapterda2=newSqlDataAdapter("select我收到的信息,发送者,日期¨fromInformationwhere接收者='"+Session["ID"].ToString()+"'",con);

da2.Fill(ds2);

GridView2.DataSource=ds2;

GridView2.DataBind();

DataSetds3=newDataSet();

SqlDataAdapterda3=newSqlDataAdapter("selectDivingClass.CourseNoas课号,Course.CourseNameas课程名称,InstructorInfo.nameas授课老师,InstructorInfo.IdentityNoas教师号,CourseDescribeas课程简介,Priceas价格,typeas分类fromDivingClassjoinCourseonDivingClass.CourseNo=Course.CourseNojoinInstructorInfoonInstructorInfo.IdentityNo=DivingClass.IdentityNo",con);

da3.Fill(ds3);

GridView3.DataSource=ds3;

GridView3.DataBind();

SqlDataReaderdr=cmd.ExecuteReader();

while(dr.Read())

{

Label1.Text=dr[0].ToString();

Label2.Text=dr[1].ToString();

Label3.Text=dr[0].ToString();

Label4.Text=dr[2].ToString();

Label5.Text=dr[3].ToString();

Label6.Text=dr[4].ToString();

Label7.Text=dr[5].ToString();

Label8.Text=dr[6].ToString();

}

}

protectedvoidButton2_Click(objectsender,EventArgse)

{

Session["ID1"]=Label2.Text;

Response.Redirect("编辑区域.aspx");

}

protectedvoidGridView3_SelectedIndexChanged(objectsender,EventArgse)

{

Session["课号"]=GridView3.SelectedRow.Cells[1].Text;

Session["教师号"]=GridView3.SelectedRow.Cells[4].Text;

Session["学生账号"]=Session["ID"];

//Response.Write(Session["学生账号"].ToString());

Response.Redirect("SelectCourse.aspx");

}

}

3.3.2部分功能

学生里面有我的选课信息、我的账户管理、收到的信息、的收藏、我的笔录、选择课程等几个功能模块,点击分别切换界面。

3.3.3截图

图3-3

图3-4学生选课信息

图3-5学生编辑界面

3.4教师界面

3.4.1主要代码

C#:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Web;

usingSystem.Web.UI;

usingSystem.Web.UI.WebControls;

usingSystem.Data.SqlClient;

usingSystem.Data;

publicpartialclassTeacherInterface:

System.Web.UI.Page

{

stringconstring="DataSource=SDWM-20130407KX\\SQLEXPRESS;InitialCatalog=RemoteEdu;IntegratedSecurity=true;MultipleActiveResultSets=True";

SqlConnectioncon;

protectedvoidPage_Load(objectsender,EventArgse)

{

con=newSqlConnection();

con.ConnectionString=constring;

con.Open();

SqlCommandcmd=newSqlCommand("selectUserAccount.Name,UserAccount.Account,Sex,PhoneNum,UserAccount.Duty,IdentityNo,Birth,Password,EmailfromUserAccountjoinInstructorInfoonUserAccount.Account=InstructorInfo.Accountwher

举报
举报
版权申诉
版权申诉
word格式文档无特别注明外均可编辑修改;预览文档经过压缩,下载后原文更清晰! 立即下载
配套讲稿:

如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

特殊限制:

部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

关 键  词:
ASPNET 课程设计 报告
提示  冰豆网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:ASPNET课程设计报告小.docx
链接地址:https://www.bdocx.com/doc/12505683.html
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2008-2022 冰点文档网站版权所有

经营许可证编号:鄂ICP备2022015515号-1

收起
展开