コード例 #1
0
        // 取得畢修業狀態
        private void getGRDocNoToDG()
        {
            dgGraduateDocNoData.Rows.Clear();

            StudDiplomaInfoJuniorDiplomaNumberList = DALTransfer.GetStudentDiplomaInfoJuniorDiplomaNumberListByGradeYear(cboGradeYear.Text);
            StudDiplomaInfoJuniorDiplomaNumberList.Sort(new Comparison <StudDiplomaInfoJuniorDiplomaNumber>(StudentNumberCompare));

            // 填入 DataGridView
            int dgRowIdx = 0, hasGDDocNoCount = 0, GraduateCount = 0, NGraduateCount = 0;

            foreach (StudDiplomaInfoJuniorDiplomaNumber sdij in StudDiplomaInfoJuniorDiplomaNumberList)
            {
                dgGraduateDocNoData.Rows.Add();
                dgGraduateDocNoData.Rows[dgRowIdx].Cells[0].Value = sdij.StudentID;
                dgGraduateDocNoData.Rows[dgRowIdx].Cells[1].Value = sdij.ClassName;
                dgGraduateDocNoData.Rows[dgRowIdx].Cells[2].Value = sdij.SeatNo;
                dgGraduateDocNoData.Rows[dgRowIdx].Cells[3].Value = sdij.StudentNumber;
                dgGraduateDocNoData.Rows[dgRowIdx].Cells[4].Value = sdij.Name;
                dgGraduateDocNoData.Rows[dgRowIdx].Cells[5].Value = sdij.GRStatus;
                if (!string.IsNullOrEmpty(sdij.GRDocNo) && sdij.GRStatus == "畢業")
                {
                    GraduateCount++;
                }
                if (!string.IsNullOrEmpty(sdij.GRDocNo) && sdij.GRStatus == "修業")
                {
                    NGraduateCount++;
                }

                if (!string.IsNullOrEmpty(sdij.GRDocNo))
                {
                    hasGDDocNoCount++;
                }
                dgGraduateDocNoData.Rows[dgRowIdx].Cells[6].Value = sdij.GRDocNo;
                dgRowIdx++;
            }
            lblTotalCount.Text       = "總共" + dgRowIdx + "人, 畢業: " + GraduateCount + "人,修業: " + NGraduateCount + "人";
            lblHasGraduateCount.Text = "有畢修業證書字號有 " + hasGDDocNoCount + "人";

            // set column readnoly and width
            dgGraduateDocNoData.Columns[0].Visible = false;
            dgGraduateDocNoData.Columns[1].Width   = 80;
            dgGraduateDocNoData.Columns[2].Width   = 40;
            dgGraduateDocNoData.Columns[3].Width   = 80;
            dgGraduateDocNoData.Columns[4].Width   = 80;
            dgGraduateDocNoData.Columns[5].Width   = 40;
            dgGraduateDocNoData.Columns[6].Width   = 160;
        }
コード例 #2
0
 void bw_DoWork(object sender, DoWorkEventArgs e)
 {
     DALTransfer.SetStudentDiplomaInfoJuniorDiplomaNumberList(StudDiplomaInfoJuniorDiplomaNumberList);
 }