Exemple #1
0
        /// <summary>
        /// 下级流程信息设定
        /// </summary>
        private void btnNextSet_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FrmMainDAO.QueryUserButtonPower(this.Name, this.Text, sender, true))
                {
                    return;
                }

                if (TableWorkFlows.Rows.Count == 0 || bSWorkFlows.Current == null)
                {
                    MessageHandler.ShowMessageBox("当前没有模块流程图记录,不能进行操作。");
                    return;
                }
                DataRow headRow   = ((DataRowView)bSWorkFlows.Current).Row;
                int     autoIdInt = DataTypeConvert.GetInt(headRow["AutoId"]);
                if (autoIdInt == 0)
                {
                    MessageHandler.ShowMessageBox("请选择要操作的流程图。");
                    return;
                }
                int nextWorkFlowsTypeInt = DataTypeConvert.GetInt(lookUpNextWorkFlowsType.EditValue);
                if (nextWorkFlowsTypeInt < 1)
                {
                    MessageHandler.ShowMessageBox("当前流程图没有设定下级流程类型,不能进行操作。");
                    return;
                }
                FrmWorkFlowsLineSet lineSetForm = new FrmWorkFlowsLineSet(autoIdInt, textWorkFlowsText.Text.Trim(), nextWorkFlowsTypeInt);
                lineSetForm.ShowDialog();
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--下级流程信息设定错误。", ex);
            }
        }
Exemple #2
0
        /// <summary>
        /// 单击设定相关信息
        /// </summary>
        private void diagramMain_MouseClick(object sender, MouseEventArgs e)
        {
            try
            {
                if (!btnCancel.Enabled)
                {
                    if (IsEditWorkFlowsDetail)
                    {
                        new System.Threading.Thread(() =>
                        {
                            Action <int> action = (data) =>
                            {
                                if (diagramMain.SelectedItems.Length > 0)
                                {
                                    switch (diagramMain.SelectedItems[0].GetType().ToString())
                                    {
                                    case "DevExpress.XtraDiagram.DiagramConnector":
                                        //MessageHandler.ShowMessageBox("操作连接线设定窗体");
                                        DiagramConnector dConn          = (DiagramConnector)diagramMain.SelectedItems[0];
                                        int lineIdInt                   = DataTypeConvert.GetInt(dConn.CustomStyleId);
                                        FrmWorkFlowsLineSet lineSetForm = new FrmWorkFlowsLineSet(lineIdInt, textWorkFlowsText.Text, dConn.Text);
                                        lineSetForm.isEditWorkFlows     = IsEditWorkFlows;
                                        if (lineSetForm.ShowDialog() == DialogResult.OK)
                                        {
                                            dConn.Text            = lineSetForm.textLineText.Text.Trim();
                                            dConn.Appearance.Name = DataTypeConvert.GetString(lineSetForm.lookUpLineType.EditValue);
                                        }
                                        dConn.CanSelect = false;
                                        dConn.CanSelect = true;
                                        break;

                                    case "DevExpress.XtraDiagram.DiagramShape":
                                        //MessageHandler.ShowMessageBox("状态节点设定窗体");
                                        DiagramShape dShape             = (DiagramShape)diagramMain.SelectedItems[0];
                                        int nodeIdInt                   = DataTypeConvert.GetInt(dShape.CustomStyleId);
                                        FrmWorkFlowsNodeSet nodeSetForm = new FrmWorkFlowsNodeSet(nodeIdInt, textWorkFlowsText.Text, dShape.Content);
                                        nodeSetForm.isEditWorkFlows     = IsEditWorkFlows;
                                        if (nodeSetForm.ShowDialog() == DialogResult.OK)
                                        {
                                            dShape.Content = nodeSetForm.textNodeText.Text.Trim();

                                            int beginNodeInt = DataTypeConvert.GetInt(nodeSetForm.radioBeginNode.EditValue);
                                            if (beginNodeInt == (int)WorkFlowsHandleDAO.NodePositionType.开始节点 || beginNodeInt == (int)WorkFlowsHandleDAO.NodePositionType.结束节点)
                                            {
                                                for (int i = 0; i < diagramMain.Items.Count; i++)
                                                {
                                                    if (diagramMain.Items[i].GetType().ToString() == "DevExpress.XtraDiagram.DiagramShape")
                                                    {
                                                        //if (((DiagramShape)diagramMain.Items[i]).Shape == DevExpress.Diagram.Core.BasicFlowchartShapes.StartEnd)
                                                        if (((DiagramShape)diagramMain.Items[i]).MinHeight == beginNodeInt)
                                                        {
                                                            ((DiagramShape)diagramMain.Items[i]).MinHeight = 0;
                                                            ((DiagramShape)diagramMain.Items[i]).Shape     = DevExpress.Diagram.Core.BasicShapes.Rectangle;
                                                        }
                                                    }
                                                }

                                                dShape.Shape     = DevExpress.Diagram.Core.BasicFlowchartShapes.StartEnd;
                                                dShape.MinHeight = beginNodeInt;
                                            }
                                        }
                                        break;
                                    }
                                    diagramMain.ClearSelection();
                                }
                            };
                            Invoke(action, 1);
                        }).Start();
                    }
                }
                else if (IsDefault)
                {
                    new System.Threading.Thread(() =>
                    {
                        Action <int> action = (data) =>
                        {
                            if (diagramMain.SelectedItems.Length > 0)
                            {
                                diagramMain.ClearSelection();
                            }
                        };
                        Invoke(action, 1);
                    }).Start();
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--单击设定相关信息错误。", ex);
            }
        }