• 大小: 1.36MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-28
  • 语言: C#
  • 标签: C#  系统  课程设计  管理  

资源简介

最基本功能需求:1. 能够实现根据以下关键字查询:学生姓名、学号、班级、课程名称。2. 能够实现按照单科成绩、总成绩、平均成绩、学号排序。3. 能够实现学生成绩信息的插入、删除和修改。4. 能够查询每个课程的最高分、最低分及相应学生姓名、班级和学号。5. 能够查询每个班级某门课程的优秀率(90分及以上)、不及格率,并进行排序

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace WindowsFormsApplication1
{
    public partial class Login : Form
    {
        private static String constr = “initial catalog=XSGLXT;server=.;Integrated Security=True;“;//声明数据库连接字符串
        public Login()
        {
            InitializeComponent();
        }
        private void Button1_Click(object sender EventArgs e)
        {
            string commandText=““;
            SqlConnection conn = new SqlConnection(constr);//创建数据库连接
            //选择类型创建不同的SQL命令语句
            if (Type.Text == “教师“)
                commandText = “select * from 老师密码信息表 where 职工号=‘“ + Number.Text.Trim() + “‘and 密码=‘“ + Password.Text.Trim() + “‘“;
            else 
                if (Type.Text == “学生“)
                    commandText = “select * from 学生密码信息表 where 学号=‘“ + Number.Text.Trim() + “‘and 密码=‘“ + Password.Text.Trim() + “‘“;
            SqlCommand cmd = new SqlCommand(commandText conn);//实例化一个sqlcommand对象来执行sql命令
            try
            {
                conn.Open();//打开数据库
                SqlDataReader reader = cmd.ExecuteReader();//实例化一个数据阅读对象
                if (reader.Read())//如果搜索到这一条数据
                {
                    if (Type.Text == “学生“)
                    {
                        Student_system f2 = new Student_system(Number.Text Password.Text);//实例化一个学生功能系统窗体
                        f2.Show();
                    }
                    if(Type.Text == “教师“)
                    {
                        Teacher_system f3 = new Teacher_system(Number.Text Password.Text);//实例化一个教师功能系统窗体
                        f3.Show();
                    }
                 this.Hide();//隐藏这个窗体
                }
                else 
                    if(!reader.Read())
                {
                    MessageBox.Show(“号码或密码有误,请重新登录!“);//弹窗
                    Number.Text = ““;
                    Password.Text = ““;
                }
            }
            catch (SqlException err)
            {
                MessageBox.Show(err.ToString());
            }
            finally
            {
                conn.Close();
            }
        }

        private void Button2_Click(object sender EventArgs e)
        {
            Application.Exit();//退出程序
        }

        private void Login_Load(object sender EventArgs e)
        {

        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-01-08 13:56  学生成绩管理系统\
     目录           0  2017-01-08 13:56  学生成绩管理系统\WindowsFormsApplication1\
     目录           0  2017-01-09 20:26  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\
     文件        1041  2016-12-15 09:03  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1.sln
     文件       55296  2017-01-09 20:26  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1.v12.suo
     文件         187  2016-12-15 09:03  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\App.config
     目录           0  2017-01-08 14:50  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\
     目录           0  2017-01-08 13:56  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\
     文件       38912  2017-01-09 20:24  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
     文件         187  2016-12-15 09:03  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe.config
     文件       69120  2017-01-09 20:24  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
     文件       24224  2017-01-09 20:25  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
     文件         187  2016-12-15 09:03  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.config
     文件         490  2013-03-18 17:00  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
     目录           0  2017-01-08 14:50  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\bin\Release\
     文件        2933  2017-01-09 19:22  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Login.cs
     文件        6738  2017-01-08 15:06  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Login.Designer.cs
     文件        5817  2017-01-08 15:06  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\Login.resx
     目录           0  2017-01-08 13:56  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\
     目录           0  2017-01-09 20:24  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\
     文件        1453  2016-12-15 09:13  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7103  2017-01-08 15:07  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件           0  2016-12-15 09:03  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
     文件           0  2016-12-15 09:03  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
     文件           0  2016-12-15 09:03  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
     目录           0  2016-12-15 09:03  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\TempPE\
     文件        2850  2017-01-09 20:25  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt
     文件        1285  2017-01-09 19:47  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.GenerateResource.Cache
     文件        2211  2016-12-15 09:10  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csprojResolveAssemblyReference.cache
     文件       38912  2017-01-09 20:24  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.exe
     文件         180  2017-01-08 15:45  学生成绩管理系统\WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Login.resources
............此处省略20个文件信息

评论

共有 条评论