Esempio n. 1
0
        /// <summary>新增
        ///
        /// </summary>
        private void DoNew(string strOperation)
        {
            string strMsg = CheckSelect("新增等级");

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

            if (model != null)
            {
                intParentId = strOperation == "cmdNewSameLevel" ? model.ParentId : model.Id;
            }
            FrmTreeListDemoTreeDialog frmDialog = new   FrmTreeListDemoTreeDialog(null, intParentId, m_lstTreeListDemo);

            if (frmDialog.ShowDialog() == DialogResult.OK)
            {
                m_lstTreeListDemo           = frmDialog.ListTreeListDemo;
                dataTreeListView.DataSource = m_lstTreeListDemo;
                dataTreeListView.Refresh();
            }
        }
Esempio n. 2
0
        /// <summary>编辑
        ///
        /// </summary>
        private void DoEdit()
        {
            string strMsg = CheckSelect("修改");

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

            if (model != null)
            {
                FrmTreeListDemoTreeDialog frmDialog = new       FrmTreeListDemoTreeDialog(model, 0, m_lstTreeListDemo);
                if (frmDialog.ShowDialog() == DialogResult.OK)
                {
                    m_lstTreeListDemo           = frmDialog.ListTreeListDemo;
                    dataTreeListView.DataSource = m_lstTreeListDemo;
                    dataTreeListView.Refresh();
                }
            }
        }