Ability to set system and reseller lync and exchange mailbox plans as a default
plan added
This commit is contained in:
parent
555fb75d5d
commit
62f478010c
7 changed files with 112 additions and 2 deletions
|
@ -5775,9 +5775,81 @@ GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/****** Object: Table [dbo].[ExchangeOrganizations] Extend Exchange Accounts with ExchangeMailboxPlanID ******/
|
||||||
|
IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeOrganizations' AND COLS.name='ExchangeMailboxPlanID')
|
||||||
|
BEGIN
|
||||||
|
ALTER TABLE [dbo].[ExchangeOrganizations] ADD [ExchangeMailboxPlanID] [int]
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/****** Object: Table [dbo].[ExchangeOrganizations] Extend Exchange Accounts with LyncUserPlanID ******/
|
||||||
|
IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeOrganizations' AND COLS.name='LyncUserPlanID')
|
||||||
|
BEGIN
|
||||||
|
ALTER TABLE [dbo].[ExchangeOrganizations] ADD [LyncUserPlanID] [int]
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[SetOrganizationDefaultLyncUserPlan]
|
||||||
|
(
|
||||||
|
@ItemID int,
|
||||||
|
@LyncUserPlanId int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
UPDATE ExchangeOrganizations SET
|
||||||
|
LyncUserPlanID = @LyncUserPlanId
|
||||||
|
WHERE
|
||||||
|
ItemID = @ItemID
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER PROCEDURE [dbo].[SetOrganizationDefaultExchangeMailboxPlan]
|
||||||
|
(
|
||||||
|
@ItemID int,
|
||||||
|
@MailboxPlanId int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
UPDATE ExchangeOrganizations SET
|
||||||
|
ExchangeMailboxPlanID = @MailboxPlanId
|
||||||
|
WHERE
|
||||||
|
ItemID = @ItemID
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeOrganization')
|
||||||
|
BEGIN
|
||||||
|
EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeOrganization]
|
||||||
|
(
|
||||||
|
@ItemID int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
SELECT
|
||||||
|
ItemID,
|
||||||
|
ExchangeMailboxPlanID,
|
||||||
|
LyncUserPlanID
|
||||||
|
FROM
|
||||||
|
ExchangeOrganizations
|
||||||
|
WHERE
|
||||||
|
ItemID = @ItemID
|
||||||
|
RETURN'
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
|
@ -2570,6 +2570,18 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static IDataReader GetExchangeOrganization(int itemId)
|
||||||
|
{
|
||||||
|
return SqlHelper.ExecuteReader(
|
||||||
|
ConnectionString,
|
||||||
|
CommandType.StoredProcedure,
|
||||||
|
"GetExchangeOrganization",
|
||||||
|
new SqlParameter("@ItemID", itemId)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void SetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId)
|
public static void SetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId)
|
||||||
{
|
{
|
||||||
SqlHelper.ExecuteNonQuery(
|
SqlHelper.ExecuteNonQuery(
|
||||||
|
|
|
@ -2647,6 +2647,17 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
else
|
else
|
||||||
ExchangeServerController.GetExchangeMailboxPlansByUser(0, user, ref mailboxPlans);
|
ExchangeServerController.GetExchangeMailboxPlansByUser(0, user, ref mailboxPlans);
|
||||||
|
|
||||||
|
|
||||||
|
ExchangeOrganization ExchangeOrg = ObjectUtils.FillObjectFromDataReader<ExchangeOrganization>(DataProvider.GetExchangeOrganization(itemId));
|
||||||
|
|
||||||
|
if (ExchangeOrg != null)
|
||||||
|
{
|
||||||
|
foreach (ExchangeMailboxPlan p in mailboxPlans)
|
||||||
|
{
|
||||||
|
p.IsDefault = (p.MailboxPlanId == ExchangeOrg.ExchangeMailboxPlanID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return mailboxPlans;
|
return mailboxPlans;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
@ -548,6 +548,18 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
|
||||||
else
|
else
|
||||||
LyncController.GetLyncUserPlansByUser(0, user, ref plans);
|
LyncController.GetLyncUserPlansByUser(0, user, ref plans);
|
||||||
|
|
||||||
|
|
||||||
|
ExchangeOrganization ExchangeOrg = ObjectUtils.FillObjectFromDataReader<ExchangeOrganization>(DataProvider.GetExchangeOrganization(itemId));
|
||||||
|
|
||||||
|
if (ExchangeOrg != null)
|
||||||
|
{
|
||||||
|
foreach (LyncUserPlan p in plans)
|
||||||
|
{
|
||||||
|
p.IsDefault = (p.LyncUserPlanId == ExchangeOrg.LyncUserPlanID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return plans;
|
return plans;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
@ -80,6 +80,7 @@
|
||||||
<Compile Include="HostedSolution\BlackBerryErrorsCodes.cs" />
|
<Compile Include="HostedSolution\BlackBerryErrorsCodes.cs" />
|
||||||
<Compile Include="HostedSolution\BlackBerryStatsItem.cs" />
|
<Compile Include="HostedSolution\BlackBerryStatsItem.cs" />
|
||||||
<Compile Include="HostedSolution\BlackBerryUserDeleteState.cs" />
|
<Compile Include="HostedSolution\BlackBerryUserDeleteState.cs" />
|
||||||
|
<Compile Include="HostedSolution\ExchangeOrganization.cs" />
|
||||||
<Compile Include="HostedSolution\ExchangeAcceptedDomainType.cs" />
|
<Compile Include="HostedSolution\ExchangeAcceptedDomainType.cs" />
|
||||||
<Compile Include="HostedSolution\ExchangeMailboxPlanType.cs" />
|
<Compile Include="HostedSolution\ExchangeMailboxPlanType.cs" />
|
||||||
<Compile Include="HostedSolution\ExchangeMailboxPlan.cs" />
|
<Compile Include="HostedSolution\ExchangeMailboxPlan.cs" />
|
||||||
|
|
|
@ -142,6 +142,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId);
|
ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId);
|
||||||
|
|
||||||
if (plan.MailboxPlanType > 0)
|
if (plan.MailboxPlanType > 0)
|
||||||
|
@ -150,7 +151,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
BindMailboxPlans();
|
BindMailboxPlans();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
ES.Services.ExchangeServer.SetOrganizationDefaultExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId);
|
ES.Services.ExchangeServer.SetOrganizationDefaultExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId);
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,7 @@ namespace WebsitePanel.Portal.Lync
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
LyncUserPlan plan = ES.Services.Lync.GetLyncUserPlan(PanelRequest.ItemID, planId);
|
LyncUserPlan plan = ES.Services.Lync.GetLyncUserPlan(PanelRequest.ItemID, planId);
|
||||||
|
|
||||||
if (plan.LyncUserPlanType > 0)
|
if (plan.LyncUserPlanType > 0)
|
||||||
|
@ -152,7 +153,7 @@ namespace WebsitePanel.Portal.Lync
|
||||||
BindPlans();
|
BindPlans();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
ES.Services.Lync.SetOrganizationDefaultLyncUserPlan(PanelRequest.ItemID, planId);
|
ES.Services.Lync.SetOrganizationDefaultLyncUserPlan(PanelRequest.ItemID, planId);
|
||||||
|
|
||||||
ShowSuccessMessage("REQUEST_COMPLETED_SUCCESFULLY");
|
ShowSuccessMessage("REQUEST_COMPLETED_SUCCESFULLY");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue