Ejemplo n.º 1
0
        private void button6_Click_1(object sender, EventArgs e)//确认添加
        {
            ad_ServicesBLL BLL         = new ad_ServicesBLL();
            TeacherData    teacherData = new TeacherData();

            teacherData.TeaNo       = tbteano.Text.Trim();
            teacherData.TeaPwd      = tbteapwd.Text.Trim();
            teacherData.TeaName     = tbteaname.Text.Trim();
            teacherData.Academy     = tbacademy.Text.Trim();
            teacherData.GroupNumber = Convert.ToInt32(tbgroupnumber.Text.Trim());
            if (BLL.InsertTeabll(teacherData))
            {
                MessageBox.Show("导入成功", "提示", MessageBoxButtons.OK);
                tbteano.Text       = "";
                tbteapwd.Text      = "";
                tbteaname.Text     = "";
                tbacademy.Text     = "";
                tbgroupnumber.Text = "";
                DataTable table = BLL.SelectTeabll();
                Teagridview.DataSource = table;
            }
            else
            {
                MessageBox.Show("导入失败", "提示", MessageBoxButtons.OKCancel);
            }
        }