public object PostLoadConditionForm(PostLoadConditionFormDTO model)
        {
            Guid?            dynamicFormId = model.DynamicFormId.ToGuidObjNull();
            DCConditionModel designCode;

            if (!string.IsNullOrWhiteSpace(model.Data))
            {
                designCode = DesignCodeUtility.GetObjectOfDesignCode <DCConditionModel>(model.Data.ToStringObj().FromBase64());

                designCode.IsOutputYes = model.IsOutputYes.ToBoolObjNull();
                if (string.IsNullOrWhiteSpace(designCode.FuncName))
                {
                    designCode.FuncName = DesignCodeUtility.GetFunctionName(designCode.ShapeID);
                }
            }
            else
            {
                designCode = new DCConditionModel(Guid.NewGuid().ToString(), model.Name.ToStringObj(),
                                                  model.ShapeId.ToStringObj(), model.ParentShapeId.ToStringObj(),
                                                  model.IsOutputYes.ToBoolObjNull(), new List <DCRowConditionModel>(), model.IsFirst.ToBoolObj(), null);
            }

            using (VariableService variableService = new VariableService())
                using (DynamicFormService dynamicFormService = new DynamicFormService())
                    return new
                           {
                               ProcessControls = dynamicFormId != Guid.Empty && dynamicFormId.HasValue ?
                                                 dynamicFormService.GetControls(dynamicFormService.GetInfo(dynamicFormId.Value)).Select(c => new QueryModel(c.Key, c.Value)).ToList() : new List <QueryModel>(),
                               ListOperationTypes = EnumObjHelper.GetEnumList <DCRowConditionModel.e_OperationType>().Select(c => new QueryModel(c.Key.ToString(), c.Value)).ToList(),
                               Model = designCode
                           };
        }
        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 PostLoadDesignCodeActionList(PostLoadDesignCodeActionListDTO model)
 {
     return(new
     {
         ListActionTypes = EnumObjHelper.GetEnumList <DCBaseModel.e_ActionType>().Select(c => new QueryModel(c.Key.ToString(), c.Value)).ToList(),
         model.ShapeId,
         DynamicFormId = model.DynamicFormId.ToGuidObjNull(),
         model.ParentShapeId,
         model.IsOutputYes,
         Name = model.Name.ToStringObj().Trim(),
         model.IsFirst,
         Base64Code = model.Action.ToStringObj(),
         FuncName = DesignCodeUtility.GetFunctionName(model.ShapeId),
         Model = DesignCodeUtility.GetObjectOfDesignCode <object>(model.Action.ToStringObj().FromBase64()),
     });
 }