コード例 #1
0
        private void btnChuyenLop_Click(object sender, EventArgs e)
        {
            OldMaLop = Convert.ToInt32(cbOldLopHoc.SelectedValue.ToString());
            OldMaNH  = Convert.ToInt32(cbOldNamHoc.SelectedValue.ToString());
            MaLop    = Convert.ToInt32(cboLopHoc.SelectedValue.ToString());
            MaNH     = Convert.ToInt32(cboNamHoc.SelectedValue.ToString());
            foreach (int item in lMaHS)

            {
                busChuyenLop.ChuyenLop(item, OldMaLop, OldMaNH, MaLop, MaNH);
            }
            dgvDSLop.DataSource    = busChuyenLop.getDSLop(OldMaNH, OldMaLop);
            dgvDSLopMoi.DataSource = busChuyenLop2.getDSLop(MaNH, MaLop);
            List <DTO_MonHoc> lMonHoc = new List <DTO_MonHoc>();

            lMonHoc = busMonHoc.bgetlistMonHoc();
            List <int> lMaMH = new List <int>();

            for (int i = 0; i < lMonHoc.Count; i++)
            {
                lMaMH.Add(lMonHoc[i].MaMH);
            }
            foreach (int item in lMaMH)
            {
                foreach (int i in lMaHS)
                {
                    busChuyenLop.insertdataDTBMon(i, OldMaLop, OldMaNH, MaLop, MaNH, item);
                }
            }

            lMaHS.Clear();
            lMaMH.Clear();
            lMonHoc.Clear();
        }
コード例 #2
0
 private void btnChuyenLop_Click(object sender, EventArgs e)
 {
     OldMaLop = Convert.ToInt32(cbOldLopHoc.SelectedValue.ToString());
     OldMaNH  = Convert.ToInt32(cbOldNamHoc.SelectedValue.ToString());
     MaLop    = Convert.ToInt32(cboLopHoc.SelectedValue.ToString());
     MaNH     = Convert.ToInt32(cboNamHoc.SelectedValue.ToString());
     if (((MaLop / 10) != (OldMaLop / 10)) && MaNH == OldMaNH)
     {
         MessageBox.Show("Không thể chuyển lên lớp khi chưa hết năm học");
     }
     else
     {
         int        temp   = 0;
         List <int> temps1 = new List <int>();
         foreach (int item in lMaHS)
         {
             if (busChuyenLop.CheckSiSo(SiSo, MaLop, MaNH) == true)
             {
                 busChuyenLop.ChuyenLop(item, OldMaLop, OldMaNH, MaLop, MaNH);
                 temp++;
                 temps1.Add(item);
             }
         }
         if (temp < lMaHS.Count)
         {
             MessageBox.Show("Sĩ số lớp đã tối đa (" + SiSo + "). Không thể thêm " + (lMaHS.Count - temp) + " học sinh!");
         }
         dgvDSLop.DataSource    = busChuyenLop.getDSLop(OldMaNH, OldMaLop);
         dgvDSLopMoi.DataSource = busChuyenLop2.getDSLop(MaNH, MaLop);
         List <DTO_MonHoc> lMonHoc = new List <DTO_MonHoc>();
         lMonHoc = busMonHoc.bgetlistMonHoc();
         List <int> lMaMH = new List <int>();
         for (int i = 0; i < lMonHoc.Count; i++)
         {
             lMaMH.Add(lMonHoc[i].MaMH);
         }
         foreach (int item in lMaMH)
         {
             foreach (int i in temps1)
             {
                 busChuyenLop.insertdataDTBMon(i, OldMaLop, OldMaNH, MaLop, MaNH, item);
             }
         }
         foreach (int i in temps1)
         {
             busChuyenLop.updateDTBChung(i, OldMaLop, OldMaNH, MaLop, MaNH);
         }
         lMaHS.Clear();
         lMaMH.Clear();
         lMonHoc.Clear();
         temps1.Clear();
     }
 }
