init
This commit is contained in:
41
Common/DTS.Common.Import/Persist/SaveCustomerDetails.cs
Normal file
41
Common/DTS.Common.Import/Persist/SaveCustomerDetails.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using DataPROWin7.DataModel;
|
||||
using DTS.Common.Import.Enums;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
namespace DTS.Common.Import.Persist
|
||||
{
|
||||
public class SaveCustomerDetails : SaveVariantBase
|
||||
{
|
||||
bool invalidCustomerDetails = false;
|
||||
public SaveCustomerDetails(ImportObject importObject, IPersistCalculator persistCalculator, IImportNotification importNotification, Func<bool> isCancelled = null) :
|
||||
base(importObject, persistCalculator, importNotification, isCancelled)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Save()
|
||||
{
|
||||
_importNotification.SetStatus.Invoke(new ImportStatus { ExtraStatus = ImportExtraStatus.ReadingLabDetails, PossibleStatus = PossibleStatus.Importing });
|
||||
foreach (var c in _importObject.CustomerDetails())
|
||||
{
|
||||
if (IsCancelled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (c.IsInvalidBlank())
|
||||
{
|
||||
invalidCustomerDetails = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
CustomerDetailsList.AddCustomer(new CustomerDetails(c));
|
||||
}
|
||||
_persistCalculator.AddDone();
|
||||
_importNotification.SetProgress(_persistCalculator.ProgressValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user