change
This commit is contained in:
@@ -19,6 +19,7 @@ using CompanyManagment.App.Contracts.Checkout.Dto;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.HolidayItem;
|
||||
using CompanyManagment.App.Contracts.Hubs;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.InsuranceList;
|
||||
using CompanyManagment.App.Contracts.Leave;
|
||||
using CompanyManagment.App.Contracts.MandantoryHours;
|
||||
@@ -870,7 +871,12 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
|
||||
var timer = new Stopwatch();
|
||||
timer.Start();
|
||||
int i = 0;
|
||||
|
||||
int successProcess = 1;
|
||||
int countList = getContractsData.Data.ContractIncludedData.Count;
|
||||
List<string> failedCreateList = [];
|
||||
int createSuccessCount = 0;
|
||||
int createFailedCount = 0;
|
||||
foreach (var item in getContractsData.Data.ContractIncludedData)
|
||||
{
|
||||
|
||||
@@ -1472,25 +1478,36 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
|
||||
|
||||
var saveToDb = await _checkoutRepository.CreateCheckout(checkout);
|
||||
if(!saveToDb)
|
||||
await signalR.SendAsync()
|
||||
if (!saveToDb)
|
||||
{
|
||||
createFailedCount += 1;
|
||||
failedCreateList.Add(item.EmployeeFullName);
|
||||
}
|
||||
else
|
||||
{
|
||||
createSuccessCount += 1;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
createFailedCount += 1;
|
||||
failedCreateList.Add(item.EmployeeFullName);
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
var percent = (successProcess / (double)countList) * 100;
|
||||
await signalR.SendAsync("showStatus", countList, createFailedCount, createSuccessCount, (int)percent, failedCreateList);
|
||||
|
||||
successProcess += 1;
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||
Console.WriteLine("================================================================== ");
|
||||
Console.WriteLine("========================================Counter ================== " + (i + 1));
|
||||
Console.WriteLine("======================================== Counter " + successProcess + " ================== ");
|
||||
Console.WriteLine("================================================================== ");
|
||||
Console.ResetColor();
|
||||
i += 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user