aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSerghei Cebotari <51533848+schebotar@users.noreply.github.com>2022-01-03 13:17:49 +0300
committerGitHub <noreply@github.com>2022-01-03 13:17:49 +0300
commit72908aaaf7da74fe1b3de4d939faaf829d4a80e2 (patch)
treef8d7c8765a11e23023fcd03bcd87206f2e59a2b8 /src
parentfc870d19555cc77b0e08912b4dab21d496b2321f (diff)
parentfbe97d706cb87374a469f2e7df5c177877d6616b (diff)
Merge pull request #10 from schebotar/dev
Dev
Diffstat (limited to 'src')
-rw-r--r--src/PriceListTools/PriceList.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/PriceListTools/PriceList.cs b/src/PriceListTools/PriceList.cs
index 1460c07..35b3f7d 100644
--- a/src/PriceListTools/PriceList.cs
+++ b/src/PriceListTools/PriceList.cs
@@ -40,11 +40,24 @@ namespace RehauSku.PriceListTools
int amountColumn = OfferSheet.amountColumn.Value;
int skuColumn = OfferSheet.skuColumn.Value;
+ int exportedValues = 0;
foreach (KeyValuePair<string, double> kvp in values)
{
Range cell = ws.Columns[skuColumn].Find(kvp.Key);
- ws.Cells[cell.Row, amountColumn].Value = kvp.Value;
+ if (cell == null)
+ {
+ System.Windows.Forms.MessageBox.Show
+ ($"Артикул {kvp.Key} отсутствует в таблице заказов {RegistryUtil.PriceListPath}",
+ "Отсутствует позиция в конечной таблице заказов",
+ System.Windows.Forms.MessageBoxButtons.OK,
+ System.Windows.Forms.MessageBoxIcon.Information);
+ }
+ else
+ {
+ ws.Cells[cell.Row, amountColumn].Value = kvp.Value;
+ exportedValues++;
+ }
}
AutoFilter filter = ws.AutoFilter;
@@ -52,6 +65,7 @@ namespace RehauSku.PriceListTools
filter.Range.AutoFilter(amountColumn - firstFilterColumn + 1, "<>");
ws.Range["A1"].Activate();
+ ws.Application.StatusBar = $"Экспортировано {exportedValues} строк из {values.Count}";
}
public class PriceListSheet