示例#1
0
        /// <summary>
        /// 根据父、子、孙的名称(三层),返回孙的model的ID(若不存在,则返回-1)
        /// </summary>
        public int GetModelID(string parentName, string childName, string grandsonName)
        {
            int id = -1;

            Model.Sys_Common_Dic model = this.GetModel(parentName, childName, grandsonName);
            if (null != model)
            {
                id = model.DicID;
            }
            return(id);
        }
示例#2
0
        /// <summary>
        /// 返回指定父类名和指定字典名记录下的所有子类list
        /// </summary>
        /// <param name="parentName">parentId=0</param>
        public List <Model.Sys_Common_Dic> GetModelList(string parentName, string childName)
        {
            List <Model.Sys_Common_Dic> lst = null;

            Model.Sys_Common_Dic model = this.GetModel(parentName, 0);
            if (null != model)
            {
                Model.Sys_Common_Dic newModel = this.GetModel(childName, model.DicID);
                if (null != newModel)
                {
                    lst = this.GetModelListByParentID(newModel.DicID);
                }
            }
            return(lst);
        }