wsp-10311 Set service level for multiple accounts at once + VIP checkbox
This commit is contained in:
parent
8dddeab03c
commit
231bbfa202
17 changed files with 1101 additions and 58 deletions
|
@ -3136,6 +3136,15 @@
|
|||
<data name="Success.ORGANIZATION_UPDATE_USER_SETTINGS" xml:space="preserve">
|
||||
<value>User general settings have been successfully updated.</value>
|
||||
</data>
|
||||
<data name="Success.ORGANIZATION_USERS_ACTIONS" xml:space="preserve">
|
||||
<value>Action has been successfully performed.</value>
|
||||
</data>
|
||||
<data name="Error.ORGANIZATION_USERS_ACTIONS" xml:space="preserve">
|
||||
<value>Failed to perform action.</value>
|
||||
</data>
|
||||
<data name="Warning.ORGANIZATION_USERS_ACTIONS" xml:space="preserve">
|
||||
<value>Please select the users for which you want to perform actions.</value>
|
||||
</data>
|
||||
<data name="Success.ORGANIZATION_SET_USER_PASSWORD" xml:space="preserve">
|
||||
<value>User password has been successfully updated.</value>
|
||||
</data>
|
||||
|
|
|
@ -93,6 +93,7 @@ select:disabled {border:1px solid #ccc; background:#f5f5f5; color:#ccc; cursor:n
|
|||
textarea {font-family:inherit; font-size:inherit; color:inherit; background:#fff; border: 1px solid #ccc; padding:3px 0 3px 3px; margin:0; resize:none;}
|
||||
/* checkbox */
|
||||
input[type=checkbox], input[type=radio] {margin:8px 4px 8px; vertical-align:-1px;}
|
||||
.HeaderCheckbox {margin-left:5px;}
|
||||
input[type=image] {margin-right:4px;}
|
||||
.LoginLabel {display:block; line-height:34px; width:auto !important; padding-right:8px;}
|
||||
.LoginContainer .SubHead {padding-right:8px; color:#333;}
|
||||
|
@ -180,6 +181,9 @@ h2.ProductTitle.Huge {margin:0;}
|
|||
.FormButtonsBarClean {clear: both; padding-bottom: 4px;}
|
||||
.FormButtonsBarCleanLeft {float: left;}
|
||||
.FormButtonsBarCleanRight {text-align: right;}
|
||||
.FormButtonsBarCleanMiddle {float: right;}
|
||||
.FormButtonsBarCleanSeparator {padding-right: 30px;}
|
||||
.FormButtonsBarCleanSeparatorSmall {padding-right: 15px;}
|
||||
.GridFooter .Left {float: left;}
|
||||
.GridFooter .Right {text-align: right;}
|
||||
.FormRow {padding-top: 4px; padding-bottom: 4px;}
|
||||
|
@ -190,6 +194,7 @@ SPAN.Checkbox.Bold {font-weight: bold;}
|
|||
.Checkbox INPUT {vertical-align: middle;}
|
||||
.FormFooter {padding:10px 0;}
|
||||
.FormFooterClean {font-size: 9pt; margin-top: 10px; padding: 10px 10px 0px 0px; border-top: solid 1px #DFDFDF;}
|
||||
.FormFooterMiddle {padding:10px;}
|
||||
.FormRBtnL {padding-top: 10px;}
|
||||
UL.VerticalButtons {margin: 0px; list-style: none; padding-left: 20px; float: right; width: 150px;}
|
||||
UL.VerticalButtons LI {padding-top: 2px; padding-bottom: 2px;}
|
||||
|
|
|
@ -328,21 +328,21 @@ namespace WebsitePanel.Portal
|
|||
return idn.GetAscii(domainName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified parameter to the Query String.
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="paramName">Name of the parameter to add.</param>
|
||||
/// <param name="paramValue">Value for the parameter to add.</param>
|
||||
/// <returns>Url with added parameter.</returns>
|
||||
public static Uri AddParameter(this Uri url, string paramName, string paramValue)
|
||||
public static List<T> GetCheckboxValuesFromGrid<T>(GridView gridView, string checkboxName)
|
||||
{
|
||||
var uriBuilder = new UriBuilder(url);
|
||||
var query = HttpUtility.ParseQueryString(uriBuilder.Query);
|
||||
query[paramName] = paramValue;
|
||||
uriBuilder.Query = query.ToString();
|
||||
// Get checked users
|
||||
var userIds = new List<T>();
|
||||
|
||||
return new Uri(uriBuilder.ToString());
|
||||
foreach (GridViewRow gvr in gridView.Rows)
|
||||
{
|
||||
if (((CheckBox)gvr.FindControl(checkboxName)).Checked)
|
||||
{
|
||||
string userId = gridView.DataKeys[gvr.DataItemIndex].Value.ToString();
|
||||
userIds.Add((T)Convert.ChangeType(userId, typeof(T)));
|
||||
}
|
||||
}
|
||||
|
||||
return userIds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,6 +66,24 @@ namespace WebsitePanel.Portal.Code.Helpers
|
|||
|| PackagesHelper.CheckGroupQuotaEnabled(packageId, t.ResourceGroup, t.Quota)
|
||||
select t;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified parameter to the Query String.
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="paramName">Name of the parameter to add.</param>
|
||||
/// <param name="paramValue">Value for the parameter to add.</param>
|
||||
/// <returns>Url with added parameter.</returns>
|
||||
public static Uri AddParameter(this Uri url, string paramName, string paramValue)
|
||||
{
|
||||
var uriBuilder = new UriBuilder(url);
|
||||
var query = HttpUtility.ParseQueryString(uriBuilder.Query);
|
||||
query[paramName] = paramValue;
|
||||
uriBuilder.Query = query.ToString();
|
||||
|
||||
return new Uri(uriBuilder.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public class Tab
|
||||
|
|
|
@ -2,6 +2,15 @@
|
|||
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/UserActions.ascx" TagName="UserActions" TagPrefix="wsp" %>
|
||||
|
||||
<script src="JavaScript/jquery-1.4.4.min.js" type="text/javascript"></script>
|
||||
|
||||
<script language="javascript">
|
||||
function SelectAllCheckboxes(box) {
|
||||
$(".NormalGridView tbody :checkbox").attr("checked", $(box).attr("checked"));
|
||||
}
|
||||
</script>
|
||||
|
||||
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
|
||||
|
||||
|
@ -23,35 +32,45 @@
|
|||
<asp:Button ID="btnCreateMailbox" runat="server" meta:resourcekey="btnCreateMailbox"
|
||||
Text="Create New Mailbox" CssClass="Button1" OnClick="btnCreateMailbox_Click" />
|
||||
</div>
|
||||
<div class="FormButtonsBarCleanRight">
|
||||
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
|
||||
<asp:CheckBox ID="chkMailboxes" runat="server" meta:resourcekey="chkMailboxes" Text="Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged"/>
|
||||
<asp:CheckBox ID="chkResourceMailboxes" runat="server" meta:resourcekey="chkResourceMailboxes" Text="Resource Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged"/>
|
||||
<asp:CheckBox ID="chkSharedMailboxes" runat="server" meta:resourcekey="chkSharedMailboxes" Text="Shared Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged"/>
|
||||
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
|
||||
onselectedindexchanged="ddlPageSize_SelectedIndexChanged">
|
||||
<asp:ListItem>10</asp:ListItem>
|
||||
<asp:ListItem Selected="True">20</asp:ListItem>
|
||||
<asp:ListItem>50</asp:ListItem>
|
||||
|
||||
<asp:ListItem>100</asp:ListItem>
|
||||
|
||||
</asp:DropDownList>
|
||||
<div class="FormButtonsBarCleanMiddle">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<wsp:UserActions ID="userActions" runat="server" OnExecutingUserAction="userActions_OnExecutingUserAction" />
|
||||
</td>
|
||||
<td class="FormButtonsBarCleanSeparatorSmall"></td>
|
||||
<td>
|
||||
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
|
||||
<asp:CheckBox ID="chkMailboxes" runat="server" meta:resourcekey="chkMailboxes" Text="Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" />
|
||||
<asp:CheckBox ID="chkResourceMailboxes" runat="server" meta:resourcekey="chkResourceMailboxes" Text="Resource Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" />
|
||||
<asp:CheckBox ID="chkSharedMailboxes" runat="server" meta:resourcekey="chkSharedMailboxes" Text="Shared Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" />
|
||||
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<asp:ListItem>10</asp:ListItem>
|
||||
<asp:ListItem Selected="True">20</asp:ListItem>
|
||||
<asp:ListItem>50</asp:ListItem>
|
||||
|
||||
<asp:DropDownList ID="ddlSearchColumn" runat="server" CssClass="NormalTextBox">
|
||||
<asp:ListItem Value="DisplayName" meta:resourcekey="ddlSearchColumnDisplayName">DisplayName</asp:ListItem>
|
||||
<asp:ListItem Value="PrimaryEmailAddress" meta:resourcekey="ddlSearchColumnEmail">Email</asp:ListItem>
|
||||
<asp:ListItem Value="AccountName" meta:resourcekey="ddlSearchColumnAccountName">AccountName</asp:ListItem>
|
||||
<asp:ListItem Value="SubscriberNumber" meta:resourcekey="ddlSearchColumnSubscriberNumber">Account Number</asp:ListItem>
|
||||
<asp:ListItem Value="UserPrincipalName" meta:resourcekey="ddlSearchColumnUserPrincipalName">Login</asp:ListItem>
|
||||
</asp:DropDownList><asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
|
||||
CausesValidation="false"/>
|
||||
</asp:Panel>
|
||||
<asp:ListItem>100</asp:ListItem>
|
||||
|
||||
</asp:DropDownList>
|
||||
|
||||
<asp:DropDownList ID="ddlSearchColumn" runat="server" CssClass="NormalTextBox">
|
||||
<asp:ListItem Value="DisplayName" meta:resourcekey="ddlSearchColumnDisplayName">DisplayName</asp:ListItem>
|
||||
<asp:ListItem Value="PrimaryEmailAddress" meta:resourcekey="ddlSearchColumnEmail">Email</asp:ListItem>
|
||||
<asp:ListItem Value="AccountName" meta:resourcekey="ddlSearchColumnAccountName">AccountName</asp:ListItem>
|
||||
<asp:ListItem Value="SubscriberNumber" meta:resourcekey="ddlSearchColumnSubscriberNumber">Account Number</asp:ListItem>
|
||||
<asp:ListItem Value="UserPrincipalName" meta:resourcekey="ddlSearchColumnUserPrincipalName">Login</asp:ListItem>
|
||||
</asp:DropDownList><asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
|
||||
CausesValidation="false" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<asp:GridView ID="gvMailboxes" runat="server" AutoGenerateColumns="False" EnableViewState="true"
|
||||
Width="100%" EmptyDataText="gvMailboxes" CssSelectorClass="NormalGridView"
|
||||
Width="100%" EmptyDataText="gvMailboxes" CssSelectorClass="NormalGridView" DataKeyNames="AccountId"
|
||||
OnRowCommand="gvMailboxes_RowCommand" AllowPaging="True" AllowSorting="True"
|
||||
DataSourceID="odsAccountsPaged" PageSize="20">
|
||||
<Columns>
|
||||
|
@ -60,6 +79,14 @@
|
|||
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage((bool)Eval("Locked"),(bool)Eval("Disabled")) %>' ImageAlign="AbsMiddle" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox ID="selectAll" Runat="server" onclick="javascript:SelectAllCheckboxes(this);" CssClass="HeaderCheckbox"></asp:CheckBox>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkSelectedUsersIds"></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="gvMailboxesDisplayName" SortExpression="DisplayName">
|
||||
<ItemStyle Width="20%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
|
@ -80,7 +107,7 @@
|
|||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="gvServiceLevel">
|
||||
<ItemStyle Width="20%"></ItemStyle>
|
||||
<ItemStyle Width="15%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:Label id="lbServLevel" runat="server" ToolTip = '<%# GetServiceLevel((int)Eval("LevelId")).LevelDescription%>'>
|
||||
<%# GetServiceLevel((int)Eval("LevelId")).LevelName%>
|
||||
|
|
|
@ -69,7 +69,6 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
BindServiceLevels();
|
||||
|
||||
|
||||
if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER))
|
||||
{
|
||||
if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1)
|
||||
|
@ -273,5 +272,42 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
odsAccountsPaged.SelectParameters["accountTypes"].DefaultValue = string.Join(",", accountTypes);
|
||||
}
|
||||
|
||||
protected void userActions_OnExecutingUserAction(object sender, EventArgs e)
|
||||
{
|
||||
// Get checked users
|
||||
var userIds = Utils.GetCheckboxValuesFromGrid<int>(gvMailboxes, "chkSelectedUsersIds");
|
||||
|
||||
if (userActions.SelectedAction != UserActionTypes.None)
|
||||
{
|
||||
if (userIds.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = userActions.DoUserActions(userIds);
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
messageBox.ShowResultMessage(result);
|
||||
return;
|
||||
}
|
||||
|
||||
messageBox.ShowSuccessMessage("ORGANIZATION_USERS_ACTIONS");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
messageBox.ShowErrorMessage("ORGANIZATION_USERS_ACTIONS", ex);
|
||||
}
|
||||
|
||||
// Refresh users grid
|
||||
gvMailboxes.DataBind();
|
||||
}
|
||||
else
|
||||
{
|
||||
messageBox.ShowWarningMessage("ORGANIZATION_USERS_ACTIONS");
|
||||
}
|
||||
}
|
||||
|
||||
userActions.ResetSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,6 +85,15 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnCreateMailbox;
|
||||
|
||||
/// <summary>
|
||||
/// userActions control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.UserActions userActions;
|
||||
|
||||
/// <summary>
|
||||
/// SearchPanel control.
|
||||
/// </summary>
|
||||
|
|
|
@ -3,6 +3,15 @@
|
|||
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/UserActions.ascx" TagName="UserActions" TagPrefix="wsp" %>
|
||||
|
||||
<script src="JavaScript/jquery-1.4.4.min.js" type="text/javascript"></script>
|
||||
|
||||
<script language="javascript">
|
||||
function SelectAllCheckboxes(box) {
|
||||
$(".NormalGridView tbody :checkbox").attr("checked", $(box).attr("checked"));
|
||||
}
|
||||
</script>
|
||||
|
||||
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
|
||||
|
||||
|
@ -25,25 +34,35 @@
|
|||
<asp:Button ID="btnCreateUser" runat="server" meta:resourcekey="btnCreateUser"
|
||||
Text="Create New User" CssClass="Button1" OnClick="btnCreateUser_Click" />
|
||||
</div>
|
||||
<div class="FormButtonsBarCleanRight">
|
||||
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
|
||||
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
|
||||
onselectedindexchanged="ddlPageSize_SelectedIndexChanged">
|
||||
<asp:ListItem>10</asp:ListItem>
|
||||
<asp:ListItem Selected="True">20</asp:ListItem>
|
||||
<asp:ListItem>50</asp:ListItem>
|
||||
<asp:ListItem>100</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<div class="FormButtonsBarCleanMiddle">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<wsp:UserActions ID="userActions" runat="server" OnExecutingUserAction="userActions_OnExecutingUserAction" />
|
||||
</td>
|
||||
<td class="FormButtonsBarCleanSeparator"></td>
|
||||
<td>
|
||||
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
|
||||
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<asp:ListItem>10</asp:ListItem>
|
||||
<asp:ListItem Selected="True">20</asp:ListItem>
|
||||
<asp:ListItem>50</asp:ListItem>
|
||||
<asp:ListItem>100</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
<asp:DropDownList ID="ddlSearchColumn" runat="server" CssClass="NormalTextBox">
|
||||
<asp:ListItem Value="DisplayName" meta:resourcekey="ddlSearchColumnDisplayName">DisplayName</asp:ListItem>
|
||||
<asp:ListItem Value="PrimaryEmailAddress" meta:resourcekey="ddlSearchColumnEmail">Email</asp:ListItem>
|
||||
<asp:ListItem Value="AccountName" meta:resourcekey="ddlSearchColumnAccountName">AccountName</asp:ListItem>
|
||||
<asp:ListItem Value="SubscriberNumber" meta:resourcekey="ddlSearchColumnSubscriberNumber">Account Number</asp:ListItem>
|
||||
<asp:ListItem Value="UserPrincipalName" meta:resourcekey="ddlSearchColumnUserPrincipalName">Login</asp:ListItem>
|
||||
</asp:DropDownList><asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
|
||||
CausesValidation="false"/>
|
||||
</asp:Panel>
|
||||
<asp:DropDownList ID="ddlSearchColumn" runat="server" CssClass="NormalTextBox">
|
||||
<asp:ListItem Value="DisplayName" meta:resourcekey="ddlSearchColumnDisplayName">DisplayName</asp:ListItem>
|
||||
<asp:ListItem Value="PrimaryEmailAddress" meta:resourcekey="ddlSearchColumnEmail">Email</asp:ListItem>
|
||||
<asp:ListItem Value="AccountName" meta:resourcekey="ddlSearchColumnAccountName">AccountName</asp:ListItem>
|
||||
<asp:ListItem Value="SubscriberNumber" meta:resourcekey="ddlSearchColumnSubscriberNumber">Account Number</asp:ListItem>
|
||||
<asp:ListItem Value="UserPrincipalName" meta:resourcekey="ddlSearchColumnUserPrincipalName">Login</asp:ListItem>
|
||||
</asp:DropDownList><asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
|
||||
CausesValidation="false" />
|
||||
</asp:Panel>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<asp:Panel ID="UsersPanel" runat="server">
|
||||
|
@ -59,7 +78,14 @@
|
|||
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage((bool)Eval("Locked"),(bool)Eval("Disabled")) %>' ImageAlign="AbsMiddle" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox ID="selectAll" Runat="server" onclick="javascript:SelectAllCheckboxes(this);" CssClass="HeaderCheckbox"></asp:CheckBox>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkSelectedUsersIds"></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="gvUsersDisplayName" SortExpression="DisplayName">
|
||||
<ItemStyle Width="25%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
|
|
|
@ -388,5 +388,44 @@ namespace WebsitePanel.Portal.HostedSolution
|
|||
messageBox.ShowErrorMessage("ORGANIZATIONS_DELETE_USERS", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void userActions_OnExecutingUserAction(object sender, EventArgs e)
|
||||
{
|
||||
// Get checked users
|
||||
var userIds = Utils.GetCheckboxValuesFromGrid<int>(gvUsers, "chkSelectedUsersIds");
|
||||
|
||||
if (userActions.SelectedAction != UserActionTypes.None)
|
||||
{
|
||||
if (userIds.Count > 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = userActions.DoUserActions(userIds);
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
messageBox.ShowResultMessage(result);
|
||||
return;
|
||||
}
|
||||
|
||||
messageBox.ShowSuccessMessage("ORGANIZATION_USERS_ACTIONS");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
messageBox.ShowErrorMessage("ORGANIZATION_USERS_ACTIONS", ex);
|
||||
}
|
||||
|
||||
// Refresh users grid
|
||||
gvUsers.DataBind();
|
||||
}
|
||||
else
|
||||
{
|
||||
messageBox.ShowWarningMessage("ORGANIZATION_USERS_ACTIONS");
|
||||
}
|
||||
}
|
||||
|
||||
userActions.ResetSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,6 +85,15 @@ namespace WebsitePanel.Portal.HostedSolution {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button btnCreateUser;
|
||||
|
||||
/// <summary>
|
||||
/// userActions control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.UserActions userActions;
|
||||
|
||||
/// <summary>
|
||||
/// SearchPanel control.
|
||||
/// </summary>
|
||||
|
|
|
@ -31,6 +31,7 @@ using System.Web.UI.WebControls;
|
|||
using System.Collections.Generic;
|
||||
using WebsitePanel.Providers.Common;
|
||||
using System.Text;
|
||||
using WebsitePanel.Portal.Code.Helpers;
|
||||
|
||||
namespace WebsitePanel.Portal
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ using System.Web.UI;
|
|||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using WebsitePanel.Portal.Code.Helpers;
|
||||
|
||||
namespace WebsitePanel.Portal
|
||||
{
|
||||
|
|
|
@ -0,0 +1,189 @@
|
|||
<?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="btnDisableCancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="btnDisableOk.Text" xml:space="preserve">
|
||||
<value>Ok</value>
|
||||
</data>
|
||||
<data name="btnEnableCancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="btnEnableOk.Text" xml:space="preserve">
|
||||
<value>Ok</value>
|
||||
</data>
|
||||
<data name="btnServiceLevelCancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="btnServiceLevelOk.Text" xml:space="preserve">
|
||||
<value>Ok</value>
|
||||
</data>
|
||||
<data name="btnVIPCancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="btnVIPOk.Text" xml:space="preserve">
|
||||
<value>Ok</value>
|
||||
</data>
|
||||
<data name="ddlUserActionsItem.Actions" xml:space="preserve">
|
||||
<value>- Actions -</value>
|
||||
</data>
|
||||
<data name="ddlUserActionsItem.Disable" xml:space="preserve">
|
||||
<value>Disable</value>
|
||||
</data>
|
||||
<data name="ddlUserActionsItem.Enable" xml:space="preserve">
|
||||
<value>Enable</value>
|
||||
</data>
|
||||
<data name="ddlUserActionsItem.SetServiceLevel" xml:space="preserve">
|
||||
<value>Set Service Level</value>
|
||||
</data>
|
||||
<data name="ddlUserActionsItem.SetVIP" xml:space="preserve">
|
||||
<value>Set VIP</value>
|
||||
</data>
|
||||
<data name="ddlVIPItem.SetVIP" xml:space="preserve">
|
||||
<value>Set VIP</value>
|
||||
</data>
|
||||
<data name="ddlVIPItem.UnsetVIP" xml:space="preserve">
|
||||
<value>Unset VIP</value>
|
||||
</data>
|
||||
<data name="headerDisable.Text" xml:space="preserve">
|
||||
<value>Disable users</value>
|
||||
</data>
|
||||
<data name="headerEnable.Text" xml:space="preserve">
|
||||
<value>Enable users</value>
|
||||
</data>
|
||||
<data name="headerServiceLevel.Text" xml:space="preserve">
|
||||
<value>Service Level</value>
|
||||
</data>
|
||||
<data name="headerVIP.Text" xml:space="preserve">
|
||||
<value>Set VIP</value>
|
||||
</data>
|
||||
<data name="litDisable.Text" xml:space="preserve">
|
||||
<value>Do you wish to disable all selected users?</value>
|
||||
</data>
|
||||
<data name="litEnable.Text" xml:space="preserve">
|
||||
<value>Do you wish to enable all selected users?</value>
|
||||
</data>
|
||||
<data name="litServiceLevel.text" xml:space="preserve">
|
||||
<value>Please select a Service Level for the all checked users</value>
|
||||
</data>
|
||||
<data name="litVIP.Text" xml:space="preserve">
|
||||
<value>Please select a VIP status for the all checked users</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,135 @@
|
|||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserActions.ascx.cs" Inherits="WebsitePanel.Portal.UserActions" %>
|
||||
<script language="javascript">
|
||||
function CloseAndShowProgressDialog(text) {
|
||||
$(".Popup").hide();
|
||||
return ShowProgressDialog(text);
|
||||
}
|
||||
</script>
|
||||
<asp:UpdatePanel ID="tblActions" runat="server" CssClass="NormalBold" UpdateMode="Conditional" ChildrenAsTriggers="true" >
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:DropDownList ID="ddlUserActions" runat="server" CssClass="NormalTextBox" resourcekey="ddlUserActions"
|
||||
AutoPostBack="True" OnSelectedIndexChanged="ddlUserActions_OnSelectedIndexChanged">
|
||||
<asp:ListItem Value="0">Actions</asp:ListItem>
|
||||
<asp:ListItem Value="1">Disable</asp:ListItem>
|
||||
<asp:ListItem Value="2">Enable</asp:ListItem>
|
||||
<asp:ListItem Value="3">SetServiceLevel</asp:ListItem>
|
||||
<asp:ListItem Value="4">SetVIP</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
<ajaxToolkit:ModalPopupExtender ID="Modal" runat="server" EnableViewState="true" TargetControlID="FakeModalPopupTarget"
|
||||
PopupControlID="EnablePanel" BackgroundCssClass="modalBackground" DropShadow="false" />
|
||||
|
||||
<%-- Enable --%>
|
||||
<asp:Panel ID="EnablePanel" runat="server" CssClass="Popup" Style="display: none">
|
||||
<table class="Popup-Header">
|
||||
<tr>
|
||||
<td class="Popup-HeaderLeft"></td>
|
||||
<td class="Popup-HeaderTitle"><asp:Localize ID="headerEnable" runat="server" meta:resourcekey="headerEnable"></asp:Localize></td>
|
||||
<td class="Popup-HeaderRight"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="Popup-Content">
|
||||
<div class="Popup-Body">
|
||||
<br/>
|
||||
<asp:Literal ID="litEnable" runat="server" meta:resourcekey="litEnable"></asp:Literal>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="FormFooterMiddle">
|
||||
<asp:Button ID="btnEnableOk" runat="server" CssClass="Button1" meta:resourcekey="btnEnableOk" Text="Ok"
|
||||
OnClientClick="return CloseAndShowProgressDialog('Enabling users...')" OnClick="btnModalOk_Click" />
|
||||
<asp:Button ID="btnEnableCancel" runat="server" CssClass="Button1" meta:resourcekey="btnEnableCancel" Text="Cancel"
|
||||
OnClick="btnModalCancel_OnClick" CausesValidation="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
|
||||
<%-- Disable --%>
|
||||
<asp:Panel ID="DisablePanel" runat="server" CssClass="Popup" Style="display: none">
|
||||
<table class="Popup-Header">
|
||||
<tr>
|
||||
<td class="Popup-HeaderLeft"></td>
|
||||
<td class="Popup-HeaderTitle"><asp:Localize ID="headerDisable" runat="server" meta:resourcekey="headerDisable"></asp:Localize></td>
|
||||
<td class="Popup-HeaderRight"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="Popup-Content">
|
||||
<div class="Popup-Body">
|
||||
<br/>
|
||||
<asp:Literal ID="litDisable" runat="server" meta:resourcekey="litDisable"></asp:Literal>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="FormFooterMiddle">
|
||||
<asp:Button ID="btnDisableOk" runat="server" CssClass="Button1" meta:resourcekey="btnDisableOk" Text="Ok"
|
||||
OnClientClick="return CloseAndShowProgressDialog('Disabling users...')" OnClick="btnModalOk_Click" />
|
||||
<asp:Button ID="btnDisableCancel" runat="server" CssClass="Button1" meta:resourcekey="btnDisableCancel" Text="Cancel"
|
||||
OnClick="btnModalCancel_OnClick" CausesValidation="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
|
||||
<%--Set Service Level--%>
|
||||
<asp:Panel ID="ServiceLevelPanel" runat="server" CssClass="Popup" Style="display: none">
|
||||
<table class="Popup-Header">
|
||||
<tr>
|
||||
<td class="Popup-HeaderLeft"></td>
|
||||
<td class="Popup-HeaderTitle"><asp:Localize ID="headerServiceLevel" runat="server" meta:resourcekey="headerServiceLevel"></asp:Localize></td>
|
||||
<td class="Popup-HeaderRight"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="Popup-Content">
|
||||
<div class="Popup-Body">
|
||||
<br/>
|
||||
<asp:Literal ID="litServiceLevel" runat="server" meta:resourcekey="litServiceLevel"></asp:Literal>
|
||||
<br/>
|
||||
<asp:DropDownList ID="ddlServiceLevels" runat="server" CssClass="NormalTextBox" />
|
||||
<br/>
|
||||
</div>
|
||||
<div class="FormFooterMiddle">
|
||||
<asp:Button ID="btnServiceLevelOk" runat="server" CssClass="Button1" meta:resourcekey="btnServiceLevelOk" Text="Ok"
|
||||
OnClientClick="return CloseAndShowProgressDialog('Setting Service Level...')" OnClick="btnModalOk_Click" />
|
||||
<asp:Button ID="btnServiceLevelCancel" runat="server" CssClass="Button1" meta:resourcekey="btnServiceLevelCancel" Text="Cancel"
|
||||
OnClick="btnModalCancel_OnClick" CausesValidation="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
|
||||
<%-- VIP --%>
|
||||
<asp:Panel ID="VIPPanel" runat="server" CssClass="Popup" Style="display: none">
|
||||
<table class="Popup-Header">
|
||||
<tr>
|
||||
<td class="Popup-HeaderLeft"></td>
|
||||
<td class="Popup-HeaderTitle"><asp:Localize ID="headerVIP" runat="server" meta:resourcekey="headerVIP"></asp:Localize></td>
|
||||
<td class="Popup-HeaderRight"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="Popup-Content">
|
||||
<div class="Popup-Body">
|
||||
<br/>
|
||||
<asp:Literal ID="litVIP" runat="server" meta:resourcekey="litVIP"></asp:Literal>
|
||||
<br/>
|
||||
<asp:DropDownList ID="ddlVIP" runat="server" CssClass="NormalTextBox" resourcekey="ddlVIP">
|
||||
<asp:ListItem Value="0">SetVIP</asp:ListItem>
|
||||
<asp:ListItem Value="1">UnsetVIP</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="FormFooterMiddle">
|
||||
<asp:Button ID="btnVIPOk" runat="server" CssClass="Button1" meta:resourcekey="btnVIPOk" Text="Ok"
|
||||
OnClientClick="return CloseAndShowProgressDialog('Setting VIP...')" OnClick="btnModalOk_Click" />
|
||||
<asp:Button ID="btnVIPCancel" runat="server" CssClass="Button1" meta:resourcekey="btnVIPCancel" Text="Cancel"
|
||||
OnClick="btnModalCancel_OnClick" CausesValidation="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
|
||||
<asp:Button ID="FakeModalPopupTarget" runat="server" Style="display: none;" />
|
||||
</ContentTemplate>
|
||||
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="btnDisableOk" />
|
||||
<asp:PostBackTrigger ControlID="btnEnableOk" />
|
||||
<asp:PostBackTrigger ControlID="btnServiceLevelOk" />
|
||||
<asp:PostBackTrigger ControlID="btnVIPOk" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
|
@ -0,0 +1,253 @@
|
|||
// Copyright (c) 2015, 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.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
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 Microsoft.Web.Services3.Referral;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
|
||||
namespace WebsitePanel.Portal
|
||||
{
|
||||
public enum UserActionTypes
|
||||
{
|
||||
None = 0,
|
||||
Disable = 1,
|
||||
Enable = 2,
|
||||
SetServiceLevel = 3,
|
||||
SetVIP = 4,
|
||||
}
|
||||
|
||||
public partial class UserActions : WebsitePanelControlBase
|
||||
{
|
||||
public event EventHandler ExecutingUserAction;
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// Remove Service Level item and VIP item from Action List if current Hosting plan does not allow Service Levels
|
||||
if (!PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId).Groups.ContainsKey(ResourceGroups.ServiceLevels))
|
||||
{
|
||||
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(UserActionTypes.SetServiceLevel.ToString()));
|
||||
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(UserActionTypes.SetVIP.ToString()));
|
||||
}
|
||||
}
|
||||
|
||||
public UserActionTypes SelectedAction
|
||||
{
|
||||
get
|
||||
{
|
||||
return (UserActionTypes)Convert.ToInt32(ddlUserActions.SelectedValue);
|
||||
}
|
||||
}
|
||||
|
||||
protected void ddlUserActions_OnSelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
switch (SelectedAction)
|
||||
{
|
||||
case UserActionTypes.Disable:
|
||||
Modal.PopupControlID = DisablePanel.ID;
|
||||
break;
|
||||
case UserActionTypes.Enable:
|
||||
Modal.PopupControlID = EnablePanel.ID;
|
||||
break;
|
||||
case UserActionTypes.SetServiceLevel:
|
||||
FillServiceLevelsList();
|
||||
Modal.PopupControlID = ServiceLevelPanel.ID;
|
||||
break;
|
||||
case UserActionTypes.SetVIP:
|
||||
Modal.PopupControlID = VIPPanel.ID;
|
||||
break;
|
||||
}
|
||||
|
||||
Modal.Show();
|
||||
}
|
||||
|
||||
public int DoUserActions(List<int> userIds)
|
||||
{
|
||||
switch (SelectedAction)
|
||||
{
|
||||
case UserActionTypes.Disable:
|
||||
return ChangeUsersSettings(userIds, true, null, null);
|
||||
case UserActionTypes.Enable:
|
||||
return ChangeUsersSettings(userIds, false, null, null);
|
||||
case UserActionTypes.SetServiceLevel:
|
||||
return ChangeUsersSettings(userIds, null, SelectedServiceId, null);
|
||||
case UserActionTypes.SetVIP:
|
||||
return ChangeUsersSettings(userIds, null, null, SelectedVIP);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void btnModalOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ExecutingUserAction != null)
|
||||
ExecutingUserAction(this, new EventArgs());
|
||||
}
|
||||
protected void btnModalCancel_OnClick(object sender, EventArgs e)
|
||||
{
|
||||
ResetSelection();
|
||||
}
|
||||
|
||||
public void ResetSelection()
|
||||
{
|
||||
ddlUserActions.ClearSelection();
|
||||
}
|
||||
|
||||
protected int ChangeUsersSettings(List<int> userIds, bool? disable, int? serviceLevelId, bool? isVIP)
|
||||
{
|
||||
foreach (var userId in userIds)
|
||||
{
|
||||
OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, userId);
|
||||
|
||||
int result = ES.Services.Organizations.SetUserGeneralSettings(
|
||||
PanelRequest.ItemID,
|
||||
userId,
|
||||
|
||||
user.DisplayName,
|
||||
string.Empty,
|
||||
false,
|
||||
disable ?? user.Disabled,
|
||||
user.Locked,
|
||||
|
||||
user.FirstName,
|
||||
user.Initials,
|
||||
user.LastName,
|
||||
|
||||
user.Address,
|
||||
user.City,
|
||||
user.State,
|
||||
user.Zip,
|
||||
user.Country,
|
||||
|
||||
user.JobTitle,
|
||||
user.Company,
|
||||
user.Department,
|
||||
user.Office,
|
||||
user.Manager != null ? user.Manager.AccountName : String.Empty,
|
||||
|
||||
user.BusinessPhone,
|
||||
user.Fax,
|
||||
user.HomePhone,
|
||||
user.MobilePhone,
|
||||
user.Pager,
|
||||
user.WebPage,
|
||||
user.Notes,
|
||||
user.ExternalEmail,
|
||||
user.SubscriberNumber,
|
||||
serviceLevelId ?? user.LevelId,
|
||||
isVIP ?? user.IsVIP);
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#region ServiceLevel
|
||||
|
||||
protected int? SelectedServiceId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ddlServiceLevels.SelectedValue == string.Empty)
|
||||
return null;
|
||||
|
||||
return Convert.ToInt32(ddlServiceLevels.SelectedValue);
|
||||
}
|
||||
}
|
||||
|
||||
protected void FillServiceLevelsList()
|
||||
{
|
||||
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
|
||||
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels))
|
||||
{
|
||||
List<ServiceLevel> enabledServiceLevels = new List<ServiceLevel>();
|
||||
|
||||
foreach (var quota in cntx.Quotas.Where(x => x.Key.Contains(Quotas.SERVICE_LEVELS)))
|
||||
{
|
||||
foreach (var serviceLevel in ES.Services.Organizations.GetSupportServiceLevels())
|
||||
{
|
||||
if (quota.Key.Replace(Quotas.SERVICE_LEVELS, "") == serviceLevel.LevelName && CheckServiceLevelQuota(quota.Value))
|
||||
{
|
||||
enabledServiceLevels.Add(serviceLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ddlServiceLevels.DataSource = enabledServiceLevels;
|
||||
ddlServiceLevels.DataTextField = "LevelName";
|
||||
ddlServiceLevels.DataValueField = "LevelId";
|
||||
ddlServiceLevels.DataBind();
|
||||
|
||||
ddlServiceLevels.Items.Insert(0, new ListItem("<Select Service Level>", string.Empty));
|
||||
ddlServiceLevels.Items.FindByValue(string.Empty).Selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckServiceLevelQuota(QuotaValueInfo quota)
|
||||
{
|
||||
if (quota.QuotaAllocatedValue != -1)
|
||||
{
|
||||
return quota.QuotaAllocatedValue > quota.QuotaUsedValue;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region VIP
|
||||
|
||||
protected bool? SelectedVIP
|
||||
{
|
||||
get { return ddlVIP.SelectedValue == "0"; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,277 @@
|
|||
// Copyright (c) 2015, 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.
|
||||
//
|
||||
// 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 UserActions {
|
||||
|
||||
/// <summary>
|
||||
/// tblActions 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 tblActions;
|
||||
|
||||
/// <summary>
|
||||
/// ddlUserActions 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 ddlUserActions;
|
||||
|
||||
/// <summary>
|
||||
/// Modal control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::AjaxControlToolkit.ModalPopupExtender Modal;
|
||||
|
||||
/// <summary>
|
||||
/// EnablePanel 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 EnablePanel;
|
||||
|
||||
/// <summary>
|
||||
/// headerEnable 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 headerEnable;
|
||||
|
||||
/// <summary>
|
||||
/// litEnable 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 litEnable;
|
||||
|
||||
/// <summary>
|
||||
/// btnEnableOk 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 btnEnableOk;
|
||||
|
||||
/// <summary>
|
||||
/// btnEnableCancel 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 btnEnableCancel;
|
||||
|
||||
/// <summary>
|
||||
/// DisablePanel 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 DisablePanel;
|
||||
|
||||
/// <summary>
|
||||
/// headerDisable 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 headerDisable;
|
||||
|
||||
/// <summary>
|
||||
/// litDisable 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 litDisable;
|
||||
|
||||
/// <summary>
|
||||
/// btnDisableOk 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 btnDisableOk;
|
||||
|
||||
/// <summary>
|
||||
/// btnDisableCancel 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 btnDisableCancel;
|
||||
|
||||
/// <summary>
|
||||
/// ServiceLevelPanel 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 ServiceLevelPanel;
|
||||
|
||||
/// <summary>
|
||||
/// headerServiceLevel 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 headerServiceLevel;
|
||||
|
||||
/// <summary>
|
||||
/// litServiceLevel 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 litServiceLevel;
|
||||
|
||||
/// <summary>
|
||||
/// ddlServiceLevels 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 ddlServiceLevels;
|
||||
|
||||
/// <summary>
|
||||
/// btnServiceLevelOk 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 btnServiceLevelOk;
|
||||
|
||||
/// <summary>
|
||||
/// btnServiceLevelCancel 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 btnServiceLevelCancel;
|
||||
|
||||
/// <summary>
|
||||
/// VIPPanel 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 VIPPanel;
|
||||
|
||||
/// <summary>
|
||||
/// headerVIP 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 headerVIP;
|
||||
|
||||
/// <summary>
|
||||
/// litVIP 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 litVIP;
|
||||
|
||||
/// <summary>
|
||||
/// ddlVIP 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 ddlVIP;
|
||||
|
||||
/// <summary>
|
||||
/// btnVIPOk 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 btnVIPOk;
|
||||
|
||||
/// <summary>
|
||||
/// btnVIPCancel 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 btnVIPCancel;
|
||||
|
||||
/// <summary>
|
||||
/// FakeModalPopupTarget 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 FakeModalPopupTarget;
|
||||
}
|
||||
}
|
|
@ -891,6 +891,13 @@
|
|||
<Compile Include="UserControls\ItemButtonPanel.ascx.designer.cs">
|
||||
<DependentUpon>ItemButtonPanel.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControls\UserActions.ascx.cs">
|
||||
<DependentUpon>UserActions.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UserControls\UserActions.ascx.designer.cs">
|
||||
<DependentUpon>UserActions.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserOrganization.ascx.cs">
|
||||
<DependentUpon>UserOrganization.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
@ -4473,6 +4480,7 @@
|
|||
<Content Include="UserControls\PackagePhoneNumbers.ascx" />
|
||||
<Content Include="Lync\UserControls\AllocatePackagePhoneNumbers.ascx" />
|
||||
<Content Include="UserControls\ItemButtonPanel.ascx" />
|
||||
<Content Include="UserControls\UserActions.ascx" />
|
||||
<Content Include="UserOrganization.ascx" />
|
||||
<Content Include="VPSForPC\MonitoringPage.aspx" />
|
||||
<Content Include="VPSForPC\VdcAccountVLanAdd.ascx" />
|
||||
|
@ -4541,6 +4549,7 @@
|
|||
<Content Include="PhoneNumbers.ascx" />
|
||||
<Content Include="PhoneNumbersAddPhoneNumber.ascx" />
|
||||
<Content Include="PhoneNumbersEditPhoneNumber.ascx" />
|
||||
<Content Include="UserControls\App_LocalResources\UserActions.ascx.resx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="App_LocalResources\BandwidthReport.ascx.resx">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue