This commit is contained in:
2020-04-29 19:04:19 +00:00
parent 0abc8de546
commit d34acd45d4

View File

@@ -163,6 +163,7 @@ namespace AyaNova.PlugIn.V8
/// </summary> /// </summary>
private async void DoExport() private async void DoExport()
{ {
Cursor.Current = Cursors.WaitCursor;
//Show progress form //Show progress form
ProgressForm progress = new ProgressForm(); ProgressForm progress = new ProgressForm();
progress.Show(); progress.Show();
@@ -201,7 +202,7 @@ namespace AyaNova.PlugIn.V8
//ERASE DB //ERASE DB
progress.Op("Erasing AyaNova 8 data"); progress.Op("Erasing AyaNova 8 data");
var a = await util.PostAsync("License/PermanentlyEraseAllData", "\"I understand\""); var a = await util.PostAsync("License/PermanentlyEraseAllData", "\"I understand\"");
//TAGS //TAGS
progress.Op("Compiling tags"); progress.Op("Compiling tags");
ExportUnitModelCategories(progress); ExportUnitModelCategories(progress);
@@ -242,15 +243,17 @@ namespace AyaNova.PlugIn.V8
} }
catch (Exception ex) catch (Exception ex)
{ {
progress.Append("ERROR, During operation: " + progress.LastOp + "\n"+progress.LastSubOp); progress.Append("ERROR, During operation: " + progress.LastOp + "\n" + progress.LastSubOp);
progress.Append("\n************\nExport failed with error:"); progress.Append("\n************\nExport failed with error:");
progress.Append(ex.Message); progress.Append(ex.Message);
progress.Append("stack:\n" + ex.StackTrace); progress.Append("stack:\n" + ex.StackTrace);
} }
finally { finally
progress.FinishedImport(); {
progress.FinishedImport();
Cursor.Current = Cursors.Default;
} }
//----------------------------------- //-----------------------------------
//endof method //endof method
@@ -261,7 +264,7 @@ namespace AyaNova.PlugIn.V8
#region Object Export methods #region Object Export methods
#region users #region users
private async System.Threading.Tasks.Task ExportUsers(ProgressForm progress) private async System.Threading.Tasks.Task ExportUsers(ProgressForm progress)
@@ -372,7 +375,7 @@ namespace AyaNova.PlugIn.V8
d.customFields = CustomFieldData(c, DateCustomFields); d.customFields = CustomFieldData(c, DateCustomFields);
} }
var a = await util.PostAsync("User", d.ToString()); var a = await util.PostAsync("User", d.ToString());
long RavenId = util.IdFromResponse(a); long RavenId = util.IdFromResponse(a);
Map.Add(c.ID, RavenId); Map.Add(c.ID, RavenId);
@@ -389,7 +392,7 @@ namespace AyaNova.PlugIn.V8
} }
//Attachments / FILES //Attachments / FILES
await ExportAttachments(new TypeAndID(RootObjectTypes.User, c.ID),progress); await ExportAttachments(new TypeAndID(RootObjectTypes.User, c.ID), progress);
} }
@@ -634,7 +637,7 @@ namespace AyaNova.PlugIn.V8
} }
#endregion custom fields #endregion custom fields
#region Attachments exporter #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)
{ {
@@ -651,7 +654,7 @@ namespace AyaNova.PlugIn.V8
var af = AyaFile.GetItem(i.LT_O_AyaFile.Value); var af = AyaFile.GetItem(i.LT_O_AyaFile.Value);
if (af == null) continue; if (af == null) continue;
progress.SubOp("Wikifile: \"" + af.Name + "\" size:" + af.FileSize); progress.SubOp("Wikifile: \"" + af.Name + "\" " + AyaBizUtils.FileSizeDisplay((decimal)af.FileSize));
//Compile the FileData property //Compile the FileData property
var sDate = i.LT_Common_Label_Created.ToString(); var sDate = i.LT_Common_Label_Created.ToString();
@@ -695,6 +698,9 @@ namespace AyaNova.PlugIn.V8
var ravenId = a.ObjectResponse["data"][0]["id"].Value<long>(); var ravenId = a.ObjectResponse["data"][0]["id"].Value<long>();
Map.Add(af.ID, ravenId); Map.Add(af.ID, ravenId);
} }
progress.SubOp("");
} }
#endregion attachments #endregion attachments
@@ -746,7 +752,7 @@ namespace AyaNova.PlugIn.V8
} }
#endregion wiki #endregion wiki