Added new columsn to import BOD-386 BOD-387

This commit is contained in:
Patrick Fic
2020-10-05 13:20:19 -07:00
parent bc0aaf064c
commit 619df3620f
3 changed files with 11 additions and 7 deletions

View File

@@ -121,6 +121,7 @@ namespace BodyshopPartner.Utils
newJob.cieca_id = item.Job.ciecaid;
newJob.est_data = item.Job;
newJob.ownr_name = item.Job.ownr_fn?.Value + " " + item.Job.ownr_ln?.Value;
newJob.ins_co_nm = item.Job.ins_co_nm?.Value;
newJob.vehicle_info = item.Job.vehicle.data.v_model_yr.Value + " " + item.Job.vehicle.data.v_make_desc.Value + " " + item.Job.vehicle.data.v_model_desc.Value;
newJob.clm_no = item.Job.clm_no?.Value;
newJob.clm_amt = item.Job.clm_total?.Value;
@@ -132,9 +133,13 @@ namespace BodyshopPartner.Utils
newJob.est_data.vehicleid = vehuuid;
}
if (await Utils.Queries.JobsQueries.CheckSupplementByClaimNo(item.Job.clm_no?.Value ?? ""))
string jobId = await Utils.Queries.JobsQueries.CheckSupplementByClaimNo(item.Job.clm_no?.Value ?? "");
if (!string.IsNullOrEmpty(jobId))
{
newJob.issupplement = true;
newJob.jobid = jobId;
};

View File

@@ -11,10 +11,10 @@ namespace BodyshopPartner.Utils.Queries
{
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
public static async Task<bool> CheckSupplementByClaimNo(string ClmNo)
public static async Task<string> CheckSupplementByClaimNo(string ClmNo)
{
if (string.IsNullOrEmpty(ClmNo))
return false;
return null;
var r = new GraphQLRequest
{
@@ -32,18 +32,18 @@ namespace BodyshopPartner.Utils.Queries
try
{
var d = await Utils.GraphQL.ExecuteQuery(r);
return d.jobs?.Count > 0;
return d.jobs?[1].id;
}
catch (ArgumentOutOfRangeException Ex)
{
logger.Trace(Ex, "No jobs returned in GQL query.");
return false;
return null;
}
catch (Exception Ex)
{
logger.Error(Ex, "Querying for jobs by clm_no failed.");
return false;
return null;
}
}
}

View File

@@ -19,7 +19,6 @@ namespace BodyshopPartner.Utils
private static string ticket;
private static RequestProcessor2 rp;
private static string maxVersion;
//public static string companyFile; //= @"C:\Users\pfic\Development\QB Testing\Testing\DANS2014.QBW";
private static QBFileMode mode = QBFileMode.qbFileOpenDoNotCare;
private static string appID = "ImEXBSP";
private static string appName = "BodyshopPartner";