/// <summary>
 /// 装载全部主表单
 /// </summary>
 /// <param name="startNodes"></param>
 public static void LoadAllMainUserControls(TreeNodeCollection startNodes)
 {
     try
     {
         var table = RDIFrameworkService.Instance.WorkFlowUserControlService.GetAllMainUserControls(SystemInfo.UserInfo);
         startNodes.Clear();
         foreach (DataRow row in table.Rows)
         {
             var tmpNode = new MainUserControlNode
             {
                 NodeId             = row[MainUserControlTable.FieldId].ToString(),
                 ImageIndex         = 2,
                 ToolTipText        = "主表单",
                 SelectedImageIndex = 3,
                 Text        = row[MainUserControlTable.FieldFullName].ToString(),
                 Description = row[MainUserControlTable.FieldDescription].ToString(),
                 NodeType    = WorkConst.UserControl_Main
             };
             startNodes.Add(tmpNode);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #2
0
        private void InitUserControlTree()
        {
            var tmpNode1 = new BaseUserControlTreeNode
            {
                NodeType           = "#0",
                Text               = @"表单管理",
                ImageIndex         = 0,
                SelectedImageIndex = 0
            };

            tvUserControl.Nodes.Add(tmpNode1);
            var tmpNode01 = new UserControlNode
            {
                NodeType           = WorkConst.UserControl_Child + "#",
                Text               = @"子表单管理",
                ImageIndex         = 1,
                SelectedImageIndex = 1
            };

            tmpNode1.Nodes.Add(tmpNode01);

            var tmpNode02 = new MainUserControlNode
            {
                NodeType           = WorkConst.UserControl_Main + "#",
                Text               = @"主表单管理",
                ImageIndex         = 2,
                SelectedImageIndex = 2
            };

            tmpNode1.Nodes.Add(tmpNode02);
            tvUserControl.ExpandAll();
        }
Пример #3
0
 private void delmucToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (MessageBoxHelper.Show("是否删除主表单[" + NowNode.Text + "]?删除后不能回复。") == DialogResult.Yes)
     {
         MainUserControlNode.DeleteMainUserControlNode(NowNode.NodeId);
         NowNode.Remove();
     }
 }
Пример #4
0
        /// <summary>
        /// 初始化树和listview表头信息
        /// </summary>
        /// <param name="typeClient"></param>
        /// <param name="iKey"></param>
        private void InitListView(string typeClient, string iKey)
        {
            lvClient.Clear();
            lvClient.ContextMenuStrip = null;
            lvClient.View             = View.Details;
            switch (typeClient)
            {
            case "#0":    //显示子表单和主表单
            {
                lvClient.Columns.Add("名称", 100, HorizontalAlignment.Left);
                lvClient.Columns.Add("描述", 200, HorizontalAlignment.Left);
                LvShowType();
                tvUserControl.ContextMenuStrip = null;
                break;
            }

            case WorkConst.UserControl_Child + "#":    //子表单
            {
                UserControlNode.LoadAllUserControlsNode(tvUserControl.SelectedNode.Nodes);
                lvClient.Columns.Add("子表单", 150, HorizontalAlignment.Left);
                lvClient.Columns.Add("子表单Id", 0, HorizontalAlignment.Left);
                lvClient.Columns.Add("位置", 300, HorizontalAlignment.Left);
                lvClient.Columns.Add("表单名称", 300, HorizontalAlignment.Left);
                lvClient.Columns.Add("所在程序集", 270, HorizontalAlignment.Left);
                lvClient.Columns.Add("描述", 200, HorizontalAlignment.Left);
                LvShowUserControl();
                tvUserControl.ContextMenuStrip = cmUserControl;
                break;
            }

            case WorkConst.UserControl_Child:
            {
                tvUserControl.ContextMenuStrip = cmUserControl;
                break;
            }

            case WorkConst.UserControl_Main + "#":    //主表单管理
            {
                MainUserControlNode.LoadAllMainUserControls(tvUserControl.SelectedNode.Nodes);
                lvClient.Columns.Add("主表单", 200, HorizontalAlignment.Left);
                lvClient.Columns.Add("主表单Id", 0, HorizontalAlignment.Left);
                lvClient.Columns.Add("描述", 200, HorizontalAlignment.Left);
                LvShowMainUserControl();
                tvUserControl.ContextMenuStrip = cmMainUserControl;
                break;
            }

            case WorkConst.UserControl_Main:
            {
                tvUserControl.ContextMenuStrip = cmMainUserControl;
                break;
            }
            }
        }
Пример #5
0
        private void lvDelMuctoolStripMenuItem3_Click(object sender, EventArgs e)
        {
            if (this.lvClient.SelectedItems.Count <= 0)
            {
                return;
            }
            var key = lvClient.SelectedItems[0].SubItems[1].Text;

            if (MessageBoxHelper.Show("是否删除主表单[" + lvClient.SelectedItems[0].Text + "]?删除后不能回复。") == DialogResult.Yes)
            {
                MainUserControlNode.DeleteMainUserControlNode(key);
                lvClient.Items.Remove(lvClient.SelectedItems[0]);
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!CheckData())
            {
                return;
            }

            if (formState == WorkConst.STATE_ADD)
            {
                var m = new MainUserControlNode
                {
                    NodeId      = NowNodeId,
                    Text        = txtFullName.Text,
                    Description = txtDescription.Text,
                    NodeType    = WorkConst.UserControl_Main
                };
                m.InsertMainUserControlNode();
            }
            else //修改
            {
                var m = new MainUserControlNode
                {
                    NodeId      = NowNodeId,
                    Text        = txtFullName.Text,
                    NodeType    = WorkConst.UserControl_Main,
                    Description = txtDescription.Text
                };
                m.UpdateMainUserControlNode();
                RDIFrameworkService.Instance.WorkFlowUserControlService.MoveUserControlsOfMain(this.UserInfo, NowNodeId);//删除隶属主表单关系
            }

            var i = 0;

            foreach (ListViewItem lt in lvUserControls.Items)
            {
                RDIFrameworkService.Instance.WorkFlowUserControlService.AddUserControls(this.UserInfo, NowNodeId, lt.SubItems[1].Text, i, lt.SubItems[4].Text);
                i++;
            }
            this.Close();
        }