public void DeleteDocumentType(DocumentTypeDTO documentType) { if (documentType == null) { throw new Exception("文档不能为空"); } var deleteDocumentType = _documentTypeRepository.Get(documentType.DocumentTypeId); _documentTypeRepository.Remove(deleteDocumentType); }
public void ModifyDocumentType(DocumentTypeDTO documentType) { if (documentType == null) { throw new Exception("文档不能为空"); } var updateDocumentType = _documentTypeRepository.Get(documentType.DocumentTypeId); DocumentTypeFactory.SetDocumentType(updateDocumentType, documentType.Name, documentType.Description); _documentTypeRepository.Modify(updateDocumentType); }
public void InsertDocumentType(DocumentTypeDTO documentType) { if (documentType == null) { throw new Exception("文档不能为空"); } //新建文档 var newDocumentType = DocumentTypeFactory.CreateDocumentType(); DocumentTypeFactory.SetDocumentType(newDocumentType, documentType.Name, documentType.Description); _documentTypeRepository.Add(newDocumentType); }