Fixed: MailboxEmailAddresses unable to select userprincipalName

Fixed: MailboxEmailAddresses after trying to delete userPrincipalName, warning
displayed
This commit is contained in:
robvde 2012-11-28 08:25:53 +04:00
parent 6dbef1e166
commit 4b631cff90
5 changed files with 43 additions and 37 deletions

View file

@ -73,7 +73,7 @@
<asp:CheckBox ID="chkSelectAll" runat="server" onclick="javascript:SelectAllCheckboxes(this);" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" Enabled='<%# !((bool)Eval("IsPrimary") | (bool)Eval("IsUserPrincipalName"))%>' />
<asp:CheckBox ID="chkSelect" runat="server" Enabled='<%# !(bool)Eval("IsPrimary")%>' />
</ItemTemplate>
<ItemStyle Width="10px" />
</asp:TemplateField>

View file

@ -163,13 +163,30 @@ namespace WebsitePanel.Portal.ExchangeServer
{
// get selected e-mail addresses
List<string> emails = new List<string>();
bool containsUPN = false;
EntServer.ExchangeEmailAddress[] tmpEmails = ES.Services.ExchangeServer.GetMailboxEmailAddresses( PanelRequest.ItemID, PanelRequest.AccountID);
for (int i = 0; i < gvEmails.Rows.Count; i++)
{
GridViewRow row = gvEmails.Rows[i];
CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect");
if (chkSelect.Checked)
{
emails.Add(gvEmails.DataKeys[i].Value.ToString());
foreach (EntServer.ExchangeEmailAddress tmpEmail in tmpEmails)
{
if (gvEmails.DataKeys[i].Value.ToString() == tmpEmail.EmailAddress)
{
if (tmpEmail.IsUserPrincipalName)
{
containsUPN = true;
break;
}
}
}
}
}
if (emails.Count == 0)
@ -187,6 +204,11 @@ namespace WebsitePanel.Portal.ExchangeServer
messageBox.ShowResultMessage(result);
return;
}
else
{
if (containsUPN)
messageBox.ShowWarningMessage("NOT_ALL_EMAIL_ADDRESSES_DELETED");
}
// rebind
BindEmails();

View file

@ -1,31 +1,3 @@
// 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.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.