From 872c555c3b90404c40f6c5fec087680bdbd2d5f3 Mon Sep 17 00:00:00 2001 From: robvde Date: Fri, 25 Jan 2013 19:07:48 +0400 Subject: [PATCH] Server component reverted to .NET 3.5, CRM provider moved to dedicated project --- WebsitePanel/Database/update_db.sql | 6 +- .../CRMProvider2011.cs | 9 +- .../Properties/AssemblyInfo.cs | 36 ++++++ ...el.Providers.HostedSolution.Crm2011.csproj | 108 ++++++++++++++++++ .../myorganizationcrmsdktypes.cs | 0 .../Exchange2013.cs | 2 +- .../Exchange2010.cs | 2 +- .../HostedSolutionLog.cs | 24 ++-- ...bsitePanel.Providers.HostedSolution.csproj | 36 +----- WebsitePanel/Sources/WebsitePanel.Server.sln | 17 +++ .../Sources/WebsitePanel.Server/Web.config | 72 +++++++++++- .../WebsitePanel.Server.csproj | 7 +- 12 files changed, 262 insertions(+), 57 deletions(-) rename WebsitePanel/Sources/{WebsitePanel.Providers.HostedSolution => WebsitePanel.Providers.HostedSolution.Crm2011}/CRMProvider2011.cs (96%) create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/Properties/AssemblyInfo.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/WebsitePanel.Providers.HostedSolution.Crm2011.csproj rename WebsitePanel/Sources/{WebsitePanel.Providers.HostedSolution => WebsitePanel.Providers.HostedSolution.Crm2011}/myorganizationcrmsdktypes.cs (100%) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index d21358a6..155f5514 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -417,6 +417,10 @@ GO IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Hosted MS CRM 2011') BEGIN -INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (1201, 21, N'CRM', N'Hosted MS CRM 2011', N'WebsitePanel.Providers.HostedSolution.CRMProvider2011, WebsitePanel.Providers.HostedSolution', N'CRM', NULL) +INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (1201, 21, N'CRM', N'Hosted MS CRM 2011', N'WebsitePanel.Providers.HostedSolution.CRMProvider2011, WebsitePanel.Providers.HostedSolution.CRMProvider2011', N'CRM', NULL) END GO + + +UPDATE Providers SET ProviderType = N'WebsitePanel.Providers.HostedSolution.CRMProvider2011, WebsitePanel.Providers.HostedSolution.CRMProvider2011' WHERE ProviderID = 1201 +GO diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/CRMProvider2011.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/CRMProvider2011.cs similarity index 96% rename from WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/CRMProvider2011.cs rename to WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/CRMProvider2011.cs index cef5e001..8da7c628 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/CRMProvider2011.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/CRMProvider2011.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; @@ -15,6 +15,9 @@ using Microsoft.Win32; using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Server.Utils; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers; +using WebsitePanel.Providers.Utils; using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Sdk.Query; using Microsoft.Xrm.Sdk.Discovery; @@ -321,7 +324,7 @@ namespace WebsitePanel.Providers.HostedSolution return CreateOrganizationInternal(organizationId, organizationUniqueName, organizationFriendlyName, baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, initialUserDomainName, initialUserFirstName, initialUserLastName, initialUserPrimaryEmail, organizationCollation); } - const string CRMSysAdminRoleStr = "Ñèñòåìíûé àäìèíèñòðàòîð;System Administrator"; + const string CRMSysAdminRoleStr = "Ñèñòåìíûé àäìèíèñòðàòîð;System Administrator"; internal OrganizationResult CreateOrganizationInternal(Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation) { @@ -479,7 +482,7 @@ namespace WebsitePanel.Providers.HostedSolution } } - catch (Exception ex) + catch (Exception) { } finally diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/Properties/AssemblyInfo.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..441e0209 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WebsitePanel.Providers.HostedSolution.Crm2011")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WebsitePanel.Providers.HostedSolution.Crm2011")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("bbac7aad-84ac-4ea1-9834-502fcc71d129")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/WebsitePanel.Providers.HostedSolution.Crm2011.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/WebsitePanel.Providers.HostedSolution.Crm2011.csproj new file mode 100644 index 00000000..a42ccde1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/WebsitePanel.Providers.HostedSolution.Crm2011.csproj @@ -0,0 +1,108 @@ + + + + + Debug + AnyCPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7} + Library + Properties + WebsitePanel.Providers.HostedSolution.Crm2011 + WebsitePanel.Providers.HostedSolution.Crm2011 + v4.0 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\Lib\References\Microsoft\Microsoft.Crm.dll + + + ..\..\Lib\References\Microsoft\Microsoft.Crm.Admin.AdminService.dll + + + ..\..\Lib\References\Microsoft\microsoft.crm.sdk.proxy.dll + + + ..\..\Lib\References\Microsoft\Microsoft.Crm.Setup.Common.dll + + + ..\..\Lib\References\Microsoft\Microsoft.Crm.Setup.DatabaseInstaller.dll + + + ..\..\Lib\References\Microsoft\Microsoft.Crm.Setup.Server.Utility.dll + + + ..\..\Lib\References\Microsoft\Microsoft.Crm.Tools.Admin.DMSnapinLib.dll + + + ..\..\Lib\References\Microsoft\microsoft.xrm.client.dll + + + ..\..\Lib\References\Microsoft\microsoft.xrm.client.codegeneration.dll + + + ..\..\Lib\References\Microsoft\microsoft.xrm.portal.dll + + + ..\..\Lib\References\Microsoft\microsoft.xrm.portal.files.dll + + + ..\..\Lib\References\Microsoft\microsoft.xrm.sdk.dll + + + ..\..\Lib\References\Microsoft\microsoft.xrm.sdk.deployment.dll + + + ..\..\Lib\References\Microsoft\microsoft.xrm.sdk.workflow.dll + + + + + + + + + + + + ..\..\Bin\WebsitePanel.Providers.Base.dll + + + ..\WebsitePanel.Server\bin\WebsitePanel.Providers.HostedSolution.dll + + + ..\WebsitePanel.Server.Utils\bin\Debug\WebsitePanel.Server.Utils.dll + + + + + + + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/myorganizationcrmsdktypes.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/myorganizationcrmsdktypes.cs similarity index 100% rename from WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/myorganizationcrmsdktypes.cs rename to WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Crm2011/myorganizationcrmsdktypes.cs diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs index 01a6cd40..a932dae7 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs @@ -3005,7 +3005,7 @@ namespace WebsitePanel.Providers.HostedSolution info.LitigationHoldTotalSize = (totalItemSize == null) ? 0 : ConvertUnlimitedToBytes(totalItemSize); Int32 itemCount = (Int32)GetPSObjectProperty(statistics, "ItemsInFolder"); - info.LitigationHoldTotalItems = (itemCount == null) ? 0 : itemCount; + info.LitigationHoldTotalItems = (itemCount == 0) ? 0 : itemCount; } } else diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs index 51013b2e..e9a8f71e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs @@ -309,7 +309,7 @@ namespace WebsitePanel.Providers.HostedSolution info.LitigationHoldTotalSize = (totalItemSize == null) ? 0 : ConvertUnlimitedToBytes(totalItemSize); Int32 itemCount = (Int32)GetPSObjectProperty(statistics, "ItemsInFolder"); - info.LitigationHoldTotalItems = (itemCount == null) ? 0 : itemCount; + info.LitigationHoldTotalItems = (itemCount == 0) ? 0 : itemCount; } } else diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/HostedSolutionLog.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/HostedSolutionLog.cs index 4ad0ce27..7783d442 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/HostedSolutionLog.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/HostedSolutionLog.cs @@ -36,44 +36,44 @@ namespace WebsitePanel.Providers.HostedSolution { public class HostedSolutionLog { - internal static string LogPrefix = "HostedSolution"; + public static string LogPrefix = "HostedSolution"; - internal static void LogStart(string message, params object[] args) + public static void LogStart(string message, params object[] args) { string text = String.Format(message, args); Log.WriteStart("{0} {1}", LogPrefix, text); } - internal static void LogEnd(string message, params object[] args) + public static void LogEnd(string message, params object[] args) { string text = String.Format(message, args); Log.WriteEnd("{0} {1}", LogPrefix, text); } - internal static void LogInfo(string message, params object[] args) + public static void LogInfo(string message, params object[] args) { string text = String.Format(message, args); Log.WriteInfo("{0} {1}", LogPrefix, text); } - internal static void LogWarning(string message, params object[] args) + public static void LogWarning(string message, params object[] args) { string text = String.Format(message, args); Log.WriteWarning("{0} {1}", LogPrefix, text); } - internal static void LogError(Exception ex) + public static void LogError(Exception ex) { Log.WriteError(LogPrefix, ex); } - internal static void LogError(string message, Exception ex) + public static void LogError(string message, Exception ex) { string text = String.Format("{0} {1}", LogPrefix, message); Log.WriteError(text, ex); } - internal static void DebugInfo(string message, params object[] args) + public static void DebugInfo(string message, params object[] args) { #if DEBUG string text = String.Format(message, args); @@ -81,7 +81,7 @@ namespace WebsitePanel.Providers.HostedSolution #endif } - internal static void EndLog(string message, ResultObject res, string errorCode, Exception ex) + public static void EndLog(string message, ResultObject res, string errorCode, Exception ex) { if (res != null) { @@ -101,17 +101,17 @@ namespace WebsitePanel.Providers.HostedSolution } - internal static void EndLog(string message, ResultObject res, string errorCode) + public static void EndLog(string message, ResultObject res, string errorCode) { EndLog(message, res, errorCode, null); } - internal static void EndLog(string message, ResultObject res) + public static void EndLog(string message, ResultObject res) { EndLog(message, res, null); } - internal static void EndLog(string message) + public static void EndLog(string message) { EndLog(message, null); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj index c2f266b4..6325906e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj @@ -15,7 +15,7 @@ 3.5 - v4.0 + v3.5 publish\ true Disk @@ -63,10 +63,6 @@ ..\..\Lib\References\Microsoft\Microsoft.Crm.Admin.AdminService.dll False - - False - ..\..\Lib\References\Microsoft\microsoft.crm.sdk.proxy.dll - ..\..\Lib\References\Microsoft\Microsoft.Crm.Setup.Common.dll @@ -123,34 +119,6 @@ ..\..\Lib\References\Microsoft\Microsoft.SharePoint.dll False - - False - ..\..\Lib\References\Microsoft\microsoft.xrm.client.dll - - - False - ..\..\Lib\References\Microsoft\microsoft.xrm.client.codegeneration.dll - - - False - ..\..\Lib\References\Microsoft\microsoft.xrm.portal.dll - - - False - ..\..\Lib\References\Microsoft\microsoft.xrm.portal.files.dll - - - False - ..\..\Lib\References\Microsoft\microsoft.xrm.sdk.dll - - - False - ..\..\Lib\References\Microsoft\microsoft.xrm.sdk.deployment.dll - - - False - ..\..\Lib\References\Microsoft\microsoft.xrm.sdk.workflow.dll - @@ -173,13 +141,11 @@ - - diff --git a/WebsitePanel/Sources/WebsitePanel.Server.sln b/WebsitePanel/Sources/WebsitePanel.Server.sln index 5ae70b5f..e7e517f5 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.sln +++ b/WebsitePanel/Sources/WebsitePanel.Server.sln @@ -121,6 +121,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Host {E91E52F3-9555-4D00-B577-2B1DBDD87CA7} = {E91E52F3-9555-4D00-B577-2B1DBDD87CA7} EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.HostedSolution.Crm2011", "WebsitePanel.Providers.HostedSolution.Crm2011\WebsitePanel.Providers.HostedSolution.Crm2011.csproj", "{E5DB0722-CDC2-4D7F-8EEB-563578085FA7}" + ProjectSection(ProjectDependencies) = postProject + {684C932A-6C75-46AC-A327-F3689D89EB42} = {684C932A-6C75-46AC-A327-F3689D89EB42} + {A06DE5E4-4331-47E1-8F46-7B846146B559} = {A06DE5E4-4331-47E1-8F46-7B846146B559} + {E91E52F3-9555-4D00-B577-2B1DBDD87CA7} = {E91E52F3-9555-4D00-B577-2B1DBDD87CA7} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -631,6 +638,16 @@ Global {BC094166-B6A1-4D42-B53C-FF956FC7A4A1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {BC094166-B6A1-4D42-B53C-FF956FC7A4A1}.Release|Mixed Platforms.Build.0 = Release|Any CPU {BC094166-B6A1-4D42-B53C-FF956FC7A4A1}.Release|x86.ActiveCfg = Release|Any CPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Debug|x86.ActiveCfg = Debug|Any CPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Release|Any CPU.Build.0 = Release|Any CPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E5DB0722-CDC2-4D7F-8EEB-563578085FA7}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Web.config b/WebsitePanel/Sources/WebsitePanel.Server/Web.config index 70dca78e..128b824c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.Server/Web.config @@ -5,6 +5,17 @@
+ + +
+ +
+
+
+
+ + + @@ -63,8 +74,29 @@ - - + + + + + + + + + + + + + + + + + + + + + + + @@ -105,4 +137,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj index 3896a4a6..72c5835a 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj @@ -17,9 +17,13 @@ 4.0 - v4.0 + v3.5 false + + + + true @@ -67,7 +71,6 @@ -