//根据班级查询 private void cboClass_SelectedIndexChanged(object sender, EventArgs e) { //显示考试成绩 this.dgvScoreList.AutoGenerateColumns = false; this.dgvScoreList.DataSource = objScoreListService.GetScoreList1(this.cboClass.Text.Trim()); new Common.DataGridViewStyle().DgvStyle3(this.dgvScoreList); this.gbStat.Text = "[" + this.cboClass.Text.Trim() + "]考试成绩统计"; Dictionary <string, string> dic = objScoreListService.GetScoreListByClassId(this.cboClass.SelectedValue.ToString()); lblAttendCount.Text = dic["stuCount"]; lblCount.Text = dic["absentCount"]; lblCSharpAvg.Text = dic["avgCSharp"]; lblDBAvg.Text = dic["avgDB"]; //缺口人员 List <string> list = objScoreListService.GetAsentListByClassId(this.cboClass.SelectedValue.ToString()); this.lblList.Items.Clear(); if (list.Count == 0) { this.lblList.Items.Add("没有缺考人员!"); } else { this.lblList.Items.AddRange(list.ToArray()); } }