init
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using DTS.SensorDB;
|
||||
using DTS.Slice.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
|
||||
namespace DTS.Common.Import.Persist
|
||||
{
|
||||
public class SaveSensorModels : SaveVariantBase
|
||||
{
|
||||
public User CurrentUser { get; set; }
|
||||
public SaveSensorModels(ImportObject importObject, IPersistCalculator persistCalculator, IImportNotification importNotification, Func<bool> isCancelled = null) :
|
||||
base(importObject, persistCalculator, importNotification, isCancelled)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Save()
|
||||
{
|
||||
foreach (var st in _importObject.SensorModels())
|
||||
{
|
||||
if (IsCancelled()) { return; }
|
||||
SensorModelCollection.SensorModelList.Commit(st, CurrentUser.UserName);
|
||||
_persistCalculator.AddDone();
|
||||
_importNotification.SetProgress(_persistCalculator.ProgressValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user