コード例 #1
0
ファイル: ModelEditor.cs プロジェクト: viticm/pap2
        private void CreateSubAttib_buttom_Click(object sender, EventArgs e)
        {
            if (treeView.SelectedNode != null)
            {
                // 检查所选的叶子节点是否为虚拟字段
                DataRow row = m_DicMetaInfoTable.Rows.Find(new object[]{treeView.SelectedNode.Tag});
                if (row == null)
                    return;

                if ((int)row["fieldtype"] != 1)
                    return;

                // 设置parentid, 
                paraMetaInfo param = new paraMetaInfo();

                param.m_nFieldType = 0;
                param.m_nModTableID = (int)row["modtabid"];
                param.m_nParentField = (int)treeView.SelectedNode.Tag;
                param.m_DicMetaInfo = m_DicMetaInfoTable;
                AddVirtualField form = new AddVirtualField(row["tablename"].ToString().Trim(), this, param);
                DialogResult result = form.ShowDialog();
            
            }
        }
コード例 #2
0
ファイル: ModelEditor.cs プロジェクト: viticm/pap2
        // 子字段那层的新建虚拟字段按钮
        private void CreateVirtualField2_buttom_Click(object sender, EventArgs e)
        {
            if (treeView.SelectedNode != null)
            {
                if (treeView.SelectedNode.Level <= 2)
                    return;
                int nFieldID = (int)treeView.SelectedNode.Tag;
                DataRow row = m_DicMetaInfoTable.Rows.Find(new object[] { nFieldID });
                if (row == null)
                    return;

                paraMetaInfo param = new paraMetaInfo();
                param.m_nFieldType = 1;
                param.m_nModTableID = (int)row["modtabid"];
                param.m_nParentField = (int)treeView.SelectedNode.Tag;
                param.m_DicMetaInfo = m_DicMetaInfoTable;
                AddVirtualField form = new AddVirtualField(null, this, param);
                DialogResult result = form.ShowDialog();
                if (result == DialogResult.OK)
                {
                    if (row["fieldtype"] != null && row["fieldtype"].ToString().Trim() != "2")
                    {
                        DataRow modRow = m_DicMetaInfoTable.Rows.Find(new object[] { nFieldID });
                        if (modRow["fieldtype"].ToString().Trim() == "1")
                            return;
                        modRow.BeginEdit();
                        modRow["fieldtype"] = 2;
                        modRow.EndEdit();
                        UpdateData("SELECT * FROM sys_meta_info", m_DicMetaInfoTable, UpdateType.MOD);
                    }
                }
            }
        }
コード例 #3
0
ファイル: ModelEditor.cs プロジェクト: viticm/pap2
        // 标签那层的新建虚拟字段按钮
        private void CreatVirtualField_buttom_Click(object sender, EventArgs e)
        {
            if (treeView.SelectedNode != null)
            {
                TreeNode tabNode = treeView.SelectedNode;
                string strTableName = tabNode.Tag.ToString().Trim();
                if (strTableName == "")
                {
                    MessageBox.Show("请先为标签指定主表!");
                    return;
                }

                // 标签页那层以下才能建虚拟字段
                if (treeView.SelectedNode.Level != 2)
                    return;

                DataRow row = m_ModelTabDefTable.Rows.Find(tabNode.Text.Trim());
                if (row == null)
                    return;
                
                paraMetaInfo param = new paraMetaInfo();
                param.m_nFieldType = 1;
                param.m_nModTableID = (int)row["modtabid"];
                param.m_DicMetaInfo = m_DicMetaInfoTable;
                AddVirtualField form = new AddVirtualField(null, this, param);
                form.ShowDialog();
            }
        }