Exemplo n.º 1
0
        /// <summary>
        /// 页面实体解析成页面类
        /// </summary>
        /// <param name="pageObj"></param>
        /// <returns></returns>
        public xinlongyuForm DecodePage(PageInfoDetail pageObj, bool isNavigationWindow)
        {
            //页面基本信息
            PageBaseInfo dtObj = pageObj.data;

            if (object.Equals(dtObj.control_list, null))
            {
                return(null);
            }
            try
            {
                List <ControlDetailForPage> listControlObject = ControlCaster.CastArrayToControl(dtObj.control_list);

                //判断一下解析出来的控件数组是不是为空
                if (object.Equals(listControlObject, null) || listControlObject.Count < 1)
                {
                    return(null);
                }

                var page = this.DecodeListControlObj(listControlObject, isNavigationWindow);
                if (!object.Equals(page, null))
                {
                    page.Title = pageObj.data.page_name;                            //设置标题
                }
                return(page);
            }
            catch (Exception ex)
            {
                Logging.Error(ex.Message);
                return(null);
            }
        }
        //private string _pageControlTableName = "hs_new_page_ctrls";
        /// <summary>
        /// 缓存页面信息
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="listControlObject"></param>
        /// <returns></returns>
        public int CachePageInfo(PageInfoDetail obj)
        {
            List <ControlDetailForPage> listControlObject = ControlCaster.CastArrayToControl(obj.data.control_list);

            //
            this.CachePageBaseInfo(obj);
            //
            this.CachePageControlInfo(listControlObject);
            return(1);
        }