|
|
@ -42,7 +42,7 @@ namespace ServerManager.SyncMethods |
|
|
|
} |
|
|
|
private async Task SyncCompanyTable() |
|
|
|
{ |
|
|
|
var responseMessage = await m_httpClient.GetAsync("/api/SyncCompanyInfo/lastsyncdate/tblcompanydetails"); |
|
|
|
var responseMessage = await m_httpClient.GetAsync("/api/SyncCompanyInfo/lastsyncdate/tblcompanydetails"); |
|
|
|
if (!responseMessage.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
return; |
|
|
@ -66,7 +66,7 @@ namespace ServerManager.SyncMethods |
|
|
|
var response = await m_httpClient.PostAsJsonAsync("/api/SyncCompanyInfo/publish/tblcompanydetails", batch); |
|
|
|
if (response.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
Console.WriteLine($"Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
Console.WriteLine($"{syncTimestamp.TableName} : Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -75,7 +75,7 @@ namespace ServerManager.SyncMethods |
|
|
|
} |
|
|
|
private async Task SyncBranchTable() |
|
|
|
{ |
|
|
|
var responseMessage = await m_httpClient.GetAsync("/api/SyncCompanyInfo/lastsyncdate/tblbranch"); |
|
|
|
var responseMessage = await m_httpClient.GetAsync("/api/SyncCompanyInfo/lastsyncdate/tblbranch"); |
|
|
|
if (!responseMessage.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
return; |
|
|
@ -85,7 +85,7 @@ namespace ServerManager.SyncMethods |
|
|
|
IEnumerable<TblBranch> modifiedCart = await m_companyService.FetchBranch(date, "BRID0"); |
|
|
|
SyncTimestamp syncTimestamp = new SyncTimestamp |
|
|
|
{ |
|
|
|
TableName = "tblbranch", |
|
|
|
TableName = "tblbranches", |
|
|
|
Timestamp = DateTime.Now.AddSeconds(-10), |
|
|
|
}; |
|
|
|
int batchSize = 200; |
|
|
@ -99,7 +99,7 @@ namespace ServerManager.SyncMethods |
|
|
|
var response = await m_httpClient.PostAsJsonAsync("/api/SyncCompanyInfo/publish/tblbranch", batch); |
|
|
|
if (response.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
Console.WriteLine($"Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
Console.WriteLine($"{syncTimestamp.TableName} : Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -108,7 +108,7 @@ namespace ServerManager.SyncMethods |
|
|
|
} |
|
|
|
private async Task SyncCustomer() |
|
|
|
{ |
|
|
|
var responseMessage = await m_httpClient.GetAsync("/api/SyncCompanyInfo/lastsyncdate/tblCustomers"); |
|
|
|
var responseMessage = await m_httpClient.GetAsync("/api/SyncCompanyInfo/lastsyncdate/tblCustomers"); |
|
|
|
if (!responseMessage.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
return; |
|
|
@ -132,7 +132,7 @@ namespace ServerManager.SyncMethods |
|
|
|
var response = await m_httpClient.PostAsJsonAsync("/api/SyncCompanyInfo/publish/tblCustomers", batch); |
|
|
|
if (response.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
Console.WriteLine($"Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
Console.WriteLine($"{syncTimestamp.TableName} : Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -161,7 +161,7 @@ namespace ServerManager.SyncMethods |
|
|
|
var response = await m_httpClient.PostAsJsonAsync("/api/SyncCompanyInfo/publish/tbldriver", batch); |
|
|
|
if (response.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
Console.WriteLine($"Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
Console.WriteLine($"{syncTimestamp.TableName} : Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -190,7 +190,7 @@ namespace ServerManager.SyncMethods |
|
|
|
var response = await m_httpClient.PostAsJsonAsync("/api/SyncCompanyInfo/publish/SystemRoles", batch); |
|
|
|
if (response.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
Console.WriteLine($"Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
Console.WriteLine($"{syncTimestamp.TableName} : Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -219,7 +219,7 @@ namespace ServerManager.SyncMethods |
|
|
|
var response = await m_httpClient.PostAsJsonAsync("/api/SyncCompanyInfo/publish/tblTruckAssignment", batch); |
|
|
|
if (response.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
Console.WriteLine($"Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
Console.WriteLine($"{syncTimestamp.TableName} : Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -248,7 +248,7 @@ namespace ServerManager.SyncMethods |
|
|
|
var response = await m_httpClient.PostAsJsonAsync("/api/SyncCompanyInfo/publish/tbldrivermappings", batch); |
|
|
|
if (response.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
Console.WriteLine($"Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
Console.WriteLine($"{syncTimestamp.TableName} : Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -277,7 +277,7 @@ namespace ServerManager.SyncMethods |
|
|
|
var response = await m_httpClient.PostAsJsonAsync("/api/SyncCompanyInfo/publish/tbltruckinventory", batch); |
|
|
|
if (response.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
Console.WriteLine($"Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
Console.WriteLine($"{syncTimestamp.TableName} : Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -306,7 +306,7 @@ namespace ServerManager.SyncMethods |
|
|
|
var response = await m_httpClient.PostAsJsonAsync("/api/SyncCompanyInfo/publish/tbltrucks", batch); |
|
|
|
if (response.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
Console.WriteLine($"Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
Console.WriteLine($"{syncTimestamp.TableName} : Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -335,7 +335,7 @@ namespace ServerManager.SyncMethods |
|
|
|
var response = await m_httpClient.PostAsJsonAsync("/api/SyncCompanyInfo/publish/tblusers", batch); |
|
|
|
if (response.IsSuccessStatusCode) |
|
|
|
{ |
|
|
|
Console.WriteLine($"Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
Console.WriteLine($"{syncTimestamp.TableName} : Sent batch {batchIndex + 1}, Count: {batch.Count}"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|