Beispiel #1
0
 private void FormCheckscore_Load(object sender, EventArgs e)
 {
     cbbClass.SelectedIndex    = 0;
     cbbSemester.SelectedIndex = 0;
     cbbClass.SelectedIndex    = 0;
     if (FormMain.Power == "学生")
     {
         Text                   = "当前学生编号:" + FormMain.User;
         cbbClass.Enabled       = false;
         cbbstudent.Enabled     = false;
         cbbstudent.Text        = FormMain.User;
         dataGridView1.ReadOnly = true;
         string sqlstr1 = "select * from Coures where Cour_Semester='" + cbbSemester.SelectedItem.ToString() + "'";
         operate.BindDropdownlist(sqlstr1, cbbCourse, 1);//绑定下拉列表(课程)
         cbbCourse.SelectedIndex = -1;
     }
     else
     {
         if (FormMain.Power == "教师")
         {
             Text = "当前教师编号:" + FormMain.User;
         }
         string StuId = dataGridView1.SelectedCells[1].Value.ToString(); //得到编号(学生或者教师编号)
         operate.StuGet_Image(StuId, pictureBox1);                       //显示图片信息
         this.dataGridView1.Columns[1].FillWeight = 120;
         string str1 = "select stu_name  from Student";
         operate.BindDropdownlist(str1, cbbstudent, 0);
         cbbCourse.SelectedIndex = -1;
     }
 }