private void buttonWaitActivity_Click(object sender, RoutedEventArgs e)
        {
            if (isCreate)
            {
                WaitControlData wd = new WaitControlData();
                wd.办理查看业务表单 = this.designer.流程数据.启动时填写的表单;
                wd.办理时限     = 5;
                wd.处理方式     = "组接件";

                WaitControl wc = new WaitControl()
                {
                    X坐标 = 150, Y坐标 = 200, 类型 = "节", 结点数据 = wd
                };

                ToolWindows.SetWindowWaitControl swc = new ToolWindows.SetWindowWaitControl(wc, designer.NameList);
                swc.办理人员.IsEnabled  = false;
                swc.处理方式.IsReadOnly = true;
                swc.ShowDialog();

                if (swc.ButtonSelect == "ok")
                {
                    designer.AddActivity(wc);
                }
                swc.Close();
            }
        }
Beispiel #2
0
        public void LoadFlow <T>(T obj, IDesigner designer)
        {
            designer.Clear(false);
            WindowsWorkflowObject wf = obj as WindowsWorkflowObject;

            FlowChart flowChart = (new XomlConverter(wf.Xoml, wf.Rules, wf.Layout)).GetFlowChart();

            designer.流程数据 = flowChart.FlowData;
            foreach (var v in flowChart.ElementList)
            {
                if (v.类型 == "节")
                {
                    ActivityControl q = new WaitControl()
                    {
                        Name = v.Name, X坐标 = v.X坐标, Y坐标 = v.Y坐标, 标题 = v.Name, 说明 = ((WaitControlData)v.结点数据).说明, 类型 = v.类型, 分支集合 = v.分支集合, 结点数据 = v.结点数据
                    };
                    designer.AddActivity(q);
                }
                if (v.类型 == "头")
                {
                    ActivityControl q = new BeginControl()
                    {
                        Name = v.Name, X坐标 = v.X坐标, Y坐标 = v.Y坐标, 类型 = v.类型, 分支集合 = v.分支集合
                    };
                    designer.AddActivity(q);
                }
                if (v.类型 == "归档")
                {
                    ActivityControl q = new EndControl()
                    {
                        Name = v.Name
                    };
                    designer.AddActivity(q);
                }
            }

            foreach (var v in flowChart.ElementRelationList)
            {
                if (v.Name == "启动流程")
                {
                    v.路由 = "开始状态";
                }
                designer.AddActivityPath(v.Name, v.起点, v.目标, v.路由, v.说明);
            }
        }
        private void buttonSelfWaitActivity_Click(object sender, RoutedEventArgs e)
        {
            if (isCreate)
            {
                WaitControlData wd = new WaitControlData();
                wd.处理方式 = "到人";
                wd.办理时限 = 5;

                wd.办理查看业务表单 = this.designer.流程数据.启动时填写的表单;
                wd.办理人员 = "";

                WaitControl wc = new WaitControl() { X坐标 = 150, Y坐标 = 200, 类型 = "节", 结点数据=wd };

                ToolWindows.SetWindowWaitControl swc = new ToolWindows.SetWindowWaitControl(wc, designer.NameList);

                swc.接件部门.IsEnabled = false;
                swc.接件职能.IsEnabled = false;
                swc.处理方式.IsReadOnly = true;

                swc.ShowDialog();

                if (swc.ButtonSelect == "ok")
                {

                    designer.AddActivity(wc);
                }
                swc.Close();
            }
        }