예제 #1
0
        public object GetEditApplicationPage(Guid ApplicationPageID)
        {
            //base.SetMenuIndex(AdminMenuIndex.ApplicationPageEdit);
            using (DynamicFormService dynamicFormService = new DynamicFormService())
            {
                DynamicFormDTO dynamicFormDTO = new DynamicFormDTO(dynamicFormService.GetInfoByPageID(ApplicationPageID));
                using (LURowService luRowService = new LURowService())
                {
                    dynamicFormDTO.ApplicationPageDTO.ListGroupLU = luRowService.GetList(sysBpmsLUTable.e_LUTable.ApplicationPageGroupLU.ToString()).Select(c => new LURowDTO(c)).ToList();
                }

                using (ApplicationPageAccessService applicationPageAccessService = new ApplicationPageAccessService())
                    using (LURowService luRowService = new LURowService())
                        using (UserService userService = new UserService())
                            using (DepartmentService departmentService = new DepartmentService())
                                return(Json(new
                                {
                                    ListApplicationPageAccess = applicationPageAccessService.GetList(dynamicFormDTO.ApplicationPageID, null).Select(c => new ApplicationPageAccessDTO(c)).ToList(),
                                    ListDepartments = departmentService.GetList(true, "", null).Select(c => new DepartmentDTO(c)).ToList(),
                                    ListRoles = luRowService.GetList(sysBpmsLUTable.e_LUTable.DepartmentRoleLU.ToString()).Select(c => new LURowDTO(c)).ToList(),
                                    ListUsers = userService.GetList("", null).Select(c => new UserDTO(c)).ToList(),
                                    Model = dynamicFormDTO
                                }));
            }
        }
예제 #2
0
 public object GetAddEditFormDesign(Guid?ID = null)
 {
     using (DynamicFormService dynamicFormService = new DynamicFormService())
     {
         DynamicFormDTO dynamicFormDTO = new DynamicFormDTO(ID.HasValue ? dynamicFormService.GetInfo(ID.Value) :
                                                            dynamicFormService.GetInfoByPageID(base.ApplicationPageId.Value));
         if (dynamicFormDTO != null)
         {
             using (VariableService variableService = new VariableService())
                 return(Json(new
                 {
                     //it is used in dataGrid seting for binging form to openForm Column Item Type.
                     ProcessForms = dynamicFormService.GetList(dynamicFormDTO.ProcessId, null, base.ApplicationPageId.HasValue, string.Empty, null, null).Select(c => new { value = c.ID, text = c.Name }).ToList(),
                     //it is used for binding variable of entity type to fileupload controls.
                     EntityVariables = variableService.GetList(dynamicFormDTO.ProcessId, base.ApplicationPageId, (int)sysBpmsVariable.e_VarTypeLU.Object, "", null, true).Select(c => new { text = c.Name, value = c.ID }).ToList(),
                     //it is used for binding variable of list type to list controls like dropdownlist or checkboxlist and uploader.
                     ListVariables = variableService.GetList(dynamicFormDTO.ProcessId, base.ApplicationPageId, (int)sysBpmsVariable.e_VarTypeLU.List, "", null, true).Select(c => new { text = c.Name, value = c.Name }).ToList(),
                     Model = dynamicFormDTO
                 }));
         }
         else
         {
             return(new PostMethodMessage(SharedLang.Get("NotFound.Text"), DisplayMessageType.error));
         }
     }
 }
 public DynamicFormDTO GetInfo(Guid applicationPageId)
 {
     using (DynamicFormService dynamicFormService = new DynamicFormService())
     {
         return(new DynamicFormDTO(dynamicFormService.GetInfoByPageID(applicationPageId)));
     }
 }
