Browse Source

version 1.0.0 - full features

Dalibor Votruba 1 năm trước cách đây
mục cha
commit
c03d505b20

+ 45 - 0
App.config

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <configSections>
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+            <section name="qdr.app.studiou.orders2printpack.Properties.AppSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
+    <userSettings>
+        <qdr.app.studiou.orders2printpack.Properties.AppSettings>
+            <setting name="CSVDelimiter" serializeAs="String">
+                <value>,</value>
+            </setting>
+            <setting name="LastOutputDir" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="MapColOrderNo" serializeAs="String">
+                <value>Order No</value>
+            </setting>
+            <setting name="MapColProductCat" serializeAs="String">
+                <value>Prod Cat</value>
+            </setting>
+            <setting name="MapColUri" serializeAs="String">
+                <value>Prod Img Url</value>
+            </setting>
+            <setting name="MapColQuantity" serializeAs="String">
+                <value>Qty</value>
+            </setting>
+            <setting name="SourceSearchPattern" serializeAs="String">
+                <value>*.jpg</value>
+            </setting>
+            <setting name="OutputFileMask" serializeAs="String">
+                <value>{prod_var}_{prod_cat}_{order_no}_{ordinal}{ext}</value>
+            </setting>
+            <setting name="MapColProductFormat" serializeAs="String">
+                <value>Prod Var</value>
+            </setting>
+            <setting name="LastSourceDir" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="RemoveFromUri" serializeAs="String">
+                <value>_tn</value>
+            </setting>
+        </qdr.app.studiou.orders2printpack.Properties.AppSettings>
+    </userSettings>
+</configuration>

+ 0 - 62
Form1.Designer.cs

@@ -1,62 +0,0 @@
-namespace qdr.app.studiou.orders2printpack
-{
-    partial class Form1
-    {
-        /// <summary>
-        ///  Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        ///  Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        ///  Required method for Designer support - do not modify
-        ///  the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
-            pictureBox1 = new PictureBox();
-            ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
-            SuspendLayout();
-            // 
-            // pictureBox1
-            // 
-            pictureBox1.Image = Properties.Resources.logo;
-            pictureBox1.Location = new Point(15, 17);
-            pictureBox1.Name = "pictureBox1";
-            pictureBox1.Size = new Size(209, 112);
-            pictureBox1.TabIndex = 0;
-            pictureBox1.TabStop = false;
-            // 
-            // Form1
-            // 
-            AutoScaleDimensions = new SizeF(8F, 20F);
-            AutoScaleMode = AutoScaleMode.Font;
-            ClientSize = new Size(774, 354);
-            Controls.Add(pictureBox1);
-            Icon = (Icon)resources.GetObject("$this.Icon");
-            Name = "Form1";
-            Text = "Form1";
-            ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
-            ResumeLayout(false);
-        }
-
-        #endregion
-
-        private PictureBox pictureBox1;
-    }
-}

+ 0 - 10
Form1.cs

@@ -1,10 +0,0 @@
-namespace qdr.app.studiou.orders2printpack
-{
-    public partial class Form1 : Form
-    {
-        public Form1()
-        {
-            InitializeComponent();
-        }
-    }
-}

+ 490 - 0
FormMain.Designer.cs

