Work item 175

Exchange Accepted Domain can be switched
between Authoritative and InternalRelay
This commit is contained in:
rdolezel 2012-09-11 22:09:03 +02:00
parent e1c7c4b18f
commit 7bc0cc88fa
18 changed files with 382 additions and 16 deletions

View file

@ -33,7 +33,7 @@
Width="100%" EmptyDataText="gvDomains" CssSelectorClass="NormalGridView" OnRowCommand="gvDomains_RowCommand">
<Columns>
<asp:TemplateField HeaderText="gvDomainsName">
<ItemStyle Width="70%"></ItemStyle>
<ItemStyle Width="50%"></ItemStyle>
<ItemTemplate>
<asp:hyperlink id="lnkEditZone" runat="server" EnableViewState="false"
NavigateUrl='<%# GetDomainRecordsEditUrl(Eval("DomainID").ToString()) %>' Enabled='<%# !(bool)Eval("IsHost") %>'>
@ -41,13 +41,27 @@
</asp:hyperlink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvDomainsType">
<ItemTemplate>
<div style="text-align:center">
<asp:Label ID="Label1" Text='<%# Eval("DomainType") %>' runat="server"/>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvDomainsTypeChange">
<ItemTemplate>
<div style="text-align:center">
<asp:Button ID="btnChange" text="Change" meta:resourcekey="cmdChange" runat="server" CommandName="Change" CommandArgument='<%# Eval("DomainId") + "|" + Eval("DomainType") %>'/>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvDomainsDefault">
<ItemTemplate>
<div style="text-align:center">
<input type="radio" name="DefaultDomain" value='<%# Eval("DomainId") %>' <%# IsChecked((bool)Eval("IsDefault")) %> />
</div>
</ItemTemplate>
</asp:TemplateField>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:ImageButton ID="imgDelDomain" runat="server" Text="Delete" SkinID="ExchangeDelete"

View file

@ -117,6 +117,37 @@ namespace WebsitePanel.Portal.ExchangeServer
ShowErrorMessage("EXCHANGE_DELETE_DOMAIN", ex);
}
}
else if (e.CommandName == "Change")
{
string[] commandArgument = e.CommandArgument.ToString().Split('|');
int domainId = Utils.ParseInt(commandArgument[0].ToString(), 0);
ExchangeAcceptedDomainType acceptedDomainType = (ExchangeAcceptedDomainType)Enum.Parse(typeof(ExchangeAcceptedDomainType), commandArgument[1]);
try
{
ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.Authoritative;
if (acceptedDomainType == ExchangeAcceptedDomainType.Authoritative)
newDomainType = ExchangeAcceptedDomainType.InternalRelay;
int result = ES.Services.Organizations.ChangeOrganizationDomainType(PanelRequest.ItemID, domainId, newDomainType);
if (result < 0)
{
messageBox.ShowResultMessage(result);
return;
}
// rebind domains
BindDomainNames();
BindStats();
}
catch (Exception ex)
{
ShowErrorMessage("EXCHANGE_CHANGE_DOMAIN", ex);
}
}
}
protected void btnSetDefaultDomain_Click(object sender, EventArgs e)
@ -143,5 +174,6 @@ namespace WebsitePanel.Portal.ExchangeServer
ShowErrorMessage("EXCHANGE_SET_DEFAULT_DOMAIN", ex);
}
}
}
}

View file

@ -110,14 +110,5 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer domainsQuota;
/// <summary>
/// FormComments 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 FormComments;
}
}