예제 #4
0
        public ActionResult Settings()
        {
            var settings = new SingleActionSettingDTO(base.PortalSettings.PortalId, ModuleContext.Configuration.ModuleSettings);

            try
            {
                if (!string.IsNullOrWhiteSpace(settings.WebApiAddress))
                {
                    settings.ProcessName        = settings.ProcessID.HasValue ? new EngineProcessProxy(settings.WebApiAddress, settings.WebServicePass, base.User.Username, ApiUtility.GetIPAddress(), base.Session.SessionID, false).GetInfo(settings.ProcessID.Value)?.Name : "";
                    settings.ProcessEndFormName = settings.ProcessEndFormID.HasValue ? new EngineFormProxy(settings.WebApiAddress, settings.WebServicePass, base.User.Username, ApiUtility.GetIPAddress(), base.Session.SessionID, false).GetInfo(settings.ProcessEndFormID.Value)?.Name : "";;
                    settings.ApplicationName    = settings.ApplicationPageID.HasValue ? new EngineApplicationProxy(settings.WebApiAddress, settings.WebServicePass, base.User.Username, ApiUtility.GetIPAddress(), base.Session.SessionID, false).GetInfo(settings.ApplicationPageID.Value)?.Name : "";
                }
                else
                {
                    if (settings.ProcessID.HasValue)
                    {
                        using (ProcessService processService = new ProcessService())
                            settings.ProcessName = processService.GetInfo(settings.ProcessID.Value).Name;
                    }

                    if (settings.ProcessEndFormID.HasValue)
                    {
                        using (DynamicFormService dynamicFormService = new DynamicFormService())
                            settings.ProcessEndFormName = dynamicFormService.GetInfo(settings.ProcessEndFormID.Value).Name;
                    }

                    if (settings.ApplicationPageID.HasValue)
                    {
                        using (DynamicFormService dynamicFormService = new DynamicFormService())
                            settings.ApplicationName = dynamicFormService.GetInfoByPageID(settings.ApplicationPageID.Value).Name;
                    }
                }
                if (string.IsNullOrWhiteSpace(settings.ApplicationName) && string.IsNullOrWhiteSpace(settings.ProcessName))
                {
                    settings.ProcessID         = null;
                    settings.ApplicationPageID = null;
                }
            }
            catch
            {
            }

            if (!string.IsNullOrWhiteSpace(settings.WebApiAddress))
            {
                ViewBag.ApplicationPageUrl = ApiUtility.GetGeneralApiUrl(base.Request, base.ModuleContext.TabModuleId, base.PortalSettings.DefaultPortalAlias, "GetList", "EngineApplication", FormTokenUtility.GetFormToken(base.Session.SessionID, Guid.Empty, false), true);
                ViewBag.ProcessFormUrl     = ApiUtility.GetGeneralApiUrl(base.Request, base.ModuleContext.TabModuleId, base.PortalSettings.DefaultPortalAlias, "GetList", "EngineForm", FormTokenUtility.GetFormToken(base.Session.SessionID, Guid.Empty, false), true);
                ViewBag.ProcessUrl         = ApiUtility.GetGeneralApiUrl(base.Request, base.ModuleContext.TabModuleId, base.PortalSettings.DefaultPortalAlias, "GetList", "EngineProcess", FormTokenUtility.GetFormToken(base.Session.SessionID, Guid.Empty, false), true);
            }
            else
            {
                ViewBag.ApplicationPageUrl = UrlUtility.GetApiUrl(base.Request, base.PortalSettings.DefaultPortalAlias, "GetList", "EngineApplication", FormTokenUtility.GetFormToken(base.Session.SessionID, Guid.Empty, false));
                ViewBag.ProcessFormUrl     = UrlUtility.GetApiUrl(base.Request, base.PortalSettings.DefaultPortalAlias, "GetList", "EngineForm", FormTokenUtility.GetFormToken(base.Session.SessionID, Guid.Empty, false));
                ViewBag.ProcessUrl         = UrlUtility.GetApiUrl(base.Request, base.PortalSettings.DefaultPortalAlias, "GetList", "EngineProcess", FormTokenUtility.GetFormToken(base.Session.SessionID, Guid.Empty, false));
            }

            ViewBag.Url = base.ActivePage.FullUrl + "/controller/Settings/action/UpdatePass";
            return(View(settings));
        }
        private void InitialData(DesignCodeDTO codeDTO, Guid?dynamicFormId = null)
        {
            //codeDTO.DesignCodeData = (string.Join(",", codeDTO.CodeObjects.Select(c => string.Format("{{data:'{0}',shapeId:'{1}',id:'{2}'}}", (DesignCodeUtility.ConvertDesignCodeObjectToXml((c)).ToBase64()), ((DCBaseModel)c).ShapeID, ((DCBaseModel)c).ID))));
            codeDTO.DesignCodeData = codeDTO.CodeObjects.Select(c => new { data = DesignCodeUtility.ConvertDesignCodeObjectToXml((c)).ToBase64(), shapeId = ((DCBaseModel)c).ShapeID, id = ((DCBaseModel)c).ID }).ToList();
            using (VariableService variableService = new VariableService())
                codeDTO.ProcessVariables = variableService.GetVariableAsComboTree(base.ProcessId, base.ApplicationPageId, null, "{0}");
            codeDTO.AssembliesJson = Directory.Exists(BPMSResources.FilesRoot + BPMSResources.AssemblyRoot) ? new DirectoryInfo(BPMSResources.FilesRoot + BPMSResources.AssemblyRoot).GetFiles("*.dll").Select(c => new AssemblyDTO(c)).Select(c => new ComboTreeModel()
            {
                id = c.FileName, title = c.FileName
            }).ToList() : new List <ComboTreeModel>();
            using (DynamicFormService dynamicFormService = new DynamicFormService())
                codeDTO.ApplicationPages = dynamicFormService.GetList(null, null, true, string.Empty, null, null).Select(c => new QueryModel(c.ApplicationPageID.ToString(), c.Name)).ToList();

            using (LURowService luRowService = new LURowService())
                codeDTO.DepartmentRoles = luRowService.GetList("DepartmentRoleLU").Select(c => new LURowDTO(c)).ToList();
            using (DepartmentService departmentService = new DepartmentService())
                codeDTO.DepartmentList = departmentService.GetList(true, "", null).Select(c => new QueryModel($"new Guid(\"{ c.ID }\")", c.Name)).ToList();
            using (DocumentFolderService documentFolderService = new DocumentFolderService())
                codeDTO.DocumentFolders = documentFolderService.GetList(null, "", "", true).Select(c => new DocumentFolderDTO(c)).ToList();
            using (DynamicFormService dynamicFormService = new DynamicFormService())
            {
                if (dynamicFormId != Guid.Empty && dynamicFormId.HasValue)
                {
                    codeDTO.ProcessControls = dynamicFormService.GetControls(dynamicFormService.GetInfo(dynamicFormId.Value)).Select(c => new QueryModel(c.Key, c.Value)).ToList();
                }
                else
                if (base.ApplicationPageId.HasValue)
                {
                    codeDTO.ProcessControls = dynamicFormService.GetControls(dynamicFormService.GetInfoByPageID(base.ApplicationPageId.Value)).Select(c => new QueryModel(c.Key, c.Value)).ToList();
                }
                else
                {
                    codeDTO.ProcessControls = new List <QueryModel>();
                }
            }
        }