Ejemplo n.º 1
0
        public static Dictionary <int, QLMamNon.Dao.QLMamNonDs.LopRow> GetLopsByHocSinhIds(List <int> hocSinhIds, DateTime ngay)
        {
            Dictionary <int, QLMamNon.Dao.QLMamNonDs.HocSinhLopRow> hocSinhIdsToLopIds = GetHocSinhLopsByHocSinhIds(hocSinhIds, ngay);

            QLMamNon.Dao.QLMamNonDs.LopDataTable             lopTable             = StaticDataFacade.Get(StaticDataKeys.LopHoc) as QLMamNon.Dao.QLMamNonDs.LopDataTable;
            Dictionary <int, QLMamNon.Dao.QLMamNonDs.LopRow> hocSinhIdsToLopNames = new Dictionary <int, QLMamNon.Dao.QLMamNonDs.LopRow>();

            if (ListUtil.IsEmpty(hocSinhIdsToLopIds))
            {
                return(hocSinhIdsToLopNames);
            }

            foreach (KeyValuePair <int, QLMamNon.Dao.QLMamNonDs.HocSinhLopRow> pair in hocSinhIdsToLopIds)
            {
                if (pair.Value == null)
                {
                    continue;
                }

                QLMamNon.Dao.QLMamNonDs.LopRow[] rows = lopTable.Select(String.Format("LopId={0}", pair.Value.LopId)) as QLMamNon.Dao.QLMamNonDs.LopRow[];

                if (!ArrayUtil.IsEmpty(rows) && !hocSinhIdsToLopNames.ContainsKey(pair.Key))
                {
                    hocSinhIdsToLopNames.Add(pair.Key, rows[0]);
                }
            }

            return(hocSinhIdsToLopNames);
        }
Ejemplo n.º 2
0
        private void loadLopData()
        {
            QLMamNon.Dao.QLMamNonDs.LopDataTable dataTable = this.lopTableAdapter.GetData();

            foreach (QLMamNon.Dao.QLMamNonDs.LopRow row in dataTable)
            {
                int?khoiId = StaticDataUtil.GetKhoiIdByLopId(this.lopKhoiTableAdapter, row.LopId);
                if (khoiId.HasValue)
                {
                    row.KhoiId = khoiId.Value;
                }
            }

            this.lopRowBindingSource.DataSource = dataTable;
        }
Ejemplo n.º 3
0
        public static string GetLopNameByLopId(Int32 lopId)
        {
            if (lopId < 0)
            {
                return(CommonConstant.EMPTY);
            }

            QLMamNon.Dao.QLMamNonDs.LopDataTable lopTable = StaticDataFacade.Get(StaticDataKeys.LopHoc) as QLMamNon.Dao.QLMamNonDs.LopDataTable;
            QLMamNon.Dao.QLMamNonDs.LopRow       lopRow   = lopTable.FindByLopId(lopId);

            if (lopRow != null)
            {
                return(lopRow.Name);
            }

            return(CommonConstant.EMPTY);
        }