Example #1
0
        /// <summary>
        /// 获取对应控件
        /// </summary>
        /// <param name="ctrlId"></param>
        /// <returns></returns>
        public OAFuncDTO Get(string ctrlId)
        {
            string url = HttpContext.Current.Request.RawUrl;

            Debug.Assert(!string.IsNullOrEmpty(url), "当前路径为空");
            OAFuncDTO parent = _source.SingleOrDefault(a => !string.IsNullOrEmpty(a.Attributes) && a.Attributes.Contains(url));

            Debug.Assert(parent != null, "父项为空");
            return(_source.SingleOrDefault(a => a.Attributes == ctrlId && a.ParentId == parent.Id));
        }
Example #2
0
        public List <OAFuncDTO> FirstChildren()
        {
            List <OAFuncDTO> tmps = Modules();

            if (tmps.Count > 0)
            {
                OAFuncDTO firstModule = tmps[0];
                return(Children(firstModule.Id));
            }
            else
            {
                return(new List <OAFuncDTO>());
            }
        }