2022-04-01 17:39:01 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.Text;
|
2022-02-04 09:17:12 +03:00
|
|
|
|
|
2022-12-20 12:27:47 +03:00
|
|
|
|
namespace RhSolutions.Models
|
2022-02-04 09:17:12 +03:00
|
|
|
|
{
|
2022-12-20 11:53:55 +03:00
|
|
|
|
internal class ResultBar : StatusbarBase
|
2022-02-04 09:17:12 +03:00
|
|
|
|
{
|
|
|
|
|
private int Success { get; set; }
|
|
|
|
|
private int Replaced { get; set; }
|
|
|
|
|
private int NotFound { get; set; }
|
|
|
|
|
|
|
|
|
|
public ResultBar()
|
|
|
|
|
{
|
|
|
|
|
Success = 0;
|
|
|
|
|
Replaced = 0;
|
|
|
|
|
NotFound = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void IncrementSuccess() => Success++;
|
|
|
|
|
public void IncrementReplaced() => Replaced++;
|
|
|
|
|
public void IncrementNotFound() => NotFound++;
|
|
|
|
|
|
|
|
|
|
public override void Update()
|
|
|
|
|
{
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
if (Success > 0)
|
|
|
|
|
{
|
|
|
|
|
sb.Append($"Успешно экспортировано {Success} артикулов. ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Replaced > 0)
|
|
|
|
|
{
|
|
|
|
|
sb.Append($"Заменено {Replaced} артикулов. ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (NotFound > 0)
|
|
|
|
|
{
|
|
|
|
|
sb.Append($"Не найдено {NotFound} артикулов.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Excel.StatusBar = sb.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|