@@ -0,0 +1,490 @@
+namespace qdr.app.studiou.orders2printpack
+{
+    partial class FormMain
+    {
+        /// <summary>
+        ///  Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        ///  Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        ///  Required method for Designer support - do not modify
+        ///  the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain));
+            pictureBox1 = new PictureBox();
+            panel1 = new Panel();
+            splitContainer1 = new SplitContainer();
+            tbOutputDir = new TextBox();
+            label3 = new Label();
+            tbSourceDir = new TextBox();
+            label2 = new Label();
+            tbOrdersSourceFile = new TextBox();
+            label1 = new Label();
+            butOutputDir = new Button();
+            butOpenSource = new Button();
+            butOpenOrdersFile = new Button();
+            panel2 = new Panel();
+            ssMain = new StatusStrip();
+            ssProgress = new ToolStripProgressBar();
+            tspOrdersCount = new ToolStripStatusLabel();
+            tsbFiles = new ToolStripStatusLabel();
+            tsbSources = new ToolStripStatusLabel();
+            tsbNotFound = new ToolStripStatusLabel();
+            panel3 = new Panel();
+            splitContainer2 = new SplitContainer();
+            tsMain = new ToolStrip();
+            tsbCheck = new ToolStripButton();
+            tsbDo = new ToolStripButton();
+            toolStripSeparator1 = new ToolStripSeparator();
+            tsbAddSourceDir = new ToolStripButton();
+            toolStripSeparator2 = new ToolStripSeparator();
+            tsbSettings = new ToolStripButton();
+            splitContainer3 = new SplitContainer();
+            lbLog = new ListBox();
+            lbNotMapped = new ListBox();
+            toolStrip1 = new ToolStrip();
+            toolStripLabel1 = new ToolStripLabel();
+            dlgOpenFile = new OpenFileDialog();
+            dlgOpenDir = new FolderBrowserDialog();
+            ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
+            panel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
+            splitContainer1.Panel1.SuspendLayout();
+            splitContainer1.Panel2.SuspendLayout();
+            splitContainer1.SuspendLayout();
+            panel2.SuspendLayout();
+            ssMain.SuspendLayout();
+            panel3.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)splitContainer2).BeginInit();
+            splitContainer2.Panel1.SuspendLayout();
+            splitContainer2.Panel2.SuspendLayout();
+            splitContainer2.SuspendLayout();
+            tsMain.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)splitContainer3).BeginInit();
+            splitContainer3.Panel1.SuspendLayout();
+            splitContainer3.Panel2.SuspendLayout();
+            splitContainer3.SuspendLayout();
+            toolStrip1.SuspendLayout();
+            SuspendLayout();
+            // 
+            // pictureBox1
+            // 
+            pictureBox1.Image = Properties.Resources.logo;
+            pictureBox1.Location = new Point(21, 33);
+            pictureBox1.Name = "pictureBox1";
+            pictureBox1.Size = new Size(209, 112);
+            pictureBox1.TabIndex = 0;
+            pictureBox1.TabStop = false;
+            // 
+            // panel1
+            // 
+            panel1.Controls.Add(splitContainer1);
+            panel1.Controls.Add(panel2);
+            panel1.Dock = DockStyle.Top;
+            panel1.Location = new Point(0, 0);
+            panel1.Name = "panel1";
+            panel1.Size = new Size(895, 173);
+            panel1.TabIndex = 1;
+            // 
+            // splitContainer1
+            // 
+            splitContainer1.Dock = DockStyle.Fill;
+            splitContainer1.Location = new Point(250, 0);
+            splitContainer1.Name = "splitContainer1";
+            // 
+            // splitContainer1.Panel1
+            // 
+            splitContainer1.Panel1.Controls.Add(tbOutputDir);
+            splitContainer1.Panel1.Controls.Add(label3);
+            splitContainer1.Panel1.Controls.Add(tbSourceDir);
+            splitContainer1.Panel1.Controls.Add(label2);
+            splitContainer1.Panel1.Controls.Add(tbOrdersSourceFile);
+            splitContainer1.Panel1.Controls.Add(label1);
+            // 
+            // splitContainer1.Panel2
+            // 
+            splitContainer1.Panel2.Controls.Add(butOutputDir);
+            splitContainer1.Panel2.Controls.Add(butOpenSource);
+            splitContainer1.Panel2.Controls.Add(butOpenOrdersFile);
+            splitContainer1.Size = new Size(645, 173);
+            splitContainer1.SplitterDistance = 562;
+            splitContainer1.TabIndex = 1;
+            // 
+            // tbOutputDir
+            // 
+            tbOutputDir.Location = new Point(11, 140);
+            tbOutputDir.Name = "tbOutputDir";
+            tbOutputDir.ReadOnly = true;
+            tbOutputDir.Size = new Size(443, 27);
+            tbOutputDir.TabIndex = 5;
+            // 
+            // label3
+            // 
+            label3.AutoSize = true;
+            label3.Location = new Point(11, 117);
+            label3.Name = "label3";
+            label3.Size = new Size(106, 20);
+            label3.TabIndex = 4;
+            label3.Text = "Složka výstupu";
+            // 
+            // tbSourceDir
+            // 
+            tbSourceDir.Location = new Point(11, 86);
+            tbSourceDir.Name = "tbSourceDir";
+            tbSourceDir.ReadOnly = true;
+            tbSourceDir.Size = new Size(443, 27);
+            tbSourceDir.TabIndex = 3;
+            // 
+            // label2
+            // 
+            label2.AutoSize = true;
+            label2.Location = new Point(11, 63);
+            label2.Name = "label2";
+            label2.Size = new Size(195, 20);
+            label2.TabIndex = 2;
+            label2.Text = "Složka zdrojových forografií";
+            // 
+            // tbOrdersSourceFile
+            // 
+            tbOrdersSourceFile.Location = new Point(11, 33);
+            tbOrdersSourceFile.Name = "tbOrdersSourceFile";
+            tbOrdersSourceFile.ReadOnly = true;
+            tbOrdersSourceFile.Size = new Size(443, 27);
+            tbOrdersSourceFile.TabIndex = 1;
+            // 
+            // label1
+            // 
+            label1.AutoSize = true;
+            label1.Location = new Point(11, 10);
+            label1.Name = "label1";
+            label1.Size = new Size(172, 20);
+            label1.TabIndex = 0;
+            label1.Text = "Soubor objenávek (*.csv)";
+            // 
+            // butOutputDir
+            // 
+            butOutputDir.Location = new Point(8, 140);
+            butOutputDir.Name = "butOutputDir";
+            butOutputDir.Size = new Size(43, 23);
+            butOutputDir.TabIndex = 2;
+            butOutputDir.Text = ",,,";
+            butOutputDir.UseVisualStyleBackColor = true;
+            butOutputDir.Click += butOutputDir_Click;
+            // 
+            // butOpenSource
+            // 
+            butOpenSource.Location = new Point(8, 88);
+            butOpenSource.Name = "butOpenSource";
+            butOpenSource.Size = new Size(43, 23);
+            butOpenSource.TabIndex = 1;
+            butOpenSource.Text = ",,,";
+            butOpenSource.UseVisualStyleBackColor = true;
+            butOpenSource.Click += butOpenSource_Click;
+            // 
+            // butOpenOrdersFile
+            // 
+            butOpenOrdersFile.Location = new Point(10, 37);
+            butOpenOrdersFile.Name = "butOpenOrdersFile";
+            butOpenOrdersFile.Size = new Size(43, 23);
+            butOpenOrdersFile.TabIndex = 0;
+            butOpenOrdersFile.Text = ",,,";
+            butOpenOrdersFile.UseVisualStyleBackColor = true;
+            butOpenOrdersFile.Click += butOpenOrdersFile_Click;
+            // 
+            // panel2
+            // 
+            panel2.Controls.Add(pictureBox1);
+            panel2.Dock = DockStyle.Left;
+            panel2.Location = new Point(0, 0);
+            panel2.Name = "panel2";
+            panel2.Size = new Size(250, 173);
+            panel2.TabIndex = 0;
+            // 
+            // ssMain
+            // 
+            ssMain.ImageScalingSize = new Size(20, 20);
+            ssMain.Items.AddRange(new ToolStripItem[] { ssProgress, tspOrdersCount, tsbFiles, tsbSources, tsbNotFound });
+            ssMain.Location = new Point(0, 377);
+            ssMain.Name = "ssMain";
+            ssMain.Size = new Size(895, 26);
+            ssMain.TabIndex = 2;
+            ssMain.Text = "statusStrip1";
+            // 
+            // ssProgress
+            // 
+            ssProgress.Name = "ssProgress";
+            ssProgress.Size = new Size(100, 18);
+            // 
+            // tspOrdersCount
+            // 
+            tspOrdersCount.Name = "tspOrdersCount";
+            tspOrdersCount.Size = new Size(91, 20);
+            tspOrdersCount.Text = "Objednávek:";
+            // 
+            // tsbFiles
+            // 
+            tsbFiles.Name = "tsbFiles";
+            tsbFiles.Size = new Size(68, 20);
+            tsbFiles.Text = "Souborů:";
+            // 
+            // tsbSources
+            // 
+            tsbSources.Name = "tsbSources";
+            tsbSources.Size = new Size(56, 20);
+            tsbSources.Text = "Zdrojů:";
+            // 
+            // tsbNotFound
+            // 
+            tsbNotFound.BackColor = Color.LightCoral;
+            tsbNotFound.Name = "tsbNotFound";
+            tsbNotFound.Size = new Size(91, 20);
+            tsbNotFound.Text = "Nenalezeno:";
+            // 
+            // panel3
+            // 
+            panel3.Controls.Add(splitContainer2);
+            panel3.Dock = DockStyle.Fill;
+            panel3.Location = new Point(0, 173);
+            panel3.Name = "panel3";
+            panel3.Size = new Size(895, 204);
+            panel3.TabIndex = 3;
+            // 
+            // splitContainer2
+            // 
+            splitContainer2.Dock = DockStyle.Fill;
+            splitContainer2.Location = new Point(0, 0);
+            splitContainer2.Name = "splitContainer2";
+            splitContainer2.Orientation = Orientation.Horizontal;
+            // 
+            // splitContainer2.Panel1
+            // 
+            splitContainer2.Panel1.Controls.Add(tsMain);
+            // 
+            // splitContainer2.Panel2
+            // 
+            splitContainer2.Panel2.Controls.Add(splitContainer3);
+            splitContainer2.Size = new Size(895, 204);
+            splitContainer2.SplitterDistance = 32;
+            splitContainer2.TabIndex = 0;
+            // 
+            // tsMain
+            // 
+            tsMain.ImageScalingSize = new Size(20, 20);
+            tsMain.Items.AddRange(new ToolStripItem[] { tsbCheck, tsbDo, toolStripSeparator1, tsbAddSourceDir, toolStripSeparator2, tsbSettings });
+            tsMain.Location = new Point(0, 0);
+            tsMain.Name = "tsMain";
+            tsMain.Size = new Size(895, 27);
+            tsMain.TabIndex = 0;
+            tsMain.Text = "toolStrip1";
+            // 
+            // tsbCheck
+            // 
+            tsbCheck.BackColor = Color.GreenYellow;
+            tsbCheck.DisplayStyle = ToolStripItemDisplayStyle.Text;
+            tsbCheck.Image = (Image)resources.GetObject("tsbCheck.Image");
+            tsbCheck.ImageTransparentColor = Color.Magenta;
+            tsbCheck.Name = "tsbCheck";
+            tsbCheck.Size = new Size(85, 24);
+            tsbCheck.Text = "1. Kontrola";
+            tsbCheck.Click += tsbCheck_Click;
+            // 
+            // tsbDo
+            // 
+            tsbDo.BackColor = Color.MistyRose;
+            tsbDo.DisplayStyle = ToolStripItemDisplayStyle.Text;
+            tsbDo.Image = (Image)resources.GetObject("tsbDo.Image");
+            tsbDo.ImageTransparentColor = Color.Magenta;
+            tsbDo.Name = "tsbDo";
+            tsbDo.Size = new Size(66, 24);
+            tsbDo.Text = "2. Spusť";
+            tsbDo.Click += tsbDo_Click;
+            // 
+            // toolStripSeparator1
+            // 
+            toolStripSeparator1.Name = "toolStripSeparator1";
+            toolStripSeparator1.Size = new Size(6, 27);
+            // 
+            // tsbAddSourceDir
+            // 
+            tsbAddSourceDir.DisplayStyle = ToolStripItemDisplayStyle.Text;
+            tsbAddSourceDir.Image = (Image)resources.GetObject("tsbAddSourceDir.Image");
+            tsbAddSourceDir.ImageTransparentColor = Color.Magenta;
+            tsbAddSourceDir.Name = "tsbAddSourceDir";
+            tsbAddSourceDir.Size = new Size(96, 24);
+            tsbAddSourceDir.Text = "Přidej složku";
+            tsbAddSourceDir.Click += tsbAddSourceDir_Click;
+            // 
+            // toolStripSeparator2
+            // 
+            toolStripSeparator2.Name = "toolStripSeparator2";
+            toolStripSeparator2.Size = new Size(6, 27);
+            // 
+            // tsbSettings
+            // 
+            tsbSettings.BackColor = Color.AliceBlue;
+            tsbSettings.DisplayStyle = ToolStripItemDisplayStyle.Text;
+            tsbSettings.Image = (Image)resources.GetObject("tsbSettings.Image");
+            tsbSettings.ImageTransparentColor = Color.Magenta;
+            tsbSettings.Name = "tsbSettings";
+            tsbSettings.Size = new Size(78, 24);
+            tsbSettings.Text = "Nastavení";
+            tsbSettings.Click += tsbSettings_Click;
+            // 
+            // splitContainer3
+            // 
+            splitContainer3.Dock = DockStyle.Fill;
+            splitContainer3.Location = new Point(0, 0);
+            splitContainer3.Name = "splitContainer3";
+            // 
+            // splitContainer3.Panel1
+            // 
+            splitContainer3.Panel1.Controls.Add(lbLog);
+            // 
+            // splitContainer3.Panel2
+            // 
+            splitContainer3.Panel2.Controls.Add(lbNotMapped);
+            splitContainer3.Panel2.Controls.Add(toolStrip1);
+            splitContainer3.Size = new Size(895, 168);
+            splitContainer3.SplitterDistance = 592;
+            splitContainer3.TabIndex = 1;
+            // 
+            // lbLog
+            // 
+            lbLog.Dock = DockStyle.Fill;
+            lbLog.FormattingEnabled = true;
+            lbLog.Location = new Point(0, 0);
+            lbLog.Name = "lbLog";
+            lbLog.Size = new Size(592, 168);
+            lbLog.TabIndex = 0;
+            // 
+            // lbNotMapped
+            // 
+            lbNotMapped.Dock = DockStyle.Fill;
+            lbNotMapped.FormattingEnabled = true;
+            lbNotMapped.HorizontalScrollbar = true;
+            lbNotMapped.Location = new Point(0, 25);
+            lbNotMapped.Name = "lbNotMapped";
+            lbNotMapped.ScrollAlwaysVisible = true;
+            lbNotMapped.Size = new Size(299, 143);
+            lbNotMapped.TabIndex = 1;
+            lbNotMapped.MouseDoubleClick += lbNotMapped_MouseDoubleClick;
+            // 
+            // toolStrip1
+            // 
+            toolStrip1.ImageScalingSize = new Size(20, 20);
+            toolStrip1.Items.AddRange(new ToolStripItem[] { toolStripLabel1 });
+            toolStrip1.Location = new Point(0, 0);
+            toolStrip1.Name = "toolStrip1";
+            toolStrip1.Size = new Size(299, 25);
+            toolStrip1.TabIndex = 0;
+            toolStrip1.Text = "toolStrip1";
+            // 
+            // toolStripLabel1
+            // 
+            toolStripLabel1.Name = "toolStripLabel1";
+            toolStripLabel1.Size = new Size(146, 22);
+            toolStripLabel1.Text = "Nepřiřazené položky";
+            // 
+            // dlgOpenFile
+            // 
+            dlgOpenFile.DefaultExt = "*.csv";
+            dlgOpenFile.Filter = "CSV files|*.csv";
+            // 
+            // FormMain
+            // 
+            AutoScaleDimensions = new SizeF(8F, 20F);
+            AutoScaleMode = AutoScaleMode.Font;
+            ClientSize = new Size(895, 403);
+            Controls.Add(panel3);
+            Controls.Add(ssMain);
+            Controls.Add(panel1);
+            Icon = (Icon)resources.GetObject("$this.Icon");
+            Name = "FormMain";
+            Text = "Form1";
+            Load += FormMain_Load;
+            ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
+            panel1.ResumeLayout(false);
+            splitContainer1.Panel1.ResumeLayout(false);
+            splitContainer1.Panel1.PerformLayout();
+            splitContainer1.Panel2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
+            splitContainer1.ResumeLayout(false);
+            panel2.ResumeLayout(false);
+            ssMain.ResumeLayout(false);
+            ssMain.PerformLayout();
+            panel3.ResumeLayout(false);
+            splitContainer2.Panel1.ResumeLayout(false);
+            splitContainer2.Panel1.PerformLayout();
+            splitContainer2.Panel2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)splitContainer2).EndInit();
+            splitContainer2.ResumeLayout(false);
+            tsMain.ResumeLayout(false);
+            tsMain.PerformLayout();
+            splitContainer3.Panel1.ResumeLayout(false);
+            splitContainer3.Panel2.ResumeLayout(false);
+            splitContainer3.Panel2.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)splitContainer3).EndInit();
+            splitContainer3.ResumeLayout(false);
+            toolStrip1.ResumeLayout(false);
+            toolStrip1.PerformLayout();
+            ResumeLayout(false);
+            PerformLayout();
+        }
+
+        #endregion
+
+        private PictureBox pictureBox1;
+        private Panel panel1;
+        private SplitContainer splitContainer1;
+        private TextBox tbSourceDir;
+        private Label label2;
+        private TextBox tbOrdersSourceFile;
+        private Label label1;
+        private Button butOpenSource;
+        private Button butOpenOrdersFile;
+        private Panel panel2;
+        private StatusStrip ssMain;
+        private Panel panel3;
+        private SplitContainer splitContainer2;
+        private ToolStrip tsMain;
+        private ListBox lbLog;
+        private ToolStripProgressBar ssProgress;
+        private ToolStripStatusLabel tspOrdersCount;
+        private ToolStripStatusLabel tsbFiles;
+        private ToolStripStatusLabel tsbSources;
+        private ToolStripStatusLabel tsbNotFound;
+        private ToolStripButton tsbCheck;
+        private ToolStripButton tsbDo;
+        private OpenFileDialog dlgOpenFile;
+        private FolderBrowserDialog dlgOpenDir;
+        private ToolStripSeparator toolStripSeparator1;
+        private ToolStripButton tsbAddSourceDir;
+        private TextBox tbOutputDir;
+        private Label label3;
+        private Button butOutputDir;
+        private SplitContainer splitContainer3;
+        private ToolStrip toolStrip1;
+        private ToolStripLabel toolStripLabel1;
+        private ListBox lbNotMapped;
+        private ToolStripSeparator toolStripSeparator2;
+        private ToolStripButton tsbSettings;
+    }
+}

