Beispiel #1
0
 public static void BindComboData(ComboBox combox,DictKeyEnum dKey)
 {
     List<Bse_Dict> list = dcInstance.GetListByDictKeyByNoRoot(dKey);
     combox.DataSource = list;
     combox.DisplayMember = "Dict_Name";
     combox.ValueMember = "Dict_Code";
 }
Beispiel #2
0
        /// <summary>
        /// 数据初始化
        /// </summary>
        /// <param name="isLevel"></param>
        /// <param name="key"></param>
        /// <param name="winKey"></param>
        public void Init(bool isLevel, DictKeyEnum key, SysWinEnum winKey)
        {
            this.IsLevel = isLevel;

            DictKey = key;

            InitControl(winKey);

            SetMode(OperationTypeEnum.OperationType.Look);

            bmHelper = new BindModelHelper();

            this.treeView1.Nodes.Clear();

            CreateDataSource();

            this.treeView1.ContextMenuStrip = this.cMenu;

            if (DtTree.Rows.Count != 0)
            {
                InitTree(this.treeView1.Nodes, null);
                this.treeView1.Nodes[0].Expand();

                this.Text = treeView1.Nodes[0].Text + "管理";
            }
        }
Beispiel #3
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 #4
0
 /// <summary>
 /// 是否拥有子节点
 /// </summary>
 /// <param name="dict"></param>
 /// <returns></returns>
 public bool IsHaveChild(Bse_Dict dict, DictKeyEnum key)
 {
     List<Bse_Dict> list = this.GetByParent(dict.Dict_Code, key)
      ;
     if (list != null && list.Count > 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Beispiel #5
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 #6
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 #7
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 #8
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 #9
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);
        }