예제 #1
0
        /// <summary>
        /// 得到一个实体
        /// </summary>
        /// <param name="className">类名称</param>
        /// <returns>En</returns>
        public static Entity GetEn(string className)
        {
            //判断标记初始化实体.
            if (className.Contains(".") == false)
            {
                if (className.Contains("Dtl") == true)
                {
                    return(new GEDtl(className)); //明细表.
                }
                else
                {
                    return(new GEEntity(className)); //表单实体.
                }
            }

            if (Htable_En == null)
            {
                Htable_En = new Hashtable();
                string    cl = "BP.En.EnObj";
                ArrayList al = ClassFactory.GetObjects(cl);
                foreach (Entity en in al)
                {
                    string key = string.Empty;
                    if (null == en || DataType.IsNullOrEmpty(key = en.ToString()))
                    {
                        continue;
                    }

                    if (Htable_En.ContainsKey(key) == false)
                    {
                        Htable_En.Add(key, en);
                    }
                    else
                    {
                        continue;
                        //Htable_En[key] = en;
                    }
                }
            }
            object tmp = Htable_En[className];

            return(tmp as Entity);
        }
예제 #2
0
        /// <summary>
        /// 得到一个实体
        /// </summary>
        /// <param name="className">类名称</param>
        /// <returns>En</returns>
        public static object GetHandlerPage(string className)
        {
            if (Htable_HandlerPage == null)
            {
                Htable_HandlerPage = new Hashtable();
                string    cl = "BP.WF.HttpHandler.DirectoryPageBase";
                ArrayList al = ClassFactory.GetObjects(cl);
                foreach (Object en in al)
                {
                    string key = string.Empty;
                    if (null == en || DataType.IsNullOrEmpty(key = en.ToString()))
                    {
                        continue;
                    }

                    if (Htable_HandlerPage.ContainsKey(key) == false)
                    {
                        Htable_HandlerPage.Add(key, en);
                    }
                }
            }
            return(Htable_HandlerPage[className]);
        }
예제 #3
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 中的数据。
            return(ens);
        }
예제 #4
0
파일: EnDtl.cs 프로젝트: splanton/CCFlow
 /// <summary>
 /// 明细
 /// </summary>
 /// <param name="className">类名称</param>
 public EnDtl(string className)
 {
     this.Ens = ClassFactory.GetEns(className);
 }
예제 #5
0
 /// <summary>
 /// 把class 放在内存中去
 /// </summary>
 public static void PutClassIntoCash()
 {
     Entity   en  = ClassFactory.GetEn("BP.Sys.FAQ");
     Entities ens = ClassFactory.GetEns("BP.Sys.FAQs");
 }