• 大小: 1.56MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-20
  • 语言: C#
  • 标签: c#  winform  sqlserver  

资源简介

课设作业,带数据库文件,C#编程语言,SQLServer数据库,WinForm窗体,管理员与学生登陆,基本的增删改查

资源截图

代码片段和文件信息

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 MySchool.BLL;
using MySchool.Models;

namespace MySchool
{
    public partial class frmAddResult : Form
    {
        public frmAddResult()
        {
            InitializeComponent();
        }
        public Student Stu;
        private void frmAddResult_Load(object sender EventArgs e)
        {
            this.cboSub.DisplayMember = “SubjectName“;
            this.cboSub.ValueMember = “SubjectId“;
            try
            {
                this.cboSub.DataSource = new BindingList( SubjectBLL.GetSubject(this.Stu.Grade.GradeId));
            }
            catch (Exception ex)
            {
                MessageBox.Show(“绑定科目下拉框出现异常\n“ + ex.Message “系统提示 “ MessageBoxButtons.OK MessageBoxIcon.Information);
            }

            ShowStudentResultSeach();//使用扩展类显示

            //ShowStudentResult();//使用重写ToString()实现
        }

        private void picExamDate_ValueChanged(object sender EventArgs e)
        {
            if (this.picExamDate.Value > DateTime.Now)
            {
                MessageBox.Show(“考试日期不能大于当前日期!“ “系统提示 “ MessageBoxButtons.OK MessageBoxIcon.Information);
                this.picExamDate.Value = DateTime.Now;
                return;
            }
        }
        //使用重写ToString()方法显示ListView
        public void ShowStudentResult()
        {
            this.listView1.Items.Clear();
            try
            {
                List results = ResultBLL.GetResultByStu(this.Stu.StudentNo);
                foreach (Result r in results)
                {
                   ListViewItem lv = new ListViewItem(r.Student.ToString());
                    lv.SubItems.AddRange(new string []{r.Subject.ToString()r.StudentResult.ToString()r.ExamDate.ToString()});
                    this.listView1.Items.Add(lv);
                }
                
            }
            catch (Exception ex)
            {
                MessageBox.Show(“查询学生成绩出现异常\n“ + ex.Message “系统提示 “ MessageBoxButtons.OK MessageBoxIcon.Information);
            }
        }
        //使用扩展类显示ListView
        public void ShowStudentResultSeach()
        {
            //清空ListView时, this.listView1.Clear();不正确!
            //应该为listView1.Item.Clear();

            this.listView1.Items.Clear();
            try
            {
                List results = ResultBLL.SeachResultByStu(this.Stu.StudentNo);
                foreach (ResultSeach r in results)
                {
                    ListViewItem lv = new ListViewItem(r.StudentName);
                    lv.SubItems.AddRange(new string[] { r.SubjectName r.StudentResult.ToString() r.ExamDate.ToString() });
                    this.listView1.Items.Add(lv);
                }

            }
            catch (Exception ex)
            {
             

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .......       725  2018-04-17 01:00  MySchool.BLL\AdminBLL.cs

     文件       6144  2020-11-26 08:33  MySchool.BLL\bin\Debug\MySchool.BLL.dll

     文件      22016  2020-11-26 08:33  MySchool.BLL\bin\Debug\MySchool.BLL.pdb

     文件      13312  2020-11-26 08:33  MySchool.BLL\bin\Debug\MySchool.DAL.dll

     文件      30208  2020-11-26 08:33  MySchool.BLL\bin\Debug\MySchool.DAL.pdb

     文件       9728  2020-11-26 08:33  MySchool.BLL\bin\Debug\MySchool.Models.dll

     文件      38400  2020-11-26 08:33  MySchool.BLL\bin\Debug\MySchool.Models.pdb

    .......       443  2018-04-17 01:00  MySchool.BLL\GradeBLL.cs

    .......      2935  2018-04-17 01:00  MySchool.BLL\MySchool.BLL.csproj

     文件          0  2020-11-26 08:33  MySchool.BLL\obj\Debug\MySchool.BLL.csproj.CopyComplete

     文件       3818  2020-11-14 21:01  MySchool.BLL\obj\Debug\MySchool.BLL.csproj.FileListAbsolute.txt

     文件       4921  2020-11-26 08:33  MySchool.BLL\obj\Debug\MySchool.BLL.csprojAssemblyReference.cache

     文件       6144  2020-11-26 08:33  MySchool.BLL\obj\Debug\MySchool.BLL.dll

     文件      22016  2020-11-26 08:33  MySchool.BLL\obj\Debug\MySchool.BLL.pdb

    .......         0  2018-04-17 01:00  MySchool.BLL\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

    .......         0  2018-04-17 01:00  MySchool.BLL\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

    .......         0  2018-04-17 01:00  MySchool.BLL\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

    .......      1328  2018-04-17 01:00  MySchool.BLL\Properties\AssemblyInfo.cs

    .......      1003  2018-04-17 01:00  MySchool.BLL\ResultBLL.cs

    .......      1870  2018-04-17 01:00  MySchool.BLL\StudentBLL.cs

    .......       487  2018-04-17 01:00  MySchool.BLL\SubjectBLL.cs

    .......      1425  2018-04-17 01:00  MySchool.DAL\AdminDAL.cs

     文件      13312  2020-11-26 08:33  MySchool.DAL\bin\Debug\MySchool.DAL.dll

     文件      30208  2020-11-26 08:33  MySchool.DAL\bin\Debug\MySchool.DAL.pdb

     文件       9728  2020-11-26 08:33  MySchool.DAL\bin\Debug\MySchool.Models.dll

     文件      38400  2020-11-26 08:33  MySchool.DAL\bin\Debug\MySchool.Models.pdb

    .......       930  2018-04-17 01:00  MySchool.DAL\GradeDAL.cs

    .......      2836  2018-04-17 01:00  MySchool.DAL\MySchool.DAL.csproj

     文件          0  2020-11-26 08:33  MySchool.DAL\obj\Debug\MySchool.DAL.csproj.CopyComplete

     文件       3040  2020-11-14 21:01  MySchool.DAL\obj\Debug\MySchool.DAL.csproj.FileListAbsolute.txt

............此处省略154个文件信息

评论

共有 条评论