示例#1
0
        private void button3_Click(object sender, EventArgs e)//第一轮加载界面
        {
            ad_ServicesBLL servicesBLL = new ad_ServicesBLL();

            studataGridView.DataSource = servicesBLL.stuGetmatchdata();
            teadataGridView.DataSource = servicesBLL.teaGetmatchdata();
        }
示例#2
0
        private void button4_Click(object sender, EventArgs e)//重置结果
        {
            string         deletesql = "truncate table result";
            string         searchsql = "select * from result";
            ad_ServicesBLL bLL       = new ad_ServicesBLL();

            if (bLL.SearchRs(searchsql))
            {
                int i = bLL.Tuncast_TBrs(deletesql);
                if (i == -1)
                {
                    button2_Click(sender, e);
                    MessageBox.Show("重置成功", "提示");
                }
                else
                {
                    MessageBox.Show("重置失败", "提示");
                }
            }
            else
            {
                button2_Click(sender, e);
                MessageBox.Show("请先提交数据", "提示");
            }
        }
示例#3
0
        private void btmatch_Click(object sender, EventArgs e)//第一轮一键匹配
        {
            ad_ServicesBLL bLL = new ad_ServicesBLL();
            DialogResult   dr  = MessageBox.Show(bLL.match(), "提示", MessageBoxButtons.OKCancel);

            if (dr == DialogResult.OK)
            {
                ViewResults cform = new ViewResults(); //实例化一个子窗口
                                                       //设置子窗口不显示为顶级窗口
                cform.TopLevel = false;
                //设置子窗口的样式,没有上面的标题栏
                cform.FormBorderStyle = FormBorderStyle.None;
                //填充
                cform.Dock = DockStyle.Fill;
                //清空控件
                this.Controls.Clear();
                //加入控件
                this.Controls.Add(cform);
                //让窗体显示
                cform.Show();
                //跳转页面
            }
            else
            {
                //
            }
            //获取学生的对象数组
            sx_student[] sx_Students = new sx_student[50];
            sx_Students = Keepinformation.sx_Students;
            //获取教师的对象数组
            sx_teacher[] sx_Teachers = new sx_teacher[20];
            sx_Teachers = Keepinformation.sx_Teachers;
        }
示例#4
0
        private void button6_Click(object sender, EventArgs e)//确认修改
        {
            StudentData studentData = new StudentData();

            studentData.StuNo      = textBox2.Text;
            studentData.StuPwd     = textBox3.Text;
            studentData.StuName    = textBox4.Text;
            studentData.StuNianji  = textBox5.Text;
            studentData.Academy    = textBox6.Text;
            studentData.Profession = textBox7.Text;
            studentData.StuClass   = Convert.ToInt32(textBox8.Text);
            studentData.Grade      = Convert.ToInt32(textBox9.Text);

            ad_ServicesBLL BLL = new ad_ServicesBLL();

            if (BLL.UpdateStudatabll(studentData) > 0)
            {
                MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK);
                textBox2.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                textBox5.Text = "2016";
                textBox6.Text = "";
                textBox7.Text = "";
                textBox8.Text = "";
                textBox9.Text = "";
                DataTable table = BLL.SelectStubll();
                dataGridView1.DataSource = table;
            }
            else
            {
                MessageBox.Show("更新失败", "提示", MessageBoxButtons.OKCancel);
            }
        }
示例#5
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);
            }
        }
示例#6
0
        private void button2_Click(object sender, EventArgs e)//第二轮重新加载界面
        {
            ad_ServicesBLL servicesBLL = new ad_ServicesBLL();

            dataGridView2.DataSource = servicesBLL.ST_GetStuMatchtable();
            dataGridView1.DataSource = servicesBLL.ST_GetTeaMatchtable();
        }
