private void DocKeHoachChiTiet(long IDXL_Tuan) { oBKeHoachChiTiet = new cBXL_KeHoachChiTiet(); DataTable dt = oBKeHoachChiTiet.Get_SuKienTKB(IDXL_Tuan); sks = new SuKienTKB(); DataRow[] arrDr; string IDDM_Lop = ""; int SoTiet, IDXL_MonHocTrongKy, count; List <CHIA_TIET> lst; XL_SuKienTKBInfo sk = new XL_SuKienTKBInfo(true), skClone; for (int i = 0; i < dt.Rows.Count; i++) { IDXL_MonHocTrongKy = 0; count = 0; if (dt.Rows[i]["IDDM_Lop"].ToString() != IDDM_Lop) { IDDM_Lop = dt.Rows[i]["IDDM_Lop"].ToString(); arrDr = dt.Select("IDDM_Lop = " + IDDM_Lop); SoTiet = int.Parse(dt.Compute("Sum(SoTiet)", "IDDM_Lop = " + IDDM_Lop).ToString()); lst = lstChiaTiet32(arrDr, SoTiet); foreach (CHIA_TIET pChiaTiet in lst) { if (pChiaTiet.IDXL_MonHocTrongKy != IDXL_MonHocTrongKy) { sk = new XL_SuKienTKBInfo(true); GanSuKien(sk, arrDr[count]); sk.SoTiet = pChiaTiet.SoTiet; IDXL_MonHocTrongKy = pChiaTiet.IDXL_MonHocTrongKy; count++; } else { skClone = sk.Clone(); skClone.SoTiet = pChiaTiet.SoTiet; skClone.Idx = sks.Count; sks.Add(skClone); } } i += count - 1; } //XL_SuKienTKBInfo sk = new XL_SuKienTKBInfo(true); //GanSuKien(sk, dr); //ChiaSuKien(sk); } }
public SchoolEngine(int IDNamHoc, long _IDTuan, cBDM_PhongHoc arrPhongHoc, cBNS_GiaoVien arrGiaoVien, cBDM_Lop arrLop, SuKienTKB arrSuKien, SuKienKhacTKB mSk_lp, SuKienKhacTKB mSk_gv, HT_ThamSoXepLichInfo pThamSoTKB, int[] _arrNhomTiet) { intIDTuan = _IDTuan; sks = arrSuKien; lps = arrLop; gvs = arrGiaoVien; phs = arrPhongHoc; sk_lp = mSk_lp; sk_gv = mSk_gv; objThamSoTKB = pThamSoTKB; arrNhomTiet = _arrNhomTiet; if (arrNhomTiet.Length > 1) { if (arrNhomTiet[0] != arrNhomTiet[1]) { IsTietNhomKhacNhau = true; } } }
private void DocSuKien(long IDTuan) { oBSuKienTKB = new cBXL_SuKienTKB(); DataTable dt = oBSuKienTKB.Get_TKB(IDTuan); sks = new SuKienTKB(); foreach (DataRow dr in dt.Rows) { if (long.Parse(dr["XL_SuKienTKBID"].ToString()) > 0) { XL_SuKienTKBInfo sk = new XL_SuKienTKBInfo(true); sk.XL_SuKienTKBID = long.Parse(dr["XL_SuKienTKBID"].ToString()); GanSuKien(sk, dr); } else { XL_SuKienTKBInfo sk = new XL_SuKienTKBInfo(true); GanSuKien(sk, dr); ChiaSuKien(sk); } } FillData(); }