Skip to content

Commit 0a9dd56

Browse files
committed
Add project files.
1 parent aad4c38 commit 0a9dd56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1410
-0
lines changed

EdiFact.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31229.75
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EdiFact", "EdiFact\EdiFact.csproj", "{CE7257BC-42FD-412F-8213-23BE58E519C6}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{CE7257BC-42FD-412F-8213-23BE58E519C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{CE7257BC-42FD-412F-8213-23BE58E519C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{CE7257BC-42FD-412F-8213-23BE58E519C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{CE7257BC-42FD-412F-8213-23BE58E519C6}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {F4187F56-0019-4193-A5D6-407727E7100D}
24+
EndGlobalSection
25+
EndGlobal

EdiFact/BGM.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using indice.Edi.Serialization;
7+
8+
namespace EdiFact
9+
{
10+
[EdiSegment(Description = "Message Begin", Mandatory = true), EdiPath("BGM")]
11+
public class BGM
12+
{
13+
[EdiValue(/*"X(3)",*/ Path = "BGM/0/0")]
14+
public DocumentType Type { get; set; }
15+
16+
[EdiValue("X(3)", Path = "BGM/0/1")]
17+
public string CodeListQualifier { get; set; }
18+
19+
[EdiValue("X(3)", Path = "BGM/0/2")]
20+
public string CodeListAgency { get; set; }
21+
22+
[EdiValue("X(35)", Path = "BGM/0/3")]
23+
public string MessageName { get; set; }
24+
25+
[EdiValue("X(20)", Path = "BGM/1/0")]
26+
public string InvoiceNumber { get; set; }
27+
28+
[EdiValue(/*"X(3)",*/ Path = "BGM/2/0")]
29+
public MessageFunction MessageFunction { get; set; }
30+
}
31+
}

EdiFact/CPS.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using indice.Edi.Serialization;
7+
8+
namespace EdiFact
9+
{
10+
[EdiSegment(Description = "Consignment Package Sequence", Mandatory = true), EdiSegmentGroup("CPS")]
11+
public class CPS
12+
{
13+
[EdiValue("X(12)", Path = "CPS/0")]
14+
public string PackId { get; set; }
15+
16+
[EdiValue("X(12)", Path = "CPS/1")]
17+
public string ParentId { get; set; }
18+
19+
[EdiValue("X(3)", Path = "CPS/2")]
20+
public string PackagingLevel { get; set; }
21+
22+
public PAC Package { get; set; }
23+
}
24+
}

EdiFact/CUX.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using indice.Edi.Serialization;
7+
8+
namespace EdiFact
9+
{
10+
[EdiSegment(Description = "Currency", Mandatory = true), EdiPath("CUX")]
11+
public class CUX
12+
{
13+
[EdiValue(/*"X(3)",*/ Path = "CUX/0/0")]
14+
public CurrencyDetailType CurrencyDetailType { get; set; }
15+
16+
[EdiValue("X(35)", Path = "CUX/0/1")]
17+
public string Currency { get; set; }
18+
19+
[EdiValue(/*"X(6)",*/ Path = "CUX/0/2")]
20+
public CurrencyType CurrencyType { get; set; }
21+
22+
[EdiValue("X(35)", Path = "CUX/0/3")]
23+
public string CurrencyRateBase { get; set; }
24+
}
25+
}

EdiFact/DTM.cs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Globalization;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using indice.Edi.Serialization;
8+
9+
namespace EdiFact
10+
{
11+
[EdiSegment(Description = "Date and Time"), EdiPath("DTM")]
12+
public class DTM
13+
{
14+
[EdiValue(/*"X(3)",*/ Path = "DTM/0/0")]
15+
public DateType Qualifier { get; set; }
16+
17+
[EdiValue("X(35)", Path = "DTM/0/1")]
18+
public string Period { get; set; }
19+
20+
[EdiValue(/*"X(3)",*/ Path = "DTM/0/2")]
21+
public DateFormat FormatQualifier { get; set; }
22+
23+
public static DTM Instance(DateType qualifier, string period, DateFormat formatQualifier = DateFormat.YYYYMMDD)
24+
{
25+
return new DTM()
26+
{
27+
Qualifier = qualifier,
28+
Period = period,
29+
FormatQualifier = formatQualifier,
30+
};
31+
}
32+
33+
public static DTM FromDateTime(DateType qualifier, DateTime dateTime, DateFormat formatQualifier = DateFormat.YYYYMMDD)
34+
{
35+
string formatted;
36+
37+
switch (formatQualifier)
38+
{
39+
case DateFormat.YYYYMMDD:
40+
formatted = dateTime.ToString("yyyyMMdd");
41+
break;
42+
case DateFormat.CCYYMMDDHHMM:
43+
formatted = dateTime.ToString("yyyyMMddHHmm");
44+
break;
45+
default:
46+
throw new NotImplementedException($"DTM.FromDateTime with format {formatQualifier} not implemented.");
47+
}
48+
49+
return new DTM()
50+
{
51+
Qualifier = qualifier,
52+
FormatQualifier = formatQualifier,
53+
Period = formatted,
54+
};
55+
}
56+
57+
public DateTime? ToDateTime()
58+
{
59+
DateTime parsed;
60+
61+
switch (FormatQualifier)
62+
{
63+
case DateFormat.YYYYMMDD:
64+
if (DateTime.TryParseExact(Period, "yyyyMMdd", CultureInfo.InvariantCulture, DateTimeStyles.None, out parsed))
65+
{
66+
return parsed;
67+
}
68+
break;
69+
default:
70+
throw new NotImplementedException($"DTM.ToDateTime with format {FormatQualifier} not implemented.");
71+
}
72+
73+
return null;
74+
}
75+
}
76+
}

EdiFact/EdiFact.csproj

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{CE7257BC-42FD-412F-8213-23BE58E519C6}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>EdiFact</RootNamespace>
11+
<AssemblyName>EdiFact</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="indice.Edi, Version=1.9.18.0, Culture=neutral, processorArchitecture=MSIL">
35+
<HintPath>..\packages\indice.Edi.1.9.18\lib\net45\indice.Edi.dll</HintPath>
36+
</Reference>
37+
<Reference Include="System" />
38+
<Reference Include="System.Core" />
39+
<Reference Include="System.Xml.Linq" />
40+
<Reference Include="System.Data.DataSetExtensions" />
41+
<Reference Include="Microsoft.CSharp" />
42+
<Reference Include="System.Data" />
43+
<Reference Include="System.Net.Http" />
44+
<Reference Include="System.Xml" />
45+
</ItemGroup>
46+
<ItemGroup>
47+
<Compile Include="BGM.cs" />
48+
<Compile Include="CPS.cs" />
49+
<Compile Include="CUX.cs" />
50+
<Compile Include="DTM.cs" />
51+
<Compile Include="Enums\CurrencyDetailType.cs" />
52+
<Compile Include="Enums\CurrencyType.cs" />
53+
<Compile Include="Enums\DateFormat.cs" />
54+
<Compile Include="Enums\DateType.cs" />
55+
<Compile Include="Enums\DocumentType.cs" />
56+
<Compile Include="Enums\IdentifierType.cs" />
57+
<Compile Include="Enums\MarkingInstructions.cs" />
58+
<Compile Include="Enums\MessageFunction.cs" />
59+
<Compile Include="Enums\MonetaryAmountType.cs" />
60+
<Compile Include="Enums\Place.cs" />
61+
<Compile Include="Enums\ProductIdType.cs" />
62+
<Compile Include="Enums\QuantityType.cs" />
63+
<Compile Include="Enums\TaxType.cs" />
64+
<Compile Include="FTX.cs" />
65+
<Compile Include="GIN.cs" />
66+
<Compile Include="IMD.cs" />
67+
<Compile Include="LIN.cs" />
68+
<Compile Include="LOC.cs" />
69+
<Compile Include="MOA.cs" />
70+
<Compile Include="NAD.cs" />
71+
<Compile Include="PAC.cs" />
72+
<Compile Include="PCI.cs" />
73+
<Compile Include="PIA.cs" />
74+
<Compile Include="PRI.cs" />
75+
<Compile Include="Properties\AssemblyInfo.cs" />
76+
<Compile Include="QTY.cs" />
77+
<Compile Include="RFF.cs" />
78+
<Compile Include="TAX.cs" />
79+
<Compile Include="TopLevel\ASN.cs" />
80+
<Compile Include="TopLevel\EdiFactDocument.cs" />
81+
<Compile Include="TopLevel\Invoice.cs" />
82+
<Compile Include="TopLevel\PurchaseOrder.cs" />
83+
<Compile Include="UNB.cs" />
84+
<Compile Include="UNH.cs" />
85+
<Compile Include="UNS.cs" />
86+
<Compile Include="UNT.cs" />
87+
<Compile Include="UNZ.cs" />
88+
</ItemGroup>
89+
<ItemGroup>
90+
<None Include="packages.config" />
91+
</ItemGroup>
92+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
93+
</Project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace EdiFact
8+
{
9+
public enum CurrencyDetailType
10+
{
11+
ReferenceCurrency = 2,
12+
}
13+
}

EdiFact/Enums/CurrencyType.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace EdiFact
8+
{
9+
public enum CurrencyType
10+
{
11+
Invoicing = 4,
12+
}
13+
}

EdiFact/Enums/DateFormat.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace EdiFact
8+
{
9+
public enum DateFormat
10+
{
11+
YYYYMMDD = 102,
12+
CCYYMMDDHHMM = 203,
13+
}
14+
}

EdiFact/Enums/DateType.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace EdiFact
8+
{
9+
public enum DateType
10+
{
11+
Due = 265,
12+
Document = 137,
13+
Delivery = 35,
14+
Invoice = 3,
15+
Order = 4,
16+
DeliveryLatest = 63,
17+
DeliveryEarliest = 64
18+
}
19+
}

0 commit comments

Comments
 (0)