+ 337 - 0
FormMain.cs

@@ -0,0 +1,337 @@
+using qdr.app.studiou.orders2printpack.Properties;
+using Quadarax.Foundation.Core.Data;
+using Quadarax.Foundation.Core.IO;
+using Quadarax.Foundation.Core.Value;
+using System.Data;
+using System.IO.Abstractions;
+
+namespace qdr.app.studiou.orders2printpack
+{
+    public partial class FormMain : Form
+    {
+        private const string CS_COL_SOURCE_PATH = "LocalPath";
+        private const string CS_COL_ID = "LocalID";
+        private const string CS_TAG_LB = "{";
+        private const string CS_TAG_RB = "}";
+        private const string CS_TAG_EXT = "ext";
+        private const string CS_TAG_FILE = "file";
+        private const string CS_TAG_ORDINAL = "ordinal";
+
+        private DataTable _source = new DataTable();
+        private Dictionary<string, int> _sourceColOrdinals = new Dictionary<string, int>();
+        private List<string> _sourcePathCache = new List<string>();
+        private IFileSystem _fs = new FileSystem();
+        private string _outputPath;
+
+        public FormMain()
+        {
+            InitializeComponent();
+        }
+
+        private void FormMain_Load(object sender, EventArgs e)
+        {
+            Text = $"{Application.ProductName} v{Application.ProductVersion}";
+            RefreshToolButtons();
+        }
+
+        private void butOpenOrdersFile_Click(object sender, EventArgs e)
+        {
+            if (dlgOpenFile.ShowDialog() == DialogResult.OK)
+                OpenOrderBarchFile(dlgOpenFile.FileName);
+            RefreshToolButtons();
+        }
+
+        private void butOpenSource_Click(object sender, EventArgs e)
+        {
+            dlgOpenDir.Description = "Otevřít složku se zdrojovými (RAW) soubory...";
+            dlgOpenDir.UseDescriptionForTitle = true;
+
+            dlgOpenDir.InitialDirectory = AppSettings.Default.LastSourceDir;
+            if (dlgOpenDir.ShowDialog() == DialogResult.OK)
+            {
+                AppSettings.Default.LastSourceDir = dlgOpenDir.SelectedPath;
+                AppSettings.Default.Save();
+                OpenSourceDir(dlgOpenDir.SelectedPath);
+            }
+            RefreshToolButtons();
+        }
+
+        private void butOutputDir_Click(object sender, EventArgs e)
+        {
+            dlgOpenDir.Description = "Otevřít složku pro výstup...";
+            dlgOpenDir.UseDescriptionForTitle = true;
+
+            dlgOpenDir.InitialDirectory = AppSettings.Default.LastOutputDir;
+            if (dlgOpenDir.ShowDialog() == DialogResult.OK)
+            {
+                _outputPath = dlgOpenDir.SelectedPath;
+                Log($"Otevřena složka výstupu '{_outputPath}'");
+                AppSettings.Default.LastOutputDir = dlgOpenDir.SelectedPath;
+                AppSettings.Default.Save();
+                tbOutputDir.Text = _outputPath;
+
+            }
+            RefreshToolButtons();
+        }
+
+        private void tsbCheck_Click(object sender, EventArgs e)
+        {
+            CheckSourceOrderFile();
+        }
+
+        private void tsbDo_Click(object sender, EventArgs e)
+        {
+            ProcessSourceFile();
+        }
+
+        private void tsbAddSourceDir_Click(object sender, EventArgs e)
+        {
+            dlgOpenDir.Description = "Otevřít další složku se zdrojovými (RAW) soubory...";
+            dlgOpenDir.UseDescriptionForTitle = true;
+
+            dlgOpenDir.InitialDirectory = AppSettings.Default.LastSourceDir;
+            if (dlgOpenDir.ShowDialog() == DialogResult.OK)
+            {
+                Log("Přidávám další zdrojovou složku...");
+                //AppSettings.Default.LastSourceDir = dlgOpenDir.SelectedPath;
+                //AppSettings.Default.Save();
+                OpenSourceDir(dlgOpenDir.SelectedPath, true);
+            }
+            RefreshToolButtons();
+        }
+
+        private void Log(string message)
+        {
+            lbLog.Items.Insert(0, message);
+        }
+
+        private void OpenOrderBarchFile(string fileName)
+        {
+            BlockErrorHandled(() =>
+            {
+
+                _source = CsvHelper.CsvToDataTable(_fs, fileName, AppSettings.Default.CSVDelimiter);
+                _source.Columns.Add(new DataColumn(CS_COL_SOURCE_PATH, typeof(string)));
+                _source.Columns.Add(new DataColumn(CS_COL_ID, typeof(int)));
+                _sourceColOrdinals.Clear();
+                for (int i = 0; i < _source.Columns.Count; i++)
+                    _sourceColOrdinals.Add(_source.Columns[i].ColumnName.Replace("\"", ""), i);
+                var cntId = 0;
+                foreach (DataRow row in _source.Rows)
+                    row.SetField(_sourceColOrdinals[CS_COL_ID], cntId++);
+
+                var cntOrders = GetOrderCount();
+                var cntLines = GetLinesCount();
+                Log($"Soubor {fileName} načten. Počet objednávek: {cntOrders}, počet záznamů: {cntLines}");
+                tbOrdersSourceFile.Text = fileName;
+                tspOrdersCount.Text = $"Objednávek: {cntOrders}";
+            });
+        }
+
+        private void OpenSourceDir(string pathToSourceFolder, bool appendCache = false)
+        {
+            BlockErrorHandled(() =>
+            {
+
+                var fsrch = new FileSearch(pathToSourceFolder, true);
+                if (!appendCache)
+                    _sourcePathCache.Clear();
+
+                tbSourceDir.Text = pathToSourceFolder;
+
+                Log($"Procházím všechny soubory {AppSettings.Default.SourceSearchPattern} ve složce '{pathToSourceFolder}'...");
+                Log("Tato operace může chvíli trvat!");
+                var files = fsrch.Search([AppSettings.Default.SourceSearchPattern]);
+                if (files.Length == 0)
+                    throw new Exception($"Nenalezeny žádné soubory pro zpracování ve složce '{pathToSourceFolder}'.");
+
+                foreach (var file in files)
+                    if (!_sourcePathCache.Any(x => x == file))
+                        _sourcePathCache.Add(file);
+
+                tsbFiles.Text = "Souborů: " + _sourcePathCache.Count.ToString();
+                Log($"Nalezeno {files.Length} souborů.");
+
+            });
+        }
+
+
+        private void BlockErrorHandled(Action block)
+        {
+            try
+            {
+                block();
+            }
+            catch (Exception ex)
+            {
+                Log("Error: " + ex.Message);
+                MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                RefreshToolButtons();
+            }
+        }
+        private int GetOrderCount()
+        {
+            return _source.AsEnumerable().Select(x => x.Field<string>(_sourceColOrdinals[AppSettings.Default.MapColOrderNo])).Distinct().Count();
+        }
+
+        private int GetLinesCount()
+        {
+            return _source.AsEnumerable().Count();
+        }
+
+        private string? GetSourceFullFileName(string? webUrl)
+        {
+            if (string.IsNullOrEmpty(webUrl))
+                return null;
+
+            var fileName = Path.GetFileName(webUrl);
+            var sourcePath = _sourcePathCache.FirstOrDefault(x => string.Equals(Path.GetFileName(x), fileName));
+            if (string.IsNullOrEmpty(sourcePath))
+                Log($"Soubor '{fileName}' nebyl nalezen ve zdrojové složce.");
+            return sourcePath;
+        }
+
+        private void RefreshToolButtons()
+        {
+            var canBeChecked = GetOrderCount() > 0 && _sourcePathCache.Count > 0;
+            var canBeProcess = canBeChecked && !_source.AsEnumerable().Any(x => string.IsNullOrEmpty(x.Field<string>(_sourceColOrdinals[CS_COL_SOURCE_PATH]))) && !string.IsNullOrEmpty(_outputPath);
+
+            tsbCheck.Enabled = canBeChecked;
+            tsbDo.Enabled = canBeProcess;
+
+            RefreshNotMappedList();
+        }
+
+        private void RefreshNotMappedList()
+        {
+            var rows = _source.AsEnumerable().Where(x => string.IsNullOrEmpty(x.Field<string>(_sourceColOrdinals[CS_COL_SOURCE_PATH])));
+
+            var list = new List<Tuple<int, string>>();
+
+            foreach (var row in rows)
+            {
+                var id = row.Field<int>(_sourceColOrdinals[CS_COL_ID]);
+                var fileName = _fs.Path.GetFileName(row.Field<string>(_sourceColOrdinals[AppSettings.Default.MapColUri]));
+                var productName = row.Field<string>(_sourceColOrdinals[AppSettings.Default.MapColProductFormat]);
+                var orderNo = row.Field<string>(_sourceColOrdinals[AppSettings.Default.MapColOrderNo]);
+                list.Add(new Tuple<int, string>(id, $"{fileName} [Jméno: {productName} / Obj.:{orderNo}]"));
+            }
+            lbNotMapped.DisplayMember = "Item2";
+            lbNotMapped.ValueMember = "Item1";
+            lbNotMapped.DataSource = list;
+            lbNotMapped.Update();
+        }
+
+        private void CheckSourceOrderFile()
+        {
+            ssProgress.Value = 0;
+            int cntFailed = 0;
+            BlockErrorHandled(() =>
+            {
+                var rows = _source.AsEnumerable().Where(x => string.IsNullOrEmpty(x.Field<string>(_sourceColOrdinals[CS_COL_SOURCE_PATH])));
+
+                ssProgress.Maximum = rows.Count();
+                foreach (var row in rows)
+                {
+                    var orderNo = row.Field<string>(_sourceColOrdinals[AppSettings.Default.MapColOrderNo]);
+                    var sourceUrl = row[_sourceColOrdinals[AppSettings.Default.MapColUri]]?.ToString();
+                    var sourcePath = GetSourceFullFileName(sourceUrl);
+                    if (sourcePath == null) cntFailed++;
+
+                    row.SetField(_sourceColOrdinals[CS_COL_SOURCE_PATH], sourcePath);
+                    ssProgress.Increment(1);
+                }
+            });
+            tsbNotFound.Text = $"Nenalezeno: {cntFailed}";
+            ssProgress.Value = 0;
+        }
+
+
+        private void ProcessSourceFile()
+        {
+            ssProgress.Value = 0;
+            BlockErrorHandled(() =>
+            {
+                var rows = _source.AsEnumerable().Where(x => string.IsNullOrEmpty(x.Field<string>(_sourceColOrdinals[CS_COL_SOURCE_PATH])));
+
+                if (rows.Count() > 0)
+                    throw new Exception("Některé řádky nebyly zkontrolovány. Proveďte kontrolu zdrojových souborů (1. Kontrola).");
+
+                rows = _source.AsEnumerable();
+                //var colNames = _source.Columns.Cast<DataColumn>().Select(x => NormalizeColumnName(x.ColumnName)).ToArray();
+
+                ssProgress.Maximum = rows.Count();
+                var outputFileNameBuilder = new ParameterizedString(AppSettings.Default.OutputFileMask, CS_TAG_LB, CS_TAG_RB);
+
+                foreach (var row in rows)
+                {
+                    var orderNo = row.Field<string>(_sourceColOrdinals[AppSettings.Default.MapColOrderNo]);
+                    var sourceUrl = row[_sourceColOrdinals[AppSettings.Default.MapColUri]]?.ToString();
+                    var qty = int.Parse(row[_sourceColOrdinals[AppSettings.Default.MapColQuantity]]?.ToString()!);
+                    var sourcePath = row[_sourceColOrdinals[CS_COL_SOURCE_PATH]]?.ToString();
+                    var sourceExt = _fs.Path.GetExtension(sourcePath);
+                    var sourceFileName = _fs.Path.GetFileNameWithoutExtension(sourcePath);
+
+                    ApplyRowToParametrizedString(row, outputFileNameBuilder);
+                    outputFileNameBuilder.AddOrSetParameter(CS_TAG_EXT, sourceExt!);
+                    outputFileNameBuilder.AddOrSetParameter(CS_TAG_FILE, sourceFileName!);
+
+                    for (int i = 0; i < qty; i++)
+                    {
+                        outputFileNameBuilder.AddOrSetParameter(CS_TAG_ORDINAL, i.ToString().PadLeft(3, '0'));
+                        var outputFileName = FileUtils.SanitizedFileName(_fs, outputFileNameBuilder.ToString());
+                        var outputPath = _fs.Path.Combine(_outputPath, outputFileName);
+                        _fs.File.Copy(sourcePath!, outputPath, true);
+                        Log($"Soubor '{outputPath}' vytvořen.");
+                    }
+
+                    ssProgress.Increment(1);
+                }
+            });
+            ssProgress.Value = 0;
+        }
+
+        private string NormalizeColumnName(string name)
+        {
+            return name.ToLower().Replace(" ", "_");
+        }
+
+        private void ApplyRowToParametrizedString(DataRow row, ParameterizedString ps)
+        {
+            foreach (DataColumn col in row.Table.Columns)
+            {
+                var ord = _sourceColOrdinals[col.ColumnName];
+                ps.AddOrSetParameter(NormalizeColumnName(col.ColumnName), row[ord]?.ToString()!);
+            }
+        }
+
+        private void lbNotMapped_MouseDoubleClick(object sender, MouseEventArgs e)
+        {
+            if (lbNotMapped.SelectedIndices.Count == 0)
+                return;
+
+            var id = (int?)lbNotMapped.SelectedValue;
+            if (id == null)
+                return;
+
+            var row = _source.Rows[id.GetValueOrDefault()];
+            var fileName = _fs.Path.GetFileName(row.Field<string>(_sourceColOrdinals[AppSettings.Default.MapColUri]));
+            dlgOpenFile.Title = "Vyberte zdrojový soubor soubor pro záznam...";
+            dlgOpenFile.InitialDirectory = AppSettings.Default.LastSourceDir;
+            dlgOpenFile.FileName = fileName;
+            dlgOpenFile.Filter = "Všechny soubory|*.*";
+            if (dlgOpenFile.ShowDialog() == DialogResult.OK)
+            {
+                var sourcePath = dlgOpenFile.FileName;
+                row.SetField(_sourceColOrdinals[CS_COL_SOURCE_PATH], sourcePath);
+                RefreshToolButtons();
+            }
+        }
+
+        private void tsbSettings_Click(object sender, EventArgs e)
+        {
+            var dlg = new dlgSettings();
+            dlg.ShowDialog();
+        }
+    }
+}

