private void cmbLopCu_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cmbLopCu.SelectedValue != null && cmbNamHocCu.SelectedValue != null && cmbKhoiLopCu.SelectedValue != null)
     {
         m_HocSinhCtrl.HienThiDsHocSinhTheoLop1(cmbNamHocCu.SelectedValue.ToString(), cmbLopCu.SelectedValue.ToString(), cmbHocKyCu.SelectedValue.ToString(), lVLopCu);
     }
 }
Ejemplo n.º 2
0
        private void btnHienThiDanhSachSD_Click(object sender, EventArgs e)
        {
            STT = new int[60, 20];

            if (cmbNamHocSD.SelectedValue != null && cmbLopSD.SelectedValue != null && cmbHocKySD.SelectedValue != null && cmbMonHocSD.SelectedValue != null)
            {
                m_HocSinhCtrl.HienThiDsHocSinhTheoLop1(dGVDiem, bindingNavigatorDiem, cmbNamHocSD.SelectedValue.ToString(), cmbLopSD.SelectedValue.ToString(), cmbHocKySD.SelectedValue.ToString(), cmbMonHocSD.SelectedValue.ToString());
            }

            int countRowHocSinh = 0;

            foreach (DataGridViewRow rowHocSinh in dGVDiem.Rows)
            {
                countRowHocSinh++;

                String[] diemMieng  = new String[100];
                String[] diem15Phut = new String[100];
                String[] diem45Phut = new String[100];
                String[] diem60Phut = new String[100];
                String[] diem70Phut = new String[100];
                String[] diem90Phut = new String[100];
                String[] diem       = new String[100];
                String   diemThi    = "";

                int soDiemMieng  = 0;
                int soDiem15Phut = 0;
                int soDiem45Phut = 0;
                int soDiem60Phut = 0;
                int soDiem70Phut = 0;
                int soDiem90Phut = 0;

                int sodiem = 0;

                DataTable m_DT = m_DiemData.LayDsDiem(rowHocSinh.Cells["colMaHocSinh"].Value.ToString(),
                                                      cmbMonHocSD.SelectedValue.ToString(),
                                                      cmbHocKySD.SelectedValue.ToString(),
                                                      cmbNamHocSD.SelectedValue.ToString(),
                                                      cmbLopSD.SelectedValue.ToString()
                                                      );


                int countRowDiem = 0;

                foreach (DataRow rowDiem in m_DT.Rows)
                {
                    countRowDiem++;
                    STT[countRowHocSinh, countRowDiem] = int.Parse(rowDiem["STT"].ToString());

                    if (rowDiem["MaLoaiKT"].ToString() == "LD001")
                    {
                        diem[sodiem++] = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem1"].Value = quyDinh.ArrayToString(diem, sodiem);
                    }
                    else if (rowDiem["MaLoaiKT"].ToString() == "LD002")
                    {
                        diem15Phut[soDiem15Phut++]         = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem2"].Value = quyDinh.ArrayToString(diem15Phut, soDiem15Phut);
                    }
                    else if (rowDiem["MaLoaiKT"].ToString() == "LD003")
                    {
                        diem45Phut[soDiem45Phut++]         = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem3"].Value = quyDinh.ArrayToString(diem45Phut, soDiem45Phut);
                    }
                    else if (rowDiem["MaLoaiKT"].ToString() == "LD004")
                    {
                        diem60Phut[soDiem60Phut++]         = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem4"].Value = quyDinh.ArrayToString(diem60Phut, soDiem60Phut);
                    }
                    else if (rowDiem["MaLoaiKT"].ToString() == "LD005")
                    {
                        diem70Phut[soDiem70Phut++]         = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem5"].Value = quyDinh.ArrayToString(diem70Phut, soDiem70Phut);
                    }
                    else if (rowDiem["MaLoaiKT"].ToString() == "LD006")
                    {
                        diem70Phut[soDiem90Phut++]         = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem6"].Value = quyDinh.ArrayToString(diem90Phut, soDiem90Phut);
                    }
                }
            }
        }