public object GetPopUp(Guid threadTaskID, Guid formID)
        {
            using (ThreadTaskService threadTaskService = new ThreadTaskService())
            {
                using (DynamicFormService dynamicFormService = new DynamicFormService())
                {
                    sysBpmsThreadTask threadTask = threadTaskService.GetInfo(threadTaskID, new string[] { nameof(sysBpmsThreadTask.Thread) });
                    using (ProcessEngine ProcessEngine = new ProcessEngine(new EngineSharedModel(threadTask.ThreadID, threadTask.Thread.ProcessID, this.MyRequest.GetList(dynamicFormService.GetInfo(formID).ConfigXmlModel.IsEncrypted, base.ApiSessionId).ToList(), base.ClientUserName, base.ApiSessionId)))
                    {
                        GetTaskFormResponseModel responseVM = ProcessEngine.GetForm(threadTaskID, formID);
                        if (responseVM.EngineFormModel != null)
                        {
                            string popUpUrl = UrlUtility.GetCartableApiUrl(base.MyRequest, base.PortalSettings.DefaultPortalAlias, nameof(CartableThreadController.GetPopUp), nameof(CartableThreadController), "", "threadTaskID=" + threadTaskID);
                            string postUrl  = UrlUtility.GetCartableApiUrl(base.MyRequest, base.PortalSettings.DefaultPortalAlias, nameof(CartableThreadController.PostPopUp), nameof(CartableThreadController), "", UrlUtility.GetParamsAsArray(new HttpRequestWrapper(base.MyRequest), new string[] { $"formID={formID}", $"threadTaskID={threadTaskID}", $"stepID={responseVM.EngineFormModel.FormModel.StepID}" }).ToArray());

                            responseVM.EngineFormModel.SetUrls(popUpUrl, postUrl, new HttpRequestWrapper(base.MyRequest), base.PortalSettings.DefaultPortalAlias, FormTokenUtility.GetFormToken(base.ApiSessionId, responseVM.EngineFormModel?.FormModel?.ContentHtml?.DynamicFormID ?? Guid.Empty, responseVM?.EngineFormModel?.FormModel?.IsEncrypted ?? false));
                        }
                        return(new
                        {
                            Model = responseVM?.EngineFormModel,
                            MessageList = responseVM?.ListMessageModel.Select(c => new PostMethodMessage(c.Message, c.DisplayMessageType)),
                            RedirectUrl = base.GetRedirectUrl(responseVM?.RedirectUrlModel),
                            Result = true,
                        });
                    }
                }
            }
        }
