diff --git a/ConvertiXML.sln b/ConvertiXML.sln
new file mode 100644
index 0000000..a7a4b69
--- /dev/null
+++ b/ConvertiXML.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.14.36203.30 d17.14
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConvertiXML", "ConvertiXML\ConvertiXML.csproj", "{99DD108A-9FD9-45DE-818B-11AB1DAB7538}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {99DD108A-9FD9-45DE-818B-11AB1DAB7538}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {99DD108A-9FD9-45DE-818B-11AB1DAB7538}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {99DD108A-9FD9-45DE-818B-11AB1DAB7538}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {99DD108A-9FD9-45DE-818B-11AB1DAB7538}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {46A48786-1F9E-46D4-BFC0-9D9E74527198}
+ EndGlobalSection
+EndGlobal
diff --git a/ConvertiXML/App.config b/ConvertiXML/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/ConvertiXML/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ConvertiXML/ConvertiXML.csproj b/ConvertiXML/ConvertiXML.csproj
new file mode 100644
index 0000000..ab0c892
--- /dev/null
+++ b/ConvertiXML/ConvertiXML.csproj
@@ -0,0 +1,84 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {99DD108A-9FD9-45DE-818B-11AB1DAB7538}
+ WinExe
+ ConvertiXML
+ ConvertiXML
+ v4.7.2
+ 512
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ MainForm.cs
+
+
+
+
+ MainForm.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ConvertiXML/DictionaryExtensions.cs b/ConvertiXML/DictionaryExtensions.cs
new file mode 100644
index 0000000..0cc49fa
--- /dev/null
+++ b/ConvertiXML/DictionaryExtensions.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConvertiXML
+{
+ internal class DictionaryExtensions
+ {
+ }
+}
diff --git a/ConvertiXML/MainForm.Designer.cs b/ConvertiXML/MainForm.Designer.cs
new file mode 100644
index 0000000..71e60ef
--- /dev/null
+++ b/ConvertiXML/MainForm.Designer.cs
@@ -0,0 +1,316 @@
+namespace ConvertiXML
+{
+ partial class MainForm
+ {
+ ///
+ /// Variabile di progettazione necessaria.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Pulire le risorse in uso.
+ ///
+ /// ha valore true se le risorse gestite devono essere eliminate, false in caso contrario.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Codice generato da Progettazione Windows Form
+
+ ///
+ /// Metodo necessario per il supporto della finestra di progettazione. Non modificare
+ /// il contenuto del metodo con l'editor di codice.
+ ///
+ private void InitializeComponent()
+ {
+ this.lbAanagcesp = new System.Windows.Forms.Label();
+ this.lblAgest = new System.Windows.Forms.Label();
+ this.lblAmovm = new System.Windows.Forms.Label();
+ this.lblAcateg = new System.Windows.Forms.Label();
+ this.lblCsv_anag = new System.Windows.Forms.Label();
+ this.lblCsv_mov = new System.Windows.Forms.Label();
+ this.txtAanagcesp = new System.Windows.Forms.TextBox();
+ this.txtAmovm = new System.Windows.Forms.TextBox();
+ this.txtAgest = new System.Windows.Forms.TextBox();
+ this.txtAcateg = new System.Windows.Forms.TextBox();
+ this.txtCsv_anag = new System.Windows.Forms.TextBox();
+ this.txtCsv_mov = new System.Windows.Forms.TextBox();
+ this.btnAanagcesp = new System.Windows.Forms.Button();
+ this.btnAmovm = new System.Windows.Forms.Button();
+ this.btnAgest = new System.Windows.Forms.Button();
+ this.btnAcateg = new System.Windows.Forms.Button();
+ this.BtnCsv_anag = new System.Windows.Forms.Button();
+ this.btnCsv_mov = new System.Windows.Forms.Button();
+ this.btnConverti = new System.Windows.Forms.Button();
+ this.lblCliente = new System.Windows.Forms.Label();
+ this.txtCliente = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // lbAanagcesp
+ //
+ this.lbAanagcesp.AutoSize = true;
+ this.lbAanagcesp.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbAanagcesp.Location = new System.Drawing.Point(11, 48);
+ this.lbAanagcesp.Name = "lbAanagcesp";
+ this.lbAanagcesp.Size = new System.Drawing.Size(128, 15);
+ this.lbAanagcesp.TabIndex = 0;
+ this.lbAanagcesp.Text = "acbcv_aanagcesp.xml:";
+ //
+ // lblAgest
+ //
+ this.lblAgest.AutoSize = true;
+ this.lblAgest.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblAgest.Location = new System.Drawing.Point(11, 138);
+ this.lblAgest.Name = "lblAgest";
+ this.lblAgest.Size = new System.Drawing.Size(150, 15);
+ this.lblAgest.TabIndex = 1;
+ this.lblAgest.Text = "acbcv_agestionecesp.xml:";
+ //
+ // lblAmovm
+ //
+ this.lblAmovm.AutoSize = true;
+ this.lblAmovm.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblAmovm.Location = new System.Drawing.Point(11, 92);
+ this.lblAmovm.Name = "lblAmovm";
+ this.lblAmovm.Size = new System.Drawing.Size(113, 15);
+ this.lblAmovm.TabIndex = 2;
+ this.lblAmovm.Text = "acbcv_amovm.xml:";
+ //
+ // lblAcateg
+ //
+ this.lblAcateg.AutoSize = true;
+ this.lblAcateg.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblAcateg.Location = new System.Drawing.Point(11, 184);
+ this.lblAcateg.Name = "lblAcateg";
+ this.lblAcateg.Size = new System.Drawing.Size(126, 15);
+ this.lblAcateg.TabIndex = 3;
+ this.lblAcateg.Text = "acbcv_atabcateg.xml:";
+ //
+ // lblCsv_anag
+ //
+ this.lblCsv_anag.AutoSize = true;
+ this.lblCsv_anag.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblCsv_anag.Location = new System.Drawing.Point(11, 230);
+ this.lblCsv_anag.Name = "lblCsv_anag";
+ this.lblCsv_anag.Size = new System.Drawing.Size(147, 15);
+ this.lblCsv_anag.TabIndex = 4;
+ this.lblCsv_anag.Text = "Template CSV anagrafica:";
+ //
+ // lblCsv_mov
+ //
+ this.lblCsv_mov.AutoSize = true;
+ this.lblCsv_mov.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblCsv_mov.Location = new System.Drawing.Point(11, 276);
+ this.lblCsv_mov.Name = "lblCsv_mov";
+ this.lblCsv_mov.Size = new System.Drawing.Size(151, 15);
+ this.lblCsv_mov.TabIndex = 5;
+ this.lblCsv_mov.Text = "Template CSV movimenti:";
+ //
+ // txtAanagcesp
+ //
+ this.txtAanagcesp.Location = new System.Drawing.Point(14, 66);
+ this.txtAanagcesp.Name = "txtAanagcesp";
+ this.txtAanagcesp.Size = new System.Drawing.Size(693, 23);
+ this.txtAanagcesp.TabIndex = 6;
+ this.txtAanagcesp.Leave += new System.EventHandler(this.txtAanagcesp_Leave);
+ //
+ // txtAmovm
+ //
+ this.txtAmovm.Location = new System.Drawing.Point(14, 112);
+ this.txtAmovm.Name = "txtAmovm";
+ this.txtAmovm.Size = new System.Drawing.Size(693, 23);
+ this.txtAmovm.TabIndex = 7;
+ this.txtAmovm.Leave += new System.EventHandler(this.txtAmovm_Leave);
+ //
+ // txtAgest
+ //
+ this.txtAgest.Location = new System.Drawing.Point(14, 158);
+ this.txtAgest.Name = "txtAgest";
+ this.txtAgest.Size = new System.Drawing.Size(693, 23);
+ this.txtAgest.TabIndex = 8;
+ this.txtAgest.Leave += new System.EventHandler(this.txtAgest_Leave);
+ //
+ // txtAcateg
+ //
+ this.txtAcateg.Location = new System.Drawing.Point(14, 204);
+ this.txtAcateg.Name = "txtAcateg";
+ this.txtAcateg.Size = new System.Drawing.Size(693, 23);
+ this.txtAcateg.TabIndex = 9;
+ this.txtAcateg.Leave += new System.EventHandler(this.txtAcateg_Leave);
+ //
+ // txtCsv_anag
+ //
+ this.txtCsv_anag.Location = new System.Drawing.Point(14, 250);
+ this.txtCsv_anag.Name = "txtCsv_anag";
+ this.txtCsv_anag.Size = new System.Drawing.Size(693, 23);
+ this.txtCsv_anag.TabIndex = 10;
+ this.txtCsv_anag.Leave += new System.EventHandler(this.txtCsv_anag_Leave);
+ //
+ // txtCsv_mov
+ //
+ this.txtCsv_mov.Location = new System.Drawing.Point(14, 296);
+ this.txtCsv_mov.Name = "txtCsv_mov";
+ this.txtCsv_mov.Size = new System.Drawing.Size(693, 23);
+ this.txtCsv_mov.TabIndex = 11;
+ this.txtCsv_mov.Leave += new System.EventHandler(this.txtCsv_mov_Leave);
+ //
+ // btnAanagcesp
+ //
+ this.btnAanagcesp.Location = new System.Drawing.Point(713, 65);
+ this.btnAanagcesp.Name = "btnAanagcesp";
+ this.btnAanagcesp.Size = new System.Drawing.Size(75, 23);
+ this.btnAanagcesp.TabIndex = 12;
+ this.btnAanagcesp.Text = "Sfoglia";
+ this.btnAanagcesp.UseVisualStyleBackColor = true;
+ this.btnAanagcesp.Click += new System.EventHandler(this.btnAanagcesp_Click);
+ this.btnAanagcesp.Leave += new System.EventHandler(this.btnAanagcesp_Leave);
+ //
+ // btnAmovm
+ //
+ this.btnAmovm.Location = new System.Drawing.Point(713, 112);
+ this.btnAmovm.Name = "btnAmovm";
+ this.btnAmovm.Size = new System.Drawing.Size(75, 23);
+ this.btnAmovm.TabIndex = 13;
+ this.btnAmovm.Text = "Sfoglia";
+ this.btnAmovm.UseVisualStyleBackColor = true;
+ this.btnAmovm.Click += new System.EventHandler(this.btnAmovm_Click);
+ this.btnAmovm.Leave += new System.EventHandler(this.btnAmovm_Leave);
+ //
+ // btnAgest
+ //
+ this.btnAgest.Location = new System.Drawing.Point(713, 158);
+ this.btnAgest.Name = "btnAgest";
+ this.btnAgest.Size = new System.Drawing.Size(75, 23);
+ this.btnAgest.TabIndex = 14;
+ this.btnAgest.Text = "Sfoglia";
+ this.btnAgest.UseVisualStyleBackColor = true;
+ this.btnAgest.Click += new System.EventHandler(this.btnAgest_Click);
+ this.btnAgest.Leave += new System.EventHandler(this.btnAgest_Leave);
+ //
+ // btnAcateg
+ //
+ this.btnAcateg.Location = new System.Drawing.Point(713, 204);
+ this.btnAcateg.Name = "btnAcateg";
+ this.btnAcateg.Size = new System.Drawing.Size(75, 23);
+ this.btnAcateg.TabIndex = 15;
+ this.btnAcateg.Text = "Sfoglia";
+ this.btnAcateg.UseVisualStyleBackColor = true;
+ this.btnAcateg.Click += new System.EventHandler(this.btnAcateg_Click);
+ this.btnAcateg.Leave += new System.EventHandler(this.btnAcateg_Leave);
+ //
+ // BtnCsv_anag
+ //
+ this.BtnCsv_anag.Location = new System.Drawing.Point(713, 250);
+ this.BtnCsv_anag.Name = "BtnCsv_anag";
+ this.BtnCsv_anag.Size = new System.Drawing.Size(75, 23);
+ this.BtnCsv_anag.TabIndex = 16;
+ this.BtnCsv_anag.Text = "Sfoglia";
+ this.BtnCsv_anag.UseVisualStyleBackColor = true;
+ this.BtnCsv_anag.Click += new System.EventHandler(this.BtnCsv_anag_Click);
+ this.BtnCsv_anag.Leave += new System.EventHandler(this.BtnCsv_anag_Leave);
+ //
+ // btnCsv_mov
+ //
+ this.btnCsv_mov.Location = new System.Drawing.Point(713, 296);
+ this.btnCsv_mov.Name = "btnCsv_mov";
+ this.btnCsv_mov.Size = new System.Drawing.Size(75, 23);
+ this.btnCsv_mov.TabIndex = 17;
+ this.btnCsv_mov.Text = "Sfoglia";
+ this.btnCsv_mov.UseVisualStyleBackColor = true;
+ this.btnCsv_mov.Click += new System.EventHandler(this.btnCsv_mov_Click);
+ this.btnCsv_mov.Leave += new System.EventHandler(this.btnCsv_mov_Leave);
+ //
+ // btnConverti
+ //
+ this.btnConverti.Location = new System.Drawing.Point(661, 345);
+ this.btnConverti.Name = "btnConverti";
+ this.btnConverti.Size = new System.Drawing.Size(127, 43);
+ this.btnConverti.TabIndex = 18;
+ this.btnConverti.Text = "CONVERTI";
+ this.btnConverti.UseVisualStyleBackColor = true;
+ this.btnConverti.Click += new System.EventHandler(this.btnConverti_Click);
+ //
+ // lblCliente
+ //
+ this.lblCliente.AutoSize = true;
+ this.lblCliente.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblCliente.Location = new System.Drawing.Point(12, 20);
+ this.lblCliente.Name = "lblCliente";
+ this.lblCliente.Size = new System.Drawing.Size(93, 15);
+ this.lblCliente.TabIndex = 19;
+ this.lblCliente.Text = "NOME CLIENTE:";
+ //
+ // txtCliente
+ //
+ this.txtCliente.Location = new System.Drawing.Point(111, 16);
+ this.txtCliente.Name = "txtCliente";
+ this.txtCliente.Size = new System.Drawing.Size(323, 23);
+ this.txtCliente.TabIndex = 20;
+ //
+ // MainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(807, 397);
+ this.Controls.Add(this.txtCliente);
+ this.Controls.Add(this.lblCliente);
+ this.Controls.Add(this.btnConverti);
+ this.Controls.Add(this.btnCsv_mov);
+ this.Controls.Add(this.BtnCsv_anag);
+ this.Controls.Add(this.btnAcateg);
+ this.Controls.Add(this.btnAgest);
+ this.Controls.Add(this.btnAmovm);
+ this.Controls.Add(this.btnAanagcesp);
+ this.Controls.Add(this.txtCsv_mov);
+ this.Controls.Add(this.txtCsv_anag);
+ this.Controls.Add(this.txtAcateg);
+ this.Controls.Add(this.txtAgest);
+ this.Controls.Add(this.txtAmovm);
+ this.Controls.Add(this.txtAanagcesp);
+ this.Controls.Add(this.lblCsv_mov);
+ this.Controls.Add(this.lblCsv_anag);
+ this.Controls.Add(this.lblAcateg);
+ this.Controls.Add(this.lblAmovm);
+ this.Controls.Add(this.lblAgest);
+ this.Controls.Add(this.lbAanagcesp);
+ this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+ this.Name = "MainForm";
+ this.ShowIcon = false;
+ this.Text = "XML To CSV Converter";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lbAanagcesp;
+ private System.Windows.Forms.Label lblAgest;
+ private System.Windows.Forms.Label lblAmovm;
+ private System.Windows.Forms.Label lblAcateg;
+ private System.Windows.Forms.Label lblCsv_anag;
+ private System.Windows.Forms.Label lblCsv_mov;
+ private System.Windows.Forms.TextBox txtAanagcesp;
+ private System.Windows.Forms.TextBox txtAmovm;
+ private System.Windows.Forms.TextBox txtAgest;
+ private System.Windows.Forms.TextBox txtAcateg;
+ private System.Windows.Forms.TextBox txtCsv_anag;
+ private System.Windows.Forms.TextBox txtCsv_mov;
+ private System.Windows.Forms.Button btnAanagcesp;
+ private System.Windows.Forms.Button btnAmovm;
+ private System.Windows.Forms.Button btnAgest;
+ private System.Windows.Forms.Button btnAcateg;
+ private System.Windows.Forms.Button BtnCsv_anag;
+ private System.Windows.Forms.Button btnCsv_mov;
+ private System.Windows.Forms.Button btnConverti;
+ private System.Windows.Forms.Label lblCliente;
+ private System.Windows.Forms.TextBox txtCliente;
+ }
+}
+
diff --git a/ConvertiXML/MainForm.cs b/ConvertiXML/MainForm.cs
new file mode 100644
index 0000000..e3bc5b9
--- /dev/null
+++ b/ConvertiXML/MainForm.cs
@@ -0,0 +1,666 @@
+using System;
+using System;
+using System.Collections.Generic;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Data;
+using System.Drawing;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Windows.Forms;
+using System.Xml.Linq;
+using static System.Net.Mime.MediaTypeNames;
+
+namespace ConvertiXML
+{
+ public partial class MainForm : Form
+ {
+ public MainForm()
+ {
+ InitializeComponent();
+ }
+
+ #region METODI
+
+ private string CercaFiles()
+ {
+ //creo oggetto openFileDialog1
+ OpenFileDialog openFileDialog1 = new OpenFileDialog();
+
+ //apro finestra per selezionare il file
+ DialogResult res = openFileDialog1.ShowDialog();
+ var nomeFileTRovato = string.Empty;
+ if (res == DialogResult.OK)
+ {
+ nomeFileTRovato = openFileDialog1.FileName;
+
+ }
+ return nomeFileTRovato;
+ }
+
+ //Metodo FormatDate
+ private string FormatDate(string dateStr)
+ {
+ try
+ {
+ if (!string.IsNullOrWhiteSpace(dateStr) && dateStr != "0100-01-01")
+ {
+ if (DateTime.TryParse(dateStr, out DateTime date))
+ {
+ string result = date.ToString("dd-MM-yyyy");
+ if (result == "01-01-1900")
+ return "";
+ return result;
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show($"Errore: {ex.Message}", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ return "";
+ }
+
+ //Metodo FormatNumber
+ private string FormatNumber(object val)
+ {
+ try
+ {
+ if (val == null || string.IsNullOrWhiteSpace(val.ToString()))
+ {
+ return "";
+ }
+
+ if (double.TryParse(val.ToString(), NumberStyles.Any, CultureInfo.InvariantCulture, out double number))
+ {
+ if (number == 0)
+ {
+ return "";
+ }
+
+ // Usa formato italiano: "." per migliaia e "," per decimali
+ return number.ToString("#,0.00", new CultureInfo("it-IT"));
+ }
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show($"Errore: {ex.Message}", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ return "";
+ }
+
+ private List AdjustRow(List