This commit is contained in:
2020-05-04 00:46:49 +00:00
parent 567055faa9
commit d0ad818da4

View File

@@ -212,6 +212,8 @@ namespace AyaNova.PlugIn.V8
Regions export wiki to user
todo: RAVEN workorder structure and then export here
todo: modify each biz object export to include progress resetting code added to top of workorder service export
reset op, subop at start of export so error doesn't show last previous item's name
todo: export docs, settle on "Export" and edit all references to Import to switch it around as it's probably confusing artifact from dbdump days
@@ -1294,7 +1296,7 @@ namespace AyaNova.PlugIn.V8
//Attachments / FILES
await ExportAttachments(ObjectTID, progress);
await ExportAttachments(ObjectTID, progress, util.AyaType.WorkOrderItem);
//-----
bool repost = false;
@@ -1832,7 +1834,7 @@ namespace AyaNova.PlugIn.V8
#endregion custom fields
#region Attachments exporter
private async System.Threading.Tasks.Task ExportAttachments(TypeAndID tid, ProgressForm progress)
private async System.Threading.Tasks.Task ExportAttachments(TypeAndID tid, ProgressForm progress, util.AyaType specificRavenType = util.AyaType.NoType)
{
if (!WikiPage.HasWiki(tid.ID)) return;
@@ -1873,7 +1875,12 @@ namespace AyaNova.PlugIn.V8
MultipartFormDataContent formDataContent = new MultipartFormDataContent();
//Form data like the bizobject type and id
formDataContent.Add(new StringContent(((int)util.RootObjectToAyaType(tid.RootObjectType)).ToString()), name: "AttachToObjectType");
string RavenTypeAsString = "";
if (specificRavenType != util.AyaType.NoType)
RavenTypeAsString = ((int)specificRavenType).ToString();
else
RavenTypeAsString = ((int)util.RootObjectToAyaType(tid.RootObjectType)).ToString();
formDataContent.Add(new StringContent(RavenTypeAsString), name: "AttachToObjectType");
formDataContent.Add(new StringContent(Map[tid.ID].ToString()), name: "AttachToObjectId");
formDataContent.Add(new StringContent(ImportTag), name: "Notes");
formDataContent.Add(new StringContent(dFileData.ToString()), name: "FileData");