當前位置: 首頁>>代碼示例>>C#>>正文


C# WorkflowService.GetProcessInstance方法代碼示例

本文整理匯總了C#中Slickflow.Engine.Service.WorkflowService.GetProcessInstance方法的典型用法代碼示例。如果您正苦於以下問題:C# WorkflowService.GetProcessInstance方法的具體用法?C# WorkflowService.GetProcessInstance怎麽用?C# WorkflowService.GetProcessInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Slickflow.Engine.Service.WorkflowService的用法示例。


在下文中一共展示了WorkflowService.GetProcessInstance方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: InitFlowInfo

        protected void InitFlowInfo()
        {
            int AppInstanceID = Request.QueryString["AppInstanceID"] == null ? 0 : Helper.ConverToInt32(Request.QueryString["AppInstanceID"].ToString());
            string ProcessGUID = Request.QueryString["ProcessGUID"] == null ? string.Empty : Request.QueryString["ProcessGUID"].ToString();
            int ActivityInstanceID = Request.QueryString["ActivityInstanceID"] == null ? 0 : Helper.ConverToInt32(Request.QueryString["ActivityInstanceID"].ToString());
            if (AppInstanceID > 0)
            {
                HrsLeaveEntity hrsLeaveEntity = WorkFlows.GetHrsLeaveModel(AppInstanceID);
                if (hrsLeaveEntity != null && hrsLeaveEntity.ID > 0)
                {
                    selectLeaveType.Value = hrsLeaveEntity.LeaveType.ToString();
                    selectLeaveType.Disabled = true;
                    txtDays.Value = hrsLeaveEntity.Days.ToString();
                    txtFromDate.Value = hrsLeaveEntity.FromDate.ToString("yyyy-MM-dd");
                    txtToDate.Value = hrsLeaveEntity.ToDate.ToString("yyyy-MM-dd");
                    hiddenInstanceId.Value = hrsLeaveEntity.ID.ToString();
                    hiddenActivityInstanceID.Value = ActivityInstanceID.ToString();

                    this.txtDepmanagerRemark.Value = hrsLeaveEntity.DepManagerRemark;
                    this.txtDirectorRemark.Value = hrsLeaveEntity.DirectorRemark;//主管總監
                    this.txtDeputyGeneralRemark.Value = hrsLeaveEntity.DeputyGeneralRemark;//副總經理
                    this.txtGeneralManagerRemark.Value = hrsLeaveEntity.GeneralManagerRemark;//總經理

                    //權限設置
                    IWorkflowService service = new WorkflowService();
                    ActivityInstanceEntity activityInstanceEntity = service.GetActivityInstance(ActivityInstanceID);
                    ProcessInstanceEntity processInstanceEntity = service.GetProcessInstance(activityInstanceEntity.ProcessInstanceID);

                    this.txtProcessGUID.Value = activityInstanceEntity.ProcessGUID;
                    if (activityInstanceEntity != null)
                    {
                        ActivityEntity activityEntity = service.GetActivityEntity(processInstanceEntity.ProcessGUID,
                            processInstanceEntity.Version,
                            activityInstanceEntity.ActivityGUID);

                        var roles = service.GetActivityRoles(processInstanceEntity.ProcessGUID,
                            processInstanceEntity.Version,
                            activityInstanceEntity.ActivityGUID);

                        if (activityEntity != null && roles != null && roles.Count > 0)
                        {
                            foreach (var role in roles)
                            {
                                if (role.ID == LoginRoleID)
                                {
                                    switch (role.ID)
                                    {
                                        case 2://部門經理
                                            this.txtDepmanagerRemark.Disabled = false;
                                            hiddenPerformField.Value = "DepManager";
                                            break;

                                        case 4://主管總監
                                            this.txtDirectorRemark.Disabled = false;
                                            hiddenPerformField.Value = "Director";
                                            break;

                                        case 7://副總經理
                                            this.txtDeputyGeneralRemark.Disabled = false;
                                            hiddenPerformField.Value = "Deputy";
                                            break;

                                        case 8://總經理
                                            this.txtGeneralManagerRemark.Disabled = false;
                                            hiddenPerformField.Value = "General";
                                            break;
                                    }
                                }
                            }
                        }
                    }

                }
            }
        }
開發者ID:yydon,項目名稱:slickflow,代碼行數:75,代碼來源:HrsLeaveApproval.aspx.cs

示例2: GetProcessInstance

        public ProcessInstanceEntity GetProcessInstance()
        {
            IWorkflowService service = new WorkflowService();
            var instance = service.GetProcessInstance(14001);

            return instance;
        }
開發者ID:huoxudong125,項目名稱:Slickflow,代碼行數:7,代碼來源:Wf2GoController.cs