示例#7
0
        private void btcommit_Click(object sender, EventArgs e)//确认提交
        {
            ManageData manageData = new ManageData();

            manageData.AdminNo1             = Keepinformation.AdminNo;
            manageData.StartTime            = Convert.ToDateTime(dtptimestart.Text);
            manageData.EndTime              = Convert.ToDateTime(dtptimeend.Text);
            manageData.VolunteerFirstShare  = Convert.ToDouble(tbvolunteer1.Text.Trim());
            manageData.VolunteerSecondShare = Convert.ToDouble(tbvolunteer2.Text.Trim());
            manageData.VolunteerThirdShare  = Convert.ToDouble(tbvolunteer3.Text.Trim());
            manageData.Grade = Convert.ToDouble(tbscore.Text.Trim());
            //Console.WriteLine(manageData.StartTime);
            //OUTPUT:2020/4/6 00:00  默认时间是00:00
            ad_ServicesBLL bLL = new ad_ServicesBLL();

            if (bLL.Setparambll(manageData) == 1)
            {
                MessageBox.Show("设置成功", "提示", MessageBoxButtons.OK);
                change_enable(false);
            }
            else
            {
                MessageBox.Show("设置失败", "提示", MessageBoxButtons.OK);
            }
        }
示例#8
0
        private void StudentList_Load(object sender, EventArgs e)
        {
            ad_ServicesBLL BLL          = new ad_ServicesBLL();
            DataTable      studentTable = BLL.SelectStubll();

            dataGridView1.DataSource = studentTable;
            textBox5.Text            = "2016";
        }
示例#9
0
        private void button2_Click(object sender, EventArgs e)//加载全部结果页面
        {
            dataGridView1.DataSource = null;
            //加载全部匹配结果
            ad_ServicesBLL servicesBLL = new ad_ServicesBLL();

            dataGridView2.DataSource = servicesBLL.SelectFromResuit();
        }
示例#10
0
        private void Matching_Load(object sender, EventArgs e)//加载
        {
            tabControl1.TabPages[0].Text = "第一轮双选匹配";
            tabControl1.TabPages[1].Text = "第二轮双选匹配";
            ad_ServicesBLL servicesBLL = new ad_ServicesBLL();

            studataGridView.DataSource = servicesBLL.stuGetmatchdata();
            teadataGridView.DataSource = servicesBLL.teaGetmatchdata();
        }
示例#11
0
        private void button3_Click(object sender, EventArgs e)//提交结果
        {
            DataTable dataTable = new DataTable();

            dataTable = (DataTable)this.dataGridView1.DataSource;//获取datagridview的数据
            ad_ServicesBLL bLL = new ad_ServicesBLL();

            bLL.InsertToResult(dataTable);
            button2_Click(sender, e);
            bLL.Tuncast_TBrs("truncate table teavolheng2");
        }
示例#12
0
        private void button1_Click(object sender, EventArgs e)//导入
        {
            OpenFileDialog open = new OpenFileDialog();

            open.Title  = "请选择要导入的Excel文件";
            open.Filter = "XLSX 工作表 (*.xlsx)|*.xlsx|Excel表(*.xls)|*.xls";
            if (open.ShowDialog() == DialogResult.OK)
            {
                string fileName = open.FileName;
                textBox1.Text = fileName;
                ad_ServicesBLL bLL       = new ad_ServicesBLL();
                DataTable      dataTable = bLL.importToExcel(fileName);
                bLL.DataTableToTeaSQLServerbll(dataTable);
                Teagridview.DataSource = dataTable;
            }
        }
示例#13
0
        private void button7_Click_1(object sender, EventArgs e)//删除
        {
            string         id  = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value.ToString();
            ad_ServicesBLL bLL = new ad_ServicesBLL();

            if (bLL.RemoveStudata(id))
            {
                MessageBox.Show("删除成功", "提示", MessageBoxButtons.OK);
                ad_ServicesBLL BLL   = new ad_ServicesBLL();
                DataTable      table = BLL.SelectStubll();
                dataGridView1.DataSource = table;
            }
            else
            {
                MessageBox.Show("删除失败", "提示", MessageBoxButtons.OK);
            }
        }
示例#14
0
        private void button5_Click(object sender, EventArgs e)//删除
        {
            string         teano = Teagridview.Rows[Teagridview.CurrentRow.Index].Cells[0].Value.ToString();
            ad_ServicesBLL bLL   = new ad_ServicesBLL();

            if (bLL.RemoveTeadata(teano))
            {
                MessageBox.Show("删除成功", "提示", MessageBoxButtons.OK);
                ad_ServicesBLL BLL   = new ad_ServicesBLL();
                DataTable      table = BLL.SelectTeabll();
                Teagridview.DataSource = table;
            }
            else
            {
                MessageBox.Show("删除失败", "提示", MessageBoxButtons.OK);
            }
        }