コード例 #3
0
        private void btnChuyenLop_Click_1(object sender, EventArgs e)
        {
            MaNH  = Convert.ToInt32(cboNamHoc.SelectedValue);
            MaLop = Convert.ToInt32(cboLop.SelectedValue);
            foreach (int item in listmaHS)
            {
                busTaoLop.ChuyenLop(item, MaLop, MaNH);
            }
            DSLopCoSan.DataSource  = busLopCoSan.getLopHocCoSan(MaNH, MaLop);
            HSChuaCoLop.DataSource = busTaoLop.getDSLop();
            //insert data vao bang DTB

            lMonHoc = busMonHoc.bgetlistMonHoc();

            for (int i = 0; i < lMonHoc.Count; i++)
            {
                lMaMH.Add(lMonHoc[i].MaMH);
            }
            foreach (int item in lMaMH)
            {
                busTaoLop.InsertBaoCao(MaNH, MaLop, item);
                foreach (int i in listmaHS)
                {
                    busTaoLop.InsertDataDiemTBMon(MaNH, MaLop, item, i);
                }
            }
            foreach (int i in listmaHS)
            {
                busTaoLop.InsertDiemTBChung(MaNH, MaLop, i);
            }
            busTaoLop.InsertBaoCaoChung(MaNH, MaLop);
            listmaHS.Clear();
            lMonHoc.Clear();
            lMaMH.Clear();
        }
コード例 #4
0
 void HienThiTrongCombobox()
 {
     lNamHoc = busNamHoc.bgetListNamHoc();
     cboNamHoc.DataSource    = lNamHoc;
     cboNamHoc.DisplayMember = "tennh";
     cboNamHoc.ValueMember   = "manh";
     lMonHoc = busMonHoc.bgetlistMonHoc();
     cboMonHoc.DataSource    = lMonHoc;
     cboMonHoc.DisplayMember = "tenmh";
     cboMonHoc.ValueMember   = "mamh";
 }
コード例 #5
0
 void HienThiTrongCombobox()
 {
     lNamHoc                = busNamHoc.bgetListNamHoc();
     cbNamHoc.DataSource    = lNamHoc;
     cbNamHoc.DisplayMember = "tennh";
     cbNamHoc.ValueMember   = "manh";
     lLopHoc                = busLopHoc.bgetlistLopHoc();
     cbLop.DataSource       = lLopHoc;
     cbLop.DisplayMember    = "tenlop";
     cbLop.ValueMember      = "malop";
     lMonHoc                = busMonHoc.bgetlistMonHoc();
     cbMon.DataSource       = lMonHoc;
     cbMon.DisplayMember    = "tenmh";
     cbMon.ValueMember      = "mamh";
 }
コード例 #6
0
        private void btnChuyenLop_Click_1(object sender, EventArgs e)
        {
            MaNH  = Convert.ToInt32(cboNamHoc.SelectedValue);
            MaLop = Convert.ToInt32(cboLop.SelectedValue);
            int        temp  = 0;
            List <int> temps = new List <int>();

            foreach (int item in listmaHS)
            {
                if (busTaoLop.CheckSiSo(SiSo, MaLop, MaNH) == true)
                {
                    busTaoLop.ChuyenLop(item, MaLop, MaNH);
                    temp++;
                    temps.Add(item);
                }
            }
            if (temp < listmaHS.Count)
            {
                MessageBox.Show("Sĩ số lớp đã tối đa (" + SiSo + "). Không thể thêm " + (listmaHS.Count - temp) + " học sinh!");
            }
            DSLopCoSan.DataSource  = busLopCoSan.getLopHocCoSan(MaNH, MaLop);
            HSChuaCoLop.DataSource = busTaoLop.getDSLop();
            //insert data vao bang DTB

            lMonHoc = busMonHoc.bgetlistMonHoc();

            for (int i = 0; i < lMonHoc.Count; i++)
            {
                lMaMH.Add(lMonHoc[i].MaMH);
            }
            foreach (int item in lMaMH)
            {
                busTaoLop.InsertBaoCao(MaNH, MaLop, item);
                foreach (int i in listmaHS)
                {
                    busTaoLop.InsertDataDiemTBMon(MaNH, MaLop, item, i);
                }
            }
            foreach (int i in temps)
            {
                busTaoLop.InsertDiemTBChung(MaNH, MaLop, i);
            }
            busTaoLop.InsertBaoCaoChung(MaNH, MaLop);
            listmaHS.Clear();
            lMonHoc.Clear();
            lMaMH.Clear();
            temps.Clear();
        }