程序设计训练课程设计

上传人:无*** 文档编号:142404706 上传时间:2022-08-25 格式:DOC 页数:29 大小:268.50KB
返回 下载 相关 举报
程序设计训练课程设计_第1页
第1页 / 共29页
程序设计训练课程设计_第2页
第2页 / 共29页
程序设计训练课程设计_第3页
第3页 / 共29页
点击查看更多>>
资源描述
经济管理学院 程序设计训练A(二)课程设计课程设计题目: 高等院校科研管理信息系统 专 业 班 级: 信管101班 学 生 姓 名: 张沛梅 学 号: 100201138 指 导 教 师: 李庆恒 王玉恒 陈军霞 董绍辉 2013年 1 月 18 日1. 系统描述1.1背景某高等学校拟建立一套科研管理信息系统,实现对科研工作的信息化管理,要求系统对数据的存储完整,查询迅速,操作方便。教职员工分属于各个学院下的系或行政机关,在学院的教职员工分属于不同的系,在行政机关的教职员工分属于不同的部门如教务处,人事处,财务处等。各级单位均有单位名称,单位地址,电话等属性。教职员工基本信息包括姓名,性别,出生年月,政治面貌,籍贯,毕业院校,所学专业,学历,学位,研究方向,联系电话等信息;教职员工的科研工作主要包括撰写论文,著作和承担课题的研究,发明创造等工作,其研究成果主要包括论文,著作,课题,专利四大类。撰写的论文信息包括论文名称,所有作者姓名,出版刊物名称,刊号,时间,刊物级别(核心期刊,一般期刊,报纸杂志,会议论文),是否被三大索引收录等信息。著作主要包括书名,出版社,出版时间,著作类别(专著、编著、教材、译著),字数,作者姓名及其分工等。课题包括三个环节,立项,鉴定,获奖。课题基本情况包括课题名称,编号,承担单位,合作单位,课题立项情况包括课题来源分为纵向(国家,省部,厅局,一般)横向(其他单位),课题性质(自然科学,软科学,社会科学等),还包括立项时间,完成时间,课题成员,经费等;鉴定包括鉴定时间,鉴定级别(国家,省部,厅局,一般),人员,成果等级(国际先进,国际领先,国内先进,国内领先)等;获奖包括获奖时间,级别(国家,省部,厅局),等级(一等奖,二等奖,三等奖),人员等。专利包括专利号,名称,专利类型(发明,实用新型,外观设计等),授予时间,人员等。每位教职员工会参与多项课题,论文,著作和专利。每项科研也会有多人参加。教职员工的科研工作成果评价和他参与科研的数量和质量都有关系。根据科研参与人数的不同和该教职员工的排名不同,他可以获得相应的科研分数,所以科研的总体信息和各人的对应信息必须完整。最终提供的数据模式可以使用户按照不同年份,人员,单位等各种口径进行查询及统计工作,要求信息完整,设计规范。1.2目的和意义目的是使教职员工科研管理工作更加的简捷,管理更加先进。其意义是通过系统开发使学生更深入的理解相关编程知识,同时开发出有实际作用的系统,用实践带动学习积极性。2. 程序功能介绍程序从登陆窗口进入,根据角色不同进入的主页不同。当是用户登录时,进入到个人科研信息系统页面,在这个页面教职员工可以实现以下功能:(1) 查看个人的详细信息;(2) 修改个人的密码;(3) 可以进行参加论文,著作,课题,专利信息的录入;(4) 可以查询个人参加不同科研项目的基本信息与得分。当是管理员登录时,进入到管理员的主页,可以实现以下功能: (1)可以查看管理员自己的详细信息; (2)修改个人密码; (3)可以查看全部教职员工的登录密码; (4)可以查看参加不同科研项目的详细情况,进行录入,删除,更新科研信息的操作; (5)可以按时间段对不同项目进行时间检索,查看某个时间段某个项目的具体信息; (6)对科研项目的评分规则进行修改。3. 系统实现3.1开发环境软硬件本系统适用于微型机,内存容量2G,应配备的外部设备有鼠标、键盘、显示器、主机等. 软件环境Microsoft Visual Studio 2010和SQL server 2005.本系统的设计采用的是ASP.NET语言,在Windows 7操作系统下Microsoft Visual Studio 2010和SQL server 2005软件环境下使用。3.2程序调试情况1、调试登陆窗口遇到的问题在写登陆按钮的单击事件代码是出现了错误,此登陆功能是:如果输入的职工号是管理员,就倒转到管理员的界面,如果输入职工号是用户,就跳转到用户界面。因为没有写对代码,导致没有跳转正确。解决方案:if(Eid1!=null) & (paw1!=null) &(js1=管理员) SessionCurrentValue = user.Text; Response.Redirect(LiuyiDefault2.aspx); if(Eid1!=null) & (paw1!=null) &(js1=用?户) SessionCurrentValue = user.Text; Response.Redirect(LiuyiDefault.aspx); 2.调试按时间检索参加各项项目的具体情况出现的问题如上图,我以论文时间检索为例,时间检索论文的详细情况,需要调用数据库的存储过程。但是起初没有调用,导致检索不出结果。解决方案: myCommand.CommandText = time_select_Eplw; SqlParameter parInput = myCommand.Parameters.Add(time1, SqlDbType.DateTime); parInput.Direction = ParameterDirection.Input; parInput.Value = Convert.ToDateTime(DropDownList1.Text + / + DropDownList2.Text + / + DropDownList3.Text); SqlParameter parInput2 = myCommand.Parameters.Add(time2, SqlDbType.DateTime); parInput2.Direction = ParameterDirection.Input; parInput2.Value = Convert.ToDateTime(DropDownList4.Text + / + DropDownList5.Text + / + DropDownList6.Text);3.调试评分规则管理时出现的问题如上图,以著作评分规则修改为例,要修改评分规则需要查询出数据库中原始的评分,但是在查询单击事件的代码没有写对,执行了很多次都没有成功。解决方案:SqlConnection myCon = null; SqlCommand myCom = null; try string myConStr = Data Source=S-PC;Initial Catalog=KYGLSystem;User ID=sa;password=sa; myCon = new SqlConnection(myConStr); myCon.Open(); string sql = select ZZgrade from zz_sum where zzlx=+DropDownListZZjb.Text+; myCom = new SqlCommand(sql ,myCon); SqlDataReader result = myCom.ExecuteReader(); if (result.Read() TextBoxZZfz.Text = resultZZgrade.ToString(); catch (Exception oe) Response.Write(数y据Y库a操作失败 + oe); finally if (myCon != null) myCon.Close(); 3.3 结论本系统是高等院校教职员工科研管理信息系统,能够简单的处理个人科研信息,界面清晰,易于理解,操作简单方便。用户可以进入用户界面查询个人参加项目的情况,修改密码,可以进行科研申报。管理员通过进入管理界面查询各个项目的具体情况,可以对参加项目的人员或其他信息进行更新,删除等工作,管理参加人员。管理员还可以根据需要更改各项目的评分规则。但是还存在一些问题,不能做到按折线图或饼图的形式输出,也不能按报表的形式输出。完善方案如下:(1)应该做到用折线图或饼图输出各项目的情况; (2)应该做到各个工能灵活使用。 4. 结束语通过做本次课程设计,我有很大的感受,也学到了很多的东西。首先,我明白了自身所处的位置,我掌握的知识还很有限,在课程设计过程遇到很多问题,常常需要花很多时间去解决一个问题,这是因为没有充分掌握相关知识,这就需要我在课下多学习。如果毕业后想从事这方面的工作,课余时间还应该多看看有关的知识。另外,还应该在课余多做一些类似的系统,多接触这种做系统的练习,让自己对数据库和编程这方面做到熟练,总结出经验,以便于在以后做系统时能处理好,出现类似的错误能尽快的解决。 其次,我明白了自己在做界面和编写代码时还是做得不够好,还是经常出现错误,在编程方面的能力也还是十分有限的,不能灵活掌握课本的知识。自己有不明白的问题时,应该尽快的询问老师或者参考其他资料。自己编写代码时考虑问题还欠缺全面性,不能做到令人很满意。最后,我明白了开发一个系统不是一朝一夕的事情,虽然三个星期的时间不算太长,但是也有很多其他的同学做的很好。经过这次训练,自己要加油,下次能做得更好。 附录:源代码清单1. 登陆页面using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class dl : System.Web.UI.Page protected void Buttsure_Click(object sender, EventArgs e) string Eid1 = null; string paw1 = null; string js1 = null; String sqlconn = Data Source=S-PC;Initial Catalog=KYGLSystem;User ID=sa;password=sa; SqlConnection myConnection = new SqlConnection(sqlconn); myConnection.Open(); string sqlsel=select Eid,paw,js from dl where Eid=+user.Text+and paw=+paw.Text+; SqlCommand myCommand = new SqlCommand(sqlsel,myConnection); SqlDataReader result = myCommand.ExecuteReader(); if(result.Read() Eid1 = resultEid.ToString(); paw1 = resultpaw.ToString(); js1= resultjs.ToString(); if(user.Text=null)&(paw.Text=null)Response.Write(请?输?入?用?户名?和密码?!?!?!?); if(Eid1!=user.Text) &(paw1!=paw.Text) Response.Write(if(confirm(用?户名?或密码?不?正y确!?!?!?)window.navigate(dl.aspx); ); if(Eid1!=null) & (paw1!=null) &(js1=管理员) SessionCurrentValue = user.Text; Response.Redirect(LiuyiDefault2.aspx); if(Eid1!=null) & (paw1!=null) &(js1=用?户) SessionCurrentValue = user.Text; Response.Redirect(LiuyiDefault.aspx); myConnection.Close(); protected void ButtonCZ_Click(object sender, EventArgs e) user.Text = ; paw.Text = ; 2. 管理员界面2.1 管理员人员基本信息using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class glyJbxinix : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) String sqlconn = Data Source=S-PC;Initial Catalog=KYGLSystem;User ID=sa;password=sa; SqlConnection myConnection = new SqlConnection(sqlconn); myConnection.Open(); SqlCommand myCommand = new SqlCommand(select Employee.*,Section.Sname,Department.Dname from Employee,Section,Department where Employee.Eid= + SessionCurrentValue + and Section.Sid= Employee.Sid and Department.Did=Section.Did, myConnection); SqlDataReader myReader; myReader = myCommand.ExecuteReader(); if (myReader.Read() Label4.Text = myReaderEid.ToString(); Label2.Text = myReaderEname.ToString(); Label6.Text = myReaderEsex.ToString(); Label14.Text = myReaderSname.ToString(); Label8.Text = myReaderEbri.ToString(); Label20.Text = myReaderEsxzy.ToString(); Label10.Text = myReaderEmm.ToString(); Label12.Text = myReaderEjg.ToString(); Label18.Text = myReaderEbyxy.ToString(); Label16.Text = myReaderDname.ToString(); Label22.Text = myReaderExw.ToString(); Label24.Text = myReaderExl.ToString(); Label26.Text = myReaderEyjfx.ToString(); Label28.Text = myReaderEtel.ToString(); myReader.Close(); myConnection.Close(); 2.2管理员密码修改using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class glymima1 : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) SqlConnection myCon = null; SqlCommand myCom = null; SqlDataReader result=null; SqlCommand comm=null; string paw1=null; try string myConStr = Data Source=S-PC;Initial Catalog=KYGLSystem;User ID=sa;password=sa; myCon = new SqlConnection(myConStr); myCon.Open(); myCom = new SqlCommand(); myCom.Connection = myCon; string oldmm = ysmm.Text.Trim(); string newmm = xmm.Text.Trim(); string sqlsel=select paw from dl where Eid=+SessionCurrentValue+; comm = new SqlCommand(sqlsel,myCon); result = comm.ExecuteReader(); if(result.Read() paw1 = resultpaw.ToString(); if (paw1 = ysmm.Text) if (result != null) result.Close(); /string strUpdate = Update stu set stuName=李?芳?,XyDm=02,ZyDm=0201 where stuNum=091001; string strUpdate = Update dl set paw=0 where Eid=1; string sql = string.Format(strUpdate, newmm, SessionCurrentValue); myCom.CommandType = CommandType.Text; myCom.CommandText = sql; myCom.ExecuteNonQuery(); Response.Write(alert(数y据Y库a内容Y修T改?成功|!?!?!?) ); else if (result != null) result.Close(); Response.Write(if(confirm(此?原-始?密码?与?数y据Y库a中D的?不?符?!?!?!?请?重?新?输?入?!?!?)window.navigate(glymima1.aspx); ); catch (Exception oe) Response.Write(数y据Y库a操作失败 + oe); finally if (myCon != null) myCon.Close(); /try 结束? protected void Button2_Click(object sender, EventArgs e) Response.Redirect(LiuyiDefault2.aspx); 3. 用户密码修改代码(同管理员密码修改的代码)using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Data.SqlClient;public partial class mima : System.Web.UI.Page protected void qd_Click(object sender, EventArgs e) /定义要使用的对象 SqlConnection myCon = null; SqlCommand myCom = null; try string myConStr = Data Source=S-PC;Initial Catalog=KYGLSystem;User ID=sa;password=sa; myCon = new SqlConnection(myConStr); myCon.Open(); myCom = new SqlCommand(); myCom.Connection = myCon; string oldmm = ysmm.Text.Trim(); string newmm = xmm.Text.Trim(); /Eid1 = E000000022; /string strUpdate = Update stu set stuName=李芳,XyDm=02,ZyDm=0201 where stuNum=091001; string strUpdate = Update dl set paw=0 where Eid=1; string sql = string.Format(strUpdate, newmm, SessionCurrentValue); myCom.CommandType = CommandType.Text; myCom.CommandText = sql; myCom.ExecuteNonQuery(); Response.Write(alert(数据库内容修改成功!) ); /Response.Write(if(confirm(数据库内容修改成功)window.navigate(LiuyiDefault.aspx); ); catch (Exception oe) Response.Write(数据库操作失败 + oe); finally if (myCon != null) myCon.Close(); protected void Page_Load(object sender, EventArgs e) protected void qx_Click(object sender, EventArgs e) RequiredFieldValidator1.Visible = false; RequiredFieldValidator2.Visible = false; RequiredFieldValidator3.Visible = false; CompareValidator1.Visible = false; xmm.Text = ; zsr.Text = ; ysmm.Text = ; Response.Redirect(LiuyiDefault.aspx); 4.论文信息录入代码using System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;using System.Data;public partial class lwsb : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) for (int i = 2000; i 2014; i+) this.DropDownList2.Items.Add(i.ToString(); for (int i = 1; i 13; i+) this.DropDownList3.Items.Add(i.ToString(); for (int i = 1; i = 31; i+) this.DropDownList4.Items.Add(i.ToString(); this.Label2.Visible = false; this.TextBox8.Visible = false; this.Label7.Visible = false; this.TextBox13.Visible = false; this.Label3.Visible = false; this.TextBox9.Visible = false; this.Label8.Visible = false; this.TextBox14.Visible = false; this.Label4.Visible = false; this.TextBox10.Visible = false; this.Label9.Visible = false; this.TextBox15.Visible = false; this.Label5.Visible = false; this.TextBox11.Visible = false; this.Label10.Visible = false; this.TextBox16.Visible = false; protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) if (DropDownList1.SelectedIndex = 1) dfh1.Text = lw_ l1; if (DropDownList1.SelectedIndex = 2) dfh1.Text = lw_l4; if (DropDownList1.SelectedIndex = 3) dfh1.Text = lw_l2; if (DropDownList1.SelectedIndex = 0) dfh1.Text = lw_l3; protected void Button2_Click(object sender, EventArgs e) string cbsj = DropDownList2.Text + / + DropDownList3.Text + / + DropDownList4.Text; string sqlconn = Data Source=S-PC;Initial Catalog=KYGLSystem;User ID=sa;password=sa; SqlConnection conn = new SqlConnection(sqlconn); conn.Open(); /SqlCommand comm0 = new SqlCommand(select * from kylw where lwbh= + lwbh.Text.Trim() + ,conn); /int j = comm0.ExecuteNonQuery(); /if (j = 0) / string sfsl; if (RadioButton1.Checked) sfsl = 是; else sfsl = 否; string strsql = insert into LW(LWid,LWname,LWpublic,LWlx,rank,kan_no,LWtime,LWrecord)values(0,1,2,3,4,5,6,7); string str = string.Format(strsql, TextBox1.Text.Trim(), TextBox2.Text.Trim(), TextBox4.Text.Trim(), DropDownList1.Text,dfh1.Text.Trim(), TextBox5.Text.Trim(), cbsj, sfsl); SqlCommand comm1 = new SqlCommand(str, conn); int n = Convert.ToInt32(TextBox6.Text.Trim(); string zzbh = new stringn - 1; string fgh = new stringn - 1; switch (n) case 1: zzbh = new string1 TextBox7.Text.Trim() ; fgh = new string1 TextBox12.Text.Trim() ; break; case 2: zzbh = new string2 TextBox7.Text.Trim(), TextBox8.Text.Trim() ; fgh = new string2 TextBox12.Text.Trim(), TextBox13.Text.Trim() ; break; case 3: zzbh = new string3 TextBox7.Text.Trim(), TextBox8.Text.Trim(), TextBox9.Text.Trim() ; fgh = new string3 TextBox12.Text.Trim(), TextBox13.Text.Trim(), TextBox14.Text.Trim() ; break; case 4: zzbh = new string4 TextBox7.Text.Trim(), TextBox8.Text.Trim(), TextBox9.Text.Trim(), TextBox10.Text.Trim() ; fgh = new string4 TextBox12.Text.Trim(), TextBox13.Text.Trim(), TextBox14.Text.Trim(), TextBox15.Text.Trim() ; break; case 5: zzbh = new string5 TextBox7.Text.Trim(), TextBox8.Text.Trim(), TextBox9.Text.Trim(), TextBox10.Text.Trim(), TextBox11.Text.Trim() ; fgh = new string5 TextBox12.Text.Trim(), TextBox13.Text.Trim(), TextBox14.Text.Trim(), TextBox15.Text.Trim(), TextBox16.Text.Trim() ; break; default: Response.Write(请?输?入?人?数y!?); break; comm1.ExecuteNonQuery(); string str2 = insert into zx(LWid,Eid,fgpx)values(0,1,2); for (int i = 0; i n; i+) string sql = string.Format(str2, TextBox1.Text.Trim(), zzbhi.ToString(), fghi.ToString(); SqlCommand comm2 = new SqlCommand(sql, conn); comm2.ExecuteNonQuery(); /SqlParameter input = mycomm.Parameters.Add(zgbh, SqlDbType.VarChar); /input.Direction = ParameterDirection.Input; /input.Value = zzbhi.ToString().Trim(); /SqlParameter input1 = mycomm.Parameters.Add(lwbh, SqlDbType.Char); /input1.Direction = ParameterDirection.Input; /input1.Value = lwbh.Text.Trim(); /SqlParameter input2 = mycomm.Parameters.Add(rens, SqlDbType.Int); /input2.Direction = ParameterDirection.Input; /input2.Value = n; /mycomm.ExecuteNonQuery(); /mycomm.Parameters.Clear(); conn.Close(); Response.Write( alert(已?提交?!?);); TextBox1.Text = ; TextBox2.Text = ; TextBox4.Text = ; TextBox5.Text = RadioButton1.Text = ; RadioButton2.Text = ; TextBox6.Text = ; TextBox7.Text = ; TextBox8.Text = ; TextBox9.Text = ; TextBox10.Text = ; TextBox11.Text = ; /Response.Write(j); protected void TextBox6_TextChanged(object sender, EventArgs e) string str = TextBox6.Text.Trim(); int rs = Convert.ToInt32(str); if (rs = 1) Label1.Visible= true; TextBox7.Visible = true; Label6.Visible = true; TextBox12.Visible = true; Label2.Visible = false; TextBox8.Visible = false; Label7.V
展开阅读全文
相关资源
相关搜索

最新文档


当前位置:首页 > 压缩资料 > 基础医学


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!