Added global phone list

This commit is contained in:
dev_amdtel 2013-08-21 17:54:59 +04:00
parent f17301bfc1
commit 7e8b3cce52
46 changed files with 3667 additions and 169 deletions

View file

@ -38,6 +38,7 @@ namespace WebsitePanel.EnterpriseServer
General = 1,
WebSites = 2,
VpsExternalNetwork = 3,
VpsManagementNetwork = 4
VpsManagementNetwork = 4,
PhoneNumbers = 5
}
}

View file

@ -965,38 +965,59 @@ namespace WebsitePanel.EnterpriseServer
return res;
}
var startExternalIP = IPAddress.Parse(externalIP);
var startInternalIP = IPAddress.Parse(internalIP);
var endExternalIP = IPAddress.Parse(endIP);
// handle CIDR notation IP/Subnet addresses
if (startExternalIP.IsSubnet && endExternalIP == null) {
endExternalIP = startExternalIP.LastSubnetIP;
startExternalIP = startExternalIP.FirstSubnetIP;
}
if (startExternalIP.V6 != startInternalIP.V6 && (startExternalIP.V6 != endExternalIP.V6 && endExternalIP != null)) throw new NotSupportedException("All IP addresses must be either V4 or V6.");
int i = 0;
long step = ((endExternalIP - startExternalIP) > 0) ? 1 : -1;
while (true)
if (pool == IPAddressPool.PhoneNumbers)
{
if (i > MaxSubnet)
break;
string phoneFormat = "D" + Math.Max(externalIP.Length, endIP.Length);
// add IP address
DataProvider.AddIPAddress((int)pool, serverId, startExternalIP.ToString(), startInternalIP.ToString(), subnetMask, defaultGateway, comments);
UInt64 start = UInt64.Parse(externalIP);
UInt64 end = UInt64.Parse(endIP);
if (startExternalIP == endExternalIP)
break;
if (end < start) { UInt64 temp = start; start = end; end = temp; }
i++;
const UInt64 maxPhones = 1000; // TODO max?
startExternalIP += step;
end = Math.Min(end, start + maxPhones);
if (startInternalIP != 0)
startInternalIP += step;
for (UInt64 number = start; number <= end; number++)
DataProvider.AddIPAddress((int)pool, serverId, number.ToString(phoneFormat), "", subnetMask, defaultGateway, comments);
}
else
{
var startExternalIP = IPAddress.Parse(externalIP);
var startInternalIP = IPAddress.Parse(internalIP);
var endExternalIP = IPAddress.Parse(endIP);
// handle CIDR notation IP/Subnet addresses
if (startExternalIP.IsSubnet && endExternalIP == null)
{
endExternalIP = startExternalIP.LastSubnetIP;
startExternalIP = startExternalIP.FirstSubnetIP;
}
if (startExternalIP.V6 != startInternalIP.V6 && (startExternalIP.V6 != endExternalIP.V6 && endExternalIP != null)) throw new NotSupportedException("All IP addresses must be either V4 or V6.");
int i = 0;
long step = ((endExternalIP - startExternalIP) > 0) ? 1 : -1;
while (true)
{
if (i > MaxSubnet)
break;
// add IP address
DataProvider.AddIPAddress((int)pool, serverId, startExternalIP.ToString(), startInternalIP.ToString(), subnetMask, defaultGateway, comments);
if (startExternalIP == endExternalIP)
break;
i++;
startExternalIP += step;
if (startInternalIP != 0)
startInternalIP += step;
}
}
}
catch (Exception ex)

View file

@ -81,7 +81,10 @@
<!--END-->
<!--MenuItem url="http://phpmysqladmin.com" title="phpMyAdmin" target="_blank"
resourceGroup="MySQL4"/-->
</ModuleData>
<MenuItem pageID="LyncPhoneNumbers" resourceGroup="Hosted Organizations" />
</ModuleData>
<ModuleData id="SpaceIcons">
<Icon pageID="SpaceDomains" resourceGroup="OS" imageUrl="icons/world_48.png" />

View file

@ -160,7 +160,17 @@
<Control key="edit_ip" src="WebsitePanel/IPAddressesEditIPAddress.ascx" title="EditIPAddress" type="View" icon="adress_48.png" />
</Controls>
</ModuleDefinition>
<ModuleDefinition id="Servers">
<ModuleDefinition id="PhoneNumbers">
<Controls>
<Control key="" src="WebsitePanel/PhoneNumbers.ascx" title="PhoneNumbers" type="View" />
<Control key="add_phone" src="WebsitePanel/PhoneNumbersAddPhoneNumber.ascx" title="AddPhoneNumber" type="View" icon="adress_add_48.png" />
<Control key="edit_phone" src="WebsitePanel/PhoneNumbersEditPhoneNumber.ascx" title="EditPhoneNumber" type="View" icon="adress_48.png" />
</Controls>
</ModuleDefinition>
<ModuleDefinition id="Servers">
<Controls>
<Control key="" src="WebsitePanel/Servers.ascx" title="Servers" type="View" />
<Control key="add_ip" src="WebsitePanel/IPAddressesAddIPAddress.ascx" title="AddIPAddress" type="View" icon="adress_add_48.png" />
@ -264,7 +274,13 @@
<Control key="allocate_addresses" src="WebsitePanel/WebSitesAllocateIPAddresses.ascx" title="WebSitesAllocateIPAddresses" type="View" />
</Controls>
</ModuleDefinition>
<ModuleDefinition id="FtpAccounts">
<ModuleDefinition id="LyncPhoneNumbers">
<Controls>
<Control key="" src="WebsitePanel/LyncPhoneNumbers.ascx" title="LyncPhoneNumbers" type="View" />
<Control key="allocate_phonenumbers" src="WebsitePanel/LyncAllocatePhoneNumbers.ascx" title="LyncPhoneNumbers" type="View" />
</Controls>
</ModuleDefinition>
<ModuleDefinition id="FtpAccounts">
<Controls>
<Control key="" src="WebsitePanel/FtpAccounts.ascx" title="FTPAccounts" type="View" />
<Control key="edit_item" src="WebsitePanel/FtpAccountEditAccount.ascx" title="FTPAccountProperties" type="View" icon="folder_up_48.png" />

View file

@ -212,6 +212,17 @@
</Content>
</Page>
<Page name="LyncPhoneNumbers" roles="Administrator,Reseller,PlatformCSR,ResellerCSR,PlatformHelpdesk,ResellerHelpdesk,User" hidden="True">
<Content id="LeftPane">
<Module moduleDefinitionID="SpaceMenu" title="SpaceMenu" container="Clear.ascx">
<ModuleData ref="SpaceMenu"/>
</Module>
</Content>
<Content id="ContentPane">
<Module moduleDefinitionID="LyncPhoneNumbers" title="LyncPhoneNumbers" icon="adress_48.png" />
</Content>
</Page>
<Page name="SpaceFtpAccounts" roles="Administrator,Reseller,PlatformCSR,ResellerCSR,PlatformHelpdesk,ResellerHelpdesk,User" hidden="True">
<Content id="LeftPane">
<Module moduleDefinitionID="SpaceMenu" title="SpaceMenu" container="Clear.ascx">
@ -558,6 +569,11 @@
<Module moduleDefinitionID="IPAddresses" title="IPAddresses" container="Edit.ascx" icon="adress_48.png" />
</Content>
</Page>
<Page name="PhoneNumbers" roles="Administrator" skin="Browse1.ascx">
<Content id="ContentPane">
<Module moduleDefinitionID="PhoneNumbers" title="PhoneNumbers" container="Edit.ascx" icon="adress_48.png" />
</Content>
</Page>
<Page name="SystemSettings" roles="Administrator" skin="Browse1.ascx">
<Content id="ContentPane">
<Module moduleDefinitionID="SystemSettings" title="SystemSettings" container="Edit.ascx" icon="tool_48.png" />

View file

@ -771,8 +771,19 @@
<data name="ModuleTitle.ApplyEnableHardQuotaFeature" xml:space="preserve">
<value>System Hard Quota</value>
</data>
<data name="ModuleTitle.HeliconZoo" xml:space="preserve">
<value>Helicon Zoo</value>
</data>
<data name="ModuleTitle.LyncPhoneNumbers" xml:space="preserve">
<value>Phone Numbers</value>
</data>
<data name="ModuleTitle.AddPhoneNumber" xml:space="preserve">
<value>Add Phone Numbers</value>
</data>
<data name="ModuleTitle.EditPhoneNumber" xml:space="preserve">
<value>Edit Phone numbers</value>
</data>
<data name="ModuleTitle.PhoneNumbers" xml:space="preserve">
<value>Phone Numbers</value>
</data>
</root>

View file

@ -462,4 +462,16 @@
<data name="PageName.SpaceApplyEnableHardQuotaFeature" xml:space="preserve">
<value>System Hard Quota</value>
</data>
<data name="PageName.LyncPhoneNumbers" xml:space="preserve">
<value>Phone Numbers</value>
</data>
<data name="PageTitle.LyncPhoneNumbers" xml:space="preserve">
<value>{user} - {space} - Phone Numbers</value>
</data>
<data name="PageName.PhoneNumbers" xml:space="preserve">
<value>Phone Numbers</value>
</data>
<data name="PageTitle.PhoneNumbers" xml:space="preserve">
<value>Phone Numbers</value>
</data>
</root>

View file

