学生信息管理系统 系统源代码.docx

上传人:b****5 文档编号:3103453 上传时间:2022-11-17 格式:DOCX 页数:27 大小:17.73KB
下载 相关 举报
学生信息管理系统 系统源代码.docx_第1页
第1页 / 共27页
学生信息管理系统 系统源代码.docx_第2页
第2页 / 共27页
学生信息管理系统 系统源代码.docx_第3页
第3页 / 共27页
学生信息管理系统 系统源代码.docx_第4页
第4页 / 共27页
学生信息管理系统 系统源代码.docx_第5页
第5页 / 共27页
点击查看更多>>
下载资源
资源描述

学生信息管理系统 系统源代码.docx

《学生信息管理系统 系统源代码.docx》由会员分享,可在线阅读,更多相关《学生信息管理系统 系统源代码.docx(27页珍藏版)》请在冰豆网上搜索。

学生信息管理系统 系统源代码.docx

学生信息管理系统系统源代码

系统源代码

一、登录界面代码

usingSystem;

using;

using;

using;

using;

usingpartialclasslogin:

protectedvoidtxtid_Click(objectsender,EventArgse)

{

="";

="";

}

protectedvoidButton1_Click(objectsender,EventArgse)

{

stringstrconn=["connStr"];

SqlConnectionconn=newSqlConnection(strconn);

();

DataSetds=newDataSet();

SqlDataAdapterda=newSqlDataAdapter("select*fromuserswhereuserid='"++"'anduserpwd='"++"'",conn);

(ds);

if[0].==0)

{

Label3.Text="账号或密码错误,请重新输入!

";

}

else

{

Session["userid"]=txtid.Text;

Session["userpwd"]=;

Session["username"]=[0].Rows[0]["username"].ToString();

Session["userpower"]=[0].Rows[0]["userpower"].ToString();

if(Session["userpower"].ToString()=="0")

{

("admin/");

}

elseif(Session["userpower"].ToString()=="1")

{

("student/");

}

else

{

="对不起,权限验证失败";

}

}

();

();

}

}

 

二、添加课程页面代码

usingSystem;

using;

using;

using;

using;

usingpartialclassaddcourse:

SqlCommandmycmd;

SqlConnectionconn;

protectedvoidPage_Load(objectsender,EventArgse)

{

"onblur","checkcourseid()");

stringstrconn=["connStr"];

conn=newSqlConnection(strconn);

}

protectedvoidButton1_Click(objectsender,EventArgse)

{

if=="")

{

="课程号不能为空";

}

else

{

stringsqlstr="";

sqlstr="insertintocourse(courseid,coursename,coursetime,fen,type,teacher)values('"++"','"++"','"++"','"++"','"++"','"++"')";

();

mycmd=newSqlCommand(sqlstr,conn);

();

try

{

();

("");

}

catch(SqlException)

{

("");

}

finally

{

();

sqlstr="";

}

}

}

protectedvoidButton2_Click(objectsender,EventArgse)

{

="";

="";

="";

="";

="";

}

protectedvoidButton3_Click(objectsender,EventArgse)

{

("");

}

}

三、添加成绩程序代码

usingSystem;

using;

using;

using;

using;

usingpartialclassaddscore:

SqlCommandmycmd;

SqlConnectionconn;

protectedvoidPage_Load(objectsender,EventArgse)

{

stringstrconn=["connStr"];

conn=newSqlConnection(strconn);

}

protectedvoidButton1_Click(objectsender,EventArgse)

{

if.ToString()=="")

{

="学号不能为空";

}

else

{

stringsqlstr="";

sqlstr="insertintoscore(userid,username,courseid,coursename,score,[year])values('"++"','"++"','"++"','"++"','"++"','"++"')";

();

mycmd=newSqlCommand(sqlstr,conn);

();

try

{

();

("");

}

catch(SqlException)

{

("");

}

finally

{

();

sqlstr="";

}

}

}

protectedvoidButton2_Click(objectsender,EventArgse)

{

="";

="";

="";

="";

}

protectedvoidButton3_Click(objectsender,EventArgse)

{

("");

}

protectedvoiduserid_SelectedIndexChanged(objectsender,EventArgse)

{

stringsqlstr="";

sqlstr="selectusernamefromstudentswhereuserid='"++"'";

();

mycmd=newSqlCommand(sqlstr,conn);

();

SqlDataReaderda;

da=();

while())

{

=da["username"].ToString();

}

}

protectedvoidtxtcourseid_SelectedIndexChanged(objectsender,EventArgse)

{

stringsqlstr="";

sqlstr="selectcoursenamefromcoursewherecourseid='"++"'";

();

mycmd=newSqlCommand(sqlstr,conn);

();

SqlDataReaderda;

da=();

while())

{

=da["coursename"].ToString();

}

}

}

四、添加学生程序代码

usingSystem;

using;

using;

using;

using;

using;

using;

usingpartialclassaddstudent:

SqlCommandmycmd;

protectedvoidPage_Load(objectsender,EventArgse)

{

"onblur","checkuserid()");

stringstrconn=["connStr"];

SqlConnectionconn=newSqlConnection(strconn);

}

protectedvoidButton1_Click(objectsender,EventArgse)

{

if=="")

return;

stringstrconn=["connStr"];

SqlConnectionconn=newSqlConnection(strconn);

stringsqlstr="";

stringsql="";

sqlstr="insertintostudents(userid,username,sex,minzu,birthday,class,comefrom,beizhu,xuey,zhuany,tel,idc,zhengzmm,zhiw,huoj,weij)values('"++"','"++"','"++"','"++"','"++"','"++"','"++"','"++"','"++"','"++"','"++"','"++"','"++"','"++"','"++"','"++"')";

();

mycmd=newSqlCommand(sqlstr,conn);

();

stringname=获取上传文件的名称

stringtype=("\\")+1);alue=wpath;

();

oString();

stringsql="selectcourseidfromcoursewherecourseid='"+nam+"'";

SqlCommandDBHelper;

DBHelper=newSqlCommand(sql,conn);

();

SqlDataReaderdr=();

if())

{

("该课程号已经存在,请换一个");

}

else

{

("该课程号可以使用");

}

();

}

}

六、检查学号唯一性程序代码

usingSystem;

using;

using;

using;

using;

usingpartialclasscheckuser:

protectedvoidPage_Load(objectsender,EventArgse)

{

=0;

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 法律文书 > 调解书

copyright@ 2008-2022 冰豆网网站版权所有

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