示例3: List

        public ActionResult List(int id = 1, string processGuid = "", int activityInstanceID = 0)
        {
            if (id == 1)
            {
                ViewBag.Message = "非法鏈接";
                return View();
            }
            else
            {
                if (string.IsNullOrEmpty(processGuid))
                {
                    WorkFlowManager work = new WorkFlowManager();
                    LeaveEntity entity = work.FindById(id);
                    string s = @"<table class='table table-bordered'>"
                                + "<tr><td>部門經理</td><td>" + entity.DepManagerRemark + "</td></tr>"
                                + "<tr><td>主管總監 </td><td>" + entity.DirectorRemark + "</td></tr>"
                                + "<tr><td>副總經理</td><td>" + entity.DeputyGeneralRemark + "</td></tr>"
                                + "<tr><td>總經理</td><td>" + entity.GeneralManagerRemark + "</td> </tr></table>";
                    ViewBag.Shenpi = s;
                    return View(entity);
                }
                else
                {
                    WorkFlowManager work = new WorkFlowManager();
                    LeaveEntity entity = work.FindById(id);
                    //權限設置
                    IWorkflowService service = new WorkflowService();

                    ActivityInstanceEntity activityInstanceEntity = service.GetActivityInstance(activityInstanceID);
                    ProcessInstanceEntity processInstanceEntity = service.GetProcessInstance(activityInstanceEntity.ProcessInstanceID);

                    string s = "";
                    if (activityInstanceEntity != null)
                    {
                        ActivityEntity activityEntity = service.GetActivityEntity(processGuid, 
                            processInstanceEntity.Version,
                            activityInstanceEntity.ActivityGUID);

                        var roles = service.GetActivityRoles(processGuid, processInstanceEntity.Version, activityInstanceEntity.ActivityGUID);
                        if (activityEntity != null && roles != null && roles.Count > 0)
                        {
                            //用戶角色列表
                            IList<string> roleUser = UserManager.GetRoles(Convert.ToInt32(User.Identity.GetUserId()));

                            foreach (var role in roles)
                            {
                                //為方便起見這裏隻取第一個角色,開發人員可以自行調整
                                if (role.RoleCode == roleUser[0].ToString())
                                {
                                    switch (role.ID)
                                    {
                                        case 2:
                                            //部門經理審批
                                            s = @"<table class='table table-bordered'>" +
                                            "<tr><td>部門經理</td><td><input type='text'class='form-control' name='DepManagerRemark'></td></tr>" +
                                            "<tr><td>主管總監 </td><input type='text' class='form-control' name='DirectorRemark' style='display:none'></td></tr>" +
                                            "<tr><td>副總經理</td><td><input type='text' class='form-control' name='DeputyGeneralRemark' style='display:none'></td></tr>" +
                                            "<tr><td>總經理</td><td><input class='form-control' name='GeneralManagerRemark'  style='display:none' type='text' /> </td> </tr>"
                                            ;
                                            break;
                                        case 3:
                                            //主管總監審批
                                            s = @"<table class='table table-bordered'>" +
                                            "<tr><td>部門經理</td><td>" + entity.DepManagerRemark + "<input type='text'class='form-control'  style='display:none' name='DepManagerRemark' value='" + entity.DepManagerRemark + "'></td></tr>" +
                                            "<tr><td>主管總監 </td><input type='text' class='form-control' name='DirectorRemark' ></td></tr>" +
                                            "<tr><td>副總經理</td><td><input type='text' class='form-control' name='DeputyGeneralRemark' style='display:none'></td></tr>" +
                                            "<tr><td>總經理</td><td><input class='form-control' name='GeneralManagerRemark'  style='display:none' type='text' /> </td> </tr>"
                                                                                ;
                                            break;
                                        case 7:
                                            //副總經理審批
                                            s = @"<table class='table table-bordered'>" +
                                            "<tr><td>部門經理</td><td>" + entity.DepManagerRemark + "<input type='text'class='form-control' style='display:none' name='DepManagerRemark' value='" + entity.DepManagerRemark + "'></td></tr>" +
                                            "<tr><td>主管總監 </td><td>" + entity.DirectorRemark + "<input type='text' class='form-control' name='DirectorRemark' value='" + entity.DirectorRemark + "' ></td></tr>" +
                                            "<tr><td>副總經理</td><td><input type='text' class='form-control' name='DeputyGeneralRemark' style='display:none'></td></tr>" +
                                            "<tr><td>總經理</td><td><input class='form-control' name='GeneralManagerRemark'  style='display:none' type='text' /> </td> </tr>";
                                            break;
                                        case 8:
                                            //總經理審批
                                            s = @"<table class='table table-bordered'>" +
"<tr><td>部門經理</td><td>" + entity.DepManagerRemark + "<input type='text'class='form-control' style='display:none' name='DepManagerRemark' value='" + entity.DepManagerRemark + "'></td></tr>" +
"<tr><td>主管總監 </td><td>" + entity.DirectorRemark + "<input type='text' class='form-control' name='DirectorRemark' value='" + entity.DirectorRemark + "' ></td></tr>" +
"<tr><td>副總經理</td><td><input type='text' class='form-control' name='DeputyGeneralRemark' style='display:none' value='" + entity.DeputyGeneralRemark + "'></td></tr>" +
"<tr><td>總經理</td><td><input class='form-control' name='GeneralManagerRemark' type='text' /> </td> </tr>"
                                    ;
                                            break;
                                    }
                                }
                            }
                        }
                    }
                    //獲取當前角色      
                    ViewBag.Shenpi = "<form action='' id='Remark'>" + s + "</table></form><button class='btn btn-primary' id='agree'>同意</button><button class='btn btn-primary' id='return'>退回</button>";
                    ViewBag.processGUID = processGuid;
                    ViewBag.days = entity.Days;
                    return View(entity);
                }
            }
            //表示出現錯誤
            return View();
//.........這裏部分代碼省略.........
開發者ID:yydon,項目名稱:slickflow,代碼行數:101,代碼來源:LeaveController.cs


注:本文中的Slickflow.Engine.Service.WorkflowService.GetProcessInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。