Exemple #1
0
        /// <summary>
        /// 得到一个实体
        /// </summary>
        /// <param name="className">类名称</param>
        /// <returns>En</returns>
        public static Entity GetEn(string className)
        {
            if (Htable_En == null)
            {
                Htable_En = new Hashtable();
                string    cl = "BP.En.EnObj";
                ArrayList al = ClassFactory.GetObjects(cl);
                foreach (Entity en in al)
                {
                    if (en.ToString() == "" || en.ToString() == null)
                    {
                        continue;
                    }
                    Htable_En.Add(en.ToString(), en);
                }
            }
            object tmp = Htable_En[className];

            return(tmp as Entity);
        }
Exemple #2
0
        /// <summary>
        /// 得到一个实体
        /// </summary>
        /// <param name="className">类名称</param>
        /// <returns>En</returns>
        public static Entities GetEns(string className)
        {
            if (className.Contains(".") == false)
            {
                GEEntitys myens = new GEEntitys(className);
                return(myens);
            }

            if (Htable_Ens == null || Htable_Ens.Count == 0)
            {
                Htable_Ens = new Hashtable();
                string    cl = "BP.En.Entities";
                ArrayList al = ClassFactory.GetObjects(cl);

                Htable_Ens.Clear();
                foreach (Entities en in al)
                {
                    if (en.ToString() == null)
                    {
                        continue;
                    }

                    try
                    {
                        Htable_Ens.Add(en.ToString(), en);
                    }
                    catch
                    {
                    }
                }
            }

            Entities ens = Htable_Ens[className] as Entities;

#warning 会清除 cash 中的数据。
            //if (ens != null)
            //    ens.Clear();
            return(ens);
        }
Exemple #3
0
 /// <summary>
 /// 把class 放在内存中去
 /// </summary>
 public static void PutClassIntoCash()
 {
     Entity   en  = ClassFactory.GetEn("BP.Sys.FAQ");
     Entities ens = ClassFactory.GetEns("BP.Sys.FAQs");
 }