aboutsummaryrefslogtreecommitdiff
path: root/src/PriceListTools/ConvertTool.cs
blob: f37bfe2c4a8388f797f74bf38da3c1d1facad424 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;

namespace RehauSku.PriceListTools
{
    internal class ConvertTool : PriceListTool
    {
        private Source Current;

        public void GetCurrent()
        {
            try
            {
                Current = new Source(ExcelApp.ActiveWorkbook);
            }

            catch (Exception exception)
            {
                System.Windows.Forms.MessageBox.Show
                    (exception.Message,
                    "Ошибка распознавания",
                    System.Windows.Forms.MessageBoxButtons.OK,
                    System.Windows.Forms.MessageBoxIcon.Information);
                throw exception;
            }
        }

        public void FillTarget()
        {
            foreach (var kvp in Current.PositionAmount)
                FillColumnsWithDictionary(kvp, TargetFile.amountCell.Column);

            FilterByAmount();

            Forms.Dialog.SaveWorkbookAs();
        }
    }
}