@ -3112,7 +3112,6 @@
<data name="Error.ORGANIZATION_SET_USER_USERPRINCIPALNAME" xml:space="preserve">
<value>Failed to update user login name.</value>
</data>
<data name="Success.EXCHANGE_MAILBOX_SET_DEFAULT_EMAIL" xml:space="preserve">
<value>Mailbox primary e-mail address has been changed.</value>
</data>
@ -3365,7 +3364,6 @@
<data name="Warning.NOT_ALL_EMAIL_ADDRESSES_DELETED" xml:space="preserve">
<value>Please note not all email address are deleted</value>
</data>
<data name="Warning.EXCHANGE_NONE_PUBLIC_FOLDER_TO_DELETE" xml:space="preserve">
<value>There are no public folders to delete</value>
</data>
@ -3954,9 +3952,6 @@
<data name="Warning.1602" xml:space="preserve">
<value>IP Address could not be deleted</value>
</data>
<data name="WarningDescription.1602" xml:space="preserve">
<value>IP Address could not be deleted because it is being used by Virtual Private Server.</value>
</data>
<data name="Error.VPS_ERROR_ADDING_IP_ADDRESS" xml:space="preserve">
<value>Cannot add network adapter IP addresses</value>
</data>
@ -5313,4 +5308,19 @@
<data name="WarningDescription.ApplyEnableHardQuotaFeature" xml:space="preserve">
<value>By clicking on the button 'Apply', you will apply the respective hard quota on each provisioned home folder. Note that this may take some time.</value>
</data>
<data name="Error.IP_ADD_PHONE" xml:space="preserve">
<value>Error adding Phone number</value>
</data>
<data name="Error.IP_ADD_PHONE_RANGE" xml:space="preserve">
<value>Cannot add Phone numbers range.</value>
</data>
<data name="Error.DEALLOCATE_SPACE_PHONE_NUMBER" xml:space="preserve">
<value>The following errors have been occurred:</value>
</data>
<data name="Success.DEALLOCATE_SPACE_PHONE_NUMBER" xml:space="preserve">
<value>Phone number have been successfully deallocated.</value>
</data>
<data name="WarningDescription.PHONE_EDIT_LIST_EMPTY_ERROR" xml:space="preserve">
<value>At least one Phone number must be selected.</value>
</data>
</root>

View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="locIPQuota.Text" xml:space="preserve">
<value>Number of Phone Numbers:</value>
</data>
<data name="secQuotas.Text" xml:space="preserve">
<value>Quotas</value>
</data>
</root>

View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="locIPQuota.Text" xml:space="preserve">
<value>Number of Phone Numbers:</value>
</data>
<data name="secQuotas.Text" xml:space="preserve">
<value>Quotas</value>
</data>
</root>

View file

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnAddItem.Text" xml:space="preserve">
<value>Add</value>
</data>
<data name="gvIPAddressesExternalIP.Header" xml:space="preserve">
<value>Numbers</value>
</data>
<data name="gvIPAddressesInternalIP.Header" xml:space="preserve">
<value>NAT Address</value>
</data>
<data name="gvIPAddressesServer.Header" xml:space="preserve">
<value>Server</value>
</data>
<data name="gvIPAddressesUser.Header" xml:space="preserve">
<value>User</value>
</data>
<data name="gvIPAddressesComments.Header" xml:space="preserve">
<value>Comments</value>
</data>
<data name="gvIPAddresses.Empty" xml:space="preserve">
<value>No Phone Numbers found in the selected Pool.</value>
</data>
<data name="SearchField.ExternalIP" xml:space="preserve">
<value>Numbers</value>
</data>
<data name="SearchField.InternalIP" xml:space="preserve">
<value>NAT Address</value>
</data>
<data name="SearchField.Server" xml:space="preserve">
<value>Server Name</value>
</data>
<data name="SearchField.Username" xml:space="preserve">
<value>Username</value>
</data>
<data name="gvIPAddressesIsVps.Header" xml:space="preserve">
<value>VPS</value>
</data>
<data name="gvIPAddressesGateway.Header" xml:space="preserve">
<value>Default Gateway</value>
</data>
<data name="ddlPoolsVpsExternalNetwork.Text" xml:space="preserve">
<value>VPS External Network IP</value>
</data>
<data name="ddlPoolsVpsManagementNetwork.Text" xml:space="preserve">
<value>VPS Management Network IP</value>
</data>
<data name="ddlPoolsWebSites.Text" xml:space="preserve">
<value>Web Sites IP</value>
</data>
<data name="ddlPoolsGeneral.Text" xml:space="preserve">
<value>General IP</value>
</data>
<data name="lblItemsPerPage.Text" xml:space="preserve">
<value>Page size:</value>
</data>
<data name="lblPool.Text" xml:space="preserve">
<value>Pool:</value>
</data>
<data name="btnDeleteSelected.OnClientClick" xml:space="preserve">
<value>return confirm('Delete selected?');</value>
</data>
<data name="btnDeleteSelected.Text" xml:space="preserve">
<value>Delete selected</value>
</data>
<data name="btnEditSelected.Text" xml:space="preserve">
<value>Edit selected...</value>
</data>
<data name="gvAddressesItemName.HeaderText" xml:space="preserve">
<value>Item</value>
</data>
<data name="gvAddressesSpace.HeaderText" xml:space="preserve">
<value>Space</value>
</data>
<data name="gvAddressesUser.HeaderText" xml:space="preserve">
<value>User</value>
</data>
<data name="SearchField.DefaultGateway" xml:space="preserve">
<value>Default Gateway</value>
</data>
<data name="SearchField.ItemName" xml:space="preserve">
<value>Item Name</value>
</data>
<data name="ddlPoolsPhoneNumbers.Text" xml:space="preserve">
<value>Phone Numbers</value>
</data>
</root>

View file

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="lblExternalIP.Text" xml:space="preserve">
<value>IP Address:</value>
</data>
<data name="lblInternalIP.Text" xml:space="preserve">
<value>NAT Address:</value>
</data>
<data name="locServer.Text" xml:space="preserve">
<value>Server:</value>
</data>
<data name="lblComments.Text" xml:space="preserve">
<value>Comments:</value>
</data>
<data name="btnAdd.Text" xml:space="preserve">
<value>Add</value>
</data>
<data name="btnCancel.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="Text.NotAssigned" xml:space="preserve">
<value>&lt;Not Assigned&gt;</value>
</data>
<data name="locIPAddress.Text" xml:space="preserve">
<value>Settings:</value>
</data>
<data name="locTo.Text" xml:space="preserve">
<value>to</value>
</data>
<data name="locDefaultGateway.Text" xml:space="preserve">
<value>Default Gateway:</value>
</data>
<data name="locSubnetMask.Text" xml:space="preserve">
<value>Subnet Mask:</value>
</data>
<data name="ddlPoolsGeneral.Text" xml:space="preserve">
<value>General IP</value>
</data>
<data name="ddlPoolsVpsExternalNetwork.Text" xml:space="preserve">
<value>VPS External Network IP</value>
</data>
<data name="ddlPoolsVpsManagementNetwork.Text" xml:space="preserve">
<value>VPS Management Network IP</value>
</data>
<data name="ddlPoolsWebSites.Text" xml:space="preserve">
<value>Web Sites IP</value>
<comment> </comment>
</data>
<data name="ddlPoolsPhoneNumbers.Text" xml:space="preserve">
<value>Phone Numbers</value>
</data>
<data name="lblPhoneNumbers.Text" xml:space="preserve">
<value>Phone Numbers:</value>
</data>
</root>

View file

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="lblServer.Text" xml:space="preserve">
<value>Server:</value>
</data>
<data name="lblComments.Text" xml:space="preserve">
<value>Comments:</value>
</data>
<data name="btnUpdate.Text" xml:space="preserve">
<value>Update</value>
</data>
<data name="btnCancel.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="Text.NotAssigned" xml:space="preserve">
<value>&lt;Not Assigned&gt;</value>
</data>
<data name="locDefaultGateway.Text" xml:space="preserve">
<value>Default Gateway:</value>
</data>
<data name="locSubnetMask.Text" xml:space="preserve">
<value>Subnet Mask:</value>
</data>
<data name="ddlPoolsGeneral.Text" xml:space="preserve">
<value>General IP</value>
</data>
<data name="ddlPoolsVpsExternalNetwork.Text" xml:space="preserve">
<value>VPS External Network IP</value>
</data>
<data name="ddlPoolsVpsManagementNetwork.Text" xml:space="preserve">
<value>VPS Management Network IP</value>
</data>
<data name="ddlPoolsWebSites.Text" xml:space="preserve">
<value>Web Sites IP</value>
</data>
<data name="lblExternalIP.Text" xml:space="preserve">
<value>IP Address:</value>
</data>
<data name="lblInternalIP.Text" xml:space="preserve">
<value>NAT Address:</value>
</data>
<data name="ddlPoolsPhoneNumbers.Text" xml:space="preserve">
<value>Phone Numbers</value>
</data>
<data name="lblPhoneNumbers.Text" xml:space="preserve">
<value>Phone Number:</value>
</data>
</root>

View file

