add crm 2011 support

This commit is contained in:
dev 2013-01-17 08:54:31 +04:00
parent 14426b0216
commit 9a82cd5990
17 changed files with 170641 additions and 18 deletions

View file

@ -0,0 +1,64 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CRM2011_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.CRM2011_Settings" %>
<%@ Register Src="../UserControls/SelectIPAddress.ascx" TagName="SelectIPAddress" TagPrefix="wsp" %>
<table>
<tr>
<td class="SubHead" width="200" nowrap>Sql Server</td>
<td>
<asp:TextBox runat="server" ID="txtSqlServer" MaxLength="256" Width="200px" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSqlServer" Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>Reporting URL </td>
<td class="Normal" width="100%">
<asp:TextBox runat="server" Width="200px" ID="txtReportingService" MaxLength="256" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtReportingService" Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>Web Application Server Domain</td>
<td class="Normal" width="100%">
<asp:TextBox runat="server" Width="200px" ID="txtDomainName" MaxLength="256" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtDomainName" Display="Dynamic" ErrorMessage="*" />
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>Web Application Domain Scheme</td>
<td class="Normal" width="100%">
<asp:DropDownList runat="server" ID="ddlSchema">
<asp:ListItem Text="http" Value="http" />
<asp:ListItem Text="https" Value="https" />
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>CRM Website IP</td>
<td class="Normal" width="100%">
<wsp:SelectIPAddress ID="ddlCrmIpAddress" runat="server" ServerIdParam="ServerID" AllowEmptySelection="false" />
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>CRM Website Port</td>
<td class="Normal" width="100%">
<asp:TextBox runat="server" ID="txtPort" Width="200px" />
<asp:RangeValidator runat="server" ControlToValidate="txtPort" Display="dynamic" ErrorMessage="*" Type="String" MinimumValue="0" MaximumValue="9" />
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>Deployment web service</td>
<td class="Normal" width="100%">
<asp:TextBox runat="server" ID="txtAppRootDomain" Width="200px" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="txtAppRootDomain" ErrorMessage="*" />
</td>
</tr>
</table>

View file

@ -0,0 +1,99 @@
// Copyright (c) 2011, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
namespace WebsitePanel.Portal.ProviderControls
{
public partial class CRM2011_Settings : WebsitePanelControlBase, IHostingServiceProviderSettings
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void BindSettings(System.Collections.Specialized.StringDictionary settings)
{
txtReportingService.Text = settings[Constants.ReportingServer];
txtSqlServer.Text = settings[Constants.SqlServer];
txtDomainName.Text = settings[Constants.IFDWebApplicationRootDomain];
txtPort.Text = settings[Constants.Port];
txtAppRootDomain.Text = settings[Constants.AppRootDomain];
int selectedAddressid = FindAddressByText(settings[Constants.CRMWebsiteIP]);
ddlCrmIpAddress.AddressId = (selectedAddressid > 0) ? selectedAddressid : 0;
ddlSchema.SelectedValue = settings[Constants.UrlSchema];
}
public void SaveSettings(System.Collections.Specialized.StringDictionary settings)
{
settings[Constants.ReportingServer] = txtReportingService.Text;
settings[Constants.SqlServer] = txtSqlServer.Text;
settings[Constants.IFDWebApplicationRootDomain] = txtDomainName.Text;
settings[Constants.Port] = txtPort.Text;
settings[Constants.AppRootDomain] = txtAppRootDomain.Text;
if (ddlCrmIpAddress.AddressId > 0)
{
IPAddressInfo address = ES.Services.Servers.GetIPAddress(ddlCrmIpAddress.AddressId);
if (String.IsNullOrEmpty(address.ExternalIP))
{
settings[Constants.CRMWebsiteIP] = address.InternalIP;
}
else
{
settings[Constants.CRMWebsiteIP] = address.ExternalIP;
}
}
else
{
settings[Constants.CRMWebsiteIP] = String.Empty;
}
settings[Constants.UrlSchema] = ddlSchema.SelectedValue;
}
private static int FindAddressByText(string address)
{
foreach (IPAddressInfo addressInfo in ES.Services.Servers.GetIPAddresses(IPAddressPool.General, PanelRequest.ServerId))
{
if (addressInfo.InternalIP == address || addressInfo.ExternalIP == address)
{
return addressInfo.AddressId;
}
}
return 0;
}
}
}

View file

@ -0,0 +1,96 @@
//------------------------------------------------------------------------------
// <автоматически создаваемое>
// Этот код создан программой.
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </автоматически создаваемое>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ProviderControls {
public partial class CRM2011_Settings {
/// <summary>
/// txtSqlServer элемент управления.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtSqlServer;
/// <summary>
/// RequiredFieldValidator1 элемент управления.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
/// <summary>
/// txtReportingService элемент управления.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtReportingService;
/// <summary>
/// txtDomainName элемент управления.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtDomainName;
/// <summary>
/// RequiredFieldValidator2 элемент управления.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
/// <summary>
/// ddlSchema элемент управления.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlSchema;
/// <summary>
/// ddlCrmIpAddress элемент управления.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// </remarks>
protected global::WebsitePanel.Portal.SelectIPAddress ddlCrmIpAddress;
/// <summary>
/// txtPort элемент управления.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPort;
/// <summary>
/// txtAppRootDomain элемент управления.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtAppRootDomain;
}
}