+ 62 - 0
Form1.resx → FormMain.resx

@@ -117,7 +117,69 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="ssMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="tsMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>154, 17</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="tsbCheck.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAEKSURBVEhL3ZG9DsFQHMXvczDZvIOtXsHObuhqkViI3Quw
+        6CYmNoMYJJ0NBiFFIoIytOuf0+TeXP3yde+iyS+3OcP53Z4y3/dJJ4HAsiwyTVMp6BQCBIZhKAWdEcHV
+        vSlBmeB82NFy1KLluEWOPRC5MoHdMWhazwi4RJlALgf4EuT6BI+5kCsTrGddUY658E+QvyXYHq9UnRyC
+        U87f4aUApcXhnrI9Jzg/laQKFntXlHM+lSQK5psL5fvbp/JvJLGCQqmSWM5JkiCT84igXGtSrruKLQ0T
+        luAdmZxHBG37FFuWBC/j5XKOmX8WAH7rcI6ZMffPgjQwN2bXJgDo/COBTpjneQ2dML0PY3cISreGe8HM
+        qgAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="tsbDo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAEKSURBVEhL3ZG9DsFQHMXvczDZvIOtXsHObuhqkViI3Quw
+        6CYmNoMYJJ0NBiFFIoIytOuf0+TeXP3yde+iyS+3OcP53Z4y3/dJJ4HAsiwyTVMp6BQCBIZhKAWdEcHV
+        vSlBmeB82NFy1KLluEWOPRC5MoHdMWhazwi4RJlALgf4EuT6BI+5kCsTrGddUY658E+QvyXYHq9UnRyC
+        U87f4aUApcXhnrI9Jzg/laQKFntXlHM+lSQK5psL5fvbp/JvJLGCQqmSWM5JkiCT84igXGtSrruKLQ0T
+        luAdmZxHBG37FFuWBC/j5XKOmX8WAH7rcI6ZMffPgjQwN2bXJgDo/COBTpjneQ2dML0PY3cISreGe8HM
+        qgAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="tsbAddSourceDir.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAEKSURBVEhL3ZG9DsFQHMXvczDZvIOtXsHObuhqkViI3Quw
+        6CYmNoMYJJ0NBiFFIoIytOuf0+TeXP3yde+iyS+3OcP53Z4y3/dJJ4HAsiwyTVMp6BQCBIZhKAWdEcHV
+        vSlBmeB82NFy1KLluEWOPRC5MoHdMWhazwi4RJlALgf4EuT6BI+5kCsTrGddUY658E+QvyXYHq9UnRyC
+        U87f4aUApcXhnrI9Jzg/laQKFntXlHM+lSQK5psL5fvbp/JvJLGCQqmSWM5JkiCT84igXGtSrruKLQ0T
+        luAdmZxHBG37FFuWBC/j5XKOmX8WAH7rcI6ZMffPgjQwN2bXJgDo/COBTpjneQ2dML0PY3cISreGe8HM
+        qgAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="tsbSettings.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAEKSURBVEhL3ZG9DsFQHMXvczDZvIOtXsHObuhqkViI3Quw
+        6CYmNoMYJJ0NBiFFIoIytOuf0+TeXP3yde+iyS+3OcP53Z4y3/dJJ4HAsiwyTVMp6BQCBIZhKAWdEcHV
+        vSlBmeB82NFy1KLluEWOPRC5MoHdMWhazwi4RJlALgf4EuT6BI+5kCsTrGddUY658E+QvyXYHq9UnRyC
+        U87f4aUApcXhnrI9Jzg/laQKFntXlHM+lSQK5psL5fvbp/JvJLGCQqmSWM5JkiCT84igXGtSrruKLQ0T
+        luAdmZxHBG37FFuWBC/j5XKOmX8WAH7rcI6ZMffPgjQwN2bXJgDo/COBTpjneQ2dML0PY3cISreGe8HM
+        qgAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>537, 17</value>
+  </metadata>
+  <metadata name="dlgOpenFile.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>258, 17</value>
+  </metadata>
+  <metadata name="dlgOpenDir.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>399, 17</value>
+  </metadata>
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>25</value>
+  </metadata>
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         AAABAAIAICAAAAEAIACoEAAAJgAAABAQAAABACAAaAQAAM4QAAAoAAAAIAAAAEAAAAABACAAAAAAAAAQ

