Exemple #1
0
 private void addRootTreeNode_Click(object sender, EventArgs e)
 {
     try
     {
         tvwMainMenu.Nodes.Add("新建主菜单");
         tvwMainMenu.SelectedNode.Expand();
         //选定新建节点
         tvwMainMenu.SelectedNode = tvwMainMenu.Nodes[tvwMainMenu.Nodes.Count - 1];
         string nodeId = FrmRightBLL.getNewNodeId();
         tvwMainMenu.SelectedNode.Name = nodeId;
         //将新建节点同步到数据库
         bS_MenuBindingSource.AddNew();
         bS_MenuDataGridView.CurrentRow.Cells[0].Value = tvwMainMenu.SelectedNode.Name;
         bS_MenuDataGridView.CurrentRow.Cells[1].Value = tvwMainMenu.SelectedNode.Text;
         bS_MenuDataGridView.CurrentRow.Cells[5].Value = tvwMainMenu.SelectedNode.Index.ToString();
         this.Validate();
         this.bS_MenuBindingSource.EndEdit();
         this.bS_MenuTableAdapter.Update(dsPSAP.BS_Menu);
         FrmRightDAO.RefreshMenuButton(nodeId);
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
 /// <summary>
 /// 设定默认值
 /// </summary>
 private void TableMenu_TableNewRow(object sender, DataTableNewRowEventArgs e)
 {
     e.Row["MenuName"] = FrmRightBLL.getNewNodeId();
     e.Row["FormName"] = "";
     e.Row["FormText"] = "";
     if (parentMenuNameStr != "")
     {
         e.Row["ParentMenuName"] = parentMenuNameStr;
         e.Row["ParentMenuText"] = parentMenuTextStr;
         parentMenuNameStr       = "";
         parentMenuTextStr       = "";
     }
 }
Exemple #3
0
 private void addChildTreeNode_Click(object sender, EventArgs e)
 {
     try
     {
         tvwOrganizationStru.SelectedNode.Nodes.Add("新建子部门");
         tvwOrganizationStru.SelectedNode.Expand();
         tvwOrganizationStru.SelectedNode = tvwOrganizationStru.SelectedNode.LastNode;
         string nodeId = FrmRightBLL.getNewNodeId();
         tvwOrganizationStru.SelectedNode.Name = nodeId;
         saveNodeToTable();//将新建节点同步到数据库
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
Exemple #4
0
 private void addChildTreeNode_Click(object sender, EventArgs e)
 {
     try
     {
         tvwOrganizationStru.SelectedNode.Nodes.Add("新建子部门");
         tvwOrganizationStru.SelectedNode.Expand();
         tvwOrganizationStru.SelectedNode = tvwOrganizationStru.SelectedNode.LastNode;
         string nodeId = FrmRightBLL.getNewNodeId();
         tvwOrganizationStru.SelectedNode.Name = nodeId;
         saveNodeToTable();//将新建节点同步到数据库
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException(this.Text + "--addChildTreeNode_Click错误。", ex);
     }
 }
Exemple #5
0
 private void addChildTreeNode_Click(object sender, EventArgs e)
 {
     try
     {
         tvwMainMenu.SelectedNode.Nodes.Add("新建子菜单");
         tvwMainMenu.SelectedNode.Expand();
         tvwMainMenu.SelectedNode = tvwMainMenu.SelectedNode.LastNode;
         string nodeId = FrmRightBLL.getNewNodeId();
         tvwMainMenu.SelectedNode.Name = nodeId;
         saveNodeToTable();//将新建节点同步到数据库
         FrmRightDAO.RefreshMenuButton(nodeId);
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
Exemple #6
0
        //显示查询条件End

        #region  表标题树相关方法
        //private void insertColumnHeader_Click(object sender, EventArgs e)
        //{
        //    try
        //    {
        //        int i = tabControl2.SelectedIndex;
        //        string nName;
        //        nName = tvwTablesHeader[i].SelectedNode.Name;
        //        if (tvwTablesHeader[i].SelectedNode.Parent != null)
        //        {
        //            tvwTablesHeader[i].SelectedNode.Parent.Nodes.Insert(tvwTablesHeader[i].SelectedNode.Index, "插入列标题");
        //        }
        //        else
        //        {
        //            tvwTablesHeader[i].Nodes.Insert(tvwTablesHeader[i].SelectedNode.Index, "插入列标题");
        //        }
        //        tvwTablesHeader[i].SelectedNode.Expand();
        //        tvwTablesHeader[tabControl2.SelectedIndex].SelectedNode = tvwTablesHeader[i].SelectedNode.PrevNode;
        //        string nodeId = FrmRightBLL.getNewNodeId();
        //        tvwTablesHeader[i].SelectedNode.Name = nodeId;
        //        FrmDataQueryDesignDAO.saveCreateChildNode(Convert.ToInt16(tvtbQueryList_User.SelectedNode.Name),
        //            Convert.ToInt16(tvwTablesHeader[i].Tag), nodeId, tvwTablesHeader[i].SelectedNode.Text, tvwTablesHeader[i].SelectedNode.Parent != null && tvwTablesHeader[i].SelectedNode.Parent.Name != string.Empty ? tvwTablesHeader[i].SelectedNode.Parent.Name : null);

        //    }
        //    catch (Exception e1)
        //    {
        //        MessageBox.Show(e1.Message);
        //    }

        //}

        private void insertChildColumnHeader_Click(object sender, EventArgs e)
        {
            try
            {
                int i = tabControl2.SelectedIndex;
                tvwTablesHeader[i].SelectedNode.Nodes.Add("新建子列标题");
                tvwTablesHeader[i].SelectedNode.Expand();
                tvwTablesHeader[i].SelectedNode = tvwTablesHeader[i].SelectedNode.LastNode;
                string nodeId = FrmRightBLL.getNewNodeId();
                tvwTablesHeader[i].SelectedNode.Name = nodeId;
                FrmDataQueryDesignDAO.saveCreateChildNode(Convert.ToInt16(tvtbQueryList_User.SelectedNode.Name),
                                                          Convert.ToInt16(tvwTablesHeader[i].Tag), nodeId, tvwTablesHeader[i].SelectedNode.Text, tvwTablesHeader[i].SelectedNode.Parent.Name);
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message);
            }
        }
Exemple #7
0
 //同级菜单
 private void insertTreeNode_Click(object sender, EventArgs e)
 {
     try
     {
         string nName;
         nName = tvwOrganizationStru.SelectedNode.Name;
         tvwOrganizationStru.SelectedNode.Parent.Nodes.Insert(tvwOrganizationStru.SelectedNode.Index, "插入同级部门");
         tvwOrganizationStru.SelectedNode.Expand();
         tvwOrganizationStru.SelectedNode = tvwOrganizationStru.SelectedNode.PrevNode;
         string nodeId = FrmRightBLL.getNewNodeId();
         tvwOrganizationStru.SelectedNode.Name = nodeId;
         saveNodeToTable();//将新建节点同步到数据库
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
Exemple #8
0
 //同级菜单
 private void insertTreeNode_Click(object sender, EventArgs e)
 {
     try
     {
         string nName;
         nName = tvwOrganizationStru.SelectedNode.Name;
         tvwOrganizationStru.SelectedNode.Parent.Nodes.Insert(tvwOrganizationStru.SelectedNode.Index, "插入同级部门");
         tvwOrganizationStru.SelectedNode.Expand();
         tvwOrganizationStru.SelectedNode = tvwOrganizationStru.SelectedNode.PrevNode;
         string nodeId = FrmRightBLL.getNewNodeId();
         tvwOrganizationStru.SelectedNode.Name = nodeId;
         saveNodeToTable();//将新建节点同步到数据库
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException(this.Text + "--insertTreeNode_Click错误。", ex);
     }
 }
Exemple #9
0
 //同级菜单
 private void insertTreeNode_Click(object sender, EventArgs e)
 {
     try
     {
         string nName;
         nName = tvwMainMenu.SelectedNode.Name;
         tvwMainMenu.SelectedNode.Parent.Nodes.Insert(tvwMainMenu.SelectedNode.Index, "插入同级菜单");
         tvwMainMenu.SelectedNode.Expand();
         tvwMainMenu.SelectedNode = tvwMainMenu.SelectedNode.PrevNode;
         string nodeId = FrmRightBLL.getNewNodeId();
         tvwMainMenu.SelectedNode.Name = nodeId;
         saveNodeToTable();//将新建节点同步到数据库
         FrmRightDAO.RefreshMenuButton(nodeId);
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
Exemple #10
0
 private void createRootColumnHeader_Click(object sender, EventArgs e)
 {
     try
     {
         int i = tabControl2.SelectedIndex;
         tvwTablesHeader[i].Nodes.Add("新建根列标题");
         tvwTablesHeader[i].SelectedNode.Expand();
         //选定新建节点
         tvwTablesHeader[i].SelectedNode = tvwTablesHeader[i].Nodes[tvwTablesHeader[i].Nodes.Count - 1];
         string nodeId = FrmRightBLL.getNewNodeId();
         tvwTablesHeader[i].SelectedNode.Name = nodeId;
         FrmDataQueryDesignDAO.saveCreateRootNode(Convert.ToInt16(tvtbQueryList_User.SelectedNode.Name),
                                                  Convert.ToInt16(tvwTablesHeader[i].Tag), nodeId, tvwTablesHeader[i].SelectedNode.Text);
     }
     catch (Exception ex)
     {
         ExceptionHandler.HandleException(this.Text + "--deleteRootColumnHeader_Click错误。", ex);
     }
 }