diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6eadc23 --- /dev/null +++ b/.gitignore @@ -0,0 +1,364 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd +/Epi2Exchange/App.config diff --git a/Epi2Exchange.sln b/Epi2Exchange.sln new file mode 100644 index 0000000..0c2c82a --- /dev/null +++ b/Epi2Exchange.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30523.141 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Epi2Exchange", "Epi2Exchange\Epi2Exchange.csproj", "{6ED87064-301E-4A3C-A7F1-AD10B5F55183}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6ED87064-301E-4A3C-A7F1-AD10B5F55183}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6ED87064-301E-4A3C-A7F1-AD10B5F55183}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6ED87064-301E-4A3C-A7F1-AD10B5F55183}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6ED87064-301E-4A3C-A7F1-AD10B5F55183}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AAF830DE-2DB6-44FA-8746-EF99837D444C} + EndGlobalSection +EndGlobal diff --git a/Epi2Exchange/App.example.config b/Epi2Exchange/App.example.config new file mode 100644 index 0000000..092537f --- /dev/null +++ b/Epi2Exchange/App.example.config @@ -0,0 +1,39 @@ + + + + +
+ + + + + + + + + xxx + + + xxx + + + 8080 + + + 2 + + + xxx + + + xxx + + + xxx + + + + + + + diff --git a/Epi2Exchange/Converter.cs b/Epi2Exchange/Converter.cs new file mode 100644 index 0000000..fcfb844 --- /dev/null +++ b/Epi2Exchange/Converter.cs @@ -0,0 +1,518 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + + +using Microsoft.Exchange.WebServices.Data; + +using System.Net; +using System.Windows; + +namespace Epi2Exchange +{ + class Converter + { + + EpiContacts epicontacts; + + public Converter() + { + epicontacts = new EpiContacts(); + + Console.WriteLine("########## EPI2EXCHANGE ##########"); + Console.WriteLine(""); + Console.WriteLine(""); + Console.WriteLine(""); + Console.WriteLine(Properties.Settings.Default.ExchangeEWS); + Console.WriteLine(Properties.Settings.Default.ExchangeUser); + Console.WriteLine(Properties.Settings.Default.ExchangePassword); + Console.WriteLine(Properties.Settings.Default.ExchangeDomain); + Console.WriteLine(""); + Console.WriteLine(""); + } + + + public void MainUpdateProcedure() + { + + //Epirent-Daten über die Rest-API (JSON) in eine Objektstruktur /model parsen und dort als entsprechend vernetzte Objekte ablegen. + Model.ContactList contactList = epicontacts.getContactListFromJson(epicontacts.getContactJson()); + + + + //Durchlaufe jede Adresse - Firma + foreach (Model.ContactListPayload contact in contactList.ContactListPayload) + { + + string VarName = ""; + string VarSalutation = ""; + string VarFirstname = ""; + string VarLastname = ""; + string VarCompany = ""; + string VarMail1 = ""; + string VarMail2 = ""; + string VarMail3 = ""; + string VarChataddressAliasID = ""; + string VarPhone1 = ""; + string VarPhone2 = ""; + string VarMobilphone1 = ""; + string VarFax = ""; + string VarHomepage = ""; + string VarStreet = ""; + string VarPlz = ""; + string VarCity = ""; + string VarState = ""; + string VarCountry = ""; + + try + { + //Hole die Details eines Kontakts + contact.setContactDetail(); + }catch(Exception ex) + { + Console.WriteLine(ex); + try + { + //Hole die Details eines Kontakts + contact.setContactDetail(); + } + catch(Exception ex1) + { + Console.WriteLine(ex1); + + } + } + + VarChataddressAliasID = contact.PrimaryKey; + VarName = contact.Name; + VarFirstname = contact.Name1; + VarLastname = contact.Name2; + VarSalutation = contact.ContactDetail.ContactDetailPayload[0].salutation; + VarStreet = contact.ContactDetail.ContactDetailPayload[0].address.Street; + VarPlz = contact.ContactDetail.ContactDetailPayload[0].address.PostalCode; + VarCity = contact.ContactDetail.ContactDetailPayload[0].address.City; + VarState = contact.ContactDetail.ContactDetailPayload[0].address.FederalState; + VarCountry = contact.ContactDetail.ContactDetailPayload[0].address.Country; + VarCompany = contact.Name; + + if (contact.ContactDetail.ContactDetailPayload[0] != null) + { + int mailcounter = 0; + int phonecounter = 0; + + foreach (Model.ContactDetailCommunication communication in contact.ContactDetail.ContactDetailPayload[0].communication) + { + + switch (Convert.ToInt32(communication.Type)) + { + case 0: + switch (phonecounter) + { + case 0: + VarPhone1 = communication.ContactData; + break; + case 1: + VarPhone2 = communication.ContactData; + break; + } + phonecounter++; + break; + case 1: + VarFax = communication.ContactData; + break; + case 2: + VarMobilphone1 = communication.ContactData; + break; + case 3: + switch (mailcounter) + { + case 0: + VarMail1 = communication.ContactData; + break; + case 1: + VarMail2 = communication.ContactData; + break; + case 2: + VarMail3 = communication.ContactData; + break; + } + mailcounter++; + break; + case 4: + VarHomepage = communication.ContactData; + break; + + + } + + } + Console.WriteLine("Name: " + VarName + Environment.NewLine + "Salutation: " + VarSalutation + Environment.NewLine + "Company: " + VarCompany + Environment.NewLine + "Mail1: " + VarMail1 + Environment.NewLine + "Mail2: " + VarMail2 + Environment.NewLine + "Mail3: " + VarMail3 + Environment.NewLine + "ID: " + VarChataddressAliasID + Environment.NewLine + "Phone1: " + VarPhone1 + Environment.NewLine + "Phone2: " + VarPhone2 + Environment.NewLine + "Mobilphone: " + VarMobilphone1 + Environment.NewLine + "Fax: " + VarFax + Environment.NewLine + "Homepage: " + VarHomepage + Environment.NewLine + "Adresse: " + VarStreet + " " + VarPlz + " " + VarCity + " " + VarState + " " + VarCountry + Environment.NewLine + "##########"); + String ContactID = findContactInAddressbook(VarChataddressAliasID); + + if (!ContactID.Equals("")) + { + updateContact(ContactID, VarName, VarSalutation, VarFirstname, VarLastname, VarCompany, VarMail1, VarMail2, VarMail3, VarChataddressAliasID, VarPhone1, VarPhone2, VarMobilphone1, VarFax, VarHomepage, VarStreet, VarPlz, VarCity, VarState, VarCountry); + } + else + { + + storeNewContact(VarName, VarSalutation, VarFirstname, VarLastname, VarCompany, VarMail1, VarMail2, VarMail3, VarChataddressAliasID, VarPhone1, VarPhone2, VarMobilphone1, VarFax, VarHomepage, VarStreet, VarPlz, VarCity, VarState, VarCountry); + + } + + //Contact Person + string VarCPName = ""; + string VarCPSalutation = ""; + string VarCPFirstname = ""; + string VarCPLastname = ""; + string VarCPCompany = ""; + string VarCPMail1 = ""; + string VarCPMail2 = ""; + string VarCPMail3 = ""; + string VarCPChataddressAliasID = ""; + string VarCPPhone1 = ""; + string VarCPPhone2 = ""; + string VarCPMobilphone1 = ""; + string VarCPFax = ""; + string VarCPHomepage = ""; + string VarCPStreet = ""; + string VarCPPlz = ""; + string VarCPCity = ""; + string VarCPState = ""; + string VarCPCountry = ""; + + if (contact.ContactDetail.ContactDetailPayload[0].contactPerson != null) + { + foreach (Model.ContactPerson cperson in contact.ContactDetail.ContactDetailPayload[0].contactPerson) + { + if (cperson != null) + { + cperson.setContactPersonDetail(); + VarCPName = cperson.ContactPersonDetail.ContactPersonDetailPayload[0].name; + VarCPSalutation = cperson.ContactPersonDetail.ContactPersonDetailPayload[0].salutation; + VarCPFirstname = cperson.ContactPersonDetail.ContactPersonDetailPayload[0].firstname; + VarCPLastname = cperson.ContactPersonDetail.ContactPersonDetailPayload[0].lastname; + VarCPChataddressAliasID = contact.PrimaryKey + "-" + cperson.PrimaryKey; + + int cpersCommailcounter = 0; + int cpersComphonecounter = 0; + foreach (Model.ContactDetailCommunication cpersCom in cperson.ContactPersonDetail.ContactPersonDetailPayload[0].communication) + { + switch (Convert.ToInt32(cpersCom.Type)) + { + case 0: + switch (cpersComphonecounter) + { + case 0: + VarCPPhone1 = cpersCom.ContactData; + break; + case 1: + VarCPPhone2 = cpersCom.ContactData; + break; + } + cpersComphonecounter++; + break; + case 1: + VarCPFax = cpersCom.ContactData; + break; + case 2: + VarCPMobilphone1 = cpersCom.ContactData; + break; + case 3: + switch (cpersCommailcounter) + { + case 0: + VarCPMail1 = cpersCom.ContactData; + break; + case 1: + VarCPMail2 = cpersCom.ContactData; + break; + case 2: + VarCPMail3 = cpersCom.ContactData; + break; + } + cpersCommailcounter++; + break; + case 4: + VarCPHomepage = cpersCom.ContactData; + break; + + + } + } + + if (VarCPName.Equals("")) + VarCPName = VarName; + if (VarCPSalutation.Equals("")) + VarCPSalutation = VarSalutation; + if (VarCPFirstname.Equals("")) + VarCPFirstname = VarFirstname; + if (VarCPLastname.Equals("")) + VarCPLastname = VarLastname; + if (VarCPMail1.Equals("")) + VarCPMail1 = VarMail1; + if (VarCPMail2.Equals("")) + VarCPMail2 = VarMail2; + if (VarCPMail3.Equals("")) + VarCPMail3 = VarMail3; + if (VarCPPhone1.Equals("")) + VarCPPhone1 = VarPhone1; + if (VarCPPhone2.Equals("")) + VarCPPhone2 = VarPhone2; + if (VarCPMobilphone1.Equals("")) + VarCPMobilphone1 = VarMobilphone1; + if (VarCPPhone1.Equals("")) + VarCPPhone1 = VarPhone1; + if (VarCPFax.Equals("")) + VarCPFax = VarFax; + if (VarCPHomepage.Equals("")) + VarCPHomepage = VarHomepage; + if (VarCPPhone1.Equals("")) + VarCPPhone1 = VarPhone1; + if (VarCPStreet.Equals("")) + VarCPStreet = VarStreet; + if (VarCPPlz.Equals("")) + VarCPPlz = VarPlz; + if (VarCPCity.Equals("")) + VarCPCity = VarCity; + if (VarCPState.Equals("")) + VarCPState = VarState; + if (VarCPCountry.Equals("")) + VarCPCountry = VarCountry; + + + + Console.WriteLine("##CPERSON##" + Environment.NewLine + "Name: " + VarCPName + Environment.NewLine + "Salutation: " + VarCPSalutation + Environment.NewLine + "Company: " + VarCPCompany + Environment.NewLine + "Mail1: " + VarCPMail1 + Environment.NewLine + "Mail2: " + VarCPMail2 + Environment.NewLine + "Mail3: " + VarCPMail3 + Environment.NewLine + "ID: " + VarCPChataddressAliasID + Environment.NewLine + "Phone1: " + VarCPPhone1 + Environment.NewLine + "Phone2: " + VarCPPhone2 + Environment.NewLine + "Mobilphone: " + VarCPMobilphone1 + Environment.NewLine + "Fax: " + VarCPFax + Environment.NewLine + "Homepage: " + VarCPHomepage + Environment.NewLine + "Adresse: " + VarCPStreet + " " + VarCPPlz + " " + VarCPCity + " " + VarCPState + " " + VarCPCountry + Environment.NewLine + "##########"); + String CPersContactID = findContactInAddressbook(VarCPChataddressAliasID); + + if (!CPersContactID.Equals("")) + { + updateContact(CPersContactID, VarCPName, VarCPSalutation, VarCPFirstname, VarCPLastname, VarCompany, VarCPMail1, VarCPMail2, VarCPMail3, VarCPChataddressAliasID, VarCPPhone1, VarCPPhone2, VarCPMobilphone1, VarCPFax, VarCPHomepage, VarCPStreet, VarCPPlz, VarCPCity, VarCPState, VarCPCountry); + } + else + { + storeNewContact(VarCPName, VarCPSalutation, VarCPFirstname, VarCPLastname, VarCompany, VarCPMail1, VarCPMail2, VarCPMail3, VarCPChataddressAliasID, VarCPPhone1, VarCPPhone2, VarCPMobilphone1, VarCPFax, VarCPHomepage, VarCPStreet, VarCPPlz, VarCPCity, VarCPState, VarCPCountry); + + } + } + + VarCPName = ""; + VarCPSalutation = ""; + VarCPFirstname = ""; + VarCPLastname = ""; + VarCPCompany = ""; + VarCPMail1 = ""; + VarCPMail2 = ""; + VarCPMail3 = ""; + VarCPChataddressAliasID = ""; + VarCPPhone1 = ""; + VarCPPhone2 = ""; + VarCPMobilphone1 = ""; + VarCPFax = ""; + VarCPHomepage = ""; + VarCPStreet = ""; + VarCPPlz = ""; + VarCPCity = ""; + VarCPState = ""; + VarCPCountry = ""; + + + mailcounter = 0; + phonecounter = 0; + + + + + } + } + } + VarName = ""; + VarSalutation = ""; + VarFirstname = ""; + VarLastname = ""; + VarCompany = ""; + VarMail1 = ""; + VarMail2 = ""; + VarMail3 = ""; + VarChataddressAliasID = ""; + VarPhone1 = ""; + VarPhone2 = ""; + VarMobilphone1 = ""; + VarFax = ""; + VarHomepage = ""; + VarStreet = ""; + VarPlz = ""; + VarCity = ""; + VarState = ""; + VarCountry = ""; + + + } + + } + private void storeNewContact(string name, string salutation, string firstname, string lastname, string company, string mail1, string mail2, string mail3, string chataddressAliasID, string phone1, string phone2, string mobilphone1, string fax, string homepage, string street, string plz, string city, string state, string country) + { + ExchangeService service; + service = new ExchangeService(); + + service.Credentials = new WebCredentials(Properties.Settings.Default.ExchangeUser, Properties.Settings.Default.ExchangePassword); + service.UseDefaultCredentials = false; + service.Url = new Uri(Properties.Settings.Default.ExchangeEWS); + Microsoft.Exchange.WebServices.Data.Contact contact = new Microsoft.Exchange.WebServices.Data.Contact(service); + + contact.FileAsMapping = FileAsMapping.CompanySurnameCommaGivenName; + ExtendedPropertyDefinition oTitleProp = new ExtendedPropertyDefinition(0x3A45, MapiPropertyType.String); + + if (!name.Equals("")) + contact.DisplayName = name; + if (!salutation.Equals("")) + contact.SetExtendedProperty(oTitleProp, salutation); + if (!firstname.Equals("")) + contact.GivenName = firstname; + if (!lastname.Equals("")) + contact.Surname = lastname; + + if (!lastname.Equals("")) + contact.DisplayName = name; + + if (!company.Equals("")) + contact.CompanyName = company; + if (!mail1.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress1] = new Microsoft.Exchange.WebServices.Data.EmailAddress(mail1); + if (!mail2.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress2] = new Microsoft.Exchange.WebServices.Data.EmailAddress(mail2); + if (!mail3.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress3] = new Microsoft.Exchange.WebServices.Data.EmailAddress(mail3); + if (!chataddressAliasID.Equals("")) + contact.ImAddresses[ImAddressKey.ImAddress1] = chataddressAliasID; + if (!homepage.Equals("")) + contact.BusinessHomePage = homepage; + if (!phone1.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessPhone] = phone1; + if (!phone2.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessPhone2] = phone2; + if (!mobilphone1.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.MobilePhone] = mobilphone1; + if (!fax.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessFax] = fax; + + + //Address + PhysicalAddressEntry paEntry1 = new PhysicalAddressEntry(); + if (!street.Equals("")) + paEntry1.Street = street; + if (!plz.Equals("")) + paEntry1.PostalCode = plz; + if (!city.Equals("")) + paEntry1.City = city; + if (!state.Equals("")) + paEntry1.State = state; + if (!country.Equals("")) + paEntry1.CountryOrRegion = country; + contact.PhysicalAddresses[PhysicalAddressKey.Business] = paEntry1; + + + contact.Save(); + } + + private void updateContact(string ExchangeContactID, string name, string salutation, string firstname, string lastname, string company, string mail1, string mail2, string mail3, string chataddressAliasID, string phone1, string phone2, string mobilphone1, string fax, string homepage, string street, string plz, string city, string state, string country) + { + ExchangeService service; + service = new ExchangeService(); + service.Credentials = new WebCredentials(Properties.Settings.Default.ExchangeUser, Properties.Settings.Default.ExchangePassword); + service.UseDefaultCredentials = false; + service.Url = new Uri(Properties.Settings.Default.ExchangeEWS); + + Microsoft.Exchange.WebServices.Data.Contact contact = Microsoft.Exchange.WebServices.Data.Contact.Bind(service, new Microsoft.Exchange.WebServices.Data.ItemId(ExchangeContactID)); + contact.FileAsMapping = FileAsMapping.CompanySurnameCommaGivenName; + ExtendedPropertyDefinition oTitleProp = new ExtendedPropertyDefinition(0x3A45, MapiPropertyType.String); + + if (!name.Equals("")) + contact.DisplayName = name; + if (!salutation.Equals("")) + contact.SetExtendedProperty(oTitleProp, salutation); + if (!firstname.Equals("")) + contact.GivenName = firstname; + if (!lastname.Equals("")) + contact.Surname = lastname; + if (!company.Equals("")) + contact.CompanyName = company; + if (!mail1.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress1] = mail1; + if (!mail2.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress2] = mail2; + if (!mail3.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress3] = mail3; + if (!chataddressAliasID.Equals("")) + contact.ImAddresses[ImAddressKey.ImAddress1] = chataddressAliasID; + if (!homepage.Equals("")) + contact.BusinessHomePage = homepage; + if (!phone1.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessPhone] = phone1; + if (!phone2.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessPhone2] = phone2; + if (!mobilphone1.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.MobilePhone] = mobilphone1; + if (!fax.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessFax] = fax; + + //Address + //PhysicalAddressEntry PABusinessEntry = new PhysicalAddressEntry(); + if (!street.Equals("")) + contact.PhysicalAddresses[PhysicalAddressKey.Business].Street = street; + if (!plz.Equals("")) + contact.PhysicalAddresses[PhysicalAddressKey.Business].PostalCode = plz; + if (!city.Equals("")) + contact.PhysicalAddresses[PhysicalAddressKey.Business].City = city; + if (!state.Equals("")) + contact.PhysicalAddresses[PhysicalAddressKey.Business].State = state; + if (!country.Equals("")) + contact.PhysicalAddresses[PhysicalAddressKey.Business].CountryOrRegion = country; + //contact.PhysicalAddresses[PhysicalAddressKey.Business] = PABusinessEntry; + + + contact.Update(ConflictResolutionMode.AlwaysOverwrite); + } + + + + + public string findContactInAddressbook(String id) + { + string contactid = ""; + ExchangeService service; + service = new ExchangeService(); + service.Credentials = new WebCredentials(Properties.Settings.Default.ExchangeUser, Properties.Settings.Default.ExchangePassword, Properties.Settings.Default.ExchangeDomain); + + service.UseDefaultCredentials = false; + service.Url = new Uri(Properties.Settings.Default.ExchangeEWS); + // Microsoft.Exchange.WebServices.Data.Contact contact = new Microsoft.Exchange.WebServices.Data.Contact(service); + Microsoft.Exchange.WebServices.Data.ContactsFolder contactsfolder = Microsoft.Exchange.WebServices.Data.ContactsFolder.Bind(service, WellKnownFolderName.Contacts); + int numItems = contactsfolder.TotalCount < 50 ? contactsfolder.TotalCount : 50; + ItemView view = new ItemView(1); + + // To keep the request smaller, request only the display name property. + view.PropertySet = new PropertySet(BasePropertySet.IdOnly, ContactSchema.ImAddress1); + // Retrieve the items in the Contacts folder that have the properties that you selected. + FindItemsResults contactItems = service.FindItems(WellKnownFolderName.Contacts, new SearchFilter.IsEqualTo(ContactSchema.ImAddress1, id), view); + + // Display the list of contacts. + foreach (Microsoft.Exchange.WebServices.Data.Item item in contactItems) + { + if (item is Microsoft.Exchange.WebServices.Data.Contact) + { + Microsoft.Exchange.WebServices.Data.Contact contact = item as Microsoft.Exchange.WebServices.Data.Contact; + //Console.WriteLine(contact.ImAddresses[ImAddressKey.ImAddress1]); + Console.WriteLine("Found existing contact:\n" + contact.Id); + Console.WriteLine(contact.ImAddresses[ImAddressKey.ImAddress1]); + contactid = contact.Id.ToString(); + } + } + return contactid; + } + + + } +} diff --git a/Epi2Exchange/Epi2Exchange.csproj b/Epi2Exchange/Epi2Exchange.csproj new file mode 100644 index 0000000..8d57a00 --- /dev/null +++ b/Epi2Exchange/Epi2Exchange.csproj @@ -0,0 +1,139 @@ + + + + + Debug + AnyCPU + {6ED87064-301E-4A3C-A7F1-AD10B5F55183} + Exe + Epi2Exchange + Epi2Exchange + v4.7.2 + 512 + true + true + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + + + + ..\packages\Microsoft.Exchange.WebServices.2.2\lib\40\Microsoft.Exchange.WebServices.dll + + + ..\packages\Microsoft.Exchange.WebServices.2.2\lib\40\Microsoft.Exchange.WebServices.Auth.dll + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + + + ..\packages\RestSharp.106.11.7\lib\net452\RestSharp.dll + + + + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + + + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + False + Microsoft .NET Framework 4.7.2 %28x86 und x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + \ No newline at end of file diff --git a/Epi2Exchange/EpiContacts.cs b/Epi2Exchange/EpiContacts.cs new file mode 100644 index 0000000..805126f --- /dev/null +++ b/Epi2Exchange/EpiContacts.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RestSharp; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + + +namespace Epi2Exchange +{ + class EpiContacts + { + RestClient epirentserver; + public EpiContacts() + { + epirentserver = new RestClient("http://" + Properties.Settings.Default.EpiServer + ":" + Properties.Settings.Default.EpiPort); + } + + + public String getContactJson() + { + RestRequest request = new RestRequest("/v1/contact/filter?ia=1&cl=" + Properties.Settings.Default.EpiMandant, Method.GET); + request.AddHeader("X-EPI-NO-SESSION", "True"); + request.AddHeader("X-EPI-ACC-TOK", Properties.Settings.Default.EpiToken); + request.RequestFormat = DataFormat.Json; + + return epirentserver.ExecuteAsGet(request, "GET").Content; + + } + + + public Model.ContactList getContactListFromJson(String ContactJson) + { + Model.ContactList contactList = JsonConvert.DeserializeObject(ContactJson); + return contactList; + } + + + } +} diff --git a/Epi2Exchange/Form1.Designer.cs b/Epi2Exchange/Form1.Designer.cs new file mode 100644 index 0000000..69f6eff --- /dev/null +++ b/Epi2Exchange/Form1.Designer.cs @@ -0,0 +1,108 @@ +namespace Epi2Exchange +{ + partial class Form1 + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.tb_DataBox = new System.Windows.Forms.TextBox(); + this.btn_getContacts = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.btn_UpdateContact = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // tb_DataBox + // + this.tb_DataBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tb_DataBox.Location = new System.Drawing.Point(12, 12); + this.tb_DataBox.Multiline = true; + this.tb_DataBox.Name = "tb_DataBox"; + this.tb_DataBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.tb_DataBox.Size = new System.Drawing.Size(776, 395); + this.tb_DataBox.TabIndex = 0; + this.tb_DataBox.TextChanged += new System.EventHandler(this.tb_DataBox_TextChanged); + // + // btn_getContacts + // + this.btn_getContacts.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btn_getContacts.Location = new System.Drawing.Point(12, 415); + this.btn_getContacts.Name = "btn_getContacts"; + this.btn_getContacts.Size = new System.Drawing.Size(75, 23); + this.btn_getContacts.TabIndex = 1; + this.btn_getContacts.Text = "getContacts"; + this.btn_getContacts.UseVisualStyleBackColor = true; + this.btn_getContacts.Click += new System.EventHandler(this.button1_Click); + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.button1.Location = new System.Drawing.Point(93, 415); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(114, 23); + this.button1.TabIndex = 2; + this.button1.Text = "checkTestContact"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click_1); + // + // btn_UpdateContact + // + this.btn_UpdateContact.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.btn_UpdateContact.Location = new System.Drawing.Point(213, 415); + this.btn_UpdateContact.Name = "btn_UpdateContact"; + this.btn_UpdateContact.Size = new System.Drawing.Size(114, 23); + this.btn_UpdateContact.TabIndex = 3; + this.btn_UpdateContact.Text = "UpdateContact"; + this.btn_UpdateContact.UseVisualStyleBackColor = true; + this.btn_UpdateContact.Click += new System.EventHandler(this.btn_UpdateContact_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.btn_UpdateContact); + this.Controls.Add(this.button1); + this.Controls.Add(this.btn_getContacts); + this.Controls.Add(this.tb_DataBox); + this.Name = "Form1"; + this.Text = "Form1"; + this.Load += new System.EventHandler(this.Form1_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox tb_DataBox; + private System.Windows.Forms.Button btn_getContacts; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button btn_UpdateContact; + } +} + diff --git a/Epi2Exchange/Form1.cs b/Epi2Exchange/Form1.cs new file mode 100644 index 0000000..50db8cd --- /dev/null +++ b/Epi2Exchange/Form1.cs @@ -0,0 +1,478 @@ +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; +using Microsoft.Exchange.WebServices.Data; + +using System.Net; + + +namespace Epi2Exchange +{ + public partial class Form1 : Form + { + EpiContacts epicontacts; + + public Form1() + { + InitializeComponent(); + epicontacts = new EpiContacts(); + MainUpdateProcedure(); + + } + + + + + + private static bool RedirectionUrlValidationCallback(string redirectionUrl) + { + // The default for the validation callback is to reject the URL. + bool result = false; + Uri redirectionUri = new Uri(redirectionUrl); + // Validate the contents of the redirection URL. In this simple validation + // callback, the redirection URL is considered valid if it is using HTTPS + // to encrypt the authentication credentials. + if (redirectionUri.Scheme == "https") + { + result = true; + } + return result; + } + + private void button1_Click(object sender, EventArgs e) + { + MainUpdateProcedure(); + } + + + private void MainUpdateProcedure() + { + + //Epirent-Daten über die Rest-API (JSON) in eine Objektstruktur /model parsen und dort als entsprechend vernetzte Objekte ablegen. + Model.ContactList contactList = epicontacts.getContactListFromJson(epicontacts.getContactJson()); + + + + //Durchlaufe jede Adresse - Firma + foreach (Model.ContactListPayload contact in contactList.ContactListPayload) + { + + string VarName=""; + string VarFirstname = ""; + string VarLastname = ""; + string VarCompany=""; + string VarMail1=""; + string VarMail2=""; + string VarMail3=""; + string VarChataddressAliasID=""; + string VarPhone1=""; + string VarPhone2=""; + string VarMobilphone1=""; + string VarFax=""; + string VarHomepage=""; + string VarStreet=""; + string VarPlz=""; + string VarCity=""; + string VarState=""; + string VarCountry=""; + + + //Hole die Details eines Kontakts + contact.setContactDetail(); + + VarChataddressAliasID = contact.PrimaryKey; + VarName = contact.Name; + + VarStreet = contact.ContactDetail.ContactDetailPayload[0].address.Street; + VarPlz = contact.ContactDetail.ContactDetailPayload[0].address.PostalCode; + VarCity = contact.ContactDetail.ContactDetailPayload[0].address.City; + VarState = contact.ContactDetail.ContactDetailPayload[0].address.FederalState; + VarCountry = contact.ContactDetail.ContactDetailPayload[0].address.Country; + VarCompany = contact.Name; + + if (contact.ContactDetail.ContactDetailPayload[0] != null) + { + int mailcounter = 0; + int phonecounter = 0; + + foreach (Model.ContactDetailCommunication communication in contact.ContactDetail.ContactDetailPayload[0].communication) + { + + switch (Convert.ToInt32(communication.Type)) + { + case 0: + switch (phonecounter) + { + case 0: + VarPhone1 = communication.ContactData; + break; + case 1: + VarPhone2 = communication.ContactData; + break; + } + phonecounter++; + break; + case 1: + VarFax = communication.ContactData; + break; + case 2: + VarMobilphone1 = communication.ContactData; + break; + case 3: + switch (mailcounter) + { + case 0: + VarMail1 = communication.ContactData; + break; + case 1: + VarMail2 = communication.ContactData; + break; + case 2: + VarMail3 = communication.ContactData; + break; + } + mailcounter++; + break; + case 4: + VarHomepage = communication.ContactData; + break; + + + } + + } + Console.WriteLine("Name: " + VarName + Environment.NewLine + "Company: " + VarCompany + Environment.NewLine + "Mail1: " + VarMail1 + Environment.NewLine + "Mail2: " + VarMail2 + Environment.NewLine + "Mail3: " + VarMail3 + Environment.NewLine + "ID: " + VarChataddressAliasID + Environment.NewLine + "Phone1: " + VarPhone1 + Environment.NewLine + "Phone2: " + VarPhone2 + Environment.NewLine + "Mobilphone: " + VarMobilphone1 + Environment.NewLine + "Fax: " + VarFax + Environment.NewLine + "Homepage: " + VarHomepage + Environment.NewLine + "Adresse: " + VarStreet + " " + VarPlz + " " + VarCity + " " + VarState + " " + VarCountry + Environment.NewLine + "##########"); + String ContactID = findContactInAddressbook(VarChataddressAliasID); + + if (!ContactID.Equals("")) + { + updateContact(ContactID, VarName, VarFirstname, VarLastname, VarCompany, VarMail1, VarMail2, VarMail3, VarChataddressAliasID, VarPhone1, VarPhone2, VarMobilphone1, VarFax, VarHomepage, VarStreet, VarPlz, VarCity, VarState, VarCountry); + } + else + { + storeNewContact(VarName, VarFirstname, VarLastname, VarCompany, VarMail1, VarMail2, VarMail3, VarChataddressAliasID, VarPhone1, VarPhone2, VarMobilphone1, VarFax, VarHomepage, VarStreet, VarPlz, VarCity, VarState, VarCountry); + + } + + + + + if (contact.ContactDetail.ContactDetailPayload[0].contactPerson != null) + { + foreach (Model.ContactPerson cperson in contact.ContactDetail.ContactDetailPayload[0].contactPerson) + { + if (cperson != null) + { + cperson.setContactPersonDetail(); + VarName = cperson.ContactPersonDetail.ContactPersonDetailPayload[0].name; + VarFirstname = cperson.ContactPersonDetail.ContactPersonDetailPayload[0].firstname; + VarLastname = cperson.ContactPersonDetail.ContactPersonDetailPayload[0].lastname; + VarChataddressAliasID = contact.PrimaryKey + "-" + cperson.PrimaryKey; + int cpersCommailcounter = 0; + int cpersComphonecounter = 0; + foreach (Model.ContactDetailCommunication cpersCom in cperson.ContactPersonDetail.ContactPersonDetailPayload[0].communication) + { + switch (Convert.ToInt32(cpersCom.Type)) + { + case 0: + switch (cpersComphonecounter) + { + case 0: + VarPhone1 = cpersCom.ContactData; + break; + case 1: + VarPhone2 = cpersCom.ContactData; + break; + } + cpersComphonecounter++; + break; + case 1: + VarFax = cpersCom.ContactData; + break; + case 2: + VarMobilphone1 = cpersCom.ContactData; + break; + case 3: + switch (cpersCommailcounter) + { + case 0: + VarMail1 = cpersCom.ContactData; + break; + case 1: + VarMail2 = cpersCom.ContactData; + break; + case 2: + VarMail3 = cpersCom.ContactData; + break; + } + cpersCommailcounter++; + break; + case 4: + VarHomepage = cpersCom.ContactData; + break; + + + } + } + + + + Console.WriteLine("##CPERSON##"+Environment.NewLine+"Name: " + VarName + Environment.NewLine + "Company: " + VarCompany + Environment.NewLine + "Mail1: " + VarMail1 + Environment.NewLine + "Mail2: " + VarMail2 + Environment.NewLine + "Mail3: " + VarMail3 + Environment.NewLine + "ID: " + VarChataddressAliasID + Environment.NewLine + "Phone1: " + VarPhone1 + Environment.NewLine + "Phone2: " + VarPhone2 + Environment.NewLine + "Mobilphone: " + VarMobilphone1 + Environment.NewLine + "Fax: " + VarFax + Environment.NewLine + "Homepage: " + VarHomepage + Environment.NewLine + "Adresse: " + VarStreet + " " + VarPlz + " " + VarCity + " " + VarState + " " + VarCountry + Environment.NewLine + "##########"); + String CPersContactID = findContactInAddressbook(VarChataddressAliasID); + + if (!CPersContactID.Equals("")) + { + updateContact(CPersContactID, VarName, VarFirstname, VarLastname, VarCompany, VarMail1, VarMail2, VarMail3, VarChataddressAliasID, VarPhone1, VarPhone2, VarMobilphone1, VarFax, VarHomepage, VarStreet, VarPlz, VarCity, VarState, VarCountry); + } + else + { + storeNewContact(VarName, VarFirstname, VarLastname, VarCompany, VarMail1, VarMail2, VarMail3, VarChataddressAliasID, VarPhone1, VarPhone2, VarMobilphone1, VarFax, VarHomepage, VarStreet, VarPlz, VarCity, VarState, VarCountry); + + } + } + + VarFirstname = ""; + VarLastname = ""; + VarName = ""; + mailcounter = 0; + phonecounter = 0; + + foreach (Model.ContactDetailCommunication communication in contact.ContactDetail.ContactDetailPayload[0].communication) + { + + switch (Convert.ToInt32(communication.Type)) + { + case 0: + switch (phonecounter) + { + case 0: + VarPhone1 = communication.ContactData; + break; + case 1: + VarPhone2 = communication.ContactData; + break; + } + phonecounter++; + break; + case 1: + VarFax = communication.ContactData; + break; + case 2: + VarMobilphone1 = communication.ContactData; + break; + case 3: + switch (mailcounter) + { + case 0: + VarMail1 = communication.ContactData; + break; + case 1: + VarMail2 = communication.ContactData; + break; + case 2: + VarMail3 = communication.ContactData; + break; + } + mailcounter++; + break; + case 4: + VarHomepage = communication.ContactData; + break; + + + } + + } + + + + } + } + } + + + } + + } + private void storeNewContact(string name, string firstname, string lastname, string company, string mail1, string mail2, string mail3, string chataddressAliasID, string phone1, string phone2, string mobilphone1, string fax, string homepage, string street, string plz, string city, string state, string country) + { + ExchangeService service; + service = new ExchangeService(); + service.Credentials = new WebCredentials(Properties.Settings.Default.ExchangeUser, Properties.Settings.Default.ExchangePassword); + service.UseDefaultCredentials = true; + service.Url = new Uri(Properties.Settings.Default.ExchangeEWS); + Microsoft.Exchange.WebServices.Data.Contact contact = new Microsoft.Exchange.WebServices.Data.Contact(service); + + if (!name.Equals("")) + contact.DisplayName = name; + if (!firstname.Equals("")) + contact.GivenName = firstname; + if (!lastname.Equals("")) + contact.Surname = lastname; + + if (!lastname.Equals("")) + contact.DisplayName = name; + + if (!company.Equals("")) + contact.CompanyName = company; + if (!mail1.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress1] = new Microsoft.Exchange.WebServices.Data.EmailAddress(mail1); + if (!mail2.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress2] = new Microsoft.Exchange.WebServices.Data.EmailAddress(mail2); + if (!mail3.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress3] = new Microsoft.Exchange.WebServices.Data.EmailAddress(mail3); + if (!chataddressAliasID.Equals("")) + contact.ImAddresses[ImAddressKey.ImAddress1] = chataddressAliasID; + if (!homepage.Equals("")) + contact.BusinessHomePage = homepage; + if (!phone1.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessPhone] = phone1; + if (!phone2.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessPhone2] = phone2; + if (!mobilphone1.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.MobilePhone] = mobilphone1; + if (!fax.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessFax] = fax; + + + //Address + PhysicalAddressEntry paEntry1 = new PhysicalAddressEntry(); + if (!street.Equals("")) + paEntry1.Street = street; + if (!plz.Equals("")) + paEntry1.PostalCode = plz; + if (!city.Equals("")) + paEntry1.City = city; + if (!state.Equals("")) + paEntry1.State = state; + if (!country.Equals("")) + paEntry1.CountryOrRegion = country; + contact.PhysicalAddresses[PhysicalAddressKey.Business] = paEntry1; + + + + contact.Save(); + } + + private void updateContact(string ExchangeContactID, string name, string firstname, string lastname, string company, string mail1, string mail2, string mail3, string chataddressAliasID, string phone1, string phone2, string mobilphone1, string fax, string homepage, string street, string plz, string city, string state, string country) + { + ExchangeService service; + service = new ExchangeService(); + service.Credentials = new WebCredentials(Properties.Settings.Default.ExchangeUser, Properties.Settings.Default.ExchangePassword); + service.UseDefaultCredentials = true; + service.Url = new Uri(Properties.Settings.Default.ExchangeEWS); + + Microsoft.Exchange.WebServices.Data.Contact contact = Microsoft.Exchange.WebServices.Data.Contact.Bind(service, new Microsoft.Exchange.WebServices.Data.ItemId(ExchangeContactID)); + + if (!name.Equals("")) + contact.DisplayName = name; + if (!firstname.Equals("")) + contact.GivenName = firstname; + if (!lastname.Equals("")) + contact.Surname = lastname; + if (!company.Equals("")) + contact.CompanyName = company; + if (!mail1.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress1] = new Microsoft.Exchange.WebServices.Data.EmailAddress(mail1); + if (!mail2.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress2] = new Microsoft.Exchange.WebServices.Data.EmailAddress(mail2); + if (!mail3.Equals("")) + contact.EmailAddresses[EmailAddressKey.EmailAddress3] = new Microsoft.Exchange.WebServices.Data.EmailAddress(mail3); + if (!chataddressAliasID.Equals("")) + contact.ImAddresses[ImAddressKey.ImAddress1] = chataddressAliasID; + if (!homepage.Equals("")) + contact.BusinessHomePage = homepage; + if (!phone1.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessPhone] = phone1; + if (!phone2.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessPhone2] = phone2; + if (!mobilphone1.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.MobilePhone] = mobilphone1; + if (!fax.Equals("")) + contact.PhoneNumbers[PhoneNumberKey.BusinessFax] = fax; + + //Address + PhysicalAddressEntry paEntry1 = new PhysicalAddressEntry(); + if (!street.Equals("")) + paEntry1.Street = street; + if (!plz.Equals("")) + paEntry1.PostalCode = plz; + if (!city.Equals("")) + paEntry1.City = city; + if (!state.Equals("")) + paEntry1.State = state; + if (!country.Equals("")) + paEntry1.CountryOrRegion = country; + contact.PhysicalAddresses[PhysicalAddressKey.Business] = paEntry1; + + contact.Update(ConflictResolutionMode.AlwaysOverwrite); + } + + + + + public string findContactInAddressbook(String id) + { + string contactid = ""; + ExchangeService service; + service = new ExchangeService(); + service.Credentials = new WebCredentials(Properties.Settings.Default.ExchangeUser, Properties.Settings.Default.ExchangePassword); + service.UseDefaultCredentials = true; + service.Url = new Uri(Properties.Settings.Default.ExchangeEWS); + // Microsoft.Exchange.WebServices.Data.Contact contact = new Microsoft.Exchange.WebServices.Data.Contact(service); + + Microsoft.Exchange.WebServices.Data.ContactsFolder contactsfolder = Microsoft.Exchange.WebServices.Data.ContactsFolder.Bind(service, WellKnownFolderName.Contacts); + int numItems = contactsfolder.TotalCount < 50 ? contactsfolder.TotalCount : 50; + ItemView view = new ItemView(numItems); + + // To keep the request smaller, request only the display name property. + view.PropertySet = new PropertySet(BasePropertySet.IdOnly, ContactSchema.ImAddress1); + + // Retrieve the items in the Contacts folder that have the properties that you selected. + FindItemsResults contactItems = service.FindItems(WellKnownFolderName.Contacts, new SearchFilter.IsEqualTo(ContactSchema.ImAddress1, id),view); + + + // Display the list of contacts. + foreach (Microsoft.Exchange.WebServices.Data.Item item in contactItems) + { + if (item is Microsoft.Exchange.WebServices.Data.Contact) + { + Microsoft.Exchange.WebServices.Data.Contact contact = item as Microsoft.Exchange.WebServices.Data.Contact; + //Console.WriteLine(contact.ImAddresses[ImAddressKey.ImAddress1]); + Console.WriteLine("Found existing contact:\n" + contact.Id); + Console.WriteLine(contact.ImAddresses[ImAddressKey.ImAddress1]); + contactid= contact.Id.ToString(); + } + } + return contactid; + } + + + + private void button1_Click_1(object sender, EventArgs e) + { + + } + + private void btn_UpdateContact_Click(object sender, EventArgs e) + { + findContactInAddressbook("1291"); + } + + private void Form1_Load(object sender, EventArgs e) + { + + } + + private void tb_DataBox_TextChanged(object sender, EventArgs e) + { + + } + } +} diff --git a/Epi2Exchange/Form1.resx b/Epi2Exchange/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Epi2Exchange/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Epi2Exchange/Model/ContactDetail.cs b/Epi2Exchange/Model/ContactDetail.cs new file mode 100644 index 0000000..dc477b2 --- /dev/null +++ b/Epi2Exchange/Model/ContactDetail.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +namespace Epi2Exchange.Model +{ + class ContactDetail + { + + [JsonProperty("payload")] + public List ContactDetailPayload { get; set; } + + } + + +} diff --git a/Epi2Exchange/Model/ContactDetailPayload.cs b/Epi2Exchange/Model/ContactDetailPayload.cs new file mode 100644 index 0000000..55a112e --- /dev/null +++ b/Epi2Exchange/Model/ContactDetailPayload.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using RestSharp; + +namespace Epi2Exchange.Model +{ + class ContactDetailPayload + { + [JsonProperty("primary_key")] + public String PrimaryKey { get; set; } + + [JsonProperty("customer_no")] + public String CustomerNumber { get; set; } + + [JsonProperty("supplier_no")] + public String SupplierNumber { get; set; } + + [JsonProperty("name")] + public String Name { get; set; } + + [JsonProperty("salutation")] + public String salutation { get; set; } + + + [JsonProperty("is_customer")] + public bool IsCustomer { get; set; } + + [JsonProperty("is_supplier")] + public bool IsSupplier { get; set; } + + [JsonProperty("address")] + public ContactDetailAddress address { get; set; } + + [JsonProperty("communication")] + public List communication { get; set; } + + [JsonProperty("contact_person")] + public List contactPerson { get; set; } + } + + class ContactDetailAddress + { + [JsonProperty("primary_key")] + public String PrimaryKey { get; set; } + + [JsonProperty("postal_code")] + public String PostalCode { get; set; } + + [JsonProperty("street")] + public String Street { get; set; } + + [JsonProperty("city")] + public String City { get; set; } + + [JsonProperty("country")] + public String Country { get; set; } + + [JsonProperty("federal_state")] + public String FederalState { get; set; } + } + + class ContactDetailCommunication + { + [JsonProperty("primary_key")] + public String PrimaryKey { get; set; } + + [JsonProperty("uplink")] + public String ContactData { get; set; } + + [JsonProperty("type")] + public String Type { get; set; } + + + } + + class ContactPerson + { + + RestClient epirentserver; + + [JsonProperty("primary_key")] + public String PrimaryKey { get; set; } + + + public ContactPersonDetail ContactPersonDetail { get; set; } + + public ContactPerson() + { + epirentserver = new RestClient("http://" + Properties.Settings.Default.EpiServer + ":" + Properties.Settings.Default.EpiPort); + + } + public void setContactPersonDetail() + { + + ContactPersonDetail = GetContactPersonDetailFromJson(getContactPersonDetailJson()); + } + + public String getContactPersonDetailJson() + { + RestRequest request = new RestRequest("/v1/cperson/" + PrimaryKey + "/filter?ia=1&cl=" + Properties.Settings.Default.EpiMandant, Method.GET); + request.AddHeader("X-EPI-NO-SESSION", "True"); + request.AddHeader("X-EPI-ACC-TOK", Properties.Settings.Default.EpiToken); + request.RequestFormat = DataFormat.Json; + + return epirentserver.ExecuteAsGet(request, "GET").Content; + + } + public Model.ContactPersonDetail GetContactPersonDetailFromJson(String ContactDetailJson) + { + Model.ContactPersonDetail contactDetail = JsonConvert.DeserializeObject(ContactDetailJson); + return contactDetail; + } + + } + + + +} diff --git a/Epi2Exchange/Model/ContactList.cs b/Epi2Exchange/Model/ContactList.cs new file mode 100644 index 0000000..fc98898 --- /dev/null +++ b/Epi2Exchange/Model/ContactList.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Epi2Exchange.Model +{ + class ContactList + { + + + [JsonProperty("payload")] + public List ContactListPayload { get; set; } + } +} diff --git a/Epi2Exchange/Model/ContactListPayload.cs b/Epi2Exchange/Model/ContactListPayload.cs new file mode 100644 index 0000000..098669d --- /dev/null +++ b/Epi2Exchange/Model/ContactListPayload.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using RestSharp; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.Windows.Forms; + +namespace Epi2Exchange.Model +{ + class ContactListPayload + { + RestClient epirentserver; + + + + [JsonProperty("primary_key")] + public String PrimaryKey { get; set; } + + [JsonProperty("customer_no")] + public String CustomerNumber { get; set; } + + [JsonProperty("supplier_no")] + public String SupplierNumber { get; set; } + + [JsonProperty("name")] + public String Name { get; set; } + + [JsonProperty("name1")] + public String Name1 { get; set; } + + [JsonProperty("name2")] + public String Name2 { get; set; } + + [JsonProperty("is_customer")] + public bool IsCustomer { get; set; } + + [JsonProperty("is_supplier")] + public bool IsSupplier { get; set; } + + [JsonProperty("contact_data")] + public ContactListPayloadData ContactListPayloadData { get; set; } + + public ContactDetail ContactDetail { get; set; } + + + public ContactListPayload() + { + epirentserver = new RestClient("http://" + Properties.Settings.Default.EpiServer + ":" + Properties.Settings.Default.EpiPort); + + } + + + public void setContactDetail() + { + + ContactDetail = GetContactDetailFromJson(getContactDetailJson()); + } + + public String getContactDetailJson() + { + RestRequest request = new RestRequest("/v1/contact/" + PrimaryKey + "/filter?ia=1&cl=" + Properties.Settings.Default.EpiMandant, Method.GET); + request.AddHeader("X-EPI-NO-SESSION", "True"); + request.AddHeader("X-EPI-ACC-TOK", Properties.Settings.Default.EpiToken); + request.RequestFormat = DataFormat.Json; + + return epirentserver.ExecuteAsGet(request, "GET").Content; + + } + + + public Model.ContactDetail GetContactDetailFromJson(String ContactDetailJson) + { + Model.ContactDetail contactDetail = JsonConvert.DeserializeObject(ContactDetailJson); + return contactDetail; + } + } +} diff --git a/Epi2Exchange/Model/ContactListPayloadData.cs b/Epi2Exchange/Model/ContactListPayloadData.cs new file mode 100644 index 0000000..7567ad7 --- /dev/null +++ b/Epi2Exchange/Model/ContactListPayloadData.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Epi2Exchange.Model +{ + class ContactListPayloadData + { + + + [JsonProperty("primary_key")] + public String PrimaryKey { get; set; } + + + } +} diff --git a/Epi2Exchange/Model/ContactPersonDetail.cs b/Epi2Exchange/Model/ContactPersonDetail.cs new file mode 100644 index 0000000..8e19637 --- /dev/null +++ b/Epi2Exchange/Model/ContactPersonDetail.cs @@ -0,0 +1,16 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Epi2Exchange.Model +{ + class ContactPersonDetail + { + + [JsonProperty("payload")] + public List ContactPersonDetailPayload { get; set; } + } +} diff --git a/Epi2Exchange/Model/ContactPersonDetailPayload.cs b/Epi2Exchange/Model/ContactPersonDetailPayload.cs new file mode 100644 index 0000000..e154af0 --- /dev/null +++ b/Epi2Exchange/Model/ContactPersonDetailPayload.cs @@ -0,0 +1,28 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Epi2Exchange +{ + class ContactPersonDetailPayload + { + + [JsonProperty("name")] + public String name { get; set; } + + [JsonProperty("salutation")] + public String salutation { get; set; } + + [JsonProperty("first_name")] + public String firstname { get; set; } + + [JsonProperty("last_name")] + public String lastname { get; set; } + + [JsonProperty("communication")] + public List communication { get; set; } + } +} diff --git a/Epi2Exchange/Program.cs b/Epi2Exchange/Program.cs new file mode 100644 index 0000000..0290480 --- /dev/null +++ b/Epi2Exchange/Program.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Epi2Exchange +{ + static class Program + { + static Converter converter; + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main() + { + converter = new Converter(); + converter.MainUpdateProcedure(); + + + + //Application.EnableVisualStyles(); + //Application.SetCompatibleTextRenderingDefault(false); + //Application.Run(new Form1()); + } + } +} diff --git a/Epi2Exchange/Properties/AssemblyInfo.cs b/Epi2Exchange/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a88c2c4 --- /dev/null +++ b/Epi2Exchange/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("Epi2Exchange")] +[assembly: AssemblyDescription("Importtool von Epirent in Exchange")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("VT-Media Axel Reisinger & Leopold Strobl GbR")] +[assembly: AssemblyProduct("Epi2Exchange")] +[assembly: AssemblyCopyright("Copyright © Leopold Strobl 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. 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("6ed87064-301e-4a3c-a7f1-ad10b5f55183")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.5.2")] +[assembly: AssemblyFileVersion("1.0.5.2")] diff --git a/Epi2Exchange/Properties/Resources.Designer.cs b/Epi2Exchange/Properties/Resources.Designer.cs new file mode 100644 index 0000000..ac47e80 --- /dev/null +++ b/Epi2Exchange/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Epi2Exchange.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Epi2Exchange.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Epi2Exchange/Properties/Resources.resx b/Epi2Exchange/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Epi2Exchange/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Epi2Exchange/Properties/Settings.Designer.cs b/Epi2Exchange/Properties/Settings.Designer.cs new file mode 100644 index 0000000..b32839f --- /dev/null +++ b/Epi2Exchange/Properties/Settings.Designer.cs @@ -0,0 +1,122 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Epi2Exchange.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("sv-epi01")] + public string EpiServer { + get { + return ((string)(this["EpiServer"])); + } + set { + this["EpiServer"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("BCEF15F4DC1F2F448BA07E5364EDDAE3")] + public string EpiToken { + get { + return ((string)(this["EpiToken"])); + } + set { + this["EpiToken"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("8080")] + public string EpiPort { + get { + return ((string)(this["EpiPort"])); + } + set { + this["EpiPort"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2")] + public string EpiMandant { + get { + return ((string)(this["EpiMandant"])); + } + set { + this["EpiMandant"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("https://snmxcluster.s-nuernberger.de/EWS/Exchange.asmx")] + public string ExchangeEWS { + get { + return ((string)(this["ExchangeEWS"])); + } + set { + this["ExchangeEWS"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("leopold.strobl@vt-media.de")] + public string ExchangeUser { + get { + return ((string)(this["ExchangeUser"])); + } + set { + this["ExchangeUser"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("14032015-Leopold")] + public string ExchangePassword { + get { + return ((string)(this["ExchangePassword"])); + } + set { + this["ExchangePassword"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ExchangeDomain { + get { + return ((string)(this["ExchangeDomain"])); + } + set { + this["ExchangeDomain"] = value; + } + } + } +} diff --git a/Epi2Exchange/Properties/Settings.settings b/Epi2Exchange/Properties/Settings.settings new file mode 100644 index 0000000..e50fa97 --- /dev/null +++ b/Epi2Exchange/Properties/Settings.settings @@ -0,0 +1,30 @@ + + + + + + sv-epi01 + + + BCEF15F4DC1F2F448BA07E5364EDDAE3 + + + 8080 + + + 2 + + + https://snmxcluster.s-nuernberger.de/EWS/Exchange.asmx + + + leopold.strobl@vt-media.de + + + 14032015-Leopold + + + + + + \ No newline at end of file diff --git a/Epi2Exchange/packages.config b/Epi2Exchange/packages.config new file mode 100644 index 0000000..eac206f --- /dev/null +++ b/Epi2Exchange/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file