Ejemplo n.º 1
0
        /// <summary>
        /// 拆解权限的分级元数据
        /// </summary>
        /// <param name="_sri"></param>
        /// <param name="_meta"></param>
        private static void ParseRightLevels(ref SinoRightItem _sri, string _meta)
        {
            if (_sri.RightLevels == null)
            {
                _sri.RightLevels = new System.Collections.ArrayList();
            }
            else
            {
                _sri.RightLevels.Clear();
            }
            string _values = StrUtils.GetMetaByName("VALUE", _meta);

            if (_values == "")
            {
                return;
            }
            string[] _Levels = _values.Split(',');

            foreach (string _le in _Levels)
            {
                string[]       _items = _le.Split(':');
                RightLevelName _rln   = new RightLevelName();
                _rln.Index       = decimal.Parse(_items[0]);
                _rln.DisplayText = _items[1];
                _sri.RightLevels.Add(_rln);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 通过记录建立用户权限定义项
        /// </summary>
        /// <param name="_dr"></param>
        /// <returns></returns>
        public static SinoRightItem CreateSinoRightItem(DataRow _dr)
        {
            SinoRightItem _sri = new SinoRightItem();

            try
            {
                _sri.RightID       = _dr["QXID"].ToString();
                _sri.FatherRightID = _dr["SJQXID"].ToString();
                _sri.RightName     = _dr["QXMC"].ToString();
                _sri.RightDescript = _dr["QXMS"].ToString();
                _sri.RightType     = _dr["QXLX"].ToString();
                ParseRightLevels(ref _sri, _dr["QXMETA"].ToString());
            }
            catch (Exception e)
            {
                throw e;
            }
            return(_sri);
        }