+ 1 - 1
Program.cs

@@ -11,7 +11,7 @@ namespace qdr.app.studiou.orders2printpack
             // To customize application configuration such as set high DPI settings or default font,
             // see https://aka.ms/applicationconfiguration.
             ApplicationConfiguration.Initialize();
-            Application.Run(new Form1());
+            Application.Run(new FormMain());
         }
     }
 }

+ 158 - 0
Properties/AppSettings.Designer.cs

@@ -0,0 +1,158 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace qdr.app.studiou.orders2printpack.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.11.0.0")]
+    internal sealed partial class AppSettings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static AppSettings defaultInstance = ((AppSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new AppSettings())));
+        
+        public static AppSettings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute(",")]
+        public string CSVDelimiter {
+            get {
+                return ((string)(this["CSVDelimiter"]));
+            }
+            set {
+                this["CSVDelimiter"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string LastOutputDir {
+            get {
+                return ((string)(this["LastOutputDir"]));
+            }
+            set {
+                this["LastOutputDir"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Order No")]
+        public string MapColOrderNo {
+            get {
+                return ((string)(this["MapColOrderNo"]));
+            }
+            set {
+                this["MapColOrderNo"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Prod Cat")]
+        public string MapColProductCat {
+            get {
+                return ((string)(this["MapColProductCat"]));
+            }
+            set {
+                this["MapColProductCat"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Prod Img Url")]
+        public string MapColUri {
+            get {
+                return ((string)(this["MapColUri"]));
+            }
+            set {
+                this["MapColUri"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Qty")]
+        public string MapColQuantity {
+            get {
+                return ((string)(this["MapColQuantity"]));
+            }
+            set {
+                this["MapColQuantity"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("*.jpg")]
+        public string SourceSearchPattern {
+            get {
+                return ((string)(this["SourceSearchPattern"]));
+            }
+            set {
+                this["SourceSearchPattern"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("{prod_var}_{prod_cat}_{order_no}_{ordinal}{ext}")]
+        public string OutputFileMask {
+            get {
+                return ((string)(this["OutputFileMask"]));
+            }
+            set {
+                this["OutputFileMask"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Prod Var")]
+        public string MapColProductFormat {
+            get {
+                return ((string)(this["MapColProductFormat"]));
+            }
+            set {
+                this["MapColProductFormat"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string LastSourceDir {
+            get {
+                return ((string)(this["LastSourceDir"]));
+            }
+            set {
+                this["LastSourceDir"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("_tn")]
+        public string RemoveFromUri {
+            get {
+                return ((string)(this["RemoveFromUri"]));
+            }
+            set {
+                this["RemoveFromUri"] = value;
+            }
+        }
+    }
+}

+ 39 - 0
Properties/AppSettings.settings

@@ -0,0 +1,39 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="qdr.app.studiou.orders2printpack.Properties" GeneratedClassName="AppSettings">
+  <Profiles />
+  <Settings>
+    <Setting Name="CSVDelimiter" Type="System.String" Scope="User">
+      <Value Profile="(Default)">,</Value>
+    </Setting>
+    <Setting Name="LastOutputDir" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="MapColOrderNo" Type="System.String" Scope="User">
+      <Value Profile="(Default)">Order No</Value>
+    </Setting>
+    <Setting Name="MapColProductCat" Type="System.String" Scope="User">
+      <Value Profile="(Default)">Prod Cat</Value>
+    </Setting>
+    <Setting Name="MapColUri" Type="System.String" Scope="User">
+      <Value Profile="(Default)">Prod Img Url</Value>
+    </Setting>
+    <Setting Name="MapColQuantity" Type="System.String" Scope="User">
+      <Value Profile="(Default)">Qty</Value>
+    </Setting>
+    <Setting Name="SourceSearchPattern" Type="System.String" Scope="User">
+      <Value Profile="(Default)">*.jpg</Value>
+    </Setting>
+    <Setting Name="OutputFileMask" Type="System.String" Scope="User">
+      <Value Profile="(Default)">{prod_var}_{prod_cat}_{order_no}_{ordinal}{ext}</Value>
+    </Setting>
+    <Setting Name="MapColProductFormat" Type="System.String" Scope="User">
+      <Value Profile="(Default)">Prod Var</Value>
+    </Setting>
+    <Setting Name="LastSourceDir" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="RemoveFromUri" Type="System.String" Scope="User">
+      <Value Profile="(Default)">_tn</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>

+ 159 - 0
dlgSettings.Designer.cs

@@ -0,0 +1,159 @@
+namespace qdr.app.studiou.orders2printpack
+{
+    partial class dlgSettings
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            butOk = new Button();
+            butCancel = new Button();
+            label1 = new Label();
+            tbMask = new TextBox();
+            tbExt = new TextBox();
+            label2 = new Label();
+            tbReplacement = new TextBox();
+            label3 = new Label();
+            butReset = new Button();
+            SuspendLayout();
+            // 
+            // butOk
+            // 
+            butOk.Location = new Point(29, 282);
+            butOk.Name = "butOk";
+            butOk.Size = new Size(94, 29);
+            butOk.TabIndex = 0;
+            butOk.Text = "Ok";
+            butOk.UseVisualStyleBackColor = true;
+            butOk.Click += butOk_Click;
+            // 
+            // butCancel
+            // 
+            butCancel.Location = new Point(463, 282);
+            butCancel.Name = "butCancel";
+            butCancel.Size = new Size(94, 29);
+            butCancel.TabIndex = 1;
+            butCancel.Text = "Zrušit";
+            butCancel.UseVisualStyleBackColor = true;
+            butCancel.Click += butCancel_Click;
+            // 
+            // label1
+            // 
+            label1.AutoSize = true;
+            label1.Location = new Point(12, 9);
+            label1.Name = "label1";
+            label1.Size = new Size(293, 20);
+            label1.TabIndex = 2;
+            label1.Text = "Maska výstupního souboru (generovaného)";
+            // 
+            // tbMask
+            // 
+            tbMask.Location = new Point(12, 32);
+            tbMask.Name = "tbMask";
+            tbMask.Size = new Size(557, 27);
+            tbMask.TabIndex = 3;
+            // 
+            // tbExt
+            // 
+            tbExt.Location = new Point(12, 88);
+            tbExt.Name = "tbExt";
+            tbExt.Size = new Size(557, 27);
+            tbExt.TabIndex = 5;
+            // 
+            // label2
+            // 
+            label2.AutoSize = true;
+            label2.Location = new Point(12, 65);
+            label2.Name = "label2";
+            label2.Size = new Size(198, 20);
+            label2.TabIndex = 4;
+            label2.Text = "Přípona mediálních souborů.";
+            // 
+            // tbReplacement
+            // 
+            tbReplacement.Location = new Point(12, 149);
+            tbReplacement.Name = "tbReplacement";
+            tbReplacement.Size = new Size(557, 27);
+            tbReplacement.TabIndex = 7;
+            // 
+            // label3
+            // 
+            label3.AutoSize = true;
+            label3.Location = new Point(12, 126);
+            label3.Name = "label3";
+            label3.Size = new Size(385, 20);
+            label3.TabIndex = 6;
+            label3.Text = "Odstranit ze jména zdrojového souboru (z náhledového).";
+            // 
+            // butReset
+            // 
+            butReset.Location = new Point(463, 192);
+            butReset.Name = "butReset";
+            butReset.Size = new Size(94, 29);
+            butReset.TabIndex = 8;
+            butReset.Text = "Reset";
+            butReset.UseVisualStyleBackColor = true;
+            butReset.Click += butReset_Click;
+            // 
+            // dlgSettings
+            // 
+            AutoScaleDimensions = new SizeF(8F, 20F);
+            AutoScaleMode = AutoScaleMode.Font;
+            ClientSize = new Size(581, 326);
+            ControlBox = false;
+            Controls.Add(butReset);
+            Controls.Add(tbReplacement);
+            Controls.Add(label3);
+            Controls.Add(tbExt);
+            Controls.Add(label2);
+            Controls.Add(tbMask);
+            Controls.Add(label1);
+            Controls.Add(butCancel);
+            Controls.Add(butOk);
+            FormBorderStyle = FormBorderStyle.FixedDialog;
+            MaximizeBox = false;
+            MinimizeBox = false;
+            Name = "dlgSettings";
+            ShowIcon = false;
+            StartPosition = FormStartPosition.CenterScreen;
+            Text = "Nastavení";
+            Load += dlgSettings_Load;
+            ResumeLayout(false);
+            PerformLayout();
+        }
+
+        #endregion
+
+        private Button butOk;
+        private Button butCancel;
+        private Label label1;
+        private TextBox tbMask;
+        private TextBox tbExt;
+        private Label label2;
+        private TextBox tbReplacement;
+        private Label label3;
+        private Button butReset;
+    }
+}

+ 49 - 0
dlgSettings.cs

@@ -0,0 +1,49 @@
+using qdr.app.studiou.orders2printpack.Properties;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace qdr.app.studiou.orders2printpack
+{
+    public partial class dlgSettings : Form
+    {
+        public dlgSettings()
+        {
+            InitializeComponent();
+        }
+
+        private void butOk_Click(object sender, EventArgs e)
+        {
+            AppSettings.Default.OutputFileMask = tbMask.Text;
+            AppSettings.Default.SourceSearchPattern = tbExt.Text;
+            AppSettings.Default.RemoveFromUri = tbReplacement.Text;
+            AppSettings.Default.Save();
+            Close();
+        }
+
+        private void dlgSettings_Load(object sender, EventArgs e)
+        {
+            tbMask.Text = AppSettings.Default.OutputFileMask;
+            tbExt.Text = AppSettings.Default.SourceSearchPattern;
+            tbReplacement.Text = AppSettings.Default.RemoveFromUri;
+
+        }
+
+        private void butCancel_Click(object sender, EventArgs e)
+        {
+            Close();
+        }
+
+        private void butReset_Click(object sender, EventArgs e)
+        {
+            AppSettings.Default.Reset();
+            dlgSettings_Load(sender, e);
+        }
+    }
+}

+ 120 - 0
dlgSettings.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!--
+    Microsoft ResX Schema
+
+    Version 2.0
+
+    The primary goals of this format is to allow a simple XML format
+    that is mostly human readable. The generation and parsing of the
+    various data types are done through the TypeConverter classes
+    associated with the data types.
+
+    Example:
+
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+
+    There are any number of "resheader" rows that contain simple
+    name/value pairs.
+
+    Each data row contains a name, and value. The row also contains a
+    type or mimetype. Type corresponds to a .NET class that support
+    text/value conversion through the TypeConverter architecture.
+    Classes that don't support this are serialized and stored with the
+    mimetype set.
+
+    The mimetype is used for serialized objects, and tells the
+    ResXResourceReader how to depersist the object. This is currently not
+    extensible. For a given mimetype the value must be set accordingly:
+
+    Note - application/x-microsoft.net.object.binary.base64 is the format
+    that the ResXResourceWriter will generate, however the reader can
+    read any of the formats listed below.
+
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 16 - 0
qdr.app.studiou.orders2printpack.csproj

@@ -26,6 +26,15 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="qdr.fnd.core" Version="0.0.5-alpha" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Compile Update="Properties\AppSettings.Designer.cs">
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+      <AutoGen>True</AutoGen>
+      <DependentUpon>AppSettings.settings</DependentUpon>
+    </Compile>
     <Compile Update="Properties\Resources.Designer.cs">
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
@@ -40,4 +49,11 @@
     </EmbeddedResource>
   </ItemGroup>
 
+  <ItemGroup>
+    <None Update="Properties\AppSettings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>AppSettings.Designer.cs</LastGenOutput>
+    </None>
+  </ItemGroup>
+
 </Project>