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.IO;

using Model;

namespace LoginFrame
{
    public partial class FrmAddStudentSelectCourseInfo : Form
    {
        public FrmAddStudentSelectCourseInfo()
        {
            InitializeComponent();
        }

        private StudentSelectCourseInfo studentSelectCourseInfo = new StudentSelectCourseInfo();
        private void Btn_Add_Click(object sender, EventArgs e)
        {
            studentSelectCourseInfo.studentNumber = this.cb_studentNumber.SelectedValue.ToString(); //学生对象
            studentSelectCourseInfo.courseNumber = this.cb_courseNumber.SelectedValue.ToString(); //课程对象
            if (BLL.bllStudentSelectCourseInfo.AddStudentSelectCourseInfo(studentSelectCourseInfo))
                MessageBox.Show("选课信息添加成功!");
            else
                MessageBox.Show("选课信息添加失败!");
            this.Close(); 
        }

        private void FrmAddStudentSelectCourseInfo_Load(object sender, EventArgs e)
        {
            //查询所有的学生信息
            DataSet student_QQ287307421Ds = BLL.bllStudent_QQ287307421.getAllStudent_QQ287307421();
            this.cb_studentNumber.DataSource = student_QQ287307421Ds.Tables[0];
            this.cb_studentNumber.DisplayMember = "studentName";
            this.cb_studentNumber.ValueMember = "studentNumber";
            //查询所有的课程信息
            DataSet courseInfo_QQ254540457Ds = BLL.bllCourseInfo_QQ254540457.getAllCourseInfo_QQ254540457();
            this.cb_courseNumber.DataSource = courseInfo_QQ254540457Ds.Tables[0];
            this.cb_courseNumber.DisplayMember = "courseName";
            this.cb_courseNumber.ValueMember = "courseNumber";
        }
    }
}
