コード例 #1
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));
                }
            }
        }
コード例 #2
0
        public object GetInActiveDocumentDef(Guid id)
        {
            using (DocumentDefService documentDefService = new DocumentDefService())
            {
                sysBpmsDocumentDef documentDef = documentDefService.GetInfo(id);
                documentDef.IsActive = false;
                ResultOperation resultOperation = documentDefService.Update(documentDef);

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