Initialer Commit
authorMarkus Bröker<mbroeker@4customers.de>
Wed, 29 Mar 2017 06:02:36 +0200
changeset 0 cfa10fbf52b3
child 1 80c685d55d63
Initialer Commit
.hgignore
Sales.sln
Sales/App.config
Sales/Invoice.cs
Sales/Payment.cs
Sales/Program.cs
Sales/Properties/AssemblyInfo.cs
Sales/Sales.csproj
new file mode 100644
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,139 @@
+syntax: glob
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so
+*.a
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+*.log
+*.sql
+*.sqlite
+*.suo
+*.user
+*.sln.docstates
+[Dd]ebug/
+[Rr]elease/
+x64/
+build/
+[Bb]in/
+[Oo]bj/
+*.obj
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+.builds
+*.pidb
+*.log
+*.scc
+*.pdb
+*.user
+*.aps
+*.pch
+*.vspscc
+*.vssscc
+*_i.c
+*_p.c
+*.ncb
+*.suo
+*.tlb
+*.tlh
+*.bak
+*.[Cc]ache
+*.ilk
+*.log
+*.lib
+*.sbr
+_ReSharper*/
+[Tt]humbs.db
+[Tt]est[Rr]esult*
+[Bb]uild[Ll]og.*
+*.[Pp]ublish.xml
+*.resharper
+[Bb]ackup/
+_UpgradeReport_Files/
+UpgradeLog.*
+*.opensdf
+*.sdf
+ipch/
+x64/
+*.psess
+*.vsp
+*.vspx
+*.gpState
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+_TeamCity*
+*.dotCover
+*.ncrunch*
+.*crunch*.local.xml
+[Ee]xpress/
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+publish/
+*.Publish.xml
+*.pubxml
+csx
+*.build.csdef
+AppPackages/
+Generated_Code/
+App_Data/*.mdf
+App_Data/*.ldf
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+packages/
+sql/
+*.Cache
+ClientBin/
+[Ss]tyle[Cc]op.*
+~$*
+*~
+*.dbmdl
+*.[Pp]ublish.xml
+*.pfx
+*.publishsettings
+$RECYCLE.BIN/
+Thumbs.db
+ehthumbs.db
+Desktop.ini
+*.ide/
+*.VisualState.xml
+TestResult.xml
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+$tf/
+*.mm.*
+AutoTest.Net/
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+FakesAssemblies/
+*.favdoc
new file mode 100644
--- /dev/null
+++ b/Sales.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sales", "Sales\Sales.csproj", "{142CDB0D-7277-4655-9AE7-70EA09B6BEF7}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{142CDB0D-7277-4655-9AE7-70EA09B6BEF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{142CDB0D-7277-4655-9AE7-70EA09B6BEF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{142CDB0D-7277-4655-9AE7-70EA09B6BEF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{142CDB0D-7277-4655-9AE7-70EA09B6BEF7}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
new file mode 100644
--- /dev/null
+++ b/Sales/App.config
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+</configuration>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/Sales/Invoice.cs
@@ -0,0 +1,83 @@
+/**
+ * Invoice.cs
+ * 
+ * @author       Markus Bröker<broeker.markus@googlemail.com>
+ * @copyright    Copyright(C) 2017 4Customers UG
+ * 
+ */
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using static Sales.Payment;
+
+namespace Sales
+{
+    delegate double InvoiceDelegate();
+
+    class Invoice
+    {
+        private double value = 0;
+        private PaymentType till;
+
+        public Invoice(double value, PaymentType till)
+        {
+            this.value = value;
+            this.till = till;
+
+            InvoiceDelegate invoiceDelegateReference = this.Rabatt;
+            invoiceDelegateReference += this.AddTax;
+            invoiceDelegateReference += this.Skonto;
+
+            invoiceDelegateReference();
+        }
+
+        public double getFinalResult()
+        {            
+            return value;
+        }
+
+        //Rabatt auf den Netto Preis
+        private double Rabatt()
+        {
+            if (value > 1000.0)
+            {
+                value *= 0.75;
+            }
+            else if (value > 500.0)
+            {
+                value *= 0.85;
+            }
+
+            return value;
+        }
+
+        // Steuern auf den rabattierten Nettopreis
+        private double AddTax()
+        {
+            value *= 1.19;
+            return value;
+        }
+
+        // Skonto immer zum Schluss
+        private double Skonto()
+        {
+            switch (till)
+            {
+                case PaymentType.NOW:
+                    value *= 0.97;
+                    break;
+                case PaymentType.WEEK:
+                    value *= 0.98;
+                    break;
+                case PaymentType.MONTH:
+                    value *= 0.99;
+                    break;
+            }
+
+            return value;
+        }
+    }
+}
new file mode 100644
--- /dev/null
+++ b/Sales/Payment.cs
@@ -0,0 +1,20 @@
+/**
+ * Payment.cs
+ * 
+ * @author       Markus Bröker<broeker.markus@googlemail.com>
+ * @copyright    Copyright(C) 2017 4Customers UG
+ * 
+ */
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Sales
+{
+    class Payment
+    {
+        public enum PaymentType { NOW, WEEK, MONTH };
+    }
+}
new file mode 100644
--- /dev/null
+++ b/Sales/Program.cs
@@ -0,0 +1,32 @@
+/**
+ * Program.cs
+ * 
+ * @author       Markus Bröker<broeker.markus@googlemail.com>
+ * @copyright    Copyright(C) 2017 4Customers UG
+ * 
+ */
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using static Sales.Payment;
+
+namespace Sales
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            Console.OutputEncoding = Encoding.Default;
+
+            Program p = new Program();
+
+            Invoice invoice = new Sales.Invoice(599.99, PaymentType.NOW);
+            Console.WriteLine("Die Endsumme beträgt {0:C}", invoice.getFinalResult());
+
+            Console.ReadKey();
+        }
+    }
+}
new file mode 100644
--- /dev/null
+++ b/Sales/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Allgemeine Informationen über eine Assembly werden über die folgenden 
+// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+// die einer Assembly zugeordnet sind.
+[assembly: AssemblyTitle("Delegates")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Delegates")]
+[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar 
+// für COM-Komponenten.  Wenn Sie auf einen Typ in dieser Assembly von 
+// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
+[assembly: ComVisible(false)]
+
+// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
+[assembly: Guid("142cdb0d-7277-4655-9ae7-70ea09b6bef7")]
+
+// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+//
+//      Hauptversion
+//      Nebenversion 
+//      Buildnummer
+//      Revision
+//
+// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern 
+// übernehmen, indem Sie "*" eingeben:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
new file mode 100644
--- /dev/null
+++ b/Sales/Sales.csproj
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{142CDB0D-7277-4655-9AE7-70EA09B6BEF7}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Delegates</RootNamespace>
+    <AssemblyName>Sales</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Payment.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Invoice.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4.5.2 %28x86 und x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file