Exemplo n.º 1
0
        /// <summary>
        /// 编辑分类
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menu_EditType_Click(object sender, EventArgs e)
        {
            if (!HasFunction("Dictionary/Set/DictTypeEdit"))
            {
                MessageDxUtil.ShowError(Const.NoAuthMsg);
                return;
            }

            TreeNode selectedNode = this.treeView1.SelectedNode;

            if (selectedNode != null && selectedNode.Tag != null)
            {
                Int32        typeId = Convert.ToInt32(selectedNode.Tag);
                DictTypeInfo info   = BLLFactory <DictType> .Instance.FindById(typeId);

                if (info != null)
                {
                    FrmEditDictType dlg = new FrmEditDictType();
                    dlg.Id           = typeId;
                    dlg.pId          = info.Pid;
                    dlg.OnDataSaved += new EventHandler(dlg_OnDataTreeSaved);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        InitTreeView();
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void menu_AddType_Click(object sender, EventArgs e)
        {
            if (!HasFunction("Dictionary/Set/DictTypeAdd"))
            {
                MessageDxUtil.ShowError(Const.NoAuthMsg);
                return;
            }

            FrmEditDictType dlg = new FrmEditDictType();

            dlg.pId          = GetParentNodeIndex();
            dlg.OnDataSaved += new EventHandler(dlg_OnDataTreeSaved);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                InitTreeView();
            }
        }