Beispiel #1
0
 /// <summary>
 /// 获取某关键字相关的字典信息列表(不包含根节点)
 /// </summary>
 /// <param name="dictKey"></param>
 /// <returns></returns>
 public List<Bse_Dict> GetListByDictKeyByNoRoot(DictKeyEnum dictKey)
 {
     StringBuilder sb = new StringBuilder();
     sb.AppendFormat(" AND Dict_Key = '{0}' AND Dict_PCode is not null", dictKey.ToString());
     return Instance.GetListByWhere(sb.ToString());
 }
Beispiel #2
0
 public List<Bse_Dict> GetLevel1List(DictKeyEnum dictKey)
 {
     StringBuilder sb = new StringBuilder();
     sb.AppendFormat(" AND Dict_PCode = '{0}' AND Dict_Key = '{1}' ", "", dictKey.ToString());
     return Instance.GetListByWhere(sb.ToString());
     //return null;
 }
Beispiel #3
0
 public string GetDefaultCode(DictKeyEnum key)
 {
     string dDepth = Instance.GetMaxByWhere("Dict_Level", key.ToString(), "").ToString();
     int depth = Convert.ToInt32(dDepth) + 1;
     string dCode = key.ToString() + "_" + depth.ToString();
     return dCode;
 }
Beispiel #4
0
        public List<Sys_Control> GetControlMapForDict(DictKeyEnum dictKey, SysWinEnum winKey)
        {
            string where = string.Format(" AND Sys_Key='{0}' AND Sys_Win='{1}'", dictKey.ToString(), winKey.ToString());
            List<Sys_Control> list = CInstance.GetListByWhere(where);

            return list;
        }
Beispiel #5
0
        /// <summary>
        /// 添加字典信息
        /// </summary>
        /// <param name="dict"></param>
        /// <returns></returns>
        public object AddDictForReturn(Bse_Dict dict, DictKeyEnum key)
        {
            //默认添加为有效状态
            dict.Stat = 0;

            string dDepth = Instance.GetMaxByWhere("Dict_Level", key.ToString(), "").ToString();

            if (!string.IsNullOrEmpty(dDepth))
            {
                int depth = Convert.ToInt32(dDepth) + 1;
                dict.Dict_Code = key.ToString() + "_" + depth.ToString();
                dict.Dict_Level = depth;
            }
            object re = Instance.AddForReturn(dict);
            return re;
        }
Beispiel #6
0
        /// <summary>
        /// 添加字典信息
        /// </summary>
        /// <param name="dict"></param>
        /// <returns></returns>
        public int AddDict(Bse_Dict dict, DictKeyEnum key)
        {
            //默认添加为有效状态
            dict.Stat = 0;

            //string dDepth = Instance.GetMaxByWhere("Dict_Level", key.ToString(), "").ToString();

            //if (!string.IsNullOrEmpty(dDepth))
            //{
            //    int depth = Convert.ToInt32(dDepth) + 1;

            //    //dict.Dict_Code = key.ToString() + "_" + depth.ToString();
            dict.Dict_Code = GenerateDictCode(key.ToString());
            dict.Dict_Key = key.ToString();
            //dict.Dict_Level = depth;
            //}

            return Instance.Add(dict);
        }