Skip to content

Commit

Permalink
code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ruialexrib committed Aug 31, 2023
1 parent b65d63f commit 2214b25
Show file tree
Hide file tree
Showing 138 changed files with 92 additions and 87 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<assemblyIdentity name="SAFT_Reader.application" version="1.1.0.59" publicKeyToken="0000000000000000" language="pt-PT" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<assemblyIdentity name="SAFT_Reader.application" version="1.1.0.60" publicKeyToken="0000000000000000" language="pt-PT" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="Rui Ribeiro" asmv2:product="SAFT_READER" asmv2:supportUrl="https://github.com/ruialexrib/Programatica.SAFTReader" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true" co.v1:createDesktopShortcut="true">
<subscription>
Expand All @@ -11,17 +11,17 @@
<deploymentProvider codebase="https://raw.githubusercontent.com/ruialexrib/SAFTReader.PT/master/pub/SAFT_Reader.application" />
</deployment>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.6.1" profile="Full" supportedRuntime="4.0.30319" />
<framework targetVersion="4.6.2" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="Application Files\SAFT_Reader_1_1_0_59\SAFT_Reader.exe.manifest" size="91297">
<assemblyIdentity name="SAFT_Reader.exe" version="1.1.0.59" publicKeyToken="0000000000000000" language="pt-PT" processorArchitecture="msil" type="win32" />
<dependentAssembly dependencyType="install" codebase="Application Files\SAFT_Reader_1_1_0_60\SAFT_Reader.exe.manifest" size="91297">
<assemblyIdentity name="SAFT_Reader.exe" version="1.1.0.60" publicKeyToken="0000000000000000" language="pt-PT" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>BAO95jLMdUDiOpLg6Ade9xceBh1VGskcE8gkhlR2GD4=</dsig:DigestValue>
<dsig:DigestValue>haCQY7FglD91aPY/7hS7t1TWQxKkfdsEoJqlDDGgRms=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Expand Down Expand Up @@ -54,6 +54,12 @@
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Collections.Concurrent" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
Expand Down Expand Up @@ -246,12 +252,6 @@
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.Numerics" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<asmv1:assemblyIdentity name="SAFT_Reader.exe" version="1.1.0.59" publicKeyToken="0000000000000000" language="pt-PT" processorArchitecture="msil" type="win32" />
<asmv1:assemblyIdentity name="SAFT_Reader.exe" version="1.1.0.60" publicKeyToken="0000000000000000" language="pt-PT" processorArchitecture="msil" type="win32" />
<description asmv2:iconFile="icon.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
<application />
<entryPoint>
Expand Down Expand Up @@ -127,14 +127,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="SAFT_Reader.exe" size="1103360">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="SAFT_Reader.exe" size="1117696">
<assemblyIdentity name="SAFT_Reader" version="1.1.0.13" language="neutral" processorArchitecture="msil" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>BdNE3kpjdw94721D0TpvjQUYnnoTPdRVO8qQMkDdz6s=</dsig:DigestValue>
<dsig:DigestValue>g2MOSMjpZt1WZDwiGZYGKxTjj4PoJAgG9HFIHTOJhec=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down Expand Up @@ -1142,7 +1142,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>dkMvQURY6TtUzrAvw0jmUqhHRBCBAvOoN5LYqAQEDrg=</dsig:DigestValue>
<dsig:DigestValue>i7nVK6XGfwXI9jLesefpipCTGLEOE4i0fpGVFf3ULL8=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down Expand Up @@ -1530,7 +1530,7 @@
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>KFV6mSqXhEek1/Hl0zi6A2Y5Y7Y/nw5ohG5nhZCjVfo=</dsig:DigestValue>
<dsig:DigestValue>H82x0jrPEk/+HPhfpQSntVW3RmnY05XjSoxb5+H6Cz4=</dsig:DigestValue>
</hash>
</file>
<file name="SyncfusionLicense.txt" size="87">
Expand Down
Binary file not shown.
10 changes: 5 additions & 5 deletions pub/SAFT_Reader.application
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns="urn:schemas-microsoft-com:asm.v2" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2">
<assemblyIdentity name="SAFT_Reader.application" version="1.1.0.59" publicKeyToken="0000000000000000" language="pt-PT" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<assemblyIdentity name="SAFT_Reader.application" version="1.1.0.60" publicKeyToken="0000000000000000" language="pt-PT" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
<description asmv2:publisher="Rui Ribeiro" asmv2:product="SAFT_READER" asmv2:supportUrl="https://github.com/ruialexrib/Programatica.SAFTReader" xmlns="urn:schemas-microsoft-com:asm.v1" />
<deployment install="true" mapFileExtensions="true" co.v1:createDesktopShortcut="true">
<subscription>
Expand All @@ -11,17 +11,17 @@
<deploymentProvider codebase="https://raw.githubusercontent.com/ruialexrib/SAFTReader.PT/master/pub/SAFT_Reader.application" />
</deployment>
<compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
<framework targetVersion="4.6.1" profile="Full" supportedRuntime="4.0.30319" />
<framework targetVersion="4.6.2" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="Application Files\SAFT_Reader_1_1_0_59\SAFT_Reader.exe.manifest" size="91297">
<assemblyIdentity name="SAFT_Reader.exe" version="1.1.0.59" publicKeyToken="0000000000000000" language="pt-PT" processorArchitecture="msil" type="win32" />
<dependentAssembly dependencyType="install" codebase="Application Files\SAFT_Reader_1_1_0_60\SAFT_Reader.exe.manifest" size="91297">
<assemblyIdentity name="SAFT_Reader.exe" version="1.1.0.60" publicKeyToken="0000000000000000" language="pt-PT" processorArchitecture="msil" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>BAO95jLMdUDiOpLg6Ade9xceBh1VGskcE8gkhlR2GD4=</dsig:DigestValue>
<dsig:DigestValue>haCQY7FglD91aPY/7hS7t1TWQxKkfdsEoJqlDDGgRms=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
10 changes: 3 additions & 7 deletions src/Adapter/FileStreamAdapter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;
using System.Text;