@ -1,10 +1,11 @@
//------------------------------------------------------------------------------
// <автоматически создаваемое>
// Этот код создан программой.
// <auto-generated>
// This code was generated by a tool.
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </автоматически создаваемое>
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer {
@ -13,128 +14,142 @@ namespace WebsitePanel.Portal.ExchangeServer {
public partial class ExchangeDisclaimerGeneralSettings {
/// <summary>
/// asyncTasks элемент управления.
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// breadcrumb элемент управления.
/// breadcrumb control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb;
/// <summary>
/// menu элемент управления.
/// menu control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu;
/// <summary>
/// Image1 элемент управления.
/// Image1 control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image1;
/// <summary>
/// locTitle элемент управления.
/// locTitle control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary>
/// litDisplayName элемент управления.
/// litDisplayName control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litDisplayName;
/// <summary>
/// messageBox элемент управления.
/// messageBox control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// locDisplayName элемент управления.
/// locDisplayName control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locDisplayName;
/// <summary>
/// txtDisplayName элемент управления.
/// txtDisplayName control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtDisplayName;
/// <summary>
/// valRequireDisplayName элемент управления.
/// valRequireDisplayName control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName;
/// <summary>
/// locNotes элемент управления.
/// locNotes control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locNotes;
/// <summary>
/// txtNotes элемент управления.
/// txtNotes control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtNotes;
/// <summary>
/// btnSave элемент управления.
/// btnSave control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnSave;
/// <summary>
/// ValidationSummary1 элемент управления.
/// ValidationSummary1 control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1;
}

View file

@ -52,9 +52,10 @@
<asp:Localize runat="server" ID="locPhoneNumber" meta:resourcekey="locPhoneNumber" Text="Phone Number:" />
</td>
<td>
<asp:TextBox runat="server" ID="tbPhoneNumber" />
<!-- <asp:TextBox runat="server" ID="tb_PhoneNumber" /> -->
<asp:dropdownlist id="ddlPhoneNumber" Runat="server" CssClass="NormalTextBox"></asp:dropdownlist>
<asp:RegularExpressionValidator ID="PhoneFormatValidator" runat="server"
ControlToValidate="tbPhoneNumber" Display="Dynamic" ValidationGroup="Validation1" SetFocusOnError="true"
ControlToValidate="ddlPhoneNumber" Display="Dynamic" ValidationGroup="Validation1" SetFocusOnError="true"
ValidationExpression="^([0-9])*$"
ErrorMessage="Must contain only numbers.">
</asp:RegularExpressionValidator>

View file

@ -32,6 +32,10 @@ using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.HostedSolution;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace WebsitePanel.Portal.Lync
{
@ -43,11 +47,27 @@ namespace WebsitePanel.Portal.Lync
{
WebsitePanel.Providers.HostedSolution.LyncUserPlan[] plans = ES.Services.Lync.GetLyncUserPlans(PanelRequest.ItemID);
BindPhoneNumbers();
if (plans.Length == 0)
btnCreate.Enabled = false;
}
}
private void BindPhoneNumbers()
{
ddlPhoneNumber.Items.Add(new ListItem("<Select Phone>", ""));
PackageIPAddress[] ips = ES.Services.Servers.GetPackageUnassignedIPAddresses(PanelSecurity.PackageId, IPAddressPool.PhoneNumbers);
foreach (PackageIPAddress ip in ips)
{
string phone = ip.ExternalIP;
ddlPhoneNumber.Items.Add(new ListItem(phone, ip.PackageAddressID.ToString()));
}
}
protected void Page_PreRender(object sender, EventArgs e)
{
@ -61,7 +81,7 @@ namespace WebsitePanel.Portal.Lync
if (!EnterpriseVoice)
{
tbPhoneNumber.Text = "";
ddlPhoneNumber.Text = "";
tbPin.Text = "";
}
@ -93,7 +113,7 @@ namespace WebsitePanel.Portal.Lync
//#1
LyncUser lyncUser = ES.Services.Lync.GetLyncUserGeneralSettings(PanelRequest.ItemID, accountId);
ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, accountId, lyncUser.SipAddress, tbPhoneNumber.Text + ":" + tbPin.Text);
ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, accountId, lyncUser.SipAddress, ddlPhoneNumber.SelectedItem.Text + ":" + tbPin.Text);
Response.Redirect(EditUrl("AccountID", accountId.ToString(), "edit_lync_user",
"SpaceID=" + PanelSecurity.PackageId,

View file

@ -3,9 +3,10 @@
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.Lync {
@ -15,8 +16,9 @@ namespace WebsitePanel.Portal.Lync {
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
@ -24,8 +26,9 @@ namespace WebsitePanel.Portal.Lync {
/// breadcrumb control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb;
@ -33,8 +36,9 @@ namespace WebsitePanel.Portal.Lync {
/// menu control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu;
@ -42,8 +46,9 @@ namespace WebsitePanel.Portal.Lync {
/// Image1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image1;
@ -51,8 +56,9 @@ namespace WebsitePanel.Portal.Lync {
/// locTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
@ -60,8 +66,9 @@ namespace WebsitePanel.Portal.Lync {
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
@ -69,8 +76,9 @@ namespace WebsitePanel.Portal.Lync {
/// ExistingUserTable control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTable ExistingUserTable;
@ -78,8 +86,9 @@ namespace WebsitePanel.Portal.Lync {
/// Localize1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize Localize1;
@ -87,8 +96,9 @@ namespace WebsitePanel.Portal.Lync {
/// userSelector control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UserSelector userSelector;
@ -96,8 +106,9 @@ namespace WebsitePanel.Portal.Lync {
/// locPlanName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locPlanName;
@ -105,8 +116,9 @@ namespace WebsitePanel.Portal.Lync {
/// planSelector control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserPlanSelector planSelector;
@ -114,8 +126,9 @@ namespace WebsitePanel.Portal.Lync {
/// pnEnterpriseVoice control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel pnEnterpriseVoice;
@ -123,26 +136,29 @@ namespace WebsitePanel.Portal.Lync {
/// locPhoneNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locPhoneNumber;
/// <summary>
/// tbPhoneNumber control.
/// ddlPhoneNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox tbPhoneNumber;
protected global::System.Web.UI.WebControls.DropDownList ddlPhoneNumber;
/// <summary>
/// PhoneFormatValidator control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator PhoneFormatValidator;
@ -150,8 +166,9 @@ namespace WebsitePanel.Portal.Lync {
/// locLyncPin control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locLyncPin;
@ -159,8 +176,9 @@ namespace WebsitePanel.Portal.Lync {
/// tbPin control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox tbPin;
@ -168,8 +186,9 @@ namespace WebsitePanel.Portal.Lync {
/// PinRegularExpressionValidator control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator PinRegularExpressionValidator;
@ -177,8 +196,9 @@ namespace WebsitePanel.Portal.Lync {
/// btnCreate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnCreate;
}

View file

@ -56,9 +56,10 @@
<asp:Localize runat="server" ID="locPhoneNumber" meta:resourcekey="locPhoneNumber" Text="Phone Number:" />
</td>
<td>
<asp:TextBox runat="server" ID="tbPhoneNumber" />
<!-- <asp:TextBox runat="server" ID="tb_PhoneNumber" /> -->
<asp:dropdownlist id="ddlPhoneNumber" Runat="server" CssClass="NormalTextBox"></asp:dropdownlist>
<asp:RegularExpressionValidator ID="PhoneFormatValidator" runat="server"
ControlToValidate="tbPhoneNumber" Display="Dynamic" ValidationGroup="Validation1" SetFocusOnError="true"
ControlToValidate="ddlPhoneNumber" Display="Dynamic" ValidationGroup="Validation1" SetFocusOnError="true"
ValidationExpression="^([0-9])*$"
ErrorMessage="Must contain only numbers.">
</asp:RegularExpressionValidator>

View file

@ -31,6 +31,11 @@ using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.HostedSolution;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace WebsitePanel.Portal.Lync
{
public partial class EditLyncUser : WebsitePanelModuleBase
@ -39,9 +44,27 @@ namespace WebsitePanel.Portal.Lync
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindPhoneNumbers();
BindItems();
}
}
private void BindPhoneNumbers()
{
ddlPhoneNumber.Items.Add(new ListItem("<Select Phone>", ""));
PackageIPAddress[] ips = ES.Services.Servers.GetPackageUnassignedIPAddresses(PanelSecurity.PackageId, IPAddressPool.PhoneNumbers);
foreach (PackageIPAddress ip in ips)
{
string phone = ip.ExternalIP;
ddlPhoneNumber.Items.Add(new ListItem(phone, phone));
}
}
protected void Page_PreRender(object sender, EventArgs e)
{
bool EnterpriseVoice = false;
@ -54,7 +77,7 @@ namespace WebsitePanel.Portal.Lync
if (!EnterpriseVoice)
{
tbPhoneNumber.Text = "";
ddlPhoneNumber.Text = "";
tbPin.Text = "";
}
@ -88,7 +111,7 @@ namespace WebsitePanel.Portal.Lync
planSelector.planId = lyncUser.LyncUserPlanId.ToString();
lyncUserSettings.sipAddress = lyncUser.SipAddress;
tbPhoneNumber.Text = lyncUser.LineUri;
Utils.SelectListItem(ddlPhoneNumber, lyncUser.LineUri);
}
protected void btnSave_Click(object sender, EventArgs e)
@ -100,7 +123,7 @@ namespace WebsitePanel.Portal.Lync
LyncUserResult res = ES.Services.Lync.SetUserLyncPlan(PanelRequest.ItemID, PanelRequest.AccountID, Convert.ToInt32(planSelector.planId));
if (res.IsSuccess && res.ErrorCodes.Count == 0)
{
res = ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID, lyncUserSettings.sipAddress, tbPhoneNumber.Text + ":" + tbPin.Text);
res = ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID, lyncUserSettings.sipAddress, ddlPhoneNumber.SelectedItem.Text + ":" + tbPin.Text);
}
if (res.IsSuccess && res.ErrorCodes.Count == 0)

View file

@ -3,9 +3,10 @@
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.Lync {
@ -15,8 +16,9 @@ namespace WebsitePanel.Portal.Lync {
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
@ -24,8 +26,9 @@ namespace WebsitePanel.Portal.Lync {
/// breadcrumb control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb;
@ -33,8 +36,9 @@ namespace WebsitePanel.Portal.Lync {
/// menu control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu;
@ -42,8 +46,9 @@ namespace WebsitePanel.Portal.Lync {
/// Image1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image1;
@ -51,8 +56,9 @@ namespace WebsitePanel.Portal.Lync {
/// locTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
@ -60,8 +66,9 @@ namespace WebsitePanel.Portal.Lync {
/// litDisplayName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litDisplayName;
@ -69,8 +76,9 @@ namespace WebsitePanel.Portal.Lync {
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
@ -78,8 +86,9 @@ namespace WebsitePanel.Portal.Lync {
/// locPlanName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locPlanName;
@ -87,8 +96,9 @@ namespace WebsitePanel.Portal.Lync {
/// planSelector control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserPlanSelector planSelector;
@ -96,8 +106,9 @@ namespace WebsitePanel.Portal.Lync {
/// locSipAddress control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locSipAddress;
@ -105,8 +116,9 @@ namespace WebsitePanel.Portal.Lync {
/// lyncUserSettings control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserSettings lyncUserSettings;
@ -114,8 +126,9 @@ namespace WebsitePanel.Portal.Lync {
/// pnEnterpriseVoice control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel pnEnterpriseVoice;
@ -123,26 +136,39 @@ namespace WebsitePanel.Portal.Lync {
/// locPhoneNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locPhoneNumber;
/// <summary>
/// tbPhoneNumber control.
/// tb_PhoneNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox tbPhoneNumber;
protected global::System.Web.UI.WebControls.TextBox tb_PhoneNumber;
/// <summary>
/// ddlPhoneNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlPhoneNumber;
/// <summary>
/// PhoneFormatValidator control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator PhoneFormatValidator;
@ -150,8 +176,9 @@ namespace WebsitePanel.Portal.Lync {
/// locLyncPin control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locLyncPin;
@ -159,8 +186,9 @@ namespace WebsitePanel.Portal.Lync {
/// tbPin control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox tbPin;
@ -168,8 +196,9 @@ namespace WebsitePanel.Portal.Lync {
/// PinRegularExpressionValidator control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RegularExpressionValidator PinRegularExpressionValidator;
@ -177,8 +206,9 @@ namespace WebsitePanel.Portal.Lync {
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnSave;
}

View file

@ -0,0 +1,11 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncAllocatePhoneNumbers.ascx.cs" Inherits="WebsitePanel.Portal.LyncAllocatePhoneNumbers" %>
<%@ Register Src="UserControls/AllocatePackagePhoneNumbers.ascx" TagName="AllocatePackagePhoneNumbers" TagPrefix="wsp" %>
<div class="FormBody">
<wsp:AllocatePackagePhoneNumbers id="allocatePhoneNumbers" runat="server"
Pool="PhoneNumbers"
ResourceGroup="Web"
ListAddressesControl="" />
</div>

View file

@ -0,0 +1,44 @@
// Copyright (c) 2012, 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 System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebsitePanel.Portal
{
public partial class LyncAllocatePhoneNumbers : WebsitePanelModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}

View file

@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class LyncAllocatePhoneNumbers {
/// <summary>
/// allocatePhoneNumbers control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.AllocatePackagePhoneNumbers allocatePhoneNumbers;
}
}

View file

@ -0,0 +1,30 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncPhoneNumbers.ascx.cs" Inherits="WebsitePanel.Portal.LyncPhoneNumbers" %>
<%@ Register Src="UserControls/PackagePhoneNumbers.ascx" TagName="PackagePhoneNumbers" TagPrefix="wsp" %>
<%@ Register Src="UserControls/Quota.ascx" TagName="Quota" TagPrefix="wsp" %>
<%@ Register Src="UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %>
<div class="FormBody">
<wsp:PackagePhoneNumbers id="webAddresses" runat="server"
Pool="PhoneNumbers"
EditItemControl=""
SpaceHomeControl=""
AllocateAddressesControl="allocate_phonenumbers"
ManageAllowed="true" />
<br />
<wsp:CollapsiblePanel id="secQuotas" runat="server"
TargetControlID="QuotasPanel" meta:resourcekey="secQuotas" Text="Quotas">
</wsp:CollapsiblePanel>
<asp:Panel ID="QuotasPanel" runat="server" Height="0" style="overflow:hidden;">
<table cellspacing="6">
<tr>
<td><asp:Localize ID="locIPQuota" runat="server" meta:resourcekey="locIPQuota" Text="Number of Phone Numbes:"></asp:Localize></td>
<td><wsp:Quota ID="addressesQuota" runat="server" QuotaName="Web.IPAddresses" /></td>
</tr>
</table>
</asp:Panel>
</div>

View file

@ -0,0 +1,43 @@
// Copyright (c) 2012, 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 System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebsitePanel.Portal
{
public partial class LyncPhoneNumbers : WebsitePanelModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}

View file

@ -0,0 +1,65 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class LyncPhoneNumbers {
/// <summary>
/// webAddresses control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.PackagePhoneNumbers webAddresses;
/// <summary>
/// secQuotas control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secQuotas;
/// <summary>
/// QuotasPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel QuotasPanel;
/// <summary>
/// locIPQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locIPQuota;
/// <summary>
/// addressesQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.Quota addressesQuota;
}
}

View file

@ -0,0 +1,100 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PhoneNumbers.ascx.cs" Inherits="WebsitePanel.Portal.PhoneNumbers" %>
<%@ Register Src="UserControls/SearchBox.ascx" TagName="SearchBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<script language="javascript">
function SelectAllCheckboxes(box)
{
var state = box.checked;
var elm = box.parentElement.parentElement.parentElement.parentElement.getElementsByTagName("INPUT");
for(i = 0; i < elm.length; i++)
if(elm[i].type == "checkbox" && elm[i].id != box.id && elm[i].checked != state && !elm[i].disabled)
elm[i].checked = state;
}
</script>
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<div style="padding: 4px;">
<asp:Button ID="btnAddItem" runat="server" meta:resourcekey="btnAddItem" Text="Add" CssClass="Button3" OnClick="btnAddItem_Click" />
</div>
<div class="FormButtonsBar">
<div class="Right">
<wsp:SearchBox ID="searchBox" runat="server" />
</div>
</div>
<asp:GridView id="gvIPAddresses" runat="server" AutoGenerateColumns="False"
AllowSorting="True" EmptyDataText="gvIPAddresses"
CssSelectorClass="NormalGridView" DataKeyNames="AddressID"
AllowPaging="True" DataSourceID="odsIPAddresses">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkSelectAll" runat="server" onclick="javascript:SelectAllCheckboxes(this);" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" Enabled='<%# ((int)Eval("ItemID") == 0) %>' />
</ItemTemplate>
<ItemStyle Width="10px" />
</asp:TemplateField>
<asp:TemplateField SortExpression="ExternalIP" HeaderText="gvIPAddressesExternalIP">
<ItemTemplate>
<asp:hyperlink NavigateUrl='<%# EditUrl("AddressID", DataBinder.Eval(Container.DataItem, "AddressID").ToString(), "edit_phone") %>' runat="server" ID="Hyperlink2">
<%# Eval("ExternalIP") %>
</asp:hyperlink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ServerName" SortExpression="ServerName" HeaderText="gvIPAddressesServer" ItemStyle-Wrap="false"></asp:BoundField>
<asp:TemplateField HeaderText="gvAddressesUser" meta:resourcekey="gvAddressesUser" SortExpression="Username" >
<ItemTemplate>
<%# Eval("UserName") %>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvAddressesSpace" meta:resourcekey="gvAddressesSpace" SortExpression="PackageName" >
<ItemTemplate>
<asp:hyperlink id="lnkSpace" runat="server" NavigateUrl='<%# GetSpaceHomeUrl((int)Eval("PackageID")) %>'>
<%# Eval("PackageName") %>
</asp:hyperlink>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="gvAddressesItemName" meta:resourcekey="gvAddressesItemName" DataField="ItemName" SortExpression="ItemName" />
<asp:BoundField DataField="Comments" HeaderText="gvIPAddressesComments"></asp:BoundField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsIPAddresses" runat="server" EnablePaging="True"
SelectCountMethod="GetIPAddressesPagedCount"
SelectMethod="GetIPAddressesPaged"
SortParameterName="sortColumn"
TypeName="WebsitePanel.Portal.IPAddressesHelper"
OnSelected="odsIPAddresses_Selected">
<SelectParameters>
<asp:Parameter Name="pool" DefaultValue="PhoneNumbers" />
<asp:Parameter Name="serverId" DefaultValue="0" />
<asp:ControlParameter Name="filterColumn" ControlID="searchBox" PropertyName="FilterColumn" />
<asp:ControlParameter Name="filterValue" ControlID="searchBox" PropertyName="FilterValue" />
</SelectParameters>
</asp:ObjectDataSource>
<div class="GridFooter">
<div class="Left">
<asp:Button id="btnEditSelected" runat="server" Text="Edit Selected..."
meta:resourcekey="btnEditSelected" CssClass="SmallButton"
CausesValidation="false" onclick="btnEditSelected_Click"></asp:Button>
<asp:Button id="btnDeleteSelected" runat="server" Text="Delete Selected"
meta:resourcekey="btnDeleteSelected" CssClass="SmallButton"
CausesValidation="false" onclick="btnDeleteSelected_Click"></asp:Button>
</div>
<div class="Right">
<asp:Label ID="lblItemsPerPage" runat="server" meta:resourcekey="lblItemsPerPage" Text="Page size:" CssClass="Normal"></asp:Label>
<asp:DropDownList ID="ddlItemsPerPage" runat="server" CssClass="NormalTextBox"
AutoPostBack="True" onselectedindexchanged="ddlItemsPerPage_SelectedIndexChanged">
<asp:ListItem Value="10">10</asp:ListItem>
<asp:ListItem Value="20">20</asp:ListItem>
<asp:ListItem Value="50">50</asp:ListItem>
<asp:ListItem Value="100">100</asp:ListItem>
</asp:DropDownList>
</div>
</div>

View file

@ -0,0 +1,157 @@
// Copyright (c) 2012, 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 System.Web.UI.WebControls;
using System.Collections.Generic;
using WebsitePanel.Providers.Common;
using System.Text;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal
{
public partial class PhoneNumbers : WebsitePanelModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
// set display preferences
if (!IsPostBack)
{
// page size
gvIPAddresses.PageSize = UsersHelper.GetDisplayItemsPerPage();
ddlItemsPerPage.SelectedValue = gvIPAddresses.PageSize.ToString();
}
else
{
gvIPAddresses.PageSize = Utils.ParseInt(ddlItemsPerPage.SelectedValue, 10);
}
if (!IsPostBack)
{
searchBox.AddCriteria("ExternalIP", GetLocalizedString("SearchField.ExternalIP"));
searchBox.AddCriteria("ServerName", GetLocalizedString("SearchField.Server"));
searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName"));
searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username"));
}
}
protected void odsIPAddresses_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
ProcessException(e.Exception);
this.DisableControls = true;
e.ExceptionHandled = true;
}
}
public string GetSpaceHomeUrl(int spaceId)
{
return PortalUtils.GetSpaceHomePageUrl(spaceId);
}
protected void btnAddItem_Click(object sender, EventArgs e)
{
Response.Redirect(EditUrl("PoolID", "PhoneNumbers", "add_phone"), true);
}
protected void ddlItemsPerPage_SelectedIndexChanged(object sender, EventArgs e)
{
gvIPAddresses.PageSize = Utils.ParseInt(ddlItemsPerPage.SelectedValue, 10);
gvIPAddresses.DataBind();
}
protected void btnEditSelected_Click(object sender, EventArgs e)
{
int[] addresses = GetSelectedItems(gvIPAddresses);
if (addresses.Length == 0)
{
ShowWarningMessage("IP_EDIT_LIST_EMPTY_ERROR");
return;
}
StringBuilder sb = new StringBuilder();
for (int i = 0; i < addresses.Length; i++)
{
if (i > 0) sb.Append(",");
sb.Append(addresses[i]);
}
// go to edit screen
Response.Redirect(EditUrl("Addresses", sb.ToString(), "edit_phone"), true);
}
protected void btnDeleteSelected_Click(object sender, EventArgs e)
{
int[] addresses = GetSelectedItems(gvIPAddresses);
if (addresses.Length == 0)
{
ShowWarningMessage("IP_DELETE_LIST_EMPTY_ERROR");
return;
}
try
{
// delete selected IP addresses
ResultObject res = ES.Services.Servers.DeleteIPAddresses(addresses);
if (!res.IsSuccess)
{
messageBox.ShowMessage(res, "IP_DELETE_RANGE_IP", "IP");
return;
}
// refresh grid
gvIPAddresses.DataBind();
}
catch (Exception ex)
{
ShowErrorMessage("IP_DELETE_RANGE_IP", ex);
return;
}
}
private int[] GetSelectedItems(GridView gv)
{
List<int> items = new List<int>();
for (int i = 0; i < gv.Rows.Count; i++)
{
GridViewRow row = gv.Rows[i];
CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect");
if (chkSelect.Checked)
items.Add((int)gv.DataKeys[i].Value);
}
return items.ToArray();
}
}
}

View file

@ -0,0 +1,106 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class PhoneNumbers {
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// btnAddItem control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAddItem;
/// <summary>
/// searchBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.SearchBox searchBox;
/// <summary>
/// gvIPAddresses control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gvIPAddresses;
/// <summary>
/// odsIPAddresses control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsIPAddresses;
/// <summary>
/// btnEditSelected control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnEditSelected;
/// <summary>
/// btnDeleteSelected control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnDeleteSelected;
/// <summary>
/// lblItemsPerPage control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblItemsPerPage;
/// <summary>
/// ddlItemsPerPage control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlItemsPerPage;
}
}

View file

@ -0,0 +1,43 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PhoneNumbersAddPhoneNumber.ascx.cs" Inherits="WebsitePanel.Portal.PhoneNumbersAddPhoneNumber" %>
<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<div class="FormBody">
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<asp:ValidationSummary ID="validatorsSummary" runat="server"
ValidationGroup="EditAddress" ShowMessageBox="True" ShowSummary="False" />
<asp:CustomValidator ID="consistentAddresses" runat="server" ErrorMessage="You must not mix IPv4 and IPv6 addresses." ValidationGroup="EditAddress" Display="dynamic" ServerValidate="CheckIPAddresses" />
<table cellspacing="0" cellpadding="3">
<tr>
<td><asp:Localize ID="locServer" runat="server" meta:resourcekey="locServer" Text="Server:"></asp:Localize></td>
<td>
<asp:dropdownlist id="ddlServer" CssClass="NormalTextBox" runat="server" DataTextField="ServerName" DataValueField="ServerID"></asp:dropdownlist>
</td>
</tr>
<tr id="PhoneNumbersRow" runat="server">
<td><asp:Localize ID="Localize1" runat="server" meta:resourcekey="lblPhoneNumbers" Text="Phone Numbers:"></asp:Localize></td>
<td>
<asp:TextBox id="startPhone" runat="server" Width="260px" MaxLength="45" CssClass="NormalTextBox"/>
<asp:RequiredFieldValidator ID="requireStartPhoneValidator" runat="server" meta:resourcekey="requireStartPhoneValidator"
ControlToValidate="startPhone" SetFocusOnError="true" Text="*" Enabled="false" ValidationGroup="EditAddress" ErrorMessage="Enter Phone Number" />
&nbsp;<asp:Localize ID="Localize2" runat="server" meta:resourcekey="locTo" Text="to"></asp:Localize>&nbsp;
<asp:TextBox id="endPhone" runat="server" ValidationGroup="EditAddress" Width="260px" MaxLength="45" CssClass="NormalTextBox"/>
</td>
</tr>
<tr>
<td><asp:Localize ID="lblComments" runat="server" meta:resourcekey="lblComments" Text="Comments:"></asp:Localize></td>
<td class="NormalBold"><asp:textbox id="txtComments" Width="250px" CssClass="NormalTextBox" runat="server" Rows="3" TextMode="MultiLine"></asp:textbox></td>
</tr>
</table>
</div>
<div class="FormFooter">
<asp:Button ID="btnAdd" runat="server" meta:resourcekey="btnAdd" CssClass="Button1" OnClick="btnAdd_Click" Text="Add" ValidationGroup="EditAddress" />
<asp:Button ID="btnCancel" runat="server" meta:resourcekey="btnCancel" CssClass="Button1" Text="Cancel" CausesValidation="False" OnClick="btnCancel_Click" />
</div>

View file

@ -0,0 +1,173 @@
// Copyright (c) 2012, 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 System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.Common;
namespace WebsitePanel.Portal
{
public partial class PhoneNumbersAddPhoneNumber : WebsitePanelModuleBase
{
private void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// bind dropdowns
try
{
BindServers();
// set server if found in request
if (PanelRequest.ServerId != 0)
Utils.SelectListItem(ddlServer, PanelRequest.ServerId);
}
catch (Exception ex)
{
ShowErrorMessage("IP_ADD_INIT_FORM", ex);
return;
}
ToggleControls();
}
}
private void BindServers()
{
try
{
ddlServer.DataSource = ES.Services.Servers.GetServers();
ddlServer.DataBind();
}
catch (Exception ex)
{
Response.Write(ex);
}
// add "select" item
ddlServer.Items.Insert(0, new ListItem(GetLocalizedString("Text.NotAssigned"), ""));
}
protected void btnAdd_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
int serverId = Utils.ParseInt(ddlServer.SelectedValue, 0);
IPAddressPool pool = IPAddressPool.PhoneNumbers;
string comments = txtComments.Text.Trim();
string start;
string end;
start = startPhone.Text;
end = endPhone.Text;
// add ip address
if (end != "" || start.Contains("/"))
{
string errorKey = "IP_ADD_PHONE_RANGE";
try
{
// add IP range
ResultObject res = ES.Services.Servers.AddIPAddressesRange(pool, serverId, start, end,
"", "", "", comments);
if (!res.IsSuccess)
{
// show error
messageBox.ShowMessage(res, errorKey, "IP");
return;
}
}
catch (Exception ex)
{
ShowErrorMessage(errorKey, ex);
return;
}
}
else
{
string errorKey = "IP_ADD_PHONE";
// add single IP
try
{
IntResult res = ES.Services.Servers.AddIPAddress(pool, serverId, start,
"", "", "", comments);
if (!res.IsSuccess)
{
messageBox.ShowMessage(res, errorKey, "IP");
return;
}
}
catch (Exception ex)
{
ShowErrorMessage(errorKey, ex);
return;
}
}
// Redirect back to the portal home page
RedirectBack();
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
// Redirect back to the portal home page
RedirectBack();
}
private void RedirectBack()
{
Response.Redirect(NavigateURL("PoolID", "PhoneNumbers"));
}
protected void ddlPools_SelectedIndexChanged(object sender, EventArgs e)
{
ToggleControls();
}
private void ToggleControls()
{
requireStartPhoneValidator.Enabled = true;
}
}
}

View file

@ -0,0 +1,166 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class PhoneNumbersAddPhoneNumber {
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// validatorsSummary control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary;
/// <summary>
/// consistentAddresses control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CustomValidator consistentAddresses;
/// <summary>
/// locServer control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locServer;
/// <summary>
/// ddlServer control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlServer;
/// <summary>
/// PhoneNumbersRow control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow PhoneNumbersRow;
/// <summary>
/// Localize1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize Localize1;
/// <summary>
/// startPhone control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox startPhone;
/// <summary>
/// requireStartPhoneValidator control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator requireStartPhoneValidator;
/// <summary>
/// Localize2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize Localize2;
/// <summary>
/// endPhone control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox endPhone;
/// <summary>
/// lblComments control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize lblComments;
/// <summary>
/// txtComments control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtComments;
/// <summary>
/// btnAdd control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAdd;
/// <summary>
/// btnCancel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnCancel;
}
}

View file

@ -0,0 +1,38 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PhoneNumbersEditPhoneNumber.ascx.cs" Inherits="WebsitePanel.Portal.PhoneNumbersEditPhoneNumber" %>
<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<div class="FormBody">
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<asp:ValidationSummary ID="validatorsSummary" runat="server"
ValidationGroup="EditAddress" ShowMessageBox="True" ShowSummary="False" />
<table cellspacing="0" cellpadding="3">
<tr>
<td><asp:Localize ID="locServer" runat="server" meta:resourcekey="locServer" Text="Server:"></asp:Localize></td>
<td>
<asp:dropdownlist id="ddlServer" CssClass="NormalTextBox" runat="server" DataTextField="ServerName" DataValueField="ServerID"></asp:dropdownlist>
</td>
</tr>
<tr id="PhoneNumbersRow" runat="server">
<td><asp:Localize ID="Localize1" runat="server" meta:resourcekey="lblPhoneNumbers" Text="Phone Numbers:"></asp:Localize></td>
<td>
<asp:TextBox id="Phone" runat="server" Width="260px" MaxLength="45" CssClass="NormalTextBox"/>
<asp:RequiredFieldValidator ID="requireStartPhoneValidator" runat="server" meta:resourcekey="requireStartPhoneValidator"
ControlToValidate="Phone" SetFocusOnError="true" Text="*" Enabled="false" ValidationGroup="EditAddress" ErrorMessage="Enter Phone Number" />
</td>
</tr>
<tr>
<td><asp:Localize ID="lblComments" runat="server" meta:resourcekey="lblComments" Text="Comments:"></asp:Localize></td>
<td><asp:textbox id="txtComments" Width="300px" CssClass="NormalTextBox" runat="server" Rows="3" TextMode="MultiLine"></asp:textbox></td>
</tr>
</table>
</div>
<div class="FormFooter">
<asp:Button ID="btnUpdate" runat="server" meta:resourcekey="btnUpdate" CssClass="Button1" Text="Update" OnClick="btnUpdate_Click" ValidationGroup="EditAddress" />
<asp:Button ID="btnCancel" runat="server" meta:resourcekey="btnCancel" CssClass="Button1" Text="Cancel" CausesValidation="False" OnClick="btnCancel_Click" />
</div>

View file

@ -0,0 +1,176 @@
// Copyright (c) 2012, 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 System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
namespace WebsitePanel.Portal
{
public partial class PhoneNumbersEditPhoneNumber : WebsitePanelModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
try
{
// bind dropdowns
BindServers();
// bind IP
BindPhone();
}
catch (Exception ex)
{
ShowErrorMessage("IP_GET_IP", ex);
return;
}
}
}
private void BindPhone()
{
int addressId = PanelRequest.AddressID;
// check if multiple editing
if (!String.IsNullOrEmpty(PanelRequest.Addresses))
{
string[] ids = PanelRequest.Addresses.Split(',');
addressId = Utils.ParseInt(ids[0], 0);
}
// bind first address
IPAddressInfo addr = ES.Services.Servers.GetIPAddress(addressId);
if (addr != null)
{
Utils.SelectListItem(ddlServer, addr.ServerId);
Phone.Text = addr.ExternalIP;
txtComments.Text = addr.Comments;
ToggleControls();
}
else
{
// exit
RedirectBack();
}
}
private void BindServers()
{
ddlServer.DataSource = ES.Services.Servers.GetServers();
ddlServer.DataBind();
ddlServer.Items.Insert(0, new ListItem(GetLocalizedString("Text.NotAssigned"), ""));
}
private void RedirectBack()
{
Response.Redirect(NavigateURL("PoolID", "PhoneNumbers"));
}
protected void btnUpdate_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
try
{
int serverId = Utils.ParseInt(ddlServer.SelectedValue, 0);
IPAddressPool pool = IPAddressPool.PhoneNumbers;
ResultObject res = null;
// update single IP address
if (!String.IsNullOrEmpty(PanelRequest.Addresses))
{
// update multiple IPs
string[] ids = PanelRequest.Addresses.Split(',');
int[] addresses = new int[ids.Length];
for (int i = 0; i < ids.Length; i++)
addresses[i] = Utils.ParseInt(ids[i], 0);
res = ES.Services.Servers.UpdateIPAddresses(addresses,
pool, serverId, "", "", txtComments.Text.Trim());
}
else
{
string address = Phone.Text;
// update single IP
res = ES.Services.Servers.UpdateIPAddress(PanelRequest.AddressID,
pool, serverId, address, "", "", "", txtComments.Text.Trim());
}
if (!res.IsSuccess)
{
messageBox.ShowMessage(res, "IP_UPDATE_IP", "IP");
return;
}
// Redirect back to the portal home page
RedirectBack();
}
catch (Exception ex)
{
ShowErrorMessage("IP_UPDATE_IP", ex);
return;
}
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
// Redirect back to the portal home page
RedirectBack();
}
protected void ddlPools_SelectedIndexChanged(object sender, EventArgs e)
{
ToggleControls();
}
private void ToggleControls()
{
bool multipleEdit = !String.IsNullOrEmpty(PanelRequest.Addresses);
PhoneNumbersRow.Visible = !multipleEdit;
requireStartPhoneValidator.Enabled = !multipleEdit;
}
}
}

View file

@ -0,0 +1,136 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class PhoneNumbersEditPhoneNumber {
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// validatorsSummary control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary;
/// <summary>
/// locServer control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locServer;
/// <summary>
/// ddlServer control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlServer;
/// <summary>
/// PhoneNumbersRow control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow PhoneNumbersRow;
/// <summary>
/// Localize1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize Localize1;
/// <summary>
/// Phone control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox Phone;
/// <summary>
/// requireStartPhoneValidator control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator requireStartPhoneValidator;
/// <summary>
/// lblComments control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize lblComments;
/// <summary>
/// txtComments control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtComments;
/// <summary>
/// btnUpdate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnUpdate;
/// <summary>
/// btnCancel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnCancel;
}
}

View file

@ -1,10 +1,11 @@
//------------------------------------------------------------------------------
// <автоматически создаваемое>
// Этот код создан программой.
// <auto-generated>
// This code was generated by a tool.
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </автоматически создаваемое>
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ProviderControls {
@ -13,83 +14,92 @@ namespace WebsitePanel.Portal.ProviderControls {
public partial class CRM2011_Settings {
/// <summary>
/// txtSqlServer элемент управления.
/// txtSqlServer control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtSqlServer;
/// <summary>
/// RequiredFieldValidator1 элемент управления.
/// RequiredFieldValidator1 control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
/// <summary>
/// txtReportingService элемент управления.
/// txtReportingService control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtReportingService;
/// <summary>
/// txtDomainName элемент управления.
/// txtDomainName control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtDomainName;
/// <summary>
/// RequiredFieldValidator2 элемент управления.
/// RequiredFieldValidator2 control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
/// <summary>
/// ddlSchema элемент управления.
/// ddlSchema control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlSchema;
/// <summary>
/// ddlCrmIpAddress элемент управления.
/// ddlCrmIpAddress control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.SelectIPAddress ddlCrmIpAddress;
/// <summary>
/// txtPort элемент управления.
/// txtPort control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPort;
/// <summary>
/// txtAppRootDomain элемент управления.
/// txtAppRootDomain control.
/// </summary>
/// <remarks>
/// Автоматически создаваемое поле.
/// Для изменения переместите объявление поля из файла конструктора в файл кода программной части.
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtAppRootDomain;
}

View file

@ -0,0 +1,71 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AllocatePackagePhoneNumbers.ascx.cs" Inherits="WebsitePanel.Portal.UserControls.AllocatePackagePhoneNumbers" %>
<%@ Register Src="SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<asp:ValidationSummary ID="validatorsSummary" runat="server"
ValidationGroup="AddAddress" ShowMessageBox="True" ShowSummary="False" />
<ul id="ErrorMessagesList" runat="server" visible="false">
<li id="EmptyAddressesMessage" runat="server">
<asp:Localize ID="locNotEnoughAddresses" runat="server" Text="Not enough..." meta:resourcekey="locNotEnoughAddresses"></asp:Localize>
</li>
<li id="QuotaReachedMessage" runat="server">
<asp:Localize ID="locQuotaReached" runat="server" Text="Quota reached..." meta:resourcekey="locQuotaReached"></asp:Localize>
</li>
</ul>
<asp:UpdatePanel runat="server" ID="AddressesTable" UpdateMode="Conditional">
<ContentTemplate>
<table cellspacing="5" style="width: 100%;">
<tr>
<td>
<asp:RadioButton ID="radioExternalRandom" runat="server" AutoPostBack="true"
meta:resourcekey="radioExternalRandom" Text="Randomly select phone Numbers from the pool"
Checked="True" GroupName="ExternalAddress"
oncheckedchanged="radioExternalRandom_CheckedChanged" />
</td>
</tr>
<tr id="AddressesNumberRow" runat="server">
<td style="padding-left: 30px;">
<asp:Localize ID="locExternalAddresses" runat="server"
meta:resourcekey="locExternalAddresses" Text="Number of Phone Numbers:"></asp:Localize>
<asp:TextBox ID="txtExternalAddressesNumber" runat="server" CssClass="NormalTextBox" Width="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="ExternalAddressesValidator" runat="server" Text="*" Display="Dynamic"
ControlToValidate="txtExternalAddressesNumber" meta:resourcekey="ExternalAddressesValidator" SetFocusOnError="true"
ValidationGroup="AddAddress">*</asp:RequiredFieldValidator>
<asp:Literal ID="litMaxAddresses" runat="server"></asp:Literal>
</td>
</tr>
<tr>
<td>
<asp:RadioButton ID="radioExternalSelected" runat="server" AutoPostBack="true"
meta:resourcekey="radioExternalSelected" Text="Select PHone Number from the list"
GroupName="ExternalAddress"
oncheckedchanged="radioExternalSelected_CheckedChanged" />
</td>
</tr>
<tr id="AddressesListRow" runat="server">
<td style="padding-left: 30px;">
<asp:ListBox ID="listExternalAddresses" SelectionMode="Multiple" runat="server" Rows="8"
CssClass="NormalTextBox" Width="220" style="height:100px;" ></asp:ListBox>
<br />
<asp:Localize ID="locHoldCtrl" runat="server"
meta:resourcekey="locHoldCtrl" Text="* Hold CTRL key to select multiple phone numbers" ></asp:Localize>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<p>
<asp:Button ID="btnAdd" runat="server" meta:resourcekey="btnAdd"
ValidationGroup="AddAddress" Text="Add" CssClass="Button1"
onclick="btnAdd_Click" />
<asp:Button ID="btnCancel" runat="server" meta:resourcekey="btnCancel"
CausesValidation="false" Text="Cancel" CssClass="Button1"
onclick="btnCancel_Click" />
</p>

View file

@ -0,0 +1,174 @@
// Copyright (c) 2012, 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 System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
namespace WebsitePanel.Portal.UserControls
{
public partial class AllocatePackagePhoneNumbers : WebsitePanelControlBase
{
private IPAddressPool pool;
public IPAddressPool Pool
{
get { return pool; }
set { pool = value; }
}
private string listAddressesControl;
public string ListAddressesControl
{
get { return listAddressesControl; }
set { listAddressesControl = value; }
}
private string resourceGroup;
public string ResourceGroup
{
get { return resourceGroup; }
set { resourceGroup = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindIPAddresses();
ToggleControls();
}
}
private void BindIPAddresses()
{
bool vps = (Pool == IPAddressPool.VpsExternalNetwork || Pool == IPAddressPool.VpsManagementNetwork);
// bind list
IPAddressInfo[] ips = ES.Services.Servers.GetUnallottedIPAddresses(PanelSecurity.PackageId, ResourceGroup, Pool);
foreach (IPAddressInfo ip in ips)
{
string txt = ip.ExternalIP;
// web sites - NAT Address
if (!vps && !String.IsNullOrEmpty(ip.InternalIP))
txt += "/" + ip.InternalIP;
// VPS - Gateway Address
else if (vps && !String.IsNullOrEmpty(ip.DefaultGateway))
txt += "/" + ip.DefaultGateway;
listExternalAddresses.Items.Add(new ListItem(txt, ip.AddressId.ToString()));
}
int quotaAllowed = -1;
string quotaName = (String.Compare(ResourceGroup, ResourceGroups.VPS, true) == 0) ? Quotas.VPS_EXTERNAL_IP_ADDRESSES_NUMBER : Quotas.WEB_IP_ADDRESSES;
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
if (cntx.Quotas.ContainsKey(quotaName))
{
int quotaAllocated = cntx.Quotas[quotaName].QuotaAllocatedValue;
int quotaUsed = cntx.Quotas[quotaName].QuotaUsedValue;
if (quotaAllocated != -1)
quotaAllowed = quotaAllocated - quotaUsed;
}
// bind controls
int max = quotaAllowed == -1 ? listExternalAddresses.Items.Count : quotaAllowed;
txtExternalAddressesNumber.Text = max.ToString();
litMaxAddresses.Text = String.Format(GetLocalizedString("litMaxAddresses.Text"), max);
if (max == 0)
{
AddressesTable.Visible = false;
ErrorMessagesList.Visible = true;
EmptyAddressesMessage.Visible = (listExternalAddresses.Items.Count == 0);
QuotaReachedMessage.Visible = (quotaAllowed == 0);
btnAdd.Enabled = false;
}
}
protected void btnAdd_Click(object sender, EventArgs e)
{
try
{
List<int> ids = new List<int>();
foreach (ListItem item in listExternalAddresses.Items)
{
if (item.Selected)
ids.Add(Utils.ParseInt(item.Value));
}
ResultObject res = ES.Services.Servers.AllocatePackageIPAddresses(PanelSecurity.PackageId,
ResourceGroup, Pool,
radioExternalRandom.Checked,
Utils.ParseInt(txtExternalAddressesNumber.Text),
ids.ToArray());
if (res.IsSuccess)
{
// return back
Response.Redirect(HostModule.EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), ListAddressesControl));
}
else
{
// show message
messageBox.ShowMessage(res, "VPS_ALLOCATE_EXTERNAL_ADDRESSES_ERROR", "VPS");
}
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("VPS_ALLOCATE_EXTERNAL_ADDRESSES_ERROR", ex);
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
Response.Redirect(HostModule.EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), ListAddressesControl));
}
protected void radioExternalSelected_CheckedChanged(object sender, EventArgs e)
{
ToggleControls();
}
private void ToggleControls()
{
AddressesNumberRow.Visible = radioExternalRandom.Checked;
AddressesListRow.Visible = radioExternalSelected.Checked;
}
protected void radioExternalRandom_CheckedChanged(object sender, EventArgs e)
{
ToggleControls();
}
}
}

View file

@ -0,0 +1,215 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.UserControls {
public partial class AllocatePackagePhoneNumbers {
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// validatorsSummary control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary validatorsSummary;
/// <summary>
/// ErrorMessagesList control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl ErrorMessagesList;
/// <summary>
/// EmptyAddressesMessage control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl EmptyAddressesMessage;
/// <summary>
/// locNotEnoughAddresses control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locNotEnoughAddresses;
/// <summary>
/// QuotaReachedMessage control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl QuotaReachedMessage;
/// <summary>
/// locQuotaReached control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locQuotaReached;
/// <summary>
/// AddressesTable control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel AddressesTable;
/// <summary>
/// radioExternalRandom control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RadioButton radioExternalRandom;
/// <summary>
/// AddressesNumberRow control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow AddressesNumberRow;
/// <summary>
/// locExternalAddresses control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locExternalAddresses;
/// <summary>
/// txtExternalAddressesNumber control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtExternalAddressesNumber;
/// <summary>
/// ExternalAddressesValidator control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator ExternalAddressesValidator;
/// <summary>
/// litMaxAddresses control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litMaxAddresses;
/// <summary>
/// radioExternalSelected control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RadioButton radioExternalSelected;
/// <summary>
/// AddressesListRow control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow AddressesListRow;
/// <summary>
/// listExternalAddresses control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ListBox listExternalAddresses;
/// <summary>
/// locHoldCtrl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locHoldCtrl;
/// <summary>
/// btnAdd control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAdd;
/// <summary>
/// btnCancel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnCancel;
}
}

View file

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnAdd.Text" xml:space="preserve">
<value>Add</value>
</data>
<data name="btnCancel.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="ExternalAddressesValidator.ErrorMessage" xml:space="preserve">
<value>Enter the number of Phone Numbers</value>
</data>
<data name="litMaxAddresses.Text" xml:space="preserve">
<value>({0} max)</value>
</data>
<data name="locExternalAddresses.Text" xml:space="preserve">
<value>Number of Phone Numbers:</value>
</data>
<data name="locHoldCtrl.Text" xml:space="preserve">
<value>* Hold CTRL key to select multiple phone numbers</value>
</data>
<data name="locNotEnoughAddresses.Text" xml:space="preserve">
<value>The pool of Phone Numbers is empty.&lt;br/&gt;Allocate more Phone Numbers on reseller level. If the current hosting space is nested within "System" space then add more server Phone Numbers to the appropriate pool on "Configuration -&gt; Phone Numbers" page.</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Allocate Phone Numbers</value>
</data>
<data name="radioExternalRandom.Text" xml:space="preserve">
<value>Randomly select Phone Numbers from the pool</value>
</data>
<data name="radioExternalSelected.Text" xml:space="preserve">
<value>Select Phone Numbers from the list</value>
</data>
<data name="locQuotaReached.Text" xml:space="preserve">
<value>Phone Numbers quota has been reached.</value>
</data>
</root>

View file

@ -0,0 +1,165 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnAllocateAddress.Text" xml:space="preserve">
<value>Allocate...</value>
</data>
<data name="btnDeallocateAddresses.Text" xml:space="preserve">
<value>Deallocate Selected</value>
</data>
<data name="gvAddresses.Empty" xml:space="preserve">
<value>No Phone Numbers have been allocated to this hosting space.</value>
</data>
<data name="gvAddressesDefaultGateway.HeaderText" xml:space="preserve">
<value>Gateway</value>
</data>
<data name="gvAddressesIPAddress.HeaderText" xml:space="preserve">
<value>Phone Numbers</value>
</data>
<data name="gvAddressesItemName.HeaderText" xml:space="preserve">
<value>Item Name</value>
</data>
<data name="gvAddressesPrimary.HeaderText" xml:space="preserve">
<value>Primary</value>
</data>
<data name="gvAddressesSpace.HeaderText" xml:space="preserve">
<value>Space</value>
</data>
<data name="gvAddressesSubnetMask.HeaderText" xml:space="preserve">
<value>Subnet Mask</value>
</data>
<data name="gvAddressesUser.HeaderText" xml:space="preserve">
<value>User</value>
</data>
<data name="SearchField.DefaultGateway" xml:space="preserve">
<value>Default Gateway</value>
</data>
<data name="SearchField.IPAddress" xml:space="preserve">
<value>Phone Numbers</value>
</data>
<data name="SearchField.ItemName" xml:space="preserve">
<value>Item Name</value>
</data>
<data name="SearchField.Username" xml:space="preserve">
<value>User Name</value>
</data>
<data name="btnDeallocateAddresses.OnClientClick" xml:space="preserve">
<value>return confirm('Deallocate selected Phone Numbers from hosting space?');</value>
</data>
</root>

View file

@ -0,0 +1,87 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PackagePhoneNumbers.ascx.cs" Inherits="WebsitePanel.Portal.UserControls.PackagePhoneNumbers" %>
<%@ Register Src="SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="SearchBox.ascx" TagName="SearchBox" TagPrefix="wsp" %>
<script language="javascript">
function SelectAllCheckboxes(box) {
var state = box.checked;
var elm = box.parentElement.parentElement.parentElement.parentElement.getElementsByTagName("INPUT");
for (i = 0; i < elm.length; i++)
if (elm[i].type == "checkbox" && elm[i].id != box.id && elm[i].checked != state && !elm[i].disabled)
elm[i].checked = state;
}
</script>
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<div class="FormButtonsBarClean">
<div class="FormButtonsBarCleanLeft">
<asp:Button ID="btnAllocateAddress" runat="server" meta:resourcekey="btnAllocateAddress"
Text="Allocate IP Addresses" CssClass="Button1" CausesValidation="False"
onclick="btnAllocateAddress_Click" />
</div>
<div class="FormButtonsBarCleanRight">
<wsp:SearchBox ID="searchBox" runat="server" />
</div>
</div>
<asp:GridView ID="gvAddresses" runat="server" AutoGenerateColumns="False"
Width="100%" EmptyDataText="gvAddresses" CssSelectorClass="NormalGridView"
AllowPaging="True" AllowSorting="True" DataSourceID="odsExternalAddressesPaged"
onrowdatabound="gvAddresses_RowDataBound" DataKeyNames="PackageAddressID" >
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkSelectAll" runat="server" onclick="javascript:SelectAllCheckboxes(this);" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" />&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="gvAddressesIPAddress" meta:resourcekey="gvAddressesIPAddress"
DataField="ExternalIP" SortExpression="ExternalIP" />
<asp:TemplateField HeaderText="gvAddressesItemName" meta:resourcekey="gvAddressesItemName" SortExpression="ItemName">
<ItemTemplate>
<asp:hyperlink id="lnkEdit" runat="server" NavigateUrl='<%# GetItemEditUrl(Eval("ItemID").ToString()) %>'>
<%# Eval("ItemName") %>
</asp:hyperlink>&nbsp;
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvAddressesSpace" meta:resourcekey="gvAddressesSpace" SortExpression="PackageName" >
<ItemTemplate>
<asp:hyperlink id="lnkSpace" runat="server" NavigateUrl='<%# GetSpaceHomeUrl(Eval("PackageID").ToString()) %>'>
<%# Eval("PackageName") %>
</asp:hyperlink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvAddressesUser" meta:resourcekey="gvAddressesUser" SortExpression="Username" >
<ItemTemplate>
<%# Eval("UserName") %>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsExternalAddressesPaged" runat="server" EnablePaging="True"
SelectCountMethod="GetPackageIPAddressesCount"
SelectMethod="GetPackageIPAddresses"
SortParameterName="sortColumn"
TypeName="WebsitePanel.Portal.VirtualMachinesHelper"
OnSelected="odsExternalAddressesPaged_Selected"
onselecting="odsExternalAddressesPaged_Selecting">
<SelectParameters>
<asp:QueryStringParameter Name="packageId" QueryStringField="SpaceID" DefaultValue="0" />
<asp:Parameter Name="pool" DefaultValue="0" />
<asp:ControlParameter Name="filterColumn" ControlID="searchBox" PropertyName="FilterColumn" />
<asp:ControlParameter Name="filterValue" ControlID="searchBox" PropertyName="FilterValue" />
</SelectParameters>
</asp:ObjectDataSource>
<div style="margin-top:4px;">
<asp:Button ID="btnDeallocateAddresses" runat="server" meta:resourcekey="btnDeallocateAddresses"
Text="Deallocate selected" CssClass="SmallButton" CausesValidation="False"
onclick="btnDeallocateAddresses_Click" />
</div>

View file

@ -0,0 +1,172 @@
// Copyright (c) 2012, 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 System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
namespace WebsitePanel.Portal.UserControls
{
public partial class PackagePhoneNumbers : WebsitePanelControlBase
{
private bool spaceOwner;
private IPAddressPool pool;
public IPAddressPool Pool
{
get { return pool; }
set { pool = value; }
}
private string editItemControl;
public string EditItemControl
{
get { return editItemControl; }
set { editItemControl = value; }
}
private string spaceHomeControl;
public string SpaceHomeControl
{
get { return spaceHomeControl; }
set { spaceHomeControl = value; }
}
private string allocateAddressesControl;
public string AllocateAddressesControl
{
get { return allocateAddressesControl; }
set { allocateAddressesControl = value; }
}
public bool ManageAllowed
{
get { return ViewState["ManageAllowed"] != null ? (bool)ViewState["ManageAllowed"] : false; }
set { ViewState["ManageAllowed"] = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
searchBox.AddCriteria("ExternalIP", GetLocalizedString("SearchField.IPAddress"));
searchBox.AddCriteria("ItemName", GetLocalizedString("SearchField.ItemName"));
searchBox.AddCriteria("Username", GetLocalizedString("SearchField.Username"));
}
bool isUserSelected = PanelSecurity.SelectedUser.Role == WebsitePanel.EnterpriseServer.UserRole.User;
bool isUserLogged = PanelSecurity.EffectiveUser.Role == WebsitePanel.EnterpriseServer.UserRole.User;
spaceOwner = PanelSecurity.EffectiveUserId == PanelSecurity.SelectedUserId;
gvAddresses.Columns[3].Visible = !isUserSelected; // space
gvAddresses.Columns[4].Visible = !isUserSelected; // user
// managing external network permissions
gvAddresses.Columns[0].Visible = !isUserLogged && ManageAllowed;
btnAllocateAddress.Visible = !isUserLogged && !spaceOwner && ManageAllowed && !String.IsNullOrEmpty(AllocateAddressesControl);
btnDeallocateAddresses.Visible = !isUserLogged && ManageAllowed;
}
public string GetItemEditUrl(string itemID)
{
return HostModule.EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), EditItemControl,
"ItemID=" + itemID);
}
public string GetSpaceHomeUrl(string spaceId)
{
return HostModule.EditUrl("SpaceID", spaceId, SpaceHomeControl);
}
protected void odsExternalAddressesPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOXES", e.Exception);
e.ExceptionHandled = true;
}
}
protected void btnAllocateAddress_Click(object sender, EventArgs e)
{
Response.Redirect(HostModule.EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), AllocateAddressesControl));
}
protected void gvAddresses_RowDataBound(object sender, GridViewRowEventArgs e)
{
PackageIPAddress item = e.Row.DataItem as PackageIPAddress;
if (item != null)
{
// checkbox
CheckBox chkSelect = e.Row.FindControl("chkSelect") as CheckBox;
chkSelect.Enabled = (!spaceOwner || (PanelSecurity.PackageId != item.PackageId)) && item.ItemId == 0;
}
}
protected void btnDeallocateAddresses_Click(object sender, EventArgs e)
{
List<int> ids = new List<int>();
try
{
List<int> items = new List<int>();
for (int i = 0; i < gvAddresses.Rows.Count; i++)
{
GridViewRow row = gvAddresses.Rows[i];
CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect");
if (chkSelect.Checked)
items.Add((int)gvAddresses.DataKeys[i].Value);
}
// check if at least one is selected
if (items.Count == 0)
{
messageBox.ShowWarningMessage("PHONE_EDIT_LIST_EMPTY_ERROR");
return;
}
ResultObject res = ES.Services.Servers.DeallocatePackageIPAddresses(PanelSecurity.PackageId, items.ToArray());
messageBox.ShowMessage(res, "DEALLOCATE_SPACE_PHONE_NUMBER", "VPS");
gvAddresses.DataBind();
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("DEALLOCATE_SPACE_PHONE_NUMBER", ex);
}
}
protected void odsExternalAddressesPaged_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["pool"] = Pool;
}
}
}

View file

@ -0,0 +1,75 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.UserControls {
public partial class PackagePhoneNumbers {
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// btnAllocateAddress control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAllocateAddress;
/// <summary>
/// searchBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.SearchBox searchBox;
/// <summary>
/// gvAddresses control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gvAddresses;
/// <summary>
/// odsExternalAddressesPaged control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsExternalAddressesPaged;
/// <summary>
/// btnDeallocateAddresses control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnDeallocateAddresses;
}
}

View file

@ -38,7 +38,6 @@ namespace WebsitePanel.Portal
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}

View file

@ -461,6 +461,20 @@
<Compile Include="UserControls\OrgIdPolicyEditor.ascx.designer.cs">
<DependentUpon>OrgIdPolicyEditor.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\PackagePhoneNumbers.ascx.cs">
<DependentUpon>PackagePhoneNumbers.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\PackagePhoneNumbers.ascx.designer.cs">
<DependentUpon>PackagePhoneNumbers.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\AllocatePackagePhoneNumbers.ascx.cs">
<DependentUpon>AllocatePackagePhoneNumbers.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\AllocatePackagePhoneNumbers.ascx.designer.cs">
<DependentUpon>AllocatePackagePhoneNumbers.ascx</DependentUpon>
</Compile>
<Compile Include="VPSForPC\MonitoringPage.aspx.cs">
<DependentUpon>MonitoringPage.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -3879,6 +3893,41 @@
<Compile Include="WebsitesSSL.ascx.designer.cs">
<DependentUpon>WebsitesSSL.ascx</DependentUpon>
</Compile>
<Compile Include="LyncPhoneNumbers.ascx.cs">
<DependentUpon>LyncPhoneNumbers.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="LyncPhoneNumbers.ascx.designer.cs">
<DependentUpon>LyncPhoneNumbers.ascx</DependentUpon>
</Compile>
<Compile Include="LyncAllocatePhoneNumbers.ascx.cs">
<DependentUpon>LyncAllocatePhoneNumbers.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="LyncAllocatePhoneNumbers.ascx.designer.cs">
<DependentUpon>LyncAllocatePhoneNumbers.ascx</DependentUpon>
</Compile>
<Compile Include="PhoneNumbers.ascx.cs">
<DependentUpon>PhoneNumbers.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PhoneNumbers.ascx.designer.cs">
<DependentUpon>PhoneNumbers.ascx</DependentUpon>
</Compile>
<Compile Include="PhoneNumbersAddPhoneNumber.ascx.cs">
<DependentUpon>PhoneNumbersAddPhoneNumber.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PhoneNumbersAddPhoneNumber.ascx.designer.cs">
<DependentUpon>PhoneNumbersAddPhoneNumber.ascx</DependentUpon>
</Compile>
<Compile Include="PhoneNumbersEditPhoneNumber.ascx.cs">
<DependentUpon>PhoneNumbersEditPhoneNumber.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PhoneNumbersEditPhoneNumber.ascx.designer.cs">
<DependentUpon>PhoneNumbersEditPhoneNumber.ascx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="ApplyEnableHardQuotaFeature.ascx" />
@ -3918,6 +3967,8 @@
<Content Include="SettingsLyncUserPlansPolicy.ascx" />
<Content Include="UserControls\EditFeedsList.ascx" />
<Content Include="UserControls\OrgIdPolicyEditor.ascx" />
<Content Include="UserControls\PackagePhoneNumbers.ascx" />
<Content Include="UserControls\AllocatePackagePhoneNumbers.ascx" />
<Content Include="VPSForPC\MonitoringPage.aspx" />
<Content Include="VPSForPC\VdcAccountVLanAdd.ascx" />
<Content Include="VPSForPC\VdcAccountVLanNetwork.ascx" />
@ -3980,6 +4031,11 @@
<Content Include="UserControls\UsernameControl.ascx" />
<Content Include="WebSitesHeliconZooControl.ascx" />
<Content Include="WebsitesSSL.ascx" />
<Content Include="LyncPhoneNumbers.ascx" />
<Content Include="LyncAllocatePhoneNumbers.ascx" />
<Content Include="PhoneNumbers.ascx" />
<Content Include="PhoneNumbersAddPhoneNumber.ascx" />
<Content Include="PhoneNumbersEditPhoneNumber.ascx" />
</ItemGroup>
<ItemGroup>
<Content Include="App_LocalResources\BandwidthReport.ascx.resx">
@ -5061,6 +5117,12 @@
<SubType>Designer</SubType>
</Content>
<Content Include="UserControls\App_LocalResources\OrgIdPolicyEditor.ascx.resx" />
<Content Include="UserControls\App_LocalResources\PackagePhoneNumbers.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="UserControls\App_LocalResources\AllocatePackagePhoneNumbers.ascx.resx">
<SubType>Designer</SubType>
</Content>
<None Include="Resources\Windows2008_Settings.ascx.resx" />
<Content Include="App_LocalResources\WebSitesHeliconZooControl.ascx.resx" />
<Content Include="ExchangeServer\App_LocalResources\ExchangeDisclaimers.ascx.resx">
@ -5072,6 +5134,15 @@
<Content Include="ExchangeServer\App_LocalResources\ExchangeDistributionListMemberOf.ascx.resx" />
<Content Include="ExchangeServer\App_LocalResources\ExchangeMailboxMemberOf.ascx.resx" />
<Content Include="ExchangeServer\App_LocalResources\OrganizationUserMemberOf.ascx.resx" />
<Content Include="App_LocalResources\LyncPhoneNumbers.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="App_LocalResources\LyncAllocatePhoneNumbers.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="App_LocalResources\PhoneNumbers.ascx.resx" />
<Content Include="App_LocalResources\PhoneNumbersAddPhoneNumber.ascx.resx" />
<Content Include="App_LocalResources\PhoneNumbersEditPhoneNumber.ascx.resx" />
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
<SubType>Designer</SubType>
</EmbeddedResource>