示例#15
0
        private void button1_Click(object sender, EventArgs e)//浏览
        {
            OpenFileDialog open = new OpenFileDialog();

            open.Title  = "请选择要导入的Excel文件";
            open.Filter = "XLSX 工作表 (*.xlsx)|*.xlsx|Excel表(*.xls)|*.xls";
            if (open.ShowDialog() == DialogResult.OK)
            {
                string fileName = open.FileName;
                textBox1.Text = fileName;
                ad_ServicesBLL bLL = new ad_ServicesBLL();
                //  string sql = "select * from Student";
                DataTable dataTable = bLL.importToExcel(fileName);
                bLL.DataTableToStuSQLServerbll(dataTable);
                dataGridView1.DataSource = bLL.importToExcel(fileName);
            }
        }
示例#16
0
        private void Setting_Load(object sender, EventArgs e)
        {
            ad_ServicesBLL bLL = new ad_ServicesBLL();

            if (bLL.SelectManagebll(Keepinformation.AdminNo) == 1)
            {
                change_enable(false);
                dtptimestart.Value = Keepinformation.StartTime;
                dtptimeend.Value   = Keepinformation.EndTime;
                tbvolunteer1.Text  = Keepinformation.VolunteerFirstShare;
                tbvolunteer2.Text  = Keepinformation.VolunteerSecondShare;
                tbvolunteer3.Text  = Keepinformation.VolunteerThirdShare;
                tbscore.Text       = Keepinformation.Grade;
            }
            else
            {
                change_enable(true);
            }
        }
示例#17
0
        private void button1_Click(object sender, EventArgs e)//确认修改
        {
            AdminData adminData = new AdminData();

            adminData.AdminTitle = tbadmintitle.Text.Trim();
            adminData.AdminEmail = tbminemail.Text.Trim();
            adminData.AdminPwd   = tbnewpwd.Text.Trim();
            adminData.AdminNo    = Keepinformation.AdminNo;
            adminData.AdminName  = Keepinformation.AdminName;
            ad_ServicesBLL bLL = new ad_ServicesBLL();

            if (bLL.Updataadmbll(adminData) == 1)
            {
                MessageBox.Show("修改成功", "提示", MessageBoxButtons.OK);
                tbnewpwd.Text = "";
            }
            else
            {
                MessageBox.Show("修改失败", "提示", MessageBoxButtons.OK);
            }
        }
示例#18
0
        private void button5_Click(object sender, EventArgs e)//添加单个信息
        {
            ad_ServicesBLL BLL         = new ad_ServicesBLL();
            StudentData    studentData = new StudentData();

            studentData.StuNo      = textBox2.Text;
            studentData.StuPwd     = textBox3.Text;
            studentData.StuName    = textBox4.Text;
            studentData.StuNianji  = textBox5.Text;
            studentData.Academy    = textBox6.Text;
            studentData.Profession = textBox6.Text;
            studentData.StuClass   = Convert.ToInt32(textBox8.Text);
            studentData.Grade      = Convert.ToInt32(textBox9.Text);
            //if (BLL.Check(studentData.StuNo))//true代表数据库中已有该值
            //{
            //    MessageBox.Show("该学号已存在,不可重复录入", "警示", MessageBoxButtons.OK);
            //}
            //else
            //{
            if (BLL.InsertStubll(studentData))
            {
                MessageBox.Show("导入成功", "提示", MessageBoxButtons.OK);
                textBox2.Text = "";
                textBox3.Text = "";
                textBox4.Text = "";
                textBox5.Text = "";
                textBox6.Text = "";
                textBox7.Text = "";
                textBox8.Text = "";
                textBox9.Text = "";
                DataTable table = BLL.SelectStubll();
                dataGridView1.DataSource = table;
            }
            else
            {
                MessageBox.Show("导入失败", "提示", MessageBoxButtons.OKCancel);
            }
            //}
        }
示例#19
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ad_ServicesBLL bLL = new ad_ServicesBLL();

            Teagridview.DataSource = bLL.SelectTeabll();
        }
示例#20
0
        private void button1_Click(object sender, EventArgs e)//第二轮一键匹配
        {
            ad_ServicesBLL bLL = new ad_ServicesBLL();

            MessageBox.Show(bLL.MatchSecondtime(), "提示");
        }