Beispiel #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
                                }));
            }
        }
Beispiel #2
0
        public object PostAddEdit(LURowDTO lURowDTO)
        {
            using (LURowService luRowService = new LURowService())
            {
                ResultOperation resultOperation = null;
                sysBpmsLURow    lURow           = new sysBpmsLURow().Update(lURowDTO.LUTableID, lURowDTO.NameOf, lURowDTO.CodeOf, lURowDTO.DisplayOrder, lURowDTO.IsSystemic, lURowDTO.IsActive);
                lURow.ID = lURowDTO.ID;
                if (lURow.ID != Guid.Empty)
                {
                    resultOperation = luRowService.Update(lURow);
                }
                else
                {
                    resultOperation = luRowService.Add(lURow);
                }

                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
Beispiel #3
0
 public DepartmentMemberAddEditDTO(Guid departmentID, Guid?userId)
 {
     this.DepartmentID = departmentID;
     this.UserID       = userId ?? Guid.Empty;
     using (LURowService luRowService = new LURowService())
         this.Roles = userId.HasValue ?
                      new DepartmentMemberService().GetList(this.DepartmentID, null, this.UserID)
                      .Select(c => new QueryModel(c.RoleLU.ToString(), luRowService.GetNameOfByAlias("DepartmentRoleLU", c.RoleLU.ToString()))).ToList() : new List <QueryModel>();
 }
Beispiel #4
0
 public object Delete(Guid ID)
 {
     using (LURowService luRowService = new LURowService())
     {
         ResultOperation resultOperation = luRowService.Delete(ID);
         if (resultOperation.IsSuccess)
         {
             return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
         }
         return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
     }
 }
Beispiel #5
0
 public object GetList([System.Web.Http.FromUri] LURowIndexSearchDTO indexSearchVM)
 {
     using (LURowService luRowService = new LURowService())
     {
         indexSearchVM.Update(indexSearchVM.LUTableID.HasValue ? luRowService.GetList(indexSearchVM.LUTableID.Value, "", true, indexSearchVM.GetPagingProperties).Select(c => new LURowDTO(c)).ToList() : new List <LURowDTO>());
         using (LUTableService luTableService = new LUTableService())
         {
             indexSearchVM.Update(luTableService.GetList());
         }
         return(indexSearchVM);
     }
 }
Beispiel #6
0
 public object GetAddEdit(Guid DepartmentID, Guid?UserID = null)
 {
     using (LURowService lURowService = new LURowService())
     {
         using (UserService userService = new UserService())
         {
             DepartmentMemberAddEditDTO departmentMemberAddEditDTO = new DepartmentMemberAddEditDTO(DepartmentID, UserID);
             departmentMemberAddEditDTO.ListUsers = userService.GetList("", null).Select(c => new UserDTO(c)).ToList();
             departmentMemberAddEditDTO.ListRoles = lURowService.GetList("DepartmentRoleLU").Select(c => new LURowDTO(c)).ToList();
             return(departmentMemberAddEditDTO);
         }
     }
 }
Beispiel #7
0
 public object GetAddEdit(Guid?ID = null, Guid?LUTableID = null)
 {
     using (LURowService luRowService = new LURowService())
     {
         using (LUTableService luTableService = new LUTableService())
         {
             sysBpmsLURow lURow = !ID.HasValue ?
                                  new sysBpmsLURow().Update(LUTableID.Value, "", (luRowService.MaxCodeOfByLUTableID(LUTableID.Value) + 1).ToStringObj(), luRowService.MaxOrderByLUTableID(LUTableID.Value) + 1, false, true) :
                                  luRowService.GetInfo(ID.Value);
             return(new LURowDTO(lURow));
         }
     }
 }
        public object PostLoadExpressionCodeForm(PostLoadExpressionCodeFormDTO model)
        {
            DCExpressionModel designCode;
            Guid?dynamicFormId = model.DynamicFormId.ToGuidObjNull();

            if (!string.IsNullOrWhiteSpace(model.Data))
            {
                designCode             = DesignCodeUtility.GetObjectOfDesignCode <DCExpressionModel>(model.Data.FromBase64());
                designCode.IsOutputYes = model.IsOutputYes;
                if (string.IsNullOrWhiteSpace(designCode.FuncName))
                {
                    designCode.FuncName = DesignCodeUtility.GetFunctionName(designCode.ShapeID);
                }
            }
            else
            {
                designCode = new DCExpressionModel(Guid.NewGuid().ToString(), model.Name.ToStringObj(),
                                                   model.ShapeId.ToStringObj(), model.ParentShapeId.ToStringObj(),
                                                   "", model.IsOutputYes, model.IsFirst.ToBoolObj(), null);
            }
            designCode.Assemblies     = string.Join(",", designCode.Assemblies.ToStringObj().Split(',').Select(c => c.Trim()).ToList());
            designCode.ExpressionCode = designCode.ExpressionCode.ToStringObj().Replace("\\", "\\\\");
            using (DocumentFolderService documentFolderService = new DocumentFolderService())
                using (DepartmentService departmentService = new DepartmentService())
                    using (LURowService luRowService = new LURowService())
                        using (VariableService variableService = new VariableService())
                            using (DynamicFormService dynamicFormService = new DynamicFormService())
                                return new
                                       {
                                           GetAllSysMethods    = DesignCodeUtility.GetAllSysMethods().Select(c => new { Key = c }).ToList(),
                                           GetVariableMethods  = DesignCodeUtility.GetVariableMethods().Select(c => new { Key = c }).ToList(),
                                           GetMessageMethods   = DesignCodeUtility.GetMessageMethods().Select(c => new { Key = c }).ToList(),
                                           GetAccessMethods    = DesignCodeUtility.GetAccessMethods().Select(c => new { Key = c }).ToList(),
                                           GetHelperMethods    = DesignCodeUtility.GetHelperMethods().Select(c => new { Key = c }).ToList(),
                                           GetDocumentMethods  = DesignCodeUtility.GetDocumentMethods().Select(c => new { Key = c }).ToList(),
                                           GetAllSysProperties = DesignCodeUtility.GetAllSysProperties().Select(c => new { Key = c }).ToList(),

                                           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>()),
                                           ApplicationPages = dynamicFormService.GetList(null, null, true, string.Empty, null, null).Select(c => new QueryModel(c.ApplicationPageID.ToString(), c.Name)).ToList(),
                                           DepartmentRoles  = luRowService.GetList("DepartmentRoleLU").Select(c => new LURowDTO(c)).ToList(),
                                           DepartmentList   = departmentService.GetList(true, "", null).Select(c => new { ID = $"new Guid(\"{ c.ID }\")", c.Name }),
                                           DocumentFolders  = documentFolderService.GetList(null, "", "", true).Select(c => new QueryModel(c.ID.ToString(), c.DisplayName)).ToList(),
                                           ProcessVariables = variableService.GetVariableAsComboTree(base.ProcessId, base.ApplicationPageId, null, "{0}"),
                                           ProcessControls  = dynamicFormId != Guid.Empty && dynamicFormId.HasValue ?
                                                              dynamicFormService.GetControls(dynamicFormService.GetInfo(dynamicFormId.Value)).Select(c => new QueryModel(c.Key, c.Value)).ToList() : new List <QueryModel>(),
                                           Model = designCode
                                       };
        }
        public object GetPagesForMenu()
        {
            List <sysBpmsApplicationPage> list = new ApplicationPageEngine(new EngineSharedModel(Guid.Empty, null, this.ClientUserName, "")).GetAvailable(null, this.ClientUserName, true);

            using (LURowService luRowService = new LURowService())
                return(list.GroupBy(c => c.GroupLU).Select(c => new
                {
                    Group = c.Key,
                    GroupName = luRowService.GetNameOfByAlias(sysBpmsLUTable.e_LUTable.ApplicationPageGroupLU.ToString(), c.Key.ToString()),
                    List = c.ToList().Select(d => new
                    {
                        d.ID,
                        Name = d.DynamicForms.FirstOrDefault()?.Name ?? "no page"
                    }),
                }).ToList());
        }
Beispiel #10
0
 public object GetAddEdit(Guid?ID = null)
 {
     using (DynamicFormService dynamicFormService = new DynamicFormService())
     {
         DynamicFormDTO dynamicFormDTO = ID.HasValue ? new DynamicFormDTO(dynamicFormService.GetInfo(ID.Value)) : new DynamicFormDTO();
         dynamicFormDTO.ProcessId = base.ProcessId;
         if (!dynamicFormDTO.ProcessId.HasValue)
         {
             using (LURowService luRowService = new LURowService())
             {
                 dynamicFormDTO.ApplicationPageDTO             = new ApplicationPageDTO();
                 dynamicFormDTO.ApplicationPageDTO.ListGroupLU = luRowService.GetList(sysBpmsLUTable.e_LUTable.ApplicationPageGroupLU.ToString()).Select(c => new LURowDTO(c)).ToList();
             }
         }
         return(dynamicFormDTO);
     }
 }
Beispiel #11
0
 public object GetList([System.Web.Http.FromUri] UserIndexSearchDTO indexSearchVM)
 {
     using (UserService userService = new UserService())
     {
         List <sysBpmsUser> list = userService.GetList(
             (indexSearchVM.IsAdvSearch ? indexSearchVM.AdvName : indexSearchVM.Name),
             (indexSearchVM.IsAdvSearch ? indexSearchVM.AdvRoleCode : null),
             (indexSearchVM.IsAdvSearch ? indexSearchVM.AdvDepartmentID : null),
             indexSearchVM.GetPagingProperties);
         using (LURowService lURowService = new LURowService())
         {
             using (DepartmentService departmentService = new DepartmentService())
                 indexSearchVM.Update(
                     departmentService.GetList(true, "", null),
                     lURowService.GetList(sysBpmsLUTable.e_LUTable.DepartmentRoleLU.ToString()));
         }
         indexSearchVM.Update(list.Select(c => new UserDTO(c)).ToList());
         return(indexSearchVM);
     }
 }
        public object GetIndex(string ElementId, Guid ProcessId)
        {
            using (TaskService taskService = new TaskService())
            {
                TaskDTO task = new TaskDTO(taskService.GetInfo(ElementId, ProcessId));

                using (DepartmentService departmentService = new DepartmentService())
                    using (UserService userService = new UserService())
                        //for access
                        using (LURowService luRowService = new LURowService())
                            using (DynamicFormService dynamicFormService = new DynamicFormService())
                                using (ProcessService processService = new ProcessService())
                                    using (StepService stepService = new StepService())
                                        return new
                                               {
                                                   ListSteps       = stepService.GetList(task.ID, null).Select(c => new StepDTO(c)).ToList(),
                                                   AllowEdit       = processService.GetInfo(ProcessId).AllowEdit(),
                                                   RoleAccessTypes = EnumObjHelper.GetEnumList <UserTaskRuleModel.e_RoleAccessType>().Select(c => new QueryModel(c.Key.ToString(), c.Value)).ToList(),
                                                   UserAccessTypes = EnumObjHelper.GetEnumList <UserTaskRuleModel.e_UserAccessType>().Select(c => new QueryModel(c.Key.ToString(), c.Value)).ToList(),
                                                   UserTypes       = EnumObjHelper.GetEnumList <UserTaskRuleModel.e_UserType>().Select(c => new QueryModel(c.Key.ToString(), c.Value)).ToList(),
                                                   Departments     = departmentService.GetList(true, "", null).Select(c => new QueryModel(c.ID.ToString(), c.Name)).ToList(),
                                                   Users           = userService.GetList("", null).Select(c => new QueryModel(c.ID.ToString(), c.FullName)).ToList(),
                                                   UsersJson       = (task.MarkerTypeLU.HasValue ? userService.GetList("", null) : new List <sysBpmsUser>()).Select(c => new ComboTreeModel()
                                            {
                                                id    = c.ID.ToString(),
                                                title = c.FullName
                                            }).ToList(),
                                                   OwnerTypes    = luRowService.GetList(sysBpmsLUTable.e_LUTable.LaneOwnerTypeLU.ToString()).Select(c => new QueryModel(c.CodeOf, c.NameOf)).ToList(),
                                                   RoleNames     = luRowService.GetList("DepartmentRoleLU").Select(c => new QueryModel(c.CodeOf, c.NameOf)).ToList(),
                                                   DynamicForms  = dynamicFormService.GetList(ProcessId, null, false, string.Empty, null, null).Select(c => new QueryModel(c.ID.ToString(), c.Name)).ToList(),
                                                   RoleNamesJson = luRowService.GetList("DepartmentRoleLU").Select(c => new ComboTreeModel()
                                            {
                                                id    = c.CodeOf,
                                                title = c.NameOf,
                                            }).ToList(),
                                                   Model = task,
                                               };
            }
        }
        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>();
                }
            }
        }