private void cmbLopCu_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cmbLopCu.SelectedValue != null && cmbNamHocCu.SelectedValue != null && cmbKhoiLopCu.SelectedValue != null)
     {
         m_HocSinhCtrl.HienThiDsHocSinhTheoLop(cmbNamHocCu.SelectedValue.ToString(), cmbKhoiLopCu.SelectedValue.ToString(), cmbLopCu.SelectedValue.ToString(), lVLopCu);
     }
 }
Пример #2
0
 private void btnHienThiDanhSach_Click(object sender, EventArgs e)
 {
     if (cmbNamHoc.SelectedValue != null && cmbLop.SelectedValue != null && cmbHocKy.SelectedValue != null && cmbMonHoc.SelectedValue != null)
     {
         m_HocSinhCtrl.HienThiDsHocSinhTheoLop(dGVDiem, bindingNavigatorDiem, cmbNamHoc.SelectedValue.ToString(), cmbLop.SelectedValue.ToString());
     }
 }
        private void btnHienThiDanhSach_Click(object sender, EventArgs e)
        {
            if (cmbHocKy.SelectedValue == null)
            {
                MessageBoxEx.Show("Bạn chưa chọn học kỳ!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (cmbLop.SelectedValue == null)
            {
                MessageBoxEx.Show("Bạn chưa chọn lớp!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (cmbMonHoc.SelectedValue == null)
            {
                MessageBoxEx.Show("Bạn chưa chọn môn học!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (cmbLoaiDiem.SelectedValue == null)
            {
                MessageBoxEx.Show("Môn " + cmbMonHoc.Text + " ở lớp " + cmbLop.Text + " chưa nhập điểm!", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            STT = new int[60, 20];
            if (cmbNamHoc.SelectedValue != null && cmbLop.SelectedValue != null && cmbHocKy.SelectedValue != null && cmbMonHoc.SelectedValue != null)
            {
                m_HocSinhCtrl.HienThiDsHocSinhTheoLop(dGVDiem, bindingNavigatorDiem, cmbNamHoc.SelectedValue.ToString(), cmbLop.SelectedValue.ToString(), cmbHocKy.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.LayDsDiemCN(rowHocSinh.Cells["colMaHocSinh"].Value.ToString(),
                                                        cmbMonHoc.SelectedValue.ToString(),
                                                        cmbHocKy.SelectedValue.ToString(),
                                                        cmbNamHoc.SelectedValue.ToString(),
                                                        cmbLop.SelectedValue.ToString(),
                                                        cmbLoaiDiem.SelectedValue.ToString()
                                                        );


                int countRowDiem = 0;

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

                    if (cmbLoaiDiem.SelectedValue.ToString() == "LD001")
                    {
                        diem[sodiem++] = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem"].Value = quyDinh.ArrayToString(diem, sodiem);
                    }
                    else if (cmbLoaiDiem.SelectedValue.ToString() == "LD002")
                    {
                        diem15Phut[soDiem15Phut++]        = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem"].Value = quyDinh.ArrayToString(diem15Phut, soDiem15Phut);
                    }
                    else if (cmbLoaiDiem.SelectedValue.ToString() == "LD003")
                    {
                        diem45Phut[soDiem45Phut++]        = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem"].Value = quyDinh.ArrayToString(diem45Phut, soDiem45Phut);
                    }
                    else if (cmbLoaiDiem.SelectedValue.ToString() == "LD004")
                    {
                        diem60Phut[soDiem60Phut++]        = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem"].Value = quyDinh.ArrayToString(diem60Phut, soDiem60Phut);
                    }
                    else if (cmbLoaiDiem.SelectedValue.ToString() == "LD005")
                    {
                        diem70Phut[soDiem70Phut++]        = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem"].Value = quyDinh.ArrayToString(diem70Phut, soDiem70Phut);
                    }
                    else if (cmbLoaiDiem.SelectedValue.ToString() == "LD006")
                    {
                        diem70Phut[soDiem90Phut++]        = rowDiem["Diem"].ToString();
                        rowHocSinh.Cells["colDiem"].Value = quyDinh.ArrayToString(diem90Phut, soDiem90Phut);
                    }
                }
            }
        }
 private void button1_Click(object sender, EventArgs e)
 {
     m_HocSinhCtrl.HienThiDsHocSinhTheoLop(cmbNamHocCu.SelectedValue.ToString(), cmbKhoiLopCu.SelectedValue.ToString(), cmbLopCu.SelectedValue.ToString(), lVLopCu);
 }