public Document DocumentCreate(moDocumentProperties maAttributesList) { Document myDocument = new Document(); Attribute[] objectTypeAttributesList; CreateDocArguments documentArgs = new CreateDocArguments(); string objectTypeId; Folder parentFolder; // Set workspace myDocument.WorkspaceId = maAttributesList.WorkspaceId; //Get and set Object Type objectTypeId = DocumentTypeGetByCode(maAttributesList.DocTypeCode).Id; myDocument.ObjectTypeId = objectTypeId; // Set status myDocument.Status = StatusGetByCode(maAttributesList.WorkspaceId, maAttributesList.StatusCode); //Set version status myDocument.VersionStatus = VersionStatusTypes.Other; // Get attribute definition for objecttype objectTypeAttributesList = DocumentTypeAttributesGet(maAttributesList.WorkspaceId, objectTypeId); // Assign mezzotautomator values to object type attributes foreach(moAttribute maAttribute in maAttributesList.moAttributeList) { foreach (Attribute attribute in objectTypeAttributesList) { if (maAttribute.Code == attribute.Name) { attribute.Items = new object[1]; switch (attribute.Type) { case "System.DateTime": attribute.Items[0] = DateTime.Parse(maAttribute.Value); break; case "System.Int32": attribute.Items[0] = Int32.Parse(maAttribute.Value); break; default: attribute.Items[0] = maAttribute.Value; break; } break; } } } //Assign fields to document myDocument.Fields = objectTypeAttributesList; parentFolder = FolderGetFromPath(maAttributesList.WorkspaceId, maAttributesList.ParentFolderPath); documentArgs.ParentFolderId = parentFolder.Id; myDocument = _act.DocumentCreate(documentArgs, myDocument); return myDocument; }
/// <remarks/> public void DocumentCreateAsync(CreateDocArguments arg, Document newDocument, object userState) { if ((this.DocumentCreateOperationCompleted == null)) { this.DocumentCreateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDocumentCreateOperationCompleted); } this.InvokeAsync("DocumentCreate", new object[] { arg, newDocument}, this.DocumentCreateOperationCompleted, userState); }
public Document DocumentCreate(CreateDocArguments arg, Document newDocument) { object[] results = this.Invoke("DocumentCreate", new object[] { arg, newDocument}); return ((Document)(results[0])); }
/// <remarks/> public void DocumentCreateAsync(CreateDocArguments arg, Document newDocument) { this.DocumentCreateAsync(arg, newDocument, null); }
/// <remarks/> public System.IAsyncResult BeginDocumentCreate(CreateDocArguments arg, Document newDocument, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DocumentCreate", new object[] { arg, newDocument}, callback, asyncState); }