예제 #2
0
        public object GetThreadDetail(Guid ThreadID)
        {
            using (ThreadService threadService = new ThreadService())
            {
                using (ThreadTaskService threadTaskService = new ThreadTaskService())
                {
                    using (DynamicFormService dynamicFormService = new DynamicFormService())
                    {
                        ThreadDetailDTO threadDetailDTO = new ThreadDetailDTO(
                            threadService.GetInfo(ThreadID,
                                                  new string[] { nameof(sysBpmsThread.User), nameof(sysBpmsThread.Process) }),
                            threadTaskService.GetList(ThreadID, (int)sysBpmsTask.e_TypeLU.UserTask, null, null, new string[] { $"{nameof(sysBpmsThreadTask.Task)}.{nameof(sysBpmsThreadTask.Task.Element)}", nameof(sysBpmsThreadTask.User) }).Select(c => new ThreadHistoryDTO(c)).ToList());

                        List <sysBpmsDynamicForm> listForms = dynamicFormService.GetList(threadDetailDTO.ProcessID, null, null, "", true, null);
                        using (ProcessEngine processEngine = new ProcessEngine(new EngineSharedModel(ThreadID, threadDetailDTO.ProcessID, this.MyRequest.GetList(false, HttpContext.Current.Session.SessionID).ToList(), base.UserInfo.Username, HttpContext.Current.Session.SessionID)))
                        {
                            foreach (var item in listForms)
                            {
                                var             result          = processEngine.GetContentHtmlByFormID(item.ID, true);
                                EngineFormModel engineFormModel = new EngineFormModel(result.FormModel, ThreadID, null, threadDetailDTO.ProcessID);
                                engineFormModel.GetPopUpUrl = UrlUtility.GetCartableApiUrl(base.MyRequest, base.PortalSettings.DefaultPortalAlias, "GetPopUp", "CartableThread", "");
                                threadDetailDTO.ListOverviewForms.Add(engineFormModel);
                            }
                        }
                        return(threadDetailDTO);
                    }
                }
            }
        }
        public object GetThreadDetail(Guid ThreadID)
        {
            using (ThreadService threadService = new ThreadService())
            {
                using (ThreadTaskService threadTaskService = new ThreadTaskService())
                {
                    using (DynamicFormService dynamicFormService = new DynamicFormService())
                    {
                        ThreadDetailDTO threadDetailDTO = new ThreadDetailDTO(
                            threadService.GetInfo(ThreadID,
                                                  new string[] { nameof(sysBpmsThread.User), nameof(sysBpmsThread.Process) }),
                            threadTaskService.GetList(ThreadID, (int)sysBpmsTask.e_TypeLU.UserTask, null, null, new string[] { $"{nameof(sysBpmsThreadTask.Task)}.{nameof(sysBpmsThreadTask.Task.Element)}", nameof(sysBpmsThreadTask.User) }).Select(c => new ThreadHistoryDTO(c)).ToList());

                        List <sysBpmsDynamicForm> listForms = dynamicFormService.GetList(threadDetailDTO.ProcessID, null, null, "", true, null);
                        using (ProcessEngine processEngine = new ProcessEngine(new EngineSharedModel(ThreadID, threadDetailDTO.ProcessID, this.MyRequest.GetList(false, base.ApiSessionId).ToList(), base.ClientUserName, base.ApiSessionId)))
                        {
                            foreach (var item in listForms)
                            {
                                var             result          = processEngine.GetContentHtmlByFormID(item.ID, true);
                                EngineFormModel engineFormModel = new EngineFormModel(result.FormModel, ThreadID, null, threadDetailDTO.ProcessID);
                                string          popUpUrl        = UrlUtility.GetCartableApiUrl(base.MyRequest, base.PortalSettings.DefaultPortalAlias, nameof(CartableThreadController.GetPopUp), nameof(CartableThreadController), "");
                                engineFormModel.SetReadOnlyUrls(popUpUrl, new HttpRequestWrapper(base.MyRequest), base.PortalSettings.DefaultPortalAlias, FormTokenUtility.GetFormToken(base.ApiSessionId, engineFormModel?.FormModel?.ContentHtml?.DynamicFormID ?? Guid.Empty, engineFormModel?.FormModel?.IsEncrypted ?? false));
                                threadDetailDTO.ListOverviewForms.Add(engineFormModel);
                            }
                        }
                        return(threadDetailDTO);
                    }
                }
            }
        }
예제 #4
0
        public object GetPopUp(Guid formID)
        {
            using (DynamicFormService dynamicFormService = new DynamicFormService())
            {
                sysBpmsDynamicForm dynamicForm      = dynamicFormService.GetInfo(formID);
                Guid applicationId                  = dynamicForm.ApplicationPageID.Value;
                EngineSharedModel engineSharedModel = new EngineSharedModel(applicationId, base.MyRequest.GetList(this.IsEncrypted, base.ApiSessionId).ToList(), base.ClientUserName, base.ApiSessionId);
                using (ApplicationPageEngine applicationPageEngine = new ApplicationPageEngine(engineSharedModel))
                {
                    GetFormResponseModel responseVM = applicationPageEngine.GetForm();
                    if (responseVM.EngineFormModel != null)
                    {
                        string popUpUrl = UrlUtility.GetCartableApiUrl(base.MyRequest, base.PortalSettings.DefaultPortalAlias, nameof(CartablePageController.GetPopUp), nameof(CartablePageController), "");
                        string postUrl  = UrlUtility.GetCartableApiUrl(base.MyRequest, base.PortalSettings.DefaultPortalAlias, nameof(CartablePageController.PostPopUp), nameof(CartablePageController), "", UrlUtility.GetParamsAsArray(new HttpRequestWrapper(base.MyRequest), new string[] { $"applicationPageId={applicationId}" }).ToArray());
                        responseVM.EngineFormModel.SetUrls(popUpUrl, postUrl, new HttpRequestWrapper(base.MyRequest), base.PortalSettings.DefaultPortalAlias, FormTokenUtility.GetFormToken(base.ApiSessionId, responseVM?.EngineFormModel?.FormModel?.ContentHtml?.DynamicFormID ?? Guid.Empty, responseVM?.EngineFormModel?.FormModel?.IsEncrypted ?? false));
                    }

                    return(new
                    {
                        Model = responseVM?.EngineFormModel,
                        MessageList = responseVM?.ListMessageModel.Select(c => new PostMethodMessage(c.Message, c.DisplayMessageType)),
                        RedirectUrl = base.GetRedirectUrl(responseVM?.RedirectUrlModel),
                        Result = true,
                    });
                }
            }
        }