Beispiel #1
0
 public student_update(string student_num)
 {
     InitializeComponent();
     model.Student s = dao.studentDao.find_student(student_num);
     text11.Text = student_num;
     text12.Text = s.Student_name;
     text13.Text = s.Student_grade;
     text14.Text = s.Student_academy;
     text15.Text = s.Profession;
     text16.Text = s.Classs;
     text17.Text = s.Password;
     text18.Text = s.Id_number;
 }
Beispiel #2
0
        //录入成绩
        private void button1成绩_Click(object sender, EventArgs e)
        {
            string course = comboBox1成绩.Text;

            if (course == "")
            {
                MessageBox.Show("请选择需要录入的课程!");
            }
            else
            {
                dataGridView1成绩.Rows.Clear();
                //coursedao cdao = new coursedao();
                string[]            c    = course.Split(' ');
                string              cour = c[0];
                dao.resultDao       rdao = new dao.resultDao();
                List <model.Result> rs   = new List <model.Result>();

                rs = rdao.selectResult(cour);
                DataSet        ds   = new DataSet();
                DataTable      dt   = new DataTable("Table_New");
                dao.studentDao sdao = new dao.studentDao();
                Console.WriteLine("姚雅丽");
                dt.Columns.Add("学号", typeof(string));
                dt.Columns.Add("姓名", typeof(string));
                dt.Columns.Add("性别", typeof(string));

                dt.Columns.Add("类型", typeof(string));
                dt.Columns.Add("成绩", typeof(string));
                foreach (DataGridViewColumn co in dataGridView1成绩.Columns)
                {
                    if (co.Index != 4 && co.Index != 3)
                    {
                        co.ReadOnly = true;
                    }
                }
                foreach (model.Result r in rs)
                {
                    model.Student s = new model.Student();
                    s = sdao.selectNum(r.Student_num);
                    dataGridView1成绩.Rows.Add(r.Student_num, s.Student_name, s.Sex, "", "");
                }
            }
        }
Beispiel #3
0
        private void toolStripLabel1_Click(object sender, EventArgs e)
        {
            Console.Write("!!!!!!!!!!!!!!!!!!!!!!!!!");
            string tmp1 = toolStripComboBox1.Text;

            dao.shenheDao s = new shenheDao();
            model.Course  c = new Course();
            c = s.find_course(tmp1);
            Console.Write("lalalal" + c.Course_num);

            List <model.Result> l = new List <model.Result>();

            num = s.selectAll2(c.Course_num);

            Console.Write(num + "555555555555555555555");
            List <model.Result> rs = new List <model.Result>();

            rs = s.selectAll1(c.Course_num);
            Console.WriteLine(c.Course_num + "33333333333333333333333333");

            DataTable dt = new DataTable("Table_New");

            dt.Columns.Add("审核编码", typeof(string));
            dt.Columns.Add("课程编号", typeof(string));
            dt.Columns.Add("课程名称", typeof(string));
            dt.Columns.Add("学生学号", typeof(string));
            dt.Columns.Add("学生姓名", typeof(string));
            dt.Columns.Add("最大人数", typeof(int));
            dt.Columns.Add("状态", typeof(string));
            foreach (model.Result r1 in rs)
            {
                model.Student d = new model.Student();
                Console.Write(r1.Student_num + "111111111111111111");
                d = s.find_student(r1.Student_num);
                Console.Write("1111111111111111111");


                dt.Rows.Add(r1.Result_num, r1.Course_num, tmp1, d.Student_num, d.Student_name, c.Maxcount, r1.State);
            }
            dataGridView1.DataSource = dt;
        }