namespace SAFT_Reader.Adapter
Expand All @@ -16,10 +15,7 @@ public class FileStreamAdapter : IFileStreamAdapter
/// <returns>The content of the file as a string.</returns>
public string Read(string path)
{
string fileReader;
Encoding encoding = Encoding.GetEncoding(1252);
fileReader = File.ReadAllText(path, encoding);
return fileReader;
return File.ReadAllText(path, Encoding.GetEncoding(1252));
}

/// <summary>
Expand All @@ -29,7 +25,7 @@ public string Read(string path)
/// <param name="content">The content to write to the file.</param>
public void Write(string path, string content)
{
throw new NotImplementedException();
File.WriteAllText(path, content);
}
}
}
56 changes: 30 additions & 26 deletions src/App.config
Original file line number Diff line number Diff line change
@@ -1,57 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Shared.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.Shared.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Grid.Windows" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.Grid.Windows" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Shared.Windows" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.Shared.Windows" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Licensing" publicKeyToken="632609b4d040f6b4" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.Licensing" publicKeyToken="632609b4d040f6b4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.DataSource.WinForms" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.DataSource.WinForms" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.GridCommon.WinForms" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.GridCommon.WinForms" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Data.WinForms" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.Data.WinForms" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.XlsIO.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.XlsIO.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Pdf.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.Pdf.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.Compression.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.Compression.Base" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.SfDataGrid.WinForms" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.SfDataGrid.WinForms" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Syncfusion.SfInput.WinForms" publicKeyToken="3d67ed1f87d44c89" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59"/>
<assemblyIdentity name="Syncfusion.SfInput.WinForms" publicKeyToken="3d67ed1f87d44c89" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-18.2460.0.59" newVersion="18.2460.0.59" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
4 changes: 2 additions & 2 deletions src/Extensions/AuditFileExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace SAFT_Reader.Extensions
public static class AuditFileExtensions
{
/// <summary>
/// Converts an AuditFile object to a HeaderPt object.
/// Converts an AuditFile object to a HeaderPt object with Portuguese field names.
/// </summary>
/// <param name="a">The AuditFile object to convert.</param>
/// <returns>A HeaderPt object with data converted from the AuditFile.</returns>
/// <returns>A HeaderPt object containing audit file header information with Portuguese field names.</returns>
public static HeaderPt ToHeaderPt(this AuditFile a)
{
return new HeaderPt
Expand Down
32 changes: 10 additions & 22 deletions src/Extensions/AuditStringExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;

namespace SAFT_Reader.Extensions
{
Expand Down Expand Up @@ -63,29 +64,16 @@ public static int ToInt(this string s)
/// <returns>The corresponding account grouping category description.</returns>
public static string ToAccountGroupCatDesc(this string s)
{
switch (s)
Dictionary<string, string> mapping = new Dictionary<string, string>
{
case "GR":
return "Razão - CG";

case "GA":
return "Agregadora - CG";

case "GM":
return "Movimento - CG";

case "AR":
return "Razão - CA";

case "AA":
return "Agregadora - CA";

case "AM":
return "Movimento - CA";

default:
return "";
}
{ "GR", "Razão - CG" },
{ "GA", "Agregadora - CG" },
{ "GM", "Movimento - CG" },
{ "AR", "Razão - CA" },
{ "AA", "Agregadora - CA" },
{ "AM", "Movimento - CA" }
};
return mapping.TryGetValue(s, out string result) ? result : "";
}
}
}
Loading

0 comments on commit 2214b25

Please sign in to comment.