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
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1