aboutsummaryrefslogtreecommitdiff
path: root/src/PriceListTools
diff options
context:
space:
mode:
Diffstat (limited to 'src/PriceListTools')
-rw-r--r--src/PriceListTools/CombineTool.cs9
-rw-r--r--src/PriceListTools/ConvertTool.cs5
-rw-r--r--src/PriceListTools/ExportTool.cs5
-rw-r--r--src/PriceListTools/MergeTool.cs6
-rw-r--r--src/PriceListTools/Source.cs4
5 files changed, 27 insertions, 2 deletions
diff --git a/src/PriceListTools/CombineTool.cs b/src/PriceListTools/CombineTool.cs
index e637fef..cb47379 100644
--- a/src/PriceListTools/CombineTool.cs
+++ b/src/PriceListTools/CombineTool.cs
@@ -1,5 +1,7 @@
using Microsoft.Office.Interop.Excel;
using System.Collections.Generic;
+using RehauSku.Interface;
+using System.Linq;
namespace RehauSku.PriceListTools
{
@@ -9,6 +11,8 @@ namespace RehauSku.PriceListTools
public void FillTarget()
{
+ ProgressBar bar = new ProgressBar(SourceFiles.Sum(file => file.PositionAmount.Count));
+
foreach (Source source in SourceFiles)
{
TargetFile.Sheet.Columns[TargetFile.amountCell.Column]
@@ -19,8 +23,11 @@ namespace RehauSku.PriceListTools
newColumnHeader.Value2 = $"{source.Name}";
newColumnHeader.WrapText = true;
- foreach(var kvp in source.PositionAmount)
+ foreach (var kvp in source.PositionAmount)
+ {
FillColumnsWithDictionary(kvp, TargetFile.amountCell.Column - 1, TargetFile.amountCell.Column);
+ bar.DoProgress();
+ }
}
FilterByAmount();
diff --git a/src/PriceListTools/ConvertTool.cs b/src/PriceListTools/ConvertTool.cs
index d43b30d..d10d65e 100644
--- a/src/PriceListTools/ConvertTool.cs
+++ b/src/PriceListTools/ConvertTool.cs
@@ -27,8 +27,13 @@ namespace RehauSku.PriceListTools
public void FillTarget()
{
+ ProgressBar bar = new ProgressBar(Current.PositionAmount.Count);
+
foreach (var kvp in Current.PositionAmount)
+ {
FillColumnsWithDictionary(kvp, TargetFile.amountCell.Column);
+ bar.DoProgress();
+ }
FilterByAmount();
diff --git a/src/PriceListTools/ExportTool.cs b/src/PriceListTools/ExportTool.cs
index 119a289..568145d 100644
--- a/src/PriceListTools/ExportTool.cs
+++ b/src/PriceListTools/ExportTool.cs
@@ -2,6 +2,7 @@
using RehauSku.Assistant;
using System;
using System.Collections.Generic;
+using RehauSku.Interface;
namespace RehauSku.PriceListTools
{
@@ -23,10 +24,12 @@ namespace RehauSku.PriceListTools
public void FillTarget()
{
GetSelected();
-
+ ProgressBar bar = new ProgressBar(PositionAmount.Count);
+
foreach (var kvp in PositionAmount)
{
FillColumnsWithDictionary(kvp, TargetFile.amountCell.Column);
+ bar.DoProgress();
}
FilterByAmount();
diff --git a/src/PriceListTools/MergeTool.cs b/src/PriceListTools/MergeTool.cs
index 895740c..a51b9b7 100644
--- a/src/PriceListTools/MergeTool.cs
+++ b/src/PriceListTools/MergeTool.cs
@@ -1,5 +1,6 @@
using RehauSku.Interface;
using System.Collections.Generic;
+using System.Linq;
namespace RehauSku.PriceListTools
{
@@ -9,10 +10,15 @@ namespace RehauSku.PriceListTools
public void FillTarget()
{
+ ProgressBar bar = new ProgressBar(SourceFiles.Sum(x => x.PositionAmount.Count));
+
foreach (Source source in SourceFiles)
{
foreach (var kvp in source.PositionAmount)
+ {
FillColumnsWithDictionary(kvp, TargetFile.amountCell.Column);
+ bar.DoProgress();
+ }
}
FilterByAmount();
diff --git a/src/PriceListTools/Source.cs b/src/PriceListTools/Source.cs
index 7cf56be..fe5ee9b 100644
--- a/src/PriceListTools/Source.cs
+++ b/src/PriceListTools/Source.cs
@@ -3,6 +3,7 @@ using Microsoft.Office.Interop.Excel;
using System;
using System.Collections.Generic;
using System.Linq;
+using RehauSku.Interface;
namespace RehauSku.PriceListTools
{
@@ -39,6 +40,7 @@ namespace RehauSku.PriceListTools
public static List<Source> GetSourceLists(string[] files)
{
var ExcelApp = (Application)ExcelDnaUtil.Application;
+ ProgressBar bar = new ProgressBar(files.Length);
List<Source> sourceFiles = new List<Source>();
@@ -51,6 +53,7 @@ namespace RehauSku.PriceListTools
Source priceList = new Source(wb);
sourceFiles.Add(priceList);
wb.Close();
+ bar.DoProgress();
}
catch (Exception ex)
{
@@ -60,6 +63,7 @@ namespace RehauSku.PriceListTools
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Information);
wb.Close();
+ bar.DoProgress();
}
ExcelApp.ScreenUpdating = true;
}