This commit is contained in:
2022-07-07 13:53:26 +00:00
parent 929421468d
commit 627ad48a9d
3 changed files with 88 additions and 86 deletions

View File

@@ -11,7 +11,7 @@ namespace AyaNovaQBI
{
/*
TODO:
test updating all object types both ways, have tested vendors and customers only, in particular parts and part price only test
*/
public partial class Map : Form
@@ -61,8 +61,8 @@ namespace AyaNovaQBI
#region IMPORT
private async void importSelectedItemsToolStripMenuItem_Click(object sender, EventArgs e)
#region EXPORT
private async void exportSelectedItemsToolStripMenuItem_Click(object sender, EventArgs e)
{
bool IsAyaGrid = false;
if (gridAya.SelectedRows.Count == 0 && gridQB.SelectedRows.Count == 0) return;
@@ -74,14 +74,14 @@ namespace AyaNovaQBI
if (IsAyaGrid)
{
if (MessageBox.Show(
"Import and link the selected AyaNova objects into QuickBooks.\r\n\r\n" +
"Are you sure?", "Import AyaNova objects", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
"Export and link the selected AyaNova objects into QuickBooks.\r\n\r\n" +
"Are you sure?", "Export AyaNova objects", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No) return;
await ImportToQuickBooks();
await ExportToQuickBooks();
w = new Waiting();
w.Show();
w.Ops = $"Import completed";
w.Ops = $"Export completed";
switch (_Type)
{
case AyaType.Customer:
@@ -104,13 +104,13 @@ namespace AyaNovaQBI
else
{
if (MessageBox.Show(
"Import and link the selected QuickBooks objects into AyaNova.\r\n\r\n" +
"Are you sure?", "Import QuickBooks objects", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
"Export and link the selected QuickBooks objects into AyaNova.\r\n\r\n" +
"Are you sure?", "Export QuickBooks objects", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No) return;
await ImportToAyaNova();
await ExportToAyaNova();
w = new Waiting();
w.Show();
w.Ops = $"Import completed";
w.Ops = $"Export completed";
switch (_Type)
{
@@ -141,7 +141,7 @@ namespace AyaNovaQBI
{
if (w != null)
w.Visible = false;
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ImportSelectedItems");
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ExportSelectedItems");
}
finally
{
@@ -154,14 +154,14 @@ namespace AyaNovaQBI
#region Import to AyaNova
private async Task ImportToAyaNova()
private async Task ExportToAyaNova()
{
this.Refresh();
Cursor.Current = Cursors.WaitCursor;
ArrayList alErrors = new ArrayList();
Waiting w = new Waiting();
w.Show();
w.Ops = "Importing from QuickBooks...";
w.Ops = "Exporting from QuickBooks...";
try
{
menuStrip1.Enabled = gridQB.Enabled = gridAya.Enabled = false;
@@ -192,7 +192,7 @@ namespace AyaNovaQBI
break;
default:
throw new System.NotSupportedException("ImportToAyaNova: NOT SUPPORTED (STUB): " + _Type.ToString());
throw new System.NotSupportedException("ExportFromQuickBooks: NOT SUPPORTED type : " + _Type.ToString());
}
}
@@ -202,7 +202,7 @@ namespace AyaNovaQBI
w.Visible = false;
StringBuilder sb = new StringBuilder();
sb.Append("Import completed with some errors:\r\n\r\n");
sb.Append("Export completed with some errors:\r\n\r\n");
foreach (object o in alErrors)
{
sb.Append((string)o);
@@ -217,7 +217,7 @@ namespace AyaNovaQBI
catch (Exception ex)
{
w.Visible = false;
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ImportToAyaNova");
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ExportToAyaNova");
}
finally
{
@@ -226,18 +226,18 @@ namespace AyaNovaQBI
}
}
#endregion Import to AyaNova
#endregion Export to AyaNova
#region Import to QuickBooks
#region Export to QuickBooks
private async Task ImportToQuickBooks()
private async Task ExportToQuickBooks()
{
Refresh();
Cursor.Current = Cursors.WaitCursor;
ArrayList alErrors = new ArrayList();
Waiting w = new Waiting();
w.Show();
w.Ops = "Importing from AyaNova...";
w.Ops = "Exporting from AyaNova...";
try
{
bool firstPass = true;
@@ -303,7 +303,7 @@ namespace AyaNovaQBI
}
break;
default:
throw new System.NotSupportedException("ImportToQuickBooks: NOT SUPPORTED (STUB): " + _Type.ToString());
throw new System.NotSupportedException("ExportToQuickBooks: NOT SUPPORTED type: " + _Type.ToString());
}
}
@@ -315,7 +315,7 @@ namespace AyaNovaQBI
w.Visible = false;
StringBuilder sb = new StringBuilder();
sb.Append("Import completed with some errors:\r\n\r\n");
sb.Append("Export completed with some errors:\r\n\r\n");
foreach (object o in alErrors)
{
sb.Append((string)o);
@@ -332,7 +332,7 @@ namespace AyaNovaQBI
catch (Exception ex)
{
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ImportToQuickBooks");
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ExportToQuickBooks");
}
finally
{
@@ -340,10 +340,10 @@ namespace AyaNovaQBI
w.Close();
}
}
#endregion importtoqb
#endregion exporttoqb
#endregion import
#endregion export
#region AUTOMATIC LINK
private async void autoLinkToolStripMenuItem_Click(object sender, EventArgs e)