This commit is contained in:
@@ -568,8 +568,8 @@ namespace AyaNovaQBI
|
||||
if (string.IsNullOrWhiteSpace(QBIntegration.IntegrationData) || QBIntegration.Items.Count == 0)
|
||||
return true;//nothing mapped or set to validate return to mainform for initial setup to be triggered
|
||||
|
||||
//PFC - verify integration mapped objects still exist at each end (Util.PreFlightCheck() line 199)
|
||||
if (!await ValidateMap(initErrors))
|
||||
//PFC - verify integration mapped objects still exist in QB
|
||||
if (!await ValidateQuickBooksHasMappedItems(initErrors))
|
||||
return false;
|
||||
|
||||
//DONE
|
||||
@@ -637,11 +637,11 @@ namespace AyaNovaQBI
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Ensure existance of QBI Integration object
|
||||
/// Ensure mapped items still existing in QuickBooks
|
||||
/// </summary>
|
||||
/// <param name="initErrors"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<bool> ValidateMap(StringBuilder initErrors)
|
||||
public static async Task<bool> ValidateQuickBooksHasMappedItems(StringBuilder initErrors)
|
||||
{
|
||||
//Missing links table:
|
||||
DataTable dtTemp = new DataTable();
|
||||
@@ -695,16 +695,9 @@ namespace AyaNovaQBI
|
||||
{
|
||||
await IntegrationLog("PFC: User opted to remove all mappings after double warning.");
|
||||
QBIntegration.Items.Clear();
|
||||
//foreach (DataRow row in dtTemp.Rows)
|
||||
//{
|
||||
// QBIntegration.Items.Remove(row["MAPID"].ToString());
|
||||
//}
|
||||
//TODO: POST BACK TO SERVER
|
||||
//Exists, fetch it check if active then we're done here
|
||||
ApiResponse r = await PostAsync($"integration/{QBI_INTEGRATION_ID}", Newtonsoft.Json.JsonConvert.SerializeObject(QBIntegration));
|
||||
QBIntegration = r.ObjectResponse["data"].ToObject<Integration>();
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user