Ejemplo n.º 1
0
        //注册
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtStuID.Text.Trim() == "")
            {
                MessageBox.Show("学号不能为空");
                return;
            }
            if (txtStuName.Text.Trim() == "")
            {
                MessageBox.Show("姓名不能为空");
                return;
            }
            StudentInfoModel stu = new StudentInfoModel();

            stu.StuID        = txtStuID.Text.Trim();
            stu.StuName      = txtStuName.Text.Trim();
            stu.StuPwd       = stu.StuID;
            stu.NowBorrows   = 0;
            stu.NowsCredit   = 10;
            stu.SchoolID     = ((SchoolGroup)combSchool.SelectedItem).SchoolID;
            stu.CollegeID    = ((CollegeGroup)combCollege.SelectedItem).CollegeID;
            stu.ProfessionID = ((ProfessionGroup)combProfession.SelectedItem).ProfessionID;
            stu.HeadPath     = txtpic.Text.Trim();
            stu.StuClass     = numClass.Value.ToString();
            stu.Entrance     = dtpEntrance.Value;
            StudentInfoBLL bll = new StudentInfoBLL();

            if (bll.insertStudentInfo(stu) == 1)
            {
                MessageBox.Show("注册成功");
            }
            else
            {
                MessageBox.Show("注册失败");
            }
            this.Close();
        }