导师制双选系统

 

综合应用算法训练

 

任务说明

设计一个用于软件工程系本科导师制双选的系统。

设计要求:

(1) 实现学生信息管理,支持信息更新;

(2) 实现教师信息管理,支持信息更新;

(3) 实现学生填写导师志愿的过程,并提供当前导师的选择情况;

(4) 实现基于规则的志愿调整过程;

(5) 实现导师的学生筛选过程;

(6) 实现各种信息的多类查询。

实验环境及实验准备

     C#编程语言

系统分析与设计

此部分包括软件程序的需求分析与软件设计部分,最好图文并茂。

(1)需求分析

         参照实验要求,实现调用数据库进行信息显示,导师学生互选,更新互选结果,管理员更改教师、学生信息,查询双选结果,调整志愿。

(2)软件设计

       数据库:教师表、学生表、管理员表

   登录:点选教师/学生/管理员登录,输入正确用户名(教师号、学号)和密码成功登录。

   教师:

    默认可带5个学生。

    邀请学生:列表显示未分配的学生信息,可选。若学生未达上限,即向选中的学生发出邀请,等待学生处理。学生将收到老师的基本信息和教学经历等内容。

    处理学生申请:若收到来自学生的申请,可选择同意或拒绝。

    刷新:更新显示信息

学生:

    只能有一位导师。

    修改个人简介:点击在文本框中输入要更改的内容,保存修改个人简介。

    申请导师:若无导师,可在选择申请导师,向导师发送申请,等待老师处理。导师将收到学生的基本信息和个人简介。

    处理导师邀请:若收到邀请,进入处理界面查看邀请信息,同意或拒绝邀请。

    刷新:刷新显示信息

管理员:

    进行教师表、学生表、双选表的增删改查。并将结果导出到.xls文件

说明本程序中用到的所有数据结构及数据类型的定义、主程序的流程以及各程序模块之间的调用关系图。

软件源代码

Form1 登录

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Data.SqlClient;

 

namespace daoshizhi

{

    public partial class Form1 : Form

    {

        public static string welcome = "";

        public static string no = "";

        SqlConnection conn = new SqlConnection("server=.;database=tutorManagement;uid=sa;pwd=sa");

        public Form1()

        {

            InitializeComponent();

        }

        private void button1_Click(object sender, EventArgs e)

        {

            conn.Open();

            string username = textBox1.Text.Trim();

            string userpwd = textBox2.Text.Trim();

            if (username == "" || userpwd == "")

            {

                label2.Text = "用?户§名?或ò密ü码?不?能ü为a空?!";

            }

            else

            {

                string s1 = "select * from tutor where tno='" + username + "' and pwd='" + userpwd + "'";

                string s2 = "select * from student where sno='" + username + "' and pwd='" + userpwd + "'";

                string s3 = "select * from manager where mno='" + username + "' and pwd='" + userpwd + "'";

                if (radioButton1.Checked)

                {

                    SqlCommand s01 = new SqlCommand(s1, conn);

                    SqlDataReader t = s01.ExecuteReader();

                    if (t.Read())

                    {

                        conn.Close();

                        SqlDataAdapter s11 = new SqlDataAdapter(s1, conn);

                        DataSet ds = new DataSet();

                        conn.Open();

                        s11.Fill(ds, "tutor");

                        welcome=ds.Tables["tutor"].Rows[0]["tname"].ToString();

                        no= ds.Tables["tutor"].Rows[0]["tno"].ToString();

                        Form Form2 = new Form2();

                        Form2.Show();

                        this.Hide();

                    }

                    else label2.Text = "用?户§名?或ò密ü码?错洙?误ó!";

                }

                else if (radioButton2.Checked)

                {

                    SqlCommand s02 = new SqlCommand(s2, conn);

                    SqlDataReader t = s02.ExecuteReader();

                    if (t.Read())

                    {

                        conn.Close();

                        SqlDataAdapter s22 = new SqlDataAdapter(s2, conn);

                        DataSet ds = new DataSet();

                        conn.Open();

                        s22.Fill(ds, "student");

                        welcome = ds.Tables["student"].Rows[0]["name"].ToString();

                        no = ds.Tables["student"].Rows[0]["sno"].ToString();

                        Form Form3 = new Form3();

                        Form3.Show();

                        this.Hide();

                    }

                    else label2.Text = "用?户§名?或ò密ü码?错洙?误ó!";

                }

                else

                {

                    SqlCommand s03 = new SqlCommand(s3, conn);

                    SqlDataReader t = s03.ExecuteReader();

                    if (t.Read())

                    {

                        Form Form4 = new Form4();

                        Form4.Show();

                        this.Hide();

                    }

                    else label2.Text = "用?户§名?或ò密ü码?错洙?误ó!";

                }

            }

            conn.Close();

        }

 

 

Form2 教师界面

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Data.SqlClient;

 

namespace daoshizhi

{

    public partial class Form2 : Form

    {

        public static string welcome =Form1.welcome;

        public static string no = Form1.no;

        SqlConnection conn = new SqlConnection("server=.;database=tutorManagement;uid=sa;pwd=sa");

        public static int k;

        public Form2()

        {

            InitializeComponent();

            label1.Text = "欢?迎?,?"+welcome+"老?师簗!?";

            /*显?示?我ò的?学§生Θ?/

            conn.Open();

            string s = "select * from student where tno='"+no+"'";

            SqlCommand a = new SqlCommand(s,conn);

            SqlDataReader dr = a.ExecuteReader();

            while (dr.Read())

            {

              listBox1.Items.Add(string.Format("{0}   {1}   {2}   {3}", dr[0], dr[1],dr[2],dr[3]));

            }

            dr.Close();

            /*显?示?待鋣分?配?学§生Θ?/

            string s2 = "select sno,name,sex,message from student where tno is NULL";

            SqlCommand b = new SqlCommand(s2,conn);

            SqlDataReader dr2 = b.ExecuteReader();

            while (dr2.Read())

            {

                listBox2.Items.Add(string.Format("{0}    {1}    {2}   {3}", dr2[0], dr2[1], dr2[2], dr2[3]));

                comboBox1.Items.Add(dr2[0]);

            }

            dr2.Close();

            conn.Close();

            /*显?示?学§生Θ?邀?请?*/

            conn.Open();

            string s3 = "sel

  • 7
    点赞
  • 62
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值