• 冲刺阶段 day 6


    项目进展:学生管理这部分已经进展的差不多了,调试了几遍,改了几个小Bug之后就没有什么问题了,基本完成,如若后续还有一些新的功能到时候再自行加入。明天开始教师部分。

    存在问题:我觉得我们的项目还是比较课堂,比较中规中矩的,还需一些闪光点来加分,例如再加入一些功能。下次小组开会的时候再讨论一下。

    实现的部分代码:

    MainFrm 

    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;
    
    namespace GengdanContactsMIS_WinForm
    {
        public partial class MainFrm : Form
        {
            public MainFrm()
            {
                InitializeComponent();
            }
    
            private void 系部管理ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                DepartmentFrm f = new DepartmentFrm();
                f.ShowDialog();
            }
    
            private void 专业管理ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                MajorFrm m = new MajorFrm();
                m.ShowDialog();
            }
    
            private void btnCancel_Click(object sender, EventArgs e)
            {
                this.Close();
            }
    
            private void 班级管理ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                ClassFrm f = new ClassFrm();
                f.ShowDialog();
            }
    
            private void 学生管理ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                StudentFrm f = new StudentFrm();
                f.ShowDialog();
            }
    
            private void 教师管理ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                TeacherFrm f = new TeacherFrm();
                f.ShowDialog();
            }
    
            
        }
    }

    StudentFrm

    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;
    
    namespace GengdanContactsMIS_WinForm
    {
        public partial class StudentFrm : Form
        {
            public StudentFrm()
            {
                InitializeComponent();
                BindClass();
                BindStudent();
            }
            void BindClass()
            {
                string sql = "select ClassId ,ClassName from Class";
                DB db = new DB();
                DataSet ds = db.GetDataSet(sql, "Class");
                cbClass.DataSource = ds.Tables["Class"];
                cbClass.DisplayMember = "ClassName";
                cbClass.ValueMember = "ClassId";
            }
            void BindStudent()
            {
                string sql = "select SNo as 学号,SName as 姓名,Sex as 性别,ClassName as 班级,BirthDate as 出生年月日,Phone as 电话,Email as 邮箱,Adress as 地址 from Student,Class where Student.ClassId=Class.ClassId";
                DB db = new DB();
                DataSet ds = db.GetDataSet(sql,"Student");
                dataGridView1.DataSource = ds.Tables["Student"];
            }
    
            private void btnAdd_Click(object sender, EventArgs e)
            {
                string sql = "insert into Student(SNo,SName,Sex,ClassId,BirthDate,Phone,Email,Adress)values("
                     + txtSNo.Text + ",'" + txtSName.Text + "','" + txtSex.Text + "'," + cbClass.SelectedValue + ",'" + txtBirthDate.Text + "','" + txtPhone.Text + "','" + txtEmail.Text + "','" + txtAdress.Text + "')";
                 DB db = new DB();
                 if (db.ExecuteSQL(sql))
                     MessageBox.Show("学生增加成功");
                 else
                     MessageBox.Show("学生增加失败,请检查学号是否已存在");
                 BindStudent();
            }
    
            private void btnSearch_Click(object sender, EventArgs e)
            {
                string sql = "select SNo,SName,Sex,ClassName,BirthDate,Phone,Email,Adress from Class,Student where Class.ClassId=Student.ClassId and SName='" + txtSName.Text + "'";
                DB db = new DB();
                DataSet ds = db.GetDataSet(sql, "a");
                dataGridView1.DataSource = ds.Tables["a"];
            }
    
            private void btnCancel_Click(object sender, EventArgs e)
            {
                this.Close();
            }
        }
    }

    记录人:秦文

  • 相关阅读:
    IE6,IE7,IE8,Firefox 兼容的css hack以及常见兼容性问题
    BAT及各大互联网公司2014前端笔试面试题:HTML/CSS/JAVASCRIPT
    C语言学习
    HDU 3861 The King’s Problem 最小路径覆盖(强连通分量缩点+二分图最大匹配)
    HDU 2089 不要62【解题报告】
    POJ2762 Going from u to v or from v to u? 强连通分量缩点+拓扑排序
    HDU 1754 线段树入门解题报告
    2019/4/22 kmp模板
    2019/4/22 拓扑排序的高效写法. 模板题HDU1285:确定比赛名次
    HDU 2544最短路 【dijkstra 链式前向星+优先队列优化】
  • 原文地址:https://www.cnblogs.com/3214292940F5/p/5496197.html
Copyright © 2020-2023  润新知