コード例 #1
0
 public object PostAddEdit(StyleSheetDTO styleSheetDTO)
 {
     if (string.IsNullOrWhiteSpace(styleSheetDTO.FileName))
     {
         return(new PostMethodMessage(string.Format(SharedLang.Get("FormatRequired.Text"), "File Name"), DisplayMessageType.error));
     }
     else
     {
         if (!string.IsNullOrWhiteSpace(styleSheetDTO.CurrentFileName))
         {
             if (System.IO.File.Exists(this.DirectoryFolder + "\\" + this.GetFileName(styleSheetDTO.CurrentFileName)))
             {
                 System.IO.File.Delete(this.DirectoryFolder + "\\" + this.GetFileName(styleSheetDTO.CurrentFileName));
             }
         }
         string fullName = this.GetFileName(styleSheetDTO.FileName);
         if (System.IO.File.Exists(this.DirectoryFolder + "\\" + fullName))
         {
             System.IO.File.Delete(this.DirectoryFolder + "\\" + fullName);
         }
         System.IO.File.Create(this.DirectoryFolder + "\\" + fullName).Close();
         System.IO.File.WriteAllText(this.DirectoryFolder + "\\" + fullName, styleSheetDTO.StyleCode);
         return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
     }
 }
コード例 #2
0
        public object PostAddEdit(DBConnectionDTO DBConnectionDTO)
        {
            sysBpmsDBConnection dBConnection    = new sysBpmsDBConnection();
            ResultOperation     resultOperation = dBConnection.Update(DBConnectionDTO.ID, DBConnectionDTO.Name, DBConnectionDTO.DataSource, DBConnectionDTO.InitialCatalog, DBConnectionDTO.UserID, DBConnectionDTO.Password, DBConnectionDTO.IntegratedSecurity);

            if (!resultOperation.IsSuccess)
            {
                return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
            }

            using (DBConnectionService dBConnectionService = new DBConnectionService())
            {
                if (dBConnection.ID != Guid.Empty)
                {
                    resultOperation = dBConnectionService.Update(dBConnection);
                }
                else
                {
                    resultOperation = dBConnectionService.Add(dBConnection);
                }

                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
コード例 #3
0
        public object PostSaveSubTypeMessage(PostSaveSubTypeMessageDTO model)
        {
            model.SubTypeMessageEventModel.Type  = (int)SubTypeMessageEventModel.e_Type.Message;
            model.SubTypeMessageEventModel.Email = null;

            using (EventService eventService = new EventService())
            {
                switch ((SubTypeMessageEventModel.e_KeyType)model.SubTypeMessageEventModel.KeyType)
                {
                case SubTypeMessageEventModel.e_KeyType.Static:
                    model.SubTypeMessageEventModel.Key = model.KeyStatic;
                    break;

                case SubTypeMessageEventModel.e_KeyType.Variable:
                    model.SubTypeMessageEventModel.Key = model.KeyVariable;
                    break;
                }
                model.SubTypeMessageEventModel.MessageParams = model.ListParameter;
                sysBpmsEvent    _event          = eventService.GetInfo(model.ID);
                ResultOperation resultOperation = _event.Update(model.TypeLU, _event.RefElementID, model.SubTypeMessageEventModel.BuildXml(), model.SubType, _event.CancelActivity, model.MessageTypeID);
                if (!resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
                resultOperation = eventService.Update(_event);
                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
コード例 #4
0
        public object PostAddEditDocumentDef(DocumentDefDTO DocumentDefDTO)
        {
            using (DocumentDefService documentDefService = new DocumentDefService())
            {
                sysBpmsDocumentDef documentDef = DocumentDefDTO.ID != Guid.Empty ? documentDefService.GetInfo(DocumentDefDTO.ID) : new sysBpmsDocumentDef();
                documentDef.Update(DocumentDefDTO.DocumentFolderID, DocumentDefDTO.NameOf, DocumentDefDTO.DisplayName, DocumentDefDTO.MaxSize, DocumentDefDTO.ValidExtentions, DocumentDefDTO.IsMandatory, DocumentDefDTO.Description, DocumentDefDTO.IsSystemic, DocumentDefDTO.IsActive);
                ResultOperation resultOperation = null;
                if (documentDef.ID != Guid.Empty)
                {
                    resultOperation = documentDefService.Update(documentDef);
                }
                else
                {
                    resultOperation = documentDefService.Add(documentDef);
                }

                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
コード例 #5
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));
                }
            }
        }
コード例 #6
0
        public object PostAddEdit(APIAccessDTO APIAccessDTO)
        {
            using (APIAccessService apiAccessService = new APIAccessService())
            {
                ResultOperation  resultOperation = null;
                sysBpmsAPIAccess apiAccess       = new sysBpmsAPIAccess().Update(APIAccessDTO.Name, APIAccessDTO.IPAddress, APIAccessDTO.AccessKey, APIAccessDTO.IsActive);
                apiAccess.ID = APIAccessDTO.ID;
                if (apiAccess.ID != Guid.Empty)
                {
                    resultOperation = apiAccessService.Update(apiAccess);
                }
                else
                {
                    resultOperation = apiAccessService.Add(apiAccess);
                }

                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
コード例 #7
0
        public object PostAddEdit(DepartmentMemberAddEditDTO departmentMemberVM)
        {
            departmentMemberVM.Roles = base.MyRequest.Form["Roles"].ToStringObj().Split(',').Select(c => new QueryModel(c.ToString(), "")).ToList();
            ResultOperation resultOperation = new ResultOperation();

            using (DepartmentMemberService departmentMemberService = new DepartmentMemberService())
            {
                List <sysBpmsDepartmentMember> list = departmentMemberService.GetList(departmentMemberVM.DepartmentID, null, departmentMemberVM.UserID);
                foreach (var item in list.Where(c => !departmentMemberVM.Roles.Select(d => d.Key).Contains(c.RoleLU.ToString())))
                {
                    if (resultOperation.IsSuccess)
                    {
                        resultOperation = departmentMemberService.Delete(item.ID);
                    }
                }
                foreach (var item in departmentMemberVM.Roles.Where(c => !list.Any(d => d.RoleLU == c.Key.ToIntObj())))
                {
                    if (resultOperation.IsSuccess)
                    {
                        sysBpmsDepartmentMember newMember = new sysBpmsDepartmentMember();
                        newMember.Update(departmentMemberVM.DepartmentID, departmentMemberVM.UserID, item.Key.ToIntObj());
                        resultOperation = departmentMemberService.Add(newMember);
                    }
                }
            }
            if (resultOperation.IsSuccess)
            {
                return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
            }
            else
            {
                return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
            }
        }
コード例 #8
0
        public object PostAddEditFolder(DocumentFolderDTO documentFolderDTO)
        {
            using (DocumentFolderService documentFolderService = new DocumentFolderService())
            {
                sysBpmsDocumentFolder documentFolder = !documentFolderDTO.ID.IsNullOrEmpty() ? documentFolderService.GetInfo(documentFolderDTO.ID) : new sysBpmsDocumentFolder();

                documentFolder.Update(documentFolderDTO.DocumentFolderID, documentFolderDTO.NameOf, documentFolderDTO.DisplayName, true);

                ResultOperation resultOperation = null;
                if (!documentFolderDTO.ID.IsNullOrEmpty())
                {
                    resultOperation = documentFolderService.Update(documentFolder);
                }
                else
                {
                    resultOperation = documentFolderService.Add(documentFolder);
                }

                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success, documentFolder.ID));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
コード例 #9
0
        public object PostEditApplicationPage(PostEditApplicationPageDTO model)
        {
            using (DynamicFormService dynamicFormService = new DynamicFormService())
            {
                sysBpmsDynamicForm dynamicForm = dynamicFormService.GetInfo(model.DynamicFormDTO.ID);
                dynamicForm.Update(null, model.DynamicFormDTO.ApplicationPageID, model.DynamicFormDTO.Name, model.DynamicFormDTO.Version, model.DynamicFormDTO.ShowInOverview);

                DynamicFormConfigXmlModel configXmlModel = dynamicForm.ConfigXmlModel;
                configXmlModel.IsEncrypted = model.DynamicFormDTO.IsEncrypted;
                dynamicForm.Update(configXmlModel);

                dynamicFormService.Update(dynamicForm, base.userName);

                using (ApplicationPageService applicationPageService = new ApplicationPageService())
                {
                    sysBpmsApplicationPage applicationPage = applicationPageService.GetInfo(model.DynamicFormDTO.ApplicationPageID.Value);
                    applicationPage.Update(model.DynamicFormDTO.ApplicationPageDTO.GroupLU, model.DynamicFormDTO.ApplicationPageDTO.Description, model.DynamicFormDTO.ApplicationPageDTO.ShowInMenu);
                    applicationPageService.Update(applicationPage);

                    using (ApplicationPageAccessService applicationPageAccessService = new ApplicationPageAccessService())
                    {
                        List <sysBpmsApplicationPageAccess> newApplicationPageAccess =
                            (model.listRole ?? new List <ApplicationPageAccessDTO>()).Select(c => new sysBpmsApplicationPageAccess().Update(c.ID, model.DynamicFormDTO.ApplicationPageID.Value, c.DepartmentID, c.RoleLU, c.UserID, c.AllowAdd, c.AllowEdit, c.AllowDelete, c.AllowView)).ToList()
                            .Union((model.listUser ?? new List <ApplicationPageAccessDTO>()).Select(c => new sysBpmsApplicationPageAccess().Update(c.ID, model.DynamicFormDTO.ApplicationPageID.Value, c.DepartmentID, c.RoleLU, c.UserID, c.AllowAdd, c.AllowEdit, c.AllowDelete, c.AllowView))).ToList();
                        applicationPageAccessService.AddEdit(applicationPage.ID, newApplicationPageAccess);
                    }
                }
            }
            return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
        }
コード例 #10
0
        public object PostAddEdit(ProcessGroupDTO processGroupDTO)
        {
            using (ProcessGroupService ProcessGroupService = new ProcessGroupService())
            {
                sysBpmsProcessGroup ProcessGroup = processGroupDTO.ID != Guid.Empty ? ProcessGroupService.GetInfo(processGroupDTO.ID) : new sysBpmsProcessGroup();

                ResultOperation resultOperation = ProcessGroup.Update(processGroupDTO.ProcessGroupID, processGroupDTO.Name, processGroupDTO.Description);

                if (!resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
                if (processGroupDTO.ID != Guid.Empty)
                {
                    resultOperation = ProcessGroupService.Update(ProcessGroup);
                }
                else
                {
                    resultOperation = ProcessGroupService.Add(ProcessGroup);
                }

                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
コード例 #11
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));
         }
     }
 }
コード例 #12
0
 public object PostAddEditFormDesign(PostAddEditFormDesignDTO model)
 {
     using (DynamicFormService dynamicFormService = new DynamicFormService())
     {
         sysBpmsDynamicForm dynamicForm = dynamicFormService.GetInfo(model.DynamicFormId);
         if (dynamicForm != null)
         {
             ResultOperation resultOperation = dynamicForm.Update(model.DesignJson);
             if (!resultOperation.IsSuccess)
             {
                 return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
             }
             resultOperation = dynamicFormService.GetSourceCode(dynamicForm);
             if (!resultOperation.IsSuccess)
             {
                 return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
             }
             resultOperation = dynamicFormService.Update(dynamicForm, base.userName);
             if (resultOperation.IsSuccess)
             {
                 return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
             }
             else
             {
                 return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
             }
         }
         else
         {
             return(new PostMethodMessage(SharedLang.Get("NotFound.Text"), DisplayMessageType.error));
         }
     }
 }
コード例 #13
0
        public object PostAddEdit(DepartmentDTO departmentDTO)
        {
            using (DepartmentService departmentService = new DepartmentService())
            {
                sysBpmsDepartment department = departmentDTO.ID != Guid.Empty ? departmentService.GetInfo(departmentDTO.ID) : new sysBpmsDepartment();
                department.Update(departmentDTO.DepartmentID, departmentDTO.Name);

                sysBpmsEmailAccount emailAccount = new sysBpmsEmailAccount();

                ResultOperation resultOperation = emailAccount.Update((int)sysBpmsEmailAccount.e_ObjectTypeLU.Department, department.ID, departmentDTO.SMTP, departmentDTO.Port, departmentDTO.MailPassword, departmentDTO.WorkEmail);
                if (!resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
                if (departmentDTO.ID != Guid.Empty)
                {
                    resultOperation = departmentService.Update(department, emailAccount);
                }
                else
                {
                    resultOperation = departmentService.Add(department, emailAccount);
                }

                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
コード例 #14
0
 public object Delete(string fileName)
 {
     if (System.IO.File.Exists(this.DirectoryFolder + "\\" + this.GetFileName(fileName)))
     {
         System.IO.File.Delete(this.DirectoryFolder + "\\" + this.GetFileName(fileName));
     }
     return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
 }
コード例 #15
0
 private void CheckMandatory(ResultOperation resultOperation, sysBpmsEntityDef entityDef, List <SqlParameter> columnParams)
 {
     if (entityDef.Properties.Any(c => c.Required && !columnParams.Any(d => d.ParameterName.TrimStart('@') == c.Name)))
     {
         string errorMsg = string.Join("<br/>", entityDef.Properties.Where(c => c.Required && !columnParams.Any(d => d.ParameterName.TrimStart('@') == c.Name)).
                                       Select(c => string.Format(SharedLang.Get("FormatRequired.Text"), c.Name)));
         resultOperation.AddError(errorMsg);
     }
 }
コード例 #16
0
 public object GetActive(Guid ID)
 {
     using (APIAccessService apiAccessService = new APIAccessService())
     {
         sysBpmsAPIAccess apiAccess = apiAccessService.GetInfo(ID);
         apiAccess.Update(true);
         ResultOperation resultOperation = apiAccessService.Update(apiAccess);
     }
     return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
 }
コード例 #17
0
 public object PostAddEdit(PostAddEditGatewayDTO model)
 {
     using (ProcessService processService = new ProcessService())
     {
         if (!processService.GetInfo(model.ProcessId).AllowEdit())
         {
             return(new PostMethodMessage(LangUtility.Get("NotAllowEdit.Text", nameof(sysBpmsProcess)), DisplayMessageType.error));
         }
     }
     using (ConditionService conditionService = new ConditionService())
     {
         model.ListConditions = model.ListConditions ?? new List <ConditionDTO>();
         ResultOperation         resultOperation   = null;
         List <sysBpmsCondition> CurrentConditions = conditionService.GetList(model.GatewayID, null, null);
         foreach (sysBpmsCondition item in CurrentConditions.Where(c => !model.ListConditions.Any(d => d.ID == c.ID)))
         {
             resultOperation = conditionService.Delete(item.ID);
             if (!resultOperation.IsSuccess)
             {
                 return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
             }
         }
         foreach (ConditionDTO item in model.ListConditions)
         {
             sysBpmsCondition condition = item.ID != Guid.Empty ? conditionService.GetInfo(item.ID) : new sysBpmsCondition();
             resultOperation = condition.Update(model.GatewayID, item.SequenceFlowID, item.Code);
             if (!resultOperation.IsSuccess)
             {
                 break;
             }
             if (item.ID != Guid.Empty)
             {
                 resultOperation = conditionService.Update(condition);
             }
             else
             {
                 resultOperation = conditionService.Add(condition);
             }
             if (!resultOperation.IsSuccess)
             {
                 break;
             }
         }
         if (resultOperation.IsSuccess)
         {
             return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
         }
         else
         {
             return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
         }
     }
 }
コード例 #18
0
 public object Delete(Guid ID)
 {
     using (UserService userService = new UserService())
     {
         ResultOperation resultOperation = userService.Delete(ID);
         if (resultOperation.IsSuccess)
         {
             return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
         }
         return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
     }
 }
コード例 #19
0
        public object GetActive(Guid ID)
        {
            ResultOperation result = new EntityDefService().Active(ID);

            if (result.IsSuccess)
            {
                return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
            }
            else
            {
                return(new PostMethodMessage(result.GetErrors(), DisplayMessageType.success));
            }
        }
コード例 #20
0
        public object PostFile()
        {
            ResultOperation resultOperation = this.SaveFile(base.MyRequest.Files[0], "");

            if (!resultOperation.IsSuccess)
            {
                return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
            }
            else
            {
                return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
            }
        }
コード例 #21
0
 public object GetActive(Guid ID)
 {
     using (MessageTypeService messageTypeService = new MessageTypeService())
     {
         ResultOperation resultOperation = messageTypeService.Active(ID);
         if (resultOperation.IsSuccess)
         {
             return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
         }
         else
         {
             return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
         }
     }
 }
コード例 #22
0
 public object GetNewVersion(Guid ID)
 {
     using (ProcessService processService = new ProcessService())
     {
         ResultOperation resultOperation = processService.NewVersion(processService.GetInfo(ID), base.userName);
         if (resultOperation.IsSuccess)
         {
             return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
         }
         else
         {
             return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
         }
     }
 }
コード例 #23
0
 public object PostAdd(ProcessDTO processDTO)
 {
     using (ProcessService processService = new ProcessService())
     {
         ResultOperation resultOperation = processService.Add(processDTO.Name, processDTO.Description, base.userName, processDTO.ParallelCountPerUser, processDTO.ProcessGroupID, processDTO.TypeLU);
         if (resultOperation.IsSuccess)
         {
             return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success, ((sysBpmsProcess)resultOperation.CurrentObject).ID.ToString()));
         }
         else
         {
             return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
         }
     }
 }
コード例 #24
0
 public object GetCopy(Guid ID)
 {
     using (DynamicFormService dynamicFormService = new DynamicFormService())
     {
         ResultOperation resultOperation = dynamicFormService.Copy(ID, base.userName);
         if (resultOperation.IsSuccess)
         {
             return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
         }
         else
         {
             return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
         }
     }
 }
コード例 #25
0
 public object GetPublish(Guid ID)
 {
     using (ProcessService processService = new ProcessService())
     {
         ResultOperation resultOperation = processService.Publish(ID);
         if (resultOperation.IsSuccess)
         {
             return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
         }
         else
         {
             return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
         }
     }
 }
コード例 #26
0
 public object Delete(Guid UserID, Guid DepartmentID)
 {
     using (DepartmentMemberService departmentMemberService = new DepartmentMemberService())
     {
         ResultOperation resultOperation = departmentMemberService.Delete(UserID, DepartmentID);
         if (resultOperation.IsSuccess)
         {
             return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
         }
         else
         {
             return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
         }
     }
 }
コード例 #27
0
 public object GetInActive(Guid ID)
 {
     using (ProcessService processService = new ProcessService())
     {
         sysBpmsProcess  process         = processService.GetInfo(ID);
         ResultOperation resultOperation = processService.InActive(process);
         if (resultOperation.IsSuccess)
         {
             return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
         }
         else
         {
             return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
         }
     }
 }
コード例 #28
0
        public object PostAddEdit(PostAddEditEntityDefDTO postAddEdit)
        {
            using (EntityDefService entityDefService = new EntityDefService())
            {
                sysBpmsEntityDef entityDef = postAddEdit.EntityDefDTO.ID != Guid.Empty ? entityDefService.GetInfo(postAddEdit.EntityDefDTO.ID) : new sysBpmsEntityDef();

                if (postAddEdit.listProperties != null)
                {
                    foreach (var Item in postAddEdit.listProperties)
                    {
                        if (string.IsNullOrWhiteSpace(Item.ID))
                        {
                            Item.ID = Guid.NewGuid().ToString();
                        }
                        Item.IsActive = true;
                        postAddEdit.EntityDefDTO.Properties.Add(Item);
                    }
                }

                ResultOperation resultOperation = entityDef.Update(postAddEdit.EntityDefDTO.DisplayName, postAddEdit.EntityDefDTO.Name, postAddEdit.EntityDefDTO.DesignXML, true, postAddEdit.EntityDefDTO.Properties);
                if (resultOperation.IsSuccess)
                {
                    if (entityDef.ID != Guid.Empty)
                    {
                        resultOperation = entityDefService.Update(entityDef);
                    }
                    else
                    {
                        resultOperation = entityDefService.Add(entityDef);
                    }

                    if (resultOperation.IsSuccess)
                    {
                        return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success, new { entityDef.ID, Name = (entityDef.Name + $"({entityDef.DisplayName})") }));
                    }
                    else
                    {
                        return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                    }
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
コード例 #29
0
        public object PostEditInfo(ProcessDTO processDTO)
        {
            using (ProcessService processService = new ProcessService())
            {
                sysBpmsProcess process = processService.GetInfo(processDTO.ID);
                process.Update(processDTO.Name, processDTO.Description, processDTO.ParallelCountPerUser, processDTO.TypeLU);

                ResultOperation resultOperation = processService.UpdateInfo(process);
                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }
コード例 #30
0
        public object GetInActiveFolder(Guid id)
        {
            using (DocumentFolderService documentFolderService = new DocumentFolderService())
            {
                sysBpmsDocumentFolder sysBpmsDocumentFolder = documentFolderService.GetInfo(id);
                sysBpmsDocumentFolder.InActive();
                ResultOperation resultOperation = documentFolderService.Update(sysBpmsDocumentFolder);

                if (resultOperation.IsSuccess)
                {
                    return(new PostMethodMessage(SharedLang.Get("Success.Text"), DisplayMessageType.success));
                }
                else
                {
                    return(new PostMethodMessage(resultOperation.GetErrors(), DisplayMessageType.error));
                }
            }
        }