コード例 #1
0
        /// <summary>新增
        ///
        /// </summary>
        private void DoNew(string strOperation)
        {
            string strMsg = CheckSelect("新增等级");

            if (strMsg != string.Empty)
            {
                MessageBox.Show(strMsg);
                return;
            }
            int           intParentId = 0;
            BseDictionary model       = dataTreeListView.SelectedObjects[0] as BseDictionary;

            if (model != null)
            {
                intParentId = strOperation == "cmdNewSameLevel" ? model.ParentID : model.Id;
            }
            FrmBseDictionaryTreeDialog frmDialog = new FrmBseDictionaryTreeDialog(null, intParentId, m_lstBseDictionary);

            if (frmDialog.ShowDialog() == DialogResult.OK)
            {
                m_lstBseDictionary          = frmDialog.ListBseDictionary;
                dataTreeListView.DataSource = m_lstBseDictionary;
                dataTreeListView.Refresh();
            }
        }
コード例 #2
0
        /// <summary>编辑
        ///
        /// </summary>
        private void DoEdit()
        {
            string strMsg = CheckSelect("修改");

            if (strMsg != string.Empty)
            {
                MessageBox.Show(strMsg);
                return;
            }
            BseDictionary model = dataTreeListView.SelectedObjects[0] as BseDictionary;

            if (model != null)
            {
                FrmBseDictionaryTreeDialog frmDialog = new FrmBseDictionaryTreeDialog(model, 0, m_lstBseDictionary);
                if (frmDialog.ShowDialog() == DialogResult.OK)
                {
                    m_lstBseDictionary          = frmDialog.ListBseDictionary;
                    dataTreeListView.DataSource = m_lstBseDictionary;
                    dataTreeListView.Refresh();
                }
            }
        }