CRM Module update

This commit is contained in:
dev_amdtel 2013-12-01 01:06:32 +04:00
parent 2b68bfb8bf
commit 18cd090671
37 changed files with 2067 additions and 204 deletions

View file

@ -2604,6 +2604,127 @@ BEGIN
END
GO
-- CRM
-- CRM Provider fix
UPDATE Providers SET EditorControl = 'CRM2011' Where ProviderID = 1201;
-- CRM Quota
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedCRM.MaxDatabaseSize')
BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (460, 21, 4, N'HostedCRM.MaxDatabaseSize', N'Max Database Size, MB',3, 0 , NULL)
END
GO
BEGIN
UPDATE [dbo].[Quotas] SET QuotaDescription = 'Full licenses per organization' WHERE [QuotaName] = 'HostedCRM.Users'
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedCRM.LimitedUsers')
BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (461, 21, 3, N'HostedCRM.LimitedUsers', N'Limited licenses per organization',3, 0 , NULL)
END
GO
-- CRM Users
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='CRMUsers' AND COLS.name='CALType')
BEGIN
ALTER TABLE [dbo].[CRMUsers] ADD
[CALType] [int] NULL;
UPDATE [dbo].[CRMUsers]
SET
CALType = 0;
END
GO
ALTER PROCEDURE [dbo].[InsertCRMUser]
(
@ItemID int,
@CrmUserID uniqueidentifier,
@BusinessUnitID uniqueidentifier,
@CALType int
)
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO
CRMUsers
(
AccountID,
CRMUserGuid,
BusinessUnitID,
CALType
)
VALUES
(
@ItemID,
@CrmUserID,
@BusinessUnitID,
@CALType
)
END
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateCRMUser')
DROP PROCEDURE UpdateCRMUser
GO
CREATE PROCEDURE [dbo].[UpdateCRMUser]
(
@ItemID int,
@CALType int
)
AS
BEGIN
SET NOCOUNT ON;
UPDATE [dbo].[CRMUsers]
SET
CALType = @CALType
WHERE AccountID = @ItemID
END
GO
ALTER PROCEDURE [dbo].[GetCRMUsersCount]
(
@ItemID int,
@Name nvarchar(400),
@Email nvarchar(400),
@CALType int
)
AS
BEGIN
IF (@Name IS NULL)
BEGIN
SET @Name = '%'
END
IF (@Email IS NULL)
BEGIN
SET @Email = '%'
END
SELECT
COUNT(ea.AccountID)
FROM
ExchangeAccounts ea
INNER JOIN
CRMUsers cu
ON
ea.AccountID = cu.AccountID
WHERE
ea.ItemID = @ItemID AND ea.DisplayName LIKE @Name AND ea.PrimaryEmailAddress LIKE @Email
AND ((cu.CALType = @CALType) OR (@CALType = -1))
END
GO

View file

@ -156,8 +156,11 @@ order by rg.groupOrder
public const string ORGANIZATION_DOMAINS = "HostedSolution.Domains";
public const string ORGANIZATION_ALLOWCHANGEUPN = "HostedSolution.AllowChangeUPN";
public const string ORGANIZATION_SECURITYGROUPMANAGEMENT = "HostedSolution.SecurityGroupManagement";
public const string CRM_USERS = "HostedCRM.Users";
public const string CRM_ORGANIZATION = "HostedCRM.Organization";
public const string CRM_LIMITEDUSERS = "HostedCRM.LimitedUsers";
public const string CRM_MAXDATABASESIZE = "HostedCRM.MaxDatabaseSize";
public const string VPS_SERVERS_NUMBER = "VPS.ServersNumber"; // Number of VPS
public const string VPS_MANAGING_ALLOWED = "VPS.ManagingAllowed"; // Allow user to create VPS

View file

@ -29,7 +29,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
// Runtime Version:2.0.50727.5466
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -38,19 +38,21 @@
//
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
//
//
using WebsitePanel.Providers;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.ResultObjects;
//
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
//
namespace WebsitePanel.EnterpriseServer {
using System.Diagnostics;
using System.Xml.Serialization;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;
using System.Diagnostics;
/// <remarks/>
@ -81,13 +83,21 @@ namespace WebsitePanel.EnterpriseServer {
private System.Threading.SendOrPostCallback SetUserRolesOperationCompleted;
private System.Threading.SendOrPostCallback SetUserCALTypeOperationCompleted;
private System.Threading.SendOrPostCallback ChangeUserStateOperationCompleted;
private System.Threading.SendOrPostCallback GetCrmUserOperationCompleted;
private System.Threading.SendOrPostCallback SetMaxDBSizeOperationCompleted;
private System.Threading.SendOrPostCallback GetDBSizeOperationCompleted;
private System.Threading.SendOrPostCallback GetMaxDBSizeOperationCompleted;
/// <remarks/>
public esCRM() {
this.Url = "http://localhost/WebsitePanelEnterpriseServer/esCRM.asmx";
this.Url = "http://localhost:9002/esCRM.asmx";
}
/// <remarks/>
@ -120,12 +130,24 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/>
public event SetUserRolesCompletedEventHandler SetUserRolesCompleted;
/// <remarks/>
public event SetUserCALTypeCompletedEventHandler SetUserCALTypeCompleted;
/// <remarks/>
public event ChangeUserStateCompletedEventHandler ChangeUserStateCompleted;
/// <remarks/>
public event GetCrmUserCompletedEventHandler GetCrmUserCompleted;
/// <remarks/>
public event SetMaxDBSizeCompletedEventHandler SetMaxDBSizeCompleted;
/// <remarks/>
public event GetDBSizeCompletedEventHandler GetDBSizeCompleted;
/// <remarks/>
public event GetMaxDBSizeCompletedEventHandler GetMaxDBSizeCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreateOrganization", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public OrganizationResult CreateOrganization(int organizationId, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string regionName, int userId, string collation) {
@ -369,20 +391,22 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetCRMUserCount", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public IntResult GetCRMUserCount(int itemId, string name, string email) {
public IntResult GetCRMUserCount(int itemId, string name, string email, int CALType) {
object[] results = this.Invoke("GetCRMUserCount", new object[] {
itemId,
name,
email});
email,
CALType});
return ((IntResult)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetCRMUserCount(int itemId, string name, string email, System.AsyncCallback callback, object asyncState) {
public System.IAsyncResult BeginGetCRMUserCount(int itemId, string name, string email, int CALType, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetCRMUserCount", new object[] {
itemId,
name,
email}, callback, asyncState);
email,
CALType}, callback, asyncState);
}
/// <remarks/>
@ -392,19 +416,20 @@ namespace WebsitePanel.EnterpriseServer {
}
/// <remarks/>
public void GetCRMUserCountAsync(int itemId, string name, string email) {
this.GetCRMUserCountAsync(itemId, name, email, null);
public void GetCRMUserCountAsync(int itemId, string name, string email, int CALType) {
this.GetCRMUserCountAsync(itemId, name, email, CALType, null);
}
/// <remarks/>
public void GetCRMUserCountAsync(int itemId, string name, string email, object userState) {
public void GetCRMUserCountAsync(int itemId, string name, string email, int CALType, object userState) {
if ((this.GetCRMUserCountOperationCompleted == null)) {
this.GetCRMUserCountOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCRMUserCountOperationCompleted);
}
this.InvokeAsync("GetCRMUserCount", new object[] {
itemId,
name,
email}, this.GetCRMUserCountOperationCompleted, userState);
email,
CALType}, this.GetCRMUserCountOperationCompleted, userState);
}
private void OnGetCRMUserCountOperationCompleted(object arg) {
@ -416,22 +441,24 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreateCRMUser", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public UserResult CreateCRMUser(OrganizationUser user, int packageId, int itemId, System.Guid businessUnitOrgId) {
public UserResult CreateCRMUser(OrganizationUser user, int packageId, int itemId, System.Guid businessUnitOrgId, int CALType) {
object[] results = this.Invoke("CreateCRMUser", new object[] {
user,
packageId,
itemId,
businessUnitOrgId});
businessUnitOrgId,
CALType});
return ((UserResult)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginCreateCRMUser(OrganizationUser user, int packageId, int itemId, System.Guid businessUnitOrgId, System.AsyncCallback callback, object asyncState) {
public System.IAsyncResult BeginCreateCRMUser(OrganizationUser user, int packageId, int itemId, System.Guid businessUnitOrgId, int CALType, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("CreateCRMUser", new object[] {
user,
packageId,
itemId,
businessUnitOrgId}, callback, asyncState);
businessUnitOrgId,
CALType}, callback, asyncState);
}
/// <remarks/>
@ -441,12 +468,12 @@ namespace WebsitePanel.EnterpriseServer {
}
/// <remarks/>
public void CreateCRMUserAsync(OrganizationUser user, int packageId, int itemId, System.Guid businessUnitOrgId) {
this.CreateCRMUserAsync(user, packageId, itemId, businessUnitOrgId, null);
public void CreateCRMUserAsync(OrganizationUser user, int packageId, int itemId, System.Guid businessUnitOrgId, int CALType) {
this.CreateCRMUserAsync(user, packageId, itemId, businessUnitOrgId, CALType, null);
}
/// <remarks/>
public void CreateCRMUserAsync(OrganizationUser user, int packageId, int itemId, System.Guid businessUnitOrgId, object userState) {
public void CreateCRMUserAsync(OrganizationUser user, int packageId, int itemId, System.Guid businessUnitOrgId, int CALType, object userState) {
if ((this.CreateCRMUserOperationCompleted == null)) {
this.CreateCRMUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateCRMUserOperationCompleted);
}
@ -454,7 +481,8 @@ namespace WebsitePanel.EnterpriseServer {
user,
packageId,
itemId,
businessUnitOrgId}, this.CreateCRMUserOperationCompleted, userState);
businessUnitOrgId,
CALType}, this.CreateCRMUserOperationCompleted, userState);
}
private void OnCreateCRMUserOperationCompleted(object arg) {
@ -605,6 +633,56 @@ namespace WebsitePanel.EnterpriseServer {
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetUserCALType", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public ResultObject SetUserCALType(int itemId, int accountId, int packageId, int CALType) {
object[] results = this.Invoke("SetUserCALType", new object[] {
itemId,
accountId,
packageId,
CALType});
return ((ResultObject)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginSetUserCALType(int itemId, int accountId, int packageId, int CALType, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetUserCALType", new object[] {
itemId,
accountId,
packageId,
CALType}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndSetUserCALType(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void SetUserCALTypeAsync(int itemId, int accountId, int packageId, int CALType) {
this.SetUserCALTypeAsync(itemId, accountId, packageId, CALType, null);
}
/// <remarks/>
public void SetUserCALTypeAsync(int itemId, int accountId, int packageId, int CALType, object userState) {
if ((this.SetUserCALTypeOperationCompleted == null)) {
this.SetUserCALTypeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserCALTypeOperationCompleted);
}
this.InvokeAsync("SetUserCALType", new object[] {
itemId,
accountId,
packageId,
CALType}, this.SetUserCALTypeOperationCompleted, userState);
}
private void OnSetUserCALTypeOperationCompleted(object arg) {
if ((this.SetUserCALTypeCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetUserCALTypeCompleted(this, new SetUserCALTypeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ChangeUserState", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public ResultObject ChangeUserState(int itemId, int accountId, bool disable) {
@ -696,41 +774,147 @@ namespace WebsitePanel.EnterpriseServer {
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetMaxDBSize", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public ResultObject SetMaxDBSize(int itemId, int packageId, long maxSize) {
object[] results = this.Invoke("SetMaxDBSize", new object[] {
itemId,
packageId,
maxSize});
return ((ResultObject)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginSetMaxDBSize(int itemId, int packageId, long maxSize, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetMaxDBSize", new object[] {
itemId,
packageId,
maxSize}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndSetMaxDBSize(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void SetMaxDBSizeAsync(int itemId, int packageId, long maxSize) {
this.SetMaxDBSizeAsync(itemId, packageId, maxSize, null);
}
/// <remarks/>
public void SetMaxDBSizeAsync(int itemId, int packageId, long maxSize, object userState) {
if ((this.SetMaxDBSizeOperationCompleted == null)) {
this.SetMaxDBSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMaxDBSizeOperationCompleted);
}
this.InvokeAsync("SetMaxDBSize", new object[] {
itemId,
packageId,
maxSize}, this.SetMaxDBSizeOperationCompleted, userState);
}
private void OnSetMaxDBSizeOperationCompleted(object arg) {
if ((this.SetMaxDBSizeCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetMaxDBSizeCompleted(this, new SetMaxDBSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetDBSize", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public long GetDBSize(int itemId, int packageId) {
object[] results = this.Invoke("GetDBSize", new object[] {
itemId,
packageId});
return ((long)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetDBSize(int itemId, int packageId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetDBSize", new object[] {
itemId,
packageId}, callback, asyncState);
}
/// <remarks/>
public long EndGetDBSize(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((long)(results[0]));
}
/// <remarks/>
public void GetDBSizeAsync(int itemId, int packageId) {
this.GetDBSizeAsync(itemId, packageId, null);
}
/// <remarks/>
public void GetDBSizeAsync(int itemId, int packageId, object userState) {
if ((this.GetDBSizeOperationCompleted == null)) {
this.GetDBSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDBSizeOperationCompleted);
}
this.InvokeAsync("GetDBSize", new object[] {
itemId,
packageId}, this.GetDBSizeOperationCompleted, userState);
}
private void OnGetDBSizeOperationCompleted(object arg) {
if ((this.GetDBSizeCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetDBSizeCompleted(this, new GetDBSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMaxDBSize", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public long GetMaxDBSize(int itemId, int packageId) {
object[] results = this.Invoke("GetMaxDBSize", new object[] {
itemId,
packageId});
return ((long)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetMaxDBSize(int itemId, int packageId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetMaxDBSize", new object[] {
itemId,
packageId}, callback, asyncState);
}
/// <remarks/>
public long EndGetMaxDBSize(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((long)(results[0]));
}
/// <remarks/>
public void GetMaxDBSizeAsync(int itemId, int packageId) {
this.GetMaxDBSizeAsync(itemId, packageId, null);
}
/// <remarks/>
public void GetMaxDBSizeAsync(int itemId, int packageId, object userState) {
if ((this.GetMaxDBSizeOperationCompleted == null)) {
this.GetMaxDBSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMaxDBSizeOperationCompleted);
}
this.InvokeAsync("GetMaxDBSize", new object[] {
itemId,
packageId}, this.GetMaxDBSizeOperationCompleted, userState);
}
private void OnGetMaxDBSizeOperationCompleted(object arg) {
if ((this.GetMaxDBSizeCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetMaxDBSizeCompleted(this, new GetMaxDBSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e);
@ -991,6 +1175,32 @@ namespace WebsitePanel.EnterpriseServer {
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SetUserCALTypeCompletedEventHandler(object sender, SetUserCALTypeCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class SetUserCALTypeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal SetUserCALTypeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void ChangeUserStateCompletedEventHandler(object sender, ChangeUserStateCompletedEventArgs e);
@ -1042,4 +1252,82 @@ namespace WebsitePanel.EnterpriseServer {
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SetMaxDBSizeCompletedEventHandler(object sender, SetMaxDBSizeCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class SetMaxDBSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal SetMaxDBSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetDBSizeCompletedEventHandler(object sender, GetDBSizeCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetDBSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetDBSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public long Result {
get {
this.RaiseExceptionIfNecessary();
return ((long)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetMaxDBSizeCompletedEventHandler(object sender, GetMaxDBSizeCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetMaxDBSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetMaxDBSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public long Result {
get {
this.RaiseExceptionIfNecessary();
return ((long)(this.results[0]));
}
}
}
}

View file

@ -3112,13 +3112,14 @@ namespace WebsitePanel.EnterpriseServer
#region CRM
public static int GetCRMUsersCount(int itemId, string name, string email)
public static int GetCRMUsersCount(int itemId, string name, string email, int CALType)
{
SqlParameter[] sqlParams = new SqlParameter[]
{
new SqlParameter("@ItemID", itemId),
GetFilterSqlParam("@Name", name),
GetFilterSqlParam("@Email", email),
new SqlParameter("@CALType", CALType)
};
return (int)SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, "GetCRMUsersCount", sqlParams);
@ -3159,18 +3160,29 @@ namespace WebsitePanel.EnterpriseServer
new SqlParameter[] { new SqlParameter("@ItemID", itemId) });
}
public static void CreateCRMUser(int itemId, Guid crmId, Guid businessUnitId)
public static void CreateCRMUser(int itemId, Guid crmId, Guid businessUnitId, int CALType)
{
SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, "InsertCRMUser",
new SqlParameter[]
{
new SqlParameter("@ItemID", itemId),
new SqlParameter("@CrmUserID", crmId),
new SqlParameter("@BusinessUnitId", businessUnitId)
new SqlParameter("@BusinessUnitId", businessUnitId),
new SqlParameter("@CALType", CALType)
});
}
public static void UpdateCRMUser(int itemId, int CALType)
{
SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, "UpdateCRMUser",
new SqlParameter[]
{
new SqlParameter("@ItemID", itemId),
new SqlParameter("@CALType", CALType)
});
}
public static IDataReader GetCrmUser(int itemId)
{

View file

@ -265,11 +265,12 @@ namespace WebsitePanel.EnterpriseServer
return res;
}
int serviceid = PackageController.GetPackageServiceId(org.PackageId, ResourceGroups.HostedOrganizations);
string rootOU = GetProviderProperty(serviceid, "rootou");
PackageContext cntx = PackageController.GetPackageContext(org.PackageId);
int maxDBSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
org.CrmAdministratorId = user.AccountId;
org.CrmCurrency =
string.Join("|", new[] {baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, regionName});
@ -279,11 +280,10 @@ namespace WebsitePanel.EnterpriseServer
OrganizationResult serverRes =
crm.CreateOrganization(orgId, org.OrganizationId, org.Name,
org.DefaultDomain,
org.OrganizationId + "." + rootOU,
baseCurrencyCode, baseCurrencyName,
baseCurrencySymbol, user.SamAccountName, user.FirstName, user.LastName, user.PrimaryEmailAddress,
collation);
collation, maxDBSize);
if (!serverRes.IsSuccess)
{
@ -322,7 +322,7 @@ namespace WebsitePanel.EnterpriseServer
{
try
{
DataProvider.CreateCRMUser(userId, crmUser.Value.CRMUserId, crmUser.Value.BusinessUnitId);
DataProvider.CreateCRMUser(userId, crmUser.Value.CRMUserId, crmUser.Value.BusinessUnitId, 0);
}
catch (Exception ex)
{
@ -568,12 +568,12 @@ namespace WebsitePanel.EnterpriseServer
}
public static IntResult GetCRMUsersCount(int itemId, string name, string email)
public static IntResult GetCRMUsersCount(int itemId, string name, string email, int CALType)
{
IntResult res = StartTask<IntResult>("CRM", "GET_CRM_USERS_COUNT");
try
{
res.Value = DataProvider.GetCRMUsersCount(itemId, name, email);
res.Value = DataProvider.GetCRMUsersCount(itemId, name, email, CALType);
}
catch(Exception ex)
{
@ -618,7 +618,7 @@ namespace WebsitePanel.EnterpriseServer
return res;
}
IntResult intRes = GetCRMUsersCount(itemId, name, email);
IntResult intRes = GetCRMUsersCount(itemId, name, email, -1);
res.ErrorCodes.AddRange(intRes.ErrorCodes);
if (!intRes.IsSuccess)
{
@ -632,7 +632,7 @@ namespace WebsitePanel.EnterpriseServer
}
public static UserResult CreateCRMUser(OrganizationUser user, int packageId, int itemId, Guid businessUnitId)
public static UserResult CreateCRMUser(OrganizationUser user, int packageId, int itemId, Guid businessUnitId, int CALType)
{
UserResult ret = StartTask<UserResult>("CRM", "CREATE_CRM_USER");
@ -665,8 +665,7 @@ namespace WebsitePanel.EnterpriseServer
return ret;
}
BoolResult quotaRes = CheckQuota(packageId, itemId);
BoolResult quotaRes = CheckQuota(packageId, itemId, CALType);
ret.ErrorCodes.AddRange(quotaRes.ErrorCodes);
if (!quotaRes.IsSuccess)
{
@ -695,7 +694,7 @@ namespace WebsitePanel.EnterpriseServer
CRM crm = new CRM();
ServiceProviderProxy.Init(crm, serviceId);
UserResult res = crm.CreateCRMUser(user, org.OrganizationId, org.CrmOrganizationId, businessUnitId);
UserResult res = crm.CreateCRMUser(user, org.OrganizationId, org.CrmOrganizationId, businessUnitId, CALType);
ret.ErrorCodes.AddRange(res.ErrorCodes);
if (!res.IsSuccess)
@ -713,7 +712,7 @@ namespace WebsitePanel.EnterpriseServer
try
{
DataProvider.CreateCRMUser(user.AccountId, crmId, businessUnitId);
DataProvider.CreateCRMUser(user.AccountId, crmId, businessUnitId, CALType);
}
catch (Exception ex)
{
@ -964,6 +963,80 @@ namespace WebsitePanel.EnterpriseServer
}
public static ResultObject SetUserCALType(int itemId, int accountId, int packageId, int CALType)
{
ResultObject res = StartTask<CrmRolesResult>("CRM", "SET_CRM_CALTYPE");
try
{
CrmUserResult user = GetCrmUser(itemId, accountId);
if (user.Value.CALType == CALType)
{
res.IsSuccess = true;
CompleteTask();
return res;
}
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedCRM);
if (serviceId == 0)
{
CompleteTask(res, CrmErrorCodes.CRM_IS_NOT_SELECTED_IN_HOSTING_PLAN, null,
"CRM is not selected in hosting plan.");
return res;
}
CRM crm = new CRM();
ServiceProviderProxy.Init(crm, serviceId);
Organization org;
try
{
org = OrganizationController.GetOrganization(itemId);
if (org == null)
throw new ApplicationException("Org is null.");
}
catch (Exception ex)
{
CompleteTask(res, ErrorCodes.CANNOT_GET_ORGANIZATION_BY_ITEM_ID, ex);
return res;
}
BoolResult quotaRes = CheckQuota(packageId, itemId, CALType);
res.ErrorCodes.AddRange(quotaRes.ErrorCodes);
if (!quotaRes.IsSuccess)
{
CompleteTask(res);
return res;
}
if (!quotaRes.Value)
{
CompleteTask(res, CrmErrorCodes.USER_QUOTA_HAS_BEEN_REACHED, null, "CRM user quota has been reached.");
return res;
}
Guid crmUserId = GetCrmUserId(accountId);
ResultObject rolesRes = crm.SetUserCALType(org.Name, crmUserId, CALType);
DataProvider.UpdateCRMUser(accountId, CALType);
res.ErrorCodes.AddRange(rolesRes.ErrorCodes);
if (!rolesRes.IsSuccess)
{
CompleteTask(res);
return res;
}
}
catch (Exception ex)
{
CompleteTask(res, CrmErrorCodes.CANNOT_SET_CRM_USER_ROLES_GENERAL_ERROR, ex);
return res;
}
CompleteTask();
return res;
}
public static ResultObject ChangeUserState(int itemId, int accountId, bool disable)
{
@ -1016,24 +1089,25 @@ namespace WebsitePanel.EnterpriseServer
}
private static BoolResult CheckQuota(int packageId, int itemId)
private static BoolResult CheckQuota(int packageId, int itemId, int CALType)
{
BoolResult res = StartTask<BoolResult>("CRM", "CHECK_QUOTA");
try
{
PackageContext cntx = PackageController.GetPackageContext(packageId);
IntResult tmp = GetCRMUsersCount(itemId, string.Empty, string.Empty);
IntResult tmp = GetCRMUsersCount(itemId, string.Empty, string.Empty, CALType);
res.ErrorCodes.AddRange(tmp.ErrorCodes);
if (!tmp.IsSuccess)
{
CompleteTask(res);
return res;
}
int allocatedCrmUsers = cntx.Quotas[Quotas.CRM_USERS].QuotaAllocatedValue;
res.Value = allocatedCrmUsers == -1 || allocatedCrmUsers >= tmp.Value;
string quotaName = CALType == 0 ? Quotas.CRM_USERS : Quotas.CRM_LIMITEDUSERS;
int allocatedCrmUsers = cntx.Quotas[quotaName].QuotaAllocatedValue;
res.Value = allocatedCrmUsers == -1 || allocatedCrmUsers > tmp.Value;
}
catch(Exception ex)
@ -1045,6 +1119,158 @@ namespace WebsitePanel.EnterpriseServer
CompleteTask();
return res;
}
public static ResultObject SetMaxDBSize(int itemId, int packageId, long maxSize)
{
ResultObject res = StartTask<CrmRolesResult>("CRM", "SET_CRM_MAXDBSIZE");
try
{
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedCRM);
if (serviceId == 0)
{
CompleteTask(res, CrmErrorCodes.CRM_IS_NOT_SELECTED_IN_HOSTING_PLAN, null,
"CRM is not selected in hosting plan.");
return res;
}
CRM crm = new CRM();
ServiceProviderProxy.Init(crm, serviceId);
Organization org;
try
{
org = OrganizationController.GetOrganization(itemId);
if (org == null)
throw new ApplicationException("Org is null.");
}
catch (Exception ex)
{
CompleteTask(res, ErrorCodes.CANNOT_GET_ORGANIZATION_BY_ITEM_ID, ex);
return res;
}
PackageContext cntx = PackageController.GetPackageContext(packageId);
int limitSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
if (limitSize != -1)
{
if (maxSize == -1) maxSize = limitSize;
if (maxSize > limitSize) maxSize = limitSize;
}
res = crm.SetMaxDBSize(org.CrmOrganizationId, maxSize);
res.ErrorCodes.AddRange(res.ErrorCodes);
if (!res.IsSuccess)
{
CompleteTask(res);
return res;
}
}
catch (Exception ex)
{
CompleteTask(res, CrmErrorCodes.CANNOT_CONFIGURE_CRM_ORGANIZATION, ex);
return res;
}
CompleteTask();
return res;
}
public static long GetDBSize(int itemId, int packageId)
{
ResultObject res = StartTask<CrmRolesResult>("CRM", "GET_CRM_DBSIZE");
long size = -1;
try
{
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedCRM);
if (serviceId == 0)
{
CompleteTask(res, CrmErrorCodes.CRM_IS_NOT_SELECTED_IN_HOSTING_PLAN, null,
"CRM is not selected in hosting plan.");
return -1;
}
CRM crm = new CRM();
ServiceProviderProxy.Init(crm, serviceId);
Organization org;
try
{
org = OrganizationController.GetOrganization(itemId);
if (org == null)
throw new ApplicationException("Org is null.");
}
catch (Exception ex)
{
CompleteTask(res, ErrorCodes.CANNOT_GET_ORGANIZATION_BY_ITEM_ID, ex);
return -1;
}
size = crm.GetDBSize(org.CrmOrganizationId);
}
catch (Exception ex)
{
CompleteTask(res, CrmErrorCodes.CANNOT_CONFIGURE_CRM_ORGANIZATION, ex);
return -1;
}
CompleteTask();
return size;
}
public static long GetMaxDBSize(int itemId, int packageId)
{
ResultObject res = StartTask<CrmRolesResult>("CRM", "GET_CRM_MAXDBSIZE");
long size = -1;
try
{
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedCRM);
if (serviceId == 0)
{
CompleteTask(res, CrmErrorCodes.CRM_IS_NOT_SELECTED_IN_HOSTING_PLAN, null,
"CRM is not selected in hosting plan.");
return -1;
}
CRM crm = new CRM();
ServiceProviderProxy.Init(crm, serviceId);
Organization org;
try
{
org = OrganizationController.GetOrganization(itemId);
if (org == null)
throw new ApplicationException("Org is null.");
}
catch (Exception ex)
{
CompleteTask(res, ErrorCodes.CANNOT_GET_ORGANIZATION_BY_ITEM_ID, ex);
return -1;
}
size = crm.GetMaxDBSize(org.CrmOrganizationId);
}
catch (Exception ex)
{
CompleteTask(res, CrmErrorCodes.CANNOT_CONFIGURE_CRM_ORGANIZATION, ex);
return -1;
}
CompleteTask();
return size;
}
}
}

View file

@ -932,7 +932,11 @@ namespace WebsitePanel.EnterpriseServer
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedCRM))
{
stats.CreatedCRMUsers = CRMController.GetCRMUsersCount(org.Id, string.Empty, string.Empty).Value;
stats.CreatedCRMUsers = CRMController.GetCRMUsersCount(org.Id, string.Empty, string.Empty, 0).Value;
stats.CreatedLimitedCRMUsers = CRMController.GetCRMUsersCount(org.Id, string.Empty, string.Empty, 2).Value;
stats.UsedCRMDiskSpace = CRMController.GetDBSize(org.Id, org.PackageId);
stats.AllocatedCRMDiskSpace = CRMController.GetMaxDBSize(org.Id, org.PackageId);
}
if (cntxTmp.Groups.ContainsKey(ResourceGroups.BlackBerry))
@ -991,7 +995,10 @@ namespace WebsitePanel.EnterpriseServer
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedCRM))
{
stats.CreatedCRMUsers += CRMController.GetCRMUsersCount(o.Id, string.Empty, string.Empty).Value;
stats.CreatedCRMUsers += CRMController.GetCRMUsersCount(o.Id, string.Empty, string.Empty, 0 ).Value;
stats.CreatedLimitedCRMUsers += CRMController.GetCRMUsersCount(o.Id, string.Empty, string.Empty, 2).Value;
stats.UsedCRMDiskSpace += CRMController.GetDBSize(o.Id, o.PackageId);
stats.AllocatedCRMDiskSpace += CRMController.GetMaxDBSize(o.Id, o.PackageId);
}
if (cntxTmp.Groups.ContainsKey(ResourceGroups.BlackBerry))
@ -1036,6 +1043,7 @@ namespace WebsitePanel.EnterpriseServer
if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM))
{
stats.AllocatedCRMUsers = cntx.Quotas[Quotas.CRM_USERS].QuotaAllocatedValue;
stats.AllocatedLimitedCRMUsers = cntx.Quotas[Quotas.CRM_LIMITEDUSERS].QuotaAllocatedValue;
}
if (cntx.Groups.ContainsKey(ResourceGroups.BlackBerry))

View file

@ -81,15 +81,15 @@ namespace WebsitePanel.EnterpriseServer
}
[WebMethod]
public IntResult GetCRMUserCount(int itemId, string name, string email)
public IntResult GetCRMUserCount(int itemId, string name, string email, int CALType)
{
return CRMController.GetCRMUsersCount(itemId, name, email);
return CRMController.GetCRMUsersCount(itemId, name, email, CALType);
}
[WebMethod]
public UserResult CreateCRMUser(OrganizationUser user, int packageId, int itemId, Guid businessUnitOrgId)
public UserResult CreateCRMUser(OrganizationUser user, int packageId, int itemId, Guid businessUnitOrgId, int CALType)
{
return CRMController.CreateCRMUser(user, packageId, itemId, businessUnitOrgId);
return CRMController.CreateCRMUser(user, packageId, itemId, businessUnitOrgId, CALType);
}
@ -112,6 +112,12 @@ namespace WebsitePanel.EnterpriseServer
return CRMController.SetUserRoles(itemId, accountId, packageId, roles);
}
[WebMethod]
public ResultObject SetUserCALType(int itemId, int accountId, int packageId, int CALType)
{
return CRMController.SetUserCALType(itemId, accountId, packageId, CALType);
}
[WebMethod]
public ResultObject ChangeUserState(int itemId, int accountId, bool disable)
{
@ -125,5 +131,23 @@ namespace WebsitePanel.EnterpriseServer
return CRMController.GetCrmUser(itemId, accountId);
}
[WebMethod]
public ResultObject SetMaxDBSize(int itemId, int packageId, long maxSize)
{
return CRMController.SetMaxDBSize(itemId, packageId, maxSize);
}
[WebMethod]
public long GetDBSize(int itemId, int packageId)
{
return CRMController.GetDBSize(itemId, packageId);
}
[WebMethod]
public long GetMaxDBSize(int itemId, int packageId)
{
return CRMController.GetMaxDBSize(itemId, packageId);
}
}
}

View file

@ -36,6 +36,6 @@ namespace WebsitePanel.Providers.HostedSolution
public Guid BusinessUnitId { get; set; }
public CRMUserAccessMode ClientAccessMode { get; set; }
public bool IsDisabled { get; set; }
public int CALType { get; set; }
}
}

View file

@ -35,10 +35,11 @@ namespace WebsitePanel.Providers.HostedSolution
public interface ICRM
{
OrganizationResult CreateOrganization(Guid organizationId, string organizationUniqueName, string organizationFriendlyName,
string organizationDomainName, string ou,
string ou,
string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol,
string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail,
string organizationCollation);
string organizationCollation,
long maxSize);
string[] GetSupportedCollationNames();
@ -46,7 +47,7 @@ namespace WebsitePanel.Providers.HostedSolution
ResultObject DeleteOrganization(Guid orgId);
UserResult CreateCRMUser(OrganizationUser user, string orgName, Guid organizationId, Guid baseUnitId);
UserResult CreateCRMUser(OrganizationUser user, string orgName, Guid organizationId, Guid baseUnitId, int CALType);
CRMBusinessUnitsResult GetOrganizationBusinessUnits(Guid organizationId, string orgName);
@ -56,13 +57,19 @@ namespace WebsitePanel.Providers.HostedSolution
ResultObject SetUserRoles(string orgName, Guid userId, Guid[] roles);
ResultObject SetUserCALType(string orgName, Guid userId, int CALType);
CrmUserResult GetCrmUserByDomainName(string domainName, string orgName);
CrmUserResult GetCrmUserById(Guid crmUserId, string orgName);
ResultObject ChangeUserState(bool disable, string orgName, Guid crmUserId);
long GetUsedSpace(Guid organizationId);
long GetDBSize(Guid organizationId);
long GetMaxDBSize(Guid organizationId);
ResultObject SetMaxDBSize(Guid organizationId, long maxSize);
}
}

View file

@ -61,6 +61,12 @@ namespace WebsitePanel.Providers.HostedSolution
private int createdCRMUsers;
private int allocatedCRMUsers;
private int createdLimitedCRMUsers;
private int allocatedLimitedCRMUsers;
private long usedCRMDiskSpace;
private long allocatedCRMDiskSpace;
private int createdEnterpriseStorageFolders;
private int allocatedEnterpriseStorageFolders;
@ -79,6 +85,18 @@ namespace WebsitePanel.Providers.HostedSolution
get { return allocatedCRMUsers; }
set { allocatedCRMUsers = value; }
}
public int CreatedLimitedCRMUsers
{
get { return createdLimitedCRMUsers; }
set { createdLimitedCRMUsers = value; }
}
public int AllocatedLimitedCRMUsers
{
get { return allocatedLimitedCRMUsers; }
set { allocatedLimitedCRMUsers = value; }
}
public int AllocatedUsers
{
@ -86,6 +104,18 @@ namespace WebsitePanel.Providers.HostedSolution
set { allocatedUsers = value; }
}
public long UsedCRMDiskSpace
{
get { return usedCRMDiskSpace; }
set { usedCRMDiskSpace = value;}
}
public long AllocatedCRMDiskSpace
{
get { return allocatedCRMDiskSpace; }
set { allocatedCRMDiskSpace = value; }
}
public int CreatedUsers
{
get { return createdUsers; }

View file

@ -179,11 +179,8 @@ namespace WebsitePanel.Providers.HostedSolution
return res;
}
public long GetUsedSpace(Guid organizationId)
private string GetDataBaseName(Guid organizationId)
{
Log.WriteStart("GetUsedSpace");
long res = 0;
string crmDatabaseName = "MSCRM_CONFIG";
string databasename = "";
@ -212,6 +209,17 @@ namespace WebsitePanel.Providers.HostedSolution
connection.Dispose();
}
return databasename;
}
public long GetDBSize(Guid organizationId)
{
Log.WriteStart("GetDBSize");
long res = 0;
string databasename = GetDataBaseName(organizationId);
SqlConnection connection = null;
try
{
connection = new SqlConnection();
@ -221,7 +229,7 @@ namespace WebsitePanel.Providers.HostedSolution
connection.Open();
string commandText = "SELECT ((dbsize + logsize) * 8192 ) size FROM " +
string commandText = "SELECT ((dbsize ) * 8192 ) size FROM " + // + logsize
"( " +
"SELECT SUM(CONVERT(BIGINT,CASE WHEN status & 64 = 0 THEN size ELSE 0 END)) dbsize " +
", SUM(CONVERT(BIGINT,CASE WHEN status & 64 <> 0 THEN size ELSE 0 END)) logsize " +
@ -243,11 +251,93 @@ namespace WebsitePanel.Providers.HostedSolution
}
Log.WriteEnd("GetUsedSpace");
Log.WriteEnd("GetDBSize");
return res;
}
public long GetMaxDBSize(Guid organizationId)
{
Log.WriteStart("GetMaxDBSize");
long res = 0;
string databasename = GetDataBaseName(organizationId);
SqlConnection connection = null;
try
{
connection = new SqlConnection();
connection.ConnectionString =
string.Format("Server={1};Initial Catalog={0};Integrated Security=SSPI",
databasename, SqlServer);
connection.Open();
string commandText = "SELECT SUM(CONVERT(BIGINT,CASE WHEN status & 64 = 0 THEN maxsize ELSE 0 END)) dbsize FROM dbo.sysfiles";
SqlCommand command = new SqlCommand(commandText, connection);
res = (long)command.ExecuteScalar();
if (res > 0) res = res * 8192;
}
catch (Exception ex)
{
Log.WriteError(ex);
}
finally
{
if (connection != null)
connection.Dispose();
}
Log.WriteEnd("GetMaxDBSize");
return res;
}
public ResultObject SetMaxDBSize(Guid organizationId, long maxSize)
{
ResultObject res = StartLog<ResultObject>("SetMaxDBSize");
string databasename = GetDataBaseName(organizationId);
SqlConnection connection = null;
try
{
connection = new SqlConnection();
connection.ConnectionString =
string.Format("Server={1};Initial Catalog={0};Integrated Security=SSPI",
databasename, SqlServer);
connection.Open();
string maxSizeStr = maxSize == -1 ? "UNLIMITED" : (maxSize/(1024*1024)).ToString() +" MB";
string commandText = "ALTER DATABASE [" + databasename + "] MODIFY FILE ( NAME = N'mscrm', MAXSIZE = " + maxSizeStr + " )";
SqlCommand command = new SqlCommand(commandText, connection);
command.ExecuteNonQuery();
res.IsSuccess = true;
}
catch (Exception ex)
{
EndLog("SetMaxDBSize", res, CrmErrorCodes.CANNOT_CHANGE_CRM_ORGANIZATION_STATE, ex);
}
finally
{
if (connection != null)
connection.Dispose();
}
EndLog("SetMaxDBSize");
return res;
}
private bool CheckOrganizationUnique(string databaseName, string orgName)
{
Log.WriteStart("CheckOrganizationUnique");
@ -393,14 +483,14 @@ namespace WebsitePanel.Providers.HostedSolution
return retOrganization;
}
public OrganizationResult CreateOrganization(Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string organizationDomainName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation)
public OrganizationResult CreateOrganization(Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize)
{
return CreateOrganizationInternal(organizationId, organizationUniqueName, organizationFriendlyName, organizationDomainName, ou , baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, initialUserDomainName, initialUserFirstName, initialUserLastName, initialUserPrimaryEmail, organizationCollation);
return CreateOrganizationInternal(organizationId, organizationUniqueName, organizationFriendlyName, ou , baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, initialUserDomainName, initialUserFirstName, initialUserLastName, initialUserPrimaryEmail, organizationCollation, maxSize);
}
const string CRMSysAdminRoleStr = "Системный администратор;System Administrator";
internal OrganizationResult CreateOrganizationInternal(Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string organizationDomainName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation)
internal OrganizationResult CreateOrganizationInternal(Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize)
{
OrganizationResult ret = StartLog<OrganizationResult>("CreateOrganizationInternal");
@ -527,6 +617,10 @@ namespace WebsitePanel.Providers.HostedSolution
};
Microsoft.Xrm.Sdk.Deployment.UpdateAdvancedSettingsResponse respUpdateSettings = (Microsoft.Xrm.Sdk.Deployment.UpdateAdvancedSettingsResponse) deploymentService.Execute(reqUpdateSettings);
// DB size limit
if (maxSize!=-1)
SetMaxDBSize(organizationId, maxSize);
int tryTimeout = 30000;
int tryCount = 10;
@ -544,7 +638,7 @@ namespace WebsitePanel.Providers.HostedSolution
string ldap = "";
Guid SysAdminGuid = RetrieveSystemUser(GetDomainName(initialUserDomainName), initialUserFirstName, initialUserLastName, CRMSysAdminRoleStr, _serviceProxy, ref ldap);
Guid SysAdminGuid = RetrieveSystemUser(GetDomainName(initialUserDomainName), initialUserFirstName, initialUserLastName, CRMSysAdminRoleStr, _serviceProxy, ref ldap, 0);
success = true;
@ -774,12 +868,12 @@ namespace WebsitePanel.Providers.HostedSolution
return res;
}
public UserResult CreateCRMUser(OrganizationUser user, string orgName, Guid organizationId, Guid baseUnitId)
public UserResult CreateCRMUser(OrganizationUser user, string orgName, Guid organizationId, Guid baseUnitId, int CALType)
{
return CreateCRMUserInternal(user, orgName, organizationId, baseUnitId);
return CreateCRMUserInternal(user, orgName, organizationId, baseUnitId, CALType);
}
internal UserResult CreateCRMUserInternal(OrganizationUser user, string orgName, Guid organizationId, Guid businessUnitId)
internal UserResult CreateCRMUserInternal(OrganizationUser user, string orgName, Guid organizationId, Guid businessUnitId, int CALType)
{
UserResult res = StartLog<UserResult>("CreateCRMUserInternal");
@ -803,7 +897,7 @@ namespace WebsitePanel.Providers.HostedSolution
string ldap = "";
Guid guid = RetrieveSystemUser(user.DomainUserName, user.FirstName, user.LastName, CRMSysAdminRoleStr, _serviceProxy, ref ldap);
Guid guid = RetrieveSystemUser(user.DomainUserName, user.FirstName, user.LastName, CRMSysAdminRoleStr, _serviceProxy, ref ldap, CALType);
user.CrmUserId = guid;
res.Value = user;
@ -828,7 +922,7 @@ namespace WebsitePanel.Providers.HostedSolution
private static Guid CreateSystemUser(String userName, String firstName,
String lastName, String domain, String roleStr,
OrganizationServiceProxy serviceProxy, ref String ldapPath)
OrganizationServiceProxy serviceProxy, ref String ldapPath, int CALType)
{
if (serviceProxy.ServiceConfiguration.AuthenticationType == AuthenticationProviderType.LiveId ||
@ -868,7 +962,8 @@ namespace WebsitePanel.Providers.HostedSolution
LogicalName = BusinessUnit.EntityLogicalName,
Name = BusinessUnit.EntityLogicalName,
Id = defaultBusinessUnit.Id
}
},
CALType = new OptionSetValue(CALType)
};
userId = serviceProxy.Create(user);
@ -890,7 +985,8 @@ namespace WebsitePanel.Providers.HostedSolution
public static Guid RetrieveSystemUser(String userName, String firstName,
String lastName, String roleStr, OrganizationServiceProxy serviceProxy,
ref String ldapPath)
ref String ldapPath,
int CALType)
{
String domain;
Guid userId = Guid.Empty;
@ -985,11 +1081,12 @@ namespace WebsitePanel.Providers.HostedSolution
};
serviceProxy.Execute(associate);
}
}
else
{
userId = CreateSystemUser(userName, firstName, lastName, domain,
roleStr, serviceProxy, ref ldapPath);
roleStr, serviceProxy, ref ldapPath, CALType);
}
return userId;
@ -1633,7 +1730,7 @@ namespace WebsitePanel.Providers.HostedSolution
OrganizationServiceProxy serviceProxy = GetOrganizationProxy(orgName);
SystemUser retruveUser =
serviceProxy.Retrieve(SystemUser.EntityLogicalName, crmUserId, new Microsoft.Xrm.Sdk.Query.ColumnSet("domainname", "businessunitid", "accessmode", "isdisabled")).ToEntity<SystemUser>();
serviceProxy.Retrieve(SystemUser.EntityLogicalName, crmUserId, new Microsoft.Xrm.Sdk.Query.ColumnSet("domainname", "businessunitid", "accessmode", "isdisabled", "caltype")).ToEntity<SystemUser>();
CrmUser user = null;
@ -1644,6 +1741,7 @@ namespace WebsitePanel.Providers.HostedSolution
user.CRMUserId = retruveUser.SystemUserId.Value;
user.ClientAccessMode = (CRMUserAccessMode)retruveUser.AccessMode.Value;
user.IsDisabled = (bool)retruveUser.IsDisabled;
user.CALType = retruveUser.CALType.Value;
ret.Value = user;
}
@ -1677,7 +1775,7 @@ namespace WebsitePanel.Providers.HostedSolution
Microsoft.Xrm.Sdk.Query.QueryExpression usereQuery = new Microsoft.Xrm.Sdk.Query.QueryExpression
{
EntityName = SystemUser.EntityLogicalName,
ColumnSet = new Microsoft.Xrm.Sdk.Query.ColumnSet("domainname", "businessunitid", "accessmode", "isdisabled", "systemuserid"),
ColumnSet = new Microsoft.Xrm.Sdk.Query.ColumnSet("domainname", "businessunitid", "accessmode", "isdisabled", "systemuserid", "caltype"),
};
EntityCollection users = serviceProxy.RetrieveMultiple(usereQuery);
@ -1694,6 +1792,7 @@ namespace WebsitePanel.Providers.HostedSolution
user.CRMUserId = sysuser.SystemUserId.Value;
user.ClientAccessMode = (CRMUserAccessMode)sysuser.AccessMode.Value;
user.IsDisabled = sysuser.IsDisabled.Value;
user.CALType = sysuser.CALType.Value;
ret.Value = user;
}
}
@ -1801,6 +1900,44 @@ namespace WebsitePanel.Providers.HostedSolution
return value.StartsWith("5.");
}
public ResultObject SetUserCALType(string orgName, Guid userId, int CALType)
{
return SetUserCALTypeInternal(orgName, userId, CALType);
}
internal ResultObject SetUserCALTypeInternal(string orgName, Guid userId, int CALType)
{
ResultObject ret = StartLog<CrmUserResult>("SetUserCALTypeInternal");
try
{
if (userId == Guid.Empty)
throw new ArgumentNullException("crmUserId");
if (string.IsNullOrEmpty(orgName))
throw new ArgumentNullException("orgName");
OrganizationServiceProxy serviceProxy = GetOrganizationProxy(orgName);
SystemUser user =
serviceProxy.Retrieve(SystemUser.EntityLogicalName, userId, new Microsoft.Xrm.Sdk.Query.ColumnSet("domainname", "businessunitid", "accessmode", "isdisabled", "caltype")).ToEntity<SystemUser>();
user.CALType = new OptionSetValue(CALType);
serviceProxy.Update(user);
}
catch (Exception ex)
{
EndLog("SetUserCALTypeInternal", ret, CrmErrorCodes.CANONT_GET_CRM_USER_BY_ID, ex);
return ret;
}
EndLog("SetUserCALTypeInternal");
return ret;
}
}
}

View file

@ -33,35 +33,35 @@
<ItemGroup>
<Reference Include="microsoft.crm.sdk.proxy">
<HintPath>..\..\Lib\References\Microsoft\microsoft.crm.sdk.proxy.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
</Reference>
<Reference Include="microsoft.xrm.client">
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.client.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
</Reference>
<Reference Include="microsoft.xrm.client.codegeneration">
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.client.codegeneration.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
</Reference>
<Reference Include="microsoft.xrm.portal">
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.portal.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
</Reference>
<Reference Include="microsoft.xrm.portal.files">
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.portal.files.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
</Reference>
<Reference Include="microsoft.xrm.sdk">
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.sdk.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
</Reference>
<Reference Include="microsoft.xrm.sdk.deployment">
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.sdk.deployment.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
</Reference>
<Reference Include="microsoft.xrm.sdk.workflow">
<HintPath>..\..\Lib\References\Microsoft\microsoft.xrm.sdk.workflow.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View file

@ -328,7 +328,7 @@ namespace WebsitePanel.Providers.HostedSolution
return retOrganization;
}
public OrganizationResult CreateOrganization(Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string organizationDomainName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation)
public OrganizationResult CreateOrganization(Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize)
{
return CreateOrganizationInternal(organizationId, organizationUniqueName, organizationFriendlyName, baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, initialUserDomainName, initialUserFirstName, initialUserLastName, initialUserPrimaryEmail, organizationCollation);
}
@ -872,7 +872,7 @@ namespace WebsitePanel.Providers.HostedSolution
return res;
}
public UserResult CreateCRMUser(OrganizationUser user, string orgName, Guid organizationId, Guid baseUnitId)
public UserResult CreateCRMUser(OrganizationUser user, string orgName, Guid organizationId, Guid baseUnitId, int CALType)
{
return CreateCRMUserInternal(user, orgName, organizationId, baseUnitId);
}
@ -1550,6 +1550,29 @@ namespace WebsitePanel.Providers.HostedSolution
return 0;
}
public ResultObject SetUserCALType(string orgName, Guid userId, int CALType)
{
ResultObject ret = new ResultObject();
ret.IsSuccess = false;
return ret;
}
public long GetDBSize(Guid organizationId)
{
return -1;
}
public long GetMaxDBSize(Guid organizationId)
{
return -1;
}
public ResultObject SetMaxDBSize(Guid organizationId, long maxSize)
{
ResultObject ret = new ResultObject();
ret.IsSuccess = false;
return ret;
}
}
}

View file

@ -39,6 +39,7 @@
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.ResultObjects;
//
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
//
@ -79,13 +80,19 @@ namespace WebsitePanel.Providers.CRM {
private System.Threading.SendOrPostCallback SetUserRolesOperationCompleted;
private System.Threading.SendOrPostCallback SetUserCALTypeOperationCompleted;
private System.Threading.SendOrPostCallback GetCrmUserByDomainNameOperationCompleted;
private System.Threading.SendOrPostCallback GetCrmUserByIdOperationCompleted;
private System.Threading.SendOrPostCallback ChangeUserStateOperationCompleted;
private System.Threading.SendOrPostCallback GetUsedSpaceOperationCompleted;
private System.Threading.SendOrPostCallback GetDBSizeOperationCompleted;
private System.Threading.SendOrPostCallback GetMaxDBSizeOperationCompleted;
private System.Threading.SendOrPostCallback SetMaxDBSizeOperationCompleted;
/// <remarks/>
public CRM() {
@ -119,6 +126,9 @@ namespace WebsitePanel.Providers.CRM {
/// <remarks/>
public event SetUserRolesCompletedEventHandler SetUserRolesCompleted;
/// <remarks/>
public event SetUserCALTypeCompletedEventHandler SetUserCALTypeCompleted;
/// <remarks/>
public event GetCrmUserByDomainNameCompletedEventHandler GetCrmUserByDomainNameCompleted;
@ -129,17 +139,22 @@ namespace WebsitePanel.Providers.CRM {
public event ChangeUserStateCompletedEventHandler ChangeUserStateCompleted;
/// <remarks/>
public event GetUsedSpaceCompletedEventHandler GetUsedSpaceCompleted;
public event GetDBSizeCompletedEventHandler GetDBSizeCompleted;
/// <remarks/>
public event GetMaxDBSizeCompletedEventHandler GetMaxDBSizeCompleted;
/// <remarks/>
public event SetMaxDBSizeCompletedEventHandler SetMaxDBSizeCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateOrganization", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public OrganizationResult CreateOrganization(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string organizationDomainName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation) {
public OrganizationResult CreateOrganization(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize) {
object[] results = this.Invoke("CreateOrganization", new object[] {
organizationId,
organizationUniqueName,
organizationFriendlyName,
organizationDomainName,
ou,
baseCurrencyCode,
baseCurrencyName,
@ -148,17 +163,17 @@ namespace WebsitePanel.Providers.CRM {
initialUserFirstName,
initialUserLastName,
initialUserPrimaryEmail,
organizationCollation});
organizationCollation,
maxSize});
return ((OrganizationResult)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginCreateOrganization(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string organizationDomainName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, System.AsyncCallback callback, object asyncState) {
public System.IAsyncResult BeginCreateOrganization(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("CreateOrganization", new object[] {
organizationId,
organizationUniqueName,
organizationFriendlyName,
organizationDomainName,
ou,
baseCurrencyCode,
baseCurrencyName,
@ -167,7 +182,8 @@ namespace WebsitePanel.Providers.CRM {
initialUserFirstName,
initialUserLastName,
initialUserPrimaryEmail,
organizationCollation}, callback, asyncState);
organizationCollation,
maxSize}, callback, asyncState);
}
/// <remarks/>
@ -177,12 +193,12 @@ namespace WebsitePanel.Providers.CRM {
}
/// <remarks/>
public void CreateOrganizationAsync(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string organizationDomainName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation) {
this.CreateOrganizationAsync(organizationId, organizationUniqueName, organizationFriendlyName, organizationDomainName, ou, baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, initialUserDomainName, initialUserFirstName, initialUserLastName, initialUserPrimaryEmail, organizationCollation, null);
public void CreateOrganizationAsync(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize) {
this.CreateOrganizationAsync(organizationId, organizationUniqueName, organizationFriendlyName, ou, baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, initialUserDomainName, initialUserFirstName, initialUserLastName, initialUserPrimaryEmail, organizationCollation, maxSize, null);
}
/// <remarks/>
public void CreateOrganizationAsync(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string organizationDomainName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, object userState) {
public void CreateOrganizationAsync(System.Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize, object userState) {
if ((this.CreateOrganizationOperationCompleted == null)) {
this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted);
}
@ -190,7 +206,6 @@ namespace WebsitePanel.Providers.CRM {
organizationId,
organizationUniqueName,
organizationFriendlyName,
organizationDomainName,
ou,
baseCurrencyCode,
baseCurrencyName,
@ -199,7 +214,8 @@ namespace WebsitePanel.Providers.CRM {
initialUserFirstName,
initialUserLastName,
initialUserPrimaryEmail,
organizationCollation}, this.CreateOrganizationOperationCompleted, userState);
organizationCollation,
maxSize}, this.CreateOrganizationOperationCompleted, userState);
}
private void OnCreateOrganizationOperationCompleted(object arg) {
@ -332,22 +348,24 @@ namespace WebsitePanel.Providers.CRM {
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCRMUser", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public UserResult CreateCRMUser(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId) {
public UserResult CreateCRMUser(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, int CALType) {
object[] results = this.Invoke("CreateCRMUser", new object[] {
user,
orgName,
organizationId,
baseUnitId});
baseUnitId,
CALType});
return ((UserResult)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginCreateCRMUser(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, System.AsyncCallback callback, object asyncState) {
public System.IAsyncResult BeginCreateCRMUser(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, int CALType, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("CreateCRMUser", new object[] {
user,
orgName,
organizationId,
baseUnitId}, callback, asyncState);
baseUnitId,
CALType}, callback, asyncState);
}
/// <remarks/>
@ -357,12 +375,12 @@ namespace WebsitePanel.Providers.CRM {
}
/// <remarks/>
public void CreateCRMUserAsync(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId) {
this.CreateCRMUserAsync(user, orgName, organizationId, baseUnitId, null);
public void CreateCRMUserAsync(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, int CALType) {
this.CreateCRMUserAsync(user, orgName, organizationId, baseUnitId, CALType, null);
}
/// <remarks/>
public void CreateCRMUserAsync(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, object userState) {
public void CreateCRMUserAsync(OrganizationUser user, string orgName, System.Guid organizationId, System.Guid baseUnitId, int CALType, object userState) {
if ((this.CreateCRMUserOperationCompleted == null)) {
this.CreateCRMUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateCRMUserOperationCompleted);
}
@ -370,7 +388,8 @@ namespace WebsitePanel.Providers.CRM {
user,
orgName,
organizationId,
baseUnitId}, this.CreateCRMUserOperationCompleted, userState);
baseUnitId,
CALType}, this.CreateCRMUserOperationCompleted, userState);
}
private void OnCreateCRMUserOperationCompleted(object arg) {
@ -563,6 +582,54 @@ namespace WebsitePanel.Providers.CRM {
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetUserCALType", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public ResultObject SetUserCALType(string orgName, System.Guid userId, int CALType) {
object[] results = this.Invoke("SetUserCALType", new object[] {
orgName,
userId,
CALType});
return ((ResultObject)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginSetUserCALType(string orgName, System.Guid userId, int CALType, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetUserCALType", new object[] {
orgName,
userId,
CALType}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndSetUserCALType(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void SetUserCALTypeAsync(string orgName, System.Guid userId, int CALType) {
this.SetUserCALTypeAsync(orgName, userId, CALType, null);
}
/// <remarks/>
public void SetUserCALTypeAsync(string orgName, System.Guid userId, int CALType, object userState) {
if ((this.SetUserCALTypeOperationCompleted == null)) {
this.SetUserCALTypeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserCALTypeOperationCompleted);
}
this.InvokeAsync("SetUserCALType", new object[] {
orgName,
userId,
CALType}, this.SetUserCALTypeOperationCompleted, userState);
}
private void OnSetUserCALTypeOperationCompleted(object arg) {
if ((this.SetUserCALTypeCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetUserCALTypeCompleted(this, new SetUserCALTypeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetCrmUserByDomainName", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
@ -703,43 +770,130 @@ namespace WebsitePanel.Providers.CRM {
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetUsedSpace", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public long GetUsedSpace(System.Guid organizationId) {
object[] results = this.Invoke("GetUsedSpace", new object[] {
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetDBSize", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public long GetDBSize(System.Guid organizationId) {
object[] results = this.Invoke("GetDBSize", new object[] {
organizationId});
return ((long)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetUsedSpace(System.Guid organizationId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetUsedSpace", new object[] {
public System.IAsyncResult BeginGetDBSize(System.Guid organizationId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetDBSize", new object[] {
organizationId}, callback, asyncState);
}
/// <remarks/>
public long EndGetUsedSpace(System.IAsyncResult asyncResult) {
public long EndGetDBSize(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((long)(results[0]));
}
/// <remarks/>
public void GetUsedSpaceAsync(System.Guid organizationId) {
this.GetUsedSpaceAsync(organizationId, null);
public void GetDBSizeAsync(System.Guid organizationId) {
this.GetDBSizeAsync(organizationId, null);
}
/// <remarks/>
public void GetUsedSpaceAsync(System.Guid organizationId, object userState) {
if ((this.GetUsedSpaceOperationCompleted == null)) {
this.GetUsedSpaceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUsedSpaceOperationCompleted);
public void GetDBSizeAsync(System.Guid organizationId, object userState) {
if ((this.GetDBSizeOperationCompleted == null)) {
this.GetDBSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDBSizeOperationCompleted);
}
this.InvokeAsync("GetUsedSpace", new object[] {
organizationId}, this.GetUsedSpaceOperationCompleted, userState);
this.InvokeAsync("GetDBSize", new object[] {
organizationId}, this.GetDBSizeOperationCompleted, userState);
}
private void OnGetUsedSpaceOperationCompleted(object arg) {
if ((this.GetUsedSpaceCompleted != null)) {
private void OnGetDBSizeOperationCompleted(object arg) {
if ((this.GetDBSizeCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetUsedSpaceCompleted(this, new GetUsedSpaceCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
this.GetDBSizeCompleted(this, new GetDBSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetMaxDBSize", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public long GetMaxDBSize(System.Guid organizationId) {
object[] results = this.Invoke("GetMaxDBSize", new object[] {
organizationId});
return ((long)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetMaxDBSize(System.Guid organizationId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetMaxDBSize", new object[] {
organizationId}, callback, asyncState);
}
/// <remarks/>
public long EndGetMaxDBSize(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((long)(results[0]));
}
/// <remarks/>
public void GetMaxDBSizeAsync(System.Guid organizationId) {
this.GetMaxDBSizeAsync(organizationId, null);
}
/// <remarks/>
public void GetMaxDBSizeAsync(System.Guid organizationId, object userState) {
if ((this.GetMaxDBSizeOperationCompleted == null)) {
this.GetMaxDBSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMaxDBSizeOperationCompleted);
}
this.InvokeAsync("GetMaxDBSize", new object[] {
organizationId}, this.GetMaxDBSizeOperationCompleted, userState);
}
private void OnGetMaxDBSizeOperationCompleted(object arg) {
if ((this.GetMaxDBSizeCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetMaxDBSizeCompleted(this, new GetMaxDBSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetMaxDBSize", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public ResultObject SetMaxDBSize(System.Guid organizationId, long maxSize) {
object[] results = this.Invoke("SetMaxDBSize", new object[] {
organizationId,
maxSize});
return ((ResultObject)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginSetMaxDBSize(System.Guid organizationId, long maxSize, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetMaxDBSize", new object[] {
organizationId,
maxSize}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndSetMaxDBSize(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void SetMaxDBSizeAsync(System.Guid organizationId, long maxSize) {
this.SetMaxDBSizeAsync(organizationId, maxSize, null);
}
/// <remarks/>
public void SetMaxDBSizeAsync(System.Guid organizationId, long maxSize, object userState) {
if ((this.SetMaxDBSizeOperationCompleted == null)) {
this.SetMaxDBSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMaxDBSizeOperationCompleted);
}
this.InvokeAsync("SetMaxDBSize", new object[] {
organizationId,
maxSize}, this.SetMaxDBSizeOperationCompleted, userState);
}
private void OnSetMaxDBSizeOperationCompleted(object arg) {
if ((this.SetMaxDBSizeCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetMaxDBSizeCompleted(this, new SetMaxDBSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
@ -983,6 +1137,32 @@ namespace WebsitePanel.Providers.CRM {
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SetUserCALTypeCompletedEventHandler(object sender, SetUserCALTypeCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class SetUserCALTypeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal SetUserCALTypeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetCrmUserByDomainNameCompletedEventHandler(object sender, GetCrmUserByDomainNameCompletedEventArgs e);
@ -1063,17 +1243,17 @@ namespace WebsitePanel.Providers.CRM {
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetUsedSpaceCompletedEventHandler(object sender, GetUsedSpaceCompletedEventArgs e);
public delegate void GetDBSizeCompletedEventHandler(object sender, GetDBSizeCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetUsedSpaceCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
public partial class GetDBSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetUsedSpaceCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
internal GetDBSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
@ -1086,4 +1266,56 @@ namespace WebsitePanel.Providers.CRM {
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetMaxDBSizeCompletedEventHandler(object sender, GetMaxDBSizeCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetMaxDBSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetMaxDBSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public long Result {
get {
this.RaiseExceptionIfNecessary();
return ((long)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SetMaxDBSizeCompletedEventHandler(object sender, SetMaxDBSizeCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class SetMaxDBSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal SetMaxDBSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
}

View file

@ -55,9 +55,9 @@ namespace WebsitePanel.Server
[WebMethod, SoapHeader("settings")]
public OrganizationResult CreateOrganization(Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string organizationDomainName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation)
public OrganizationResult CreateOrganization(Guid organizationId, string organizationUniqueName, string organizationFriendlyName, string ou, string baseCurrencyCode, string baseCurrencyName, string baseCurrencySymbol, string initialUserDomainName, string initialUserFirstName, string initialUserLastName, string initialUserPrimaryEmail, string organizationCollation, long maxSize)
{
return CrmProvider.CreateOrganization(organizationId, organizationUniqueName, organizationFriendlyName, organizationDomainName, ou, baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, initialUserDomainName, initialUserFirstName, initialUserLastName, initialUserPrimaryEmail, organizationCollation);
return CrmProvider.CreateOrganization(organizationId, organizationUniqueName, organizationFriendlyName, ou, baseCurrencyCode, baseCurrencyName, baseCurrencySymbol, initialUserDomainName, initialUserFirstName, initialUserLastName, initialUserPrimaryEmail, organizationCollation, maxSize);
}
[WebMethod, SoapHeader("settings")]
@ -79,9 +79,9 @@ namespace WebsitePanel.Server
}
[WebMethod, SoapHeader("settings")]
public UserResult CreateCRMUser(OrganizationUser user, string orgName, Guid organizationId, Guid baseUnitId)
public UserResult CreateCRMUser(OrganizationUser user, string orgName, Guid organizationId, Guid baseUnitId, int CALType)
{
return CrmProvider.CreateCRMUser(user, orgName, organizationId, baseUnitId);
return CrmProvider.CreateCRMUser(user, orgName, organizationId, baseUnitId, CALType);
}
[WebMethod, SoapHeader("settings")]
@ -107,6 +107,12 @@ namespace WebsitePanel.Server
{
return CrmProvider.SetUserRoles(orgName, userId, roles);
}
[WebMethod, SoapHeader("settings")]
public ResultObject SetUserCALType(string orgName, Guid userId, int CALType)
{
return CrmProvider.SetUserCALType(orgName, userId, CALType);
}
[WebMethod, SoapHeader("settings")]
public CrmUserResult GetCrmUserByDomainName(string domainName, string orgName)
@ -128,11 +134,22 @@ namespace WebsitePanel.Server
}
[WebMethod, SoapHeader("settings")]
public long GetUsedSpace(Guid organizationId)
public long GetDBSize(Guid organizationId)
{
return CrmProvider.GetUsedSpace( organizationId);
return CrmProvider.GetDBSize(organizationId);
}
[WebMethod, SoapHeader("settings")]
public long GetMaxDBSize(Guid organizationId)
{
return CrmProvider.GetMaxDBSize(organizationId);
}
[WebMethod, SoapHeader("settings")]
public ResultObject SetMaxDBSize(Guid organizationId, long maxSize)
{
return CrmProvider.SetMaxDBSize(organizationId, maxSize);
}
}
}

View file

@ -518,9 +518,10 @@
<Control key="CRMUsers" src="WebsitePanel/CRM/CRMUsers.ascx" title="CRM Users" type="View" />
<Control key="CRMUserRoles" src="WebsitePanel/CRM/CRMUserRoles.ascx" title="CRM User Roles" type="View" />
<Control key="create_crm_user" src="WebsitePanel/CRM/CreateCRMUser.ascx" title="Create CRM User" type="View" />
<Control key="crm_storage_settings" src="WebsitePanel/CRM/CRMStorageSettings.ascx" title="CRMRestoreSiteCollection" type="View"/>
<Control key="sharepoint_sitecollections" src="WebsitePanel/HostedSharePointSiteCollections.ascx" title="HostedSharePointSiteCollections" type="View" icon="colors_48.png"/>
<Control key="sharepoint_sitecollections" src="WebsitePanel/HostedSharePointSiteCollections.ascx" title="HostedSharePointSiteCollections" type="View" icon="colors_48.png"/>
<Control key="sharepoint_edit_sitecollection" src="WebsitePanel/HostedSharePointEditSiteCollection.ascx" title="HostedSharePointSiteCollection" type="View" icon="colors_48.png" />
<Control key="sharepoint_backup_sitecollection" src="WebsitePanel/HostedSharePointBackupSiteCollection.ascx" title="HostedSharePointBackupSiteCollection" type="View"/>
<Control key="sharepoint_restore_sitecollection" src="WebsitePanel/HostedSharePointRestoreSiteCollection.ascx" title="HostedSharePointRestoreSiteCollection" type="View"/>

View file

@ -3326,7 +3326,7 @@
<value>Max site storage, MB</value>
</data>
<data name="Quota.HostedCRM.Users" xml:space="preserve">
<value>CRM users per organization</value>
<value>Full licenses per organization</value>
</data>
<data name="Quota.HostedCRM.Organization" xml:space="preserve">
<value>CRM Organization</value>
@ -5365,4 +5365,10 @@
<data name="Success.ENTERPRISE_STORAGE_UPDATE_FOLDER_SETTINGS" xml:space="preserve">
<value>Enterprise storage folder settings have been successfully updated.</value>
</data>
<data name="Quota.HostedCRM.LimitedUsers" xml:space="preserve">
<value>Limited licenses per organization</value>
</data>
<data name="Quota.HostedCRM.MaxDatabaseSize" xml:space="preserve">
<value>Max Database Size, MB</value>
</data>
</root>

View file

@ -0,0 +1,151 @@
<?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="btnSave.Text" xml:space="preserve">
<value>Save</value>
</data>
<data name="FormComments.Text" xml:space="preserve">
<value>&lt;p&gt;Storage settings are used to limit the amount of storage available on a SharePoint site collection, and they are used to send e-mail alerts to the site administrator when a specified value of space is used.&lt;/p&gt;
&lt;p&gt;These settings will be applied to the new site collections only. By clicking "Save and Apply to All Site Collections" button you can override these settings for all existing site collections.&lt;/p&gt;
&lt;p&gt;Please note, that you cannot specify storage settings higher than defined in the space hosting plan.&lt;/p&gt;</value>
</data>
<data name="locMaxStorage.Text" xml:space="preserve">
<value>Reassign storage space (MB):</value>
</data>
<data name="locWarningStorage.Text" xml:space="preserve">
<value>Send warning E-mail when site storage reaches (MB):</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Storage Settings</value>
</data>
<data name="Text.PageName" xml:space="preserve">
<value>Storage Settings</value>
</data>
<data name="secStorageLimits.Text" xml:space="preserve">
<value>Storage Settings</value>
</data>
<data name="chkQuotaUnlimited.Text" xml:space="preserve">
<value>Don't use</value>
</data>
<data name="WarningUnlimitedValue" xml:space="preserve">
<value>Do not send</value>
</data>
</root>

View file

@ -130,7 +130,7 @@
<value>There are no CRM users</value>
</data>
<data name="locQuota.Text" xml:space="preserve">
<value>Total users created</value>
<value>Full licenses :</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>CRM Users</value>

View file

@ -0,0 +1,74 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CRMStorageSettings.ascx.cs" Inherits="WebsitePanel.Portal.CRMStorageSettings" %>
<%@ Register Src="../ExchangeServer/UserControls/Breadcrumb.ascx" TagName="Breadcrumb"
TagPrefix="wsp" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport"
TagPrefix="wsp" %>
<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel"
TagPrefix="wsp" %>
<%@ Register Src="../ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox"
TagPrefix="wsp" %>
<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %>
<%@ Register src="../UserControls/QuotaEditor.ascx" tagname="QuotaEditor" tagprefix="uc1" %>
<div id="ExchangeContainer">
<div class="Module">
<div class="Header">
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
</div>
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="storage_limits" />
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="ExchangeStorageConfig48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" ></asp:Localize>
</div>
<div class="FormBody">
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<wsp:CollapsiblePanel id="secStorageLimits" runat="server"
TargetControlID="StorageLimits" meta:resourcekey="secStorageLimits" >
</wsp:CollapsiblePanel>
<asp:Panel ID="StorageLimits" runat="server" Height="0" style="overflow:hidden;">
<table>
<tr>
<td class="FormLabel200" align="right"><asp:Localize runat="server" meta:resourcekey="locUsageStorage" >Current usage (MB):</asp:Localize></td>
<td>
<asp:Label ID="lblDBSize" runat="server" Text="0" /> of <asp:Label ID="lblMAXDBSize" runat="server" Text="0" />
</tr>
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxStorage" runat="server" meta:resourcekey="locMaxStorage" >Reassign storage space (MB):</asp:Localize></td>
<td>
<uc1:QuotaEditor QuotaTypeId="2" ID="maxStorageSettingsValue" runat="server" />
</td>
</tr>
<!--
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locWarningStorage" runat="server" meta:resourcekey="locWarningStorage" ></asp:Localize></td>
<td>
<uc1:QuotaEditor QuotaTypeId="2" ID="warningValue" runat="server" />
</td>
</tr>
-->
</table>
<br />
</asp:Panel>
<div class="FormFooterClean">
<asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1" meta:resourcekey="btnSave"
ValidationGroup="EditStorageSettings" OnClick="btnSave_Click" ></asp:Button>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,110 @@
// 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 WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.HostedSolution;
namespace WebsitePanel.Portal
{
public partial class CRMStorageSettings : WebsitePanelModuleBase
{
public string SizeValueToString(long val)
{
return (val == -1) ? GetSharedLocalizedString("Text.Unlimited") : val.ToString();
}
protected void Page_Load(object sender, EventArgs e)
{
warningValue.UnlimitedText = GetLocalizedString("WarningUnlimitedValue");
if (!IsPostBack)
{
BindValues();
}
}
private void BindValues()
{
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
maxStorageSettingsValue.ParentQuotaValue = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
long maxDBSize = ES.Services.CRM.GetMaxDBSize(PanelRequest.ItemID, PanelSecurity.PackageId);
long DBSize = ES.Services.CRM.GetDBSize(PanelRequest.ItemID, PanelSecurity.PackageId);
DBSize = DBSize > 0 ? DBSize = DBSize / (1024 * 1024) : DBSize;
maxDBSize = maxDBSize > 0 ? maxDBSize = maxDBSize / (1024 * 1024) : maxDBSize;
maxStorageSettingsValue.QuotaValue = Convert.ToInt32(maxDBSize);
lblDBSize.Text = SizeValueToString(DBSize);
lblMAXDBSize.Text = SizeValueToString(maxDBSize);
}
private void Save()
{
try
{
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
int limitSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
int maxSize = maxStorageSettingsValue.QuotaValue;
if (limitSize != -1)
{
if (maxSize == -1) maxSize = limitSize;
if (maxSize > limitSize) maxSize = limitSize;
}
if (maxSize > 0)
{
maxSize = maxSize * 1024 * 1024;
}
ES.Services.CRM.SetMaxDBSize(PanelRequest.ItemID, PanelSecurity.PackageId, maxSize);
messageBox.ShowSuccessMessage("HOSTED_SHAREPOINT_UPDATE_QUOTAS");
BindValues();
}
catch (Exception)
{
messageBox.ShowErrorMessage("HOSTED_SHAREPOINT_UPDATE_QUOTAS");
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
Save();
}
}
}

View file

@ -0,0 +1,169 @@
// 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.
//
// 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 CRMStorageSettings {
/// <summary>
/// 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 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 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 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>
/// 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>
/// secStorageLimits control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secStorageLimits;
/// <summary>
/// StorageLimits 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 StorageLimits;
/// <summary>
/// lblDBSize 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 lblDBSize;
/// <summary>
/// lblMAXDBSize 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 lblMAXDBSize;
/// <summary>
/// locMaxStorage 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 locMaxStorage;
/// <summary>
/// maxStorageSettingsValue control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaEditor maxStorageSettingsValue;
/// <summary>
/// locWarningStorage 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 locWarningStorage;
/// <summary>
/// warningValue control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaEditor warningValue;
/// <summary>
/// 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;
}
}

View file

@ -49,6 +49,17 @@
onclick="btnActive_Click" meta:resourcekey="btnActivate" /><asp:Button CssClass="Button1" runat="server"
Text="Deactivate" ID="btnDeactivate" onclick="btnDeactivate_Click" meta:resourcekey="btnDeactivate"/></td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize runat="server" meta:resourcekey="locLicenseType" Text="License Type:" /></td>
<td>
<asp:DropDownList ID="ddlLicenseType" runat="server" CssClass="NormalTextBox" AutoPostBack="false">
<asp:ListItem Value="0" meta:resourcekey="ddlLicenseTypeFull">Full</asp:ListItem>
<asp:ListItem Value="2" meta:resourcekey="ddlLicenseTypeLimited">Limited</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
<br />
</div>

View file

@ -58,6 +58,19 @@ namespace WebsitePanel.Portal.CRM
lblDisplayName.Text = user.DisplayName;
lblEmailAddress.Text = user.PrimaryEmailAddress;
lblDomainName.Text = user.DomainUserName;
int cALType = userResult.Value.CALType;
switch (cALType)
{
case 0 :
case 2 :
ddlLicenseType.SelectedValue = cALType.ToString();
break;
default:
ddlLicenseType.SelectedIndex = 0;
break;
}
}
else
{
@ -103,7 +116,20 @@ namespace WebsitePanel.Portal.CRM
ES.Services.CRM.SetUserRoles(PanelRequest.ItemID, PanelRequest.AccountID, PanelSecurity.PackageId,
roles.ToArray());
messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM");
int CALType = 0;
int.TryParse(ddlLicenseType.SelectedValue, out CALType);
ResultObject res2 =
ES.Services.CRM.SetUserCALType(PanelRequest.ItemID, PanelRequest.AccountID, PanelSecurity.PackageId,
CALType);
if (!res2.IsSuccess)
messageBox.ShowErrorMessage("UPDATE_CRM_USER_ROLES");
else if (!res.IsSuccess)
messageBox.ShowErrorMessage("UPDATE_CRM_USER_ROLES");
else
messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM");
}
catch(Exception ex)
{

View file

@ -1,10 +1,37 @@
//------------------------------------------------------------------------------
// 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.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -166,6 +193,15 @@ namespace WebsitePanel.Portal.CRM {
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnDeactivate;
/// <summary>
/// ddlLicenseType 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 ddlLicenseType;
/// <summary>
/// gvRoles control.
/// </summary>
@ -183,14 +219,5 @@ namespace WebsitePanel.Portal.CRM {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnUpdate;
/// <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;
}
}

View file

@ -67,7 +67,6 @@
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsAccountsPaged" runat="server" EnablePaging="True"
SelectCountMethod="GetCRMUsersPagedCount"
SelectMethod="GetCRMUsersPaged"
SortParameterName="sortColumn"
@ -80,9 +79,26 @@
</SelectParameters>
</asp:ObjectDataSource>
<br />
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Total Users Created:"></asp:Localize>
&nbsp;&nbsp;&nbsp;
<wsp:QuotaViewer ID="usersQuota" runat="server" QuotaTypeId="2" />
<table>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Full licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="usersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locLimitedQuota" runat="server" meta:resourcekey="locLimitedQuota" Text="Limited licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="limitedusersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
</table>
</div>
</div>
</div>

View file

@ -48,10 +48,15 @@ namespace WebsitePanel.Portal.CRM
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
int allocatedCrmUsers = stats.AllocatedCRMUsers;
int usedUsers = stats.CreatedCRMUsers;
usersQuota.QuotaUsedValue = usedUsers;
usersQuota.QuotaValue = allocatedCrmUsers;
if (stats.AllocatedCRMUsers != -1) usersQuota.QuotaAvailable = tenantStats.AllocatedCRMUsers - tenantStats.CreatedCRMUsers;
limitedusersQuota.QuotaUsedValue = stats.CreatedLimitedCRMUsers;
limitedusersQuota.QuotaValue = stats.AllocatedLimitedCRMUsers;
//if (stats.AllocatedCRMUsers != -1) usersQuota.QuotaAvailable = tenantStats.AllocatedCRMUsers - tenantStats.CreatedCRMUsers;
//if (stats.AllocatedLimitedCRMUsers != -1) limitedusersQuota.QuotaAvailable = tenantStats.AllocatedLimitedCRMUsers - tenantStats.CreatedLimitedCRMUsers;
}
}

View file

@ -1,4 +1,32 @@
//------------------------------------------------------------------------------
// 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.
//
@ -157,12 +185,21 @@ namespace WebsitePanel.Portal.CRM {
protected global::WebsitePanel.Portal.QuotaViewer usersQuota;
/// <summary>
/// FormComments control.
/// locLimitedQuota 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;
protected global::System.Web.UI.WebControls.Localize locLimitedQuota;
/// <summary>
/// limitedusersQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer limitedusersQuota;
}
}

View file

@ -38,6 +38,16 @@
<td class="FormLabel150"><asp:Localize ID="Localize1" runat="server" meta:resourcekey="locDisplayName" Text="Display Name: *"></asp:Localize></td>
<td><wsp:UserSelector id="userSelector" runat="server" IncludeMailboxes="true"></wsp:UserSelector></td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize runat="server" meta:resourcekey="locLicenseType" Text="License Type: *" /></td>
<td>
<asp:DropDownList ID="ddlLicenseType" runat="server" CssClass="NormalTextBox" AutoPostBack="false">
<asp:ListItem Value="0" meta:resourcekey="ddlLicenseTypeFull">Full</asp:ListItem>
<asp:ListItem Value="2" meta:resourcekey="ddlLicenseTypeLimited">Limited</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="FormLabel150">

View file

@ -68,9 +68,12 @@ namespace WebsitePanel.Portal.CRM
try
{
OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, accountId);
user.AccountId = accountId;
user.AccountId = accountId;
res = ES.Services.CRM.CreateCRMUser(user, PanelSecurity.PackageId, PanelRequest.ItemID, new Guid(ddlBusinessUnits.SelectedValue));
int cALType = 0;
int.TryParse(ddlLicenseType.SelectedValue, out cALType);
res = ES.Services.CRM.CreateCRMUser(user, PanelSecurity.PackageId, PanelRequest.ItemID, new Guid(ddlBusinessUnits.SelectedValue), cALType);
if (res.IsSuccess)
{

View file

@ -1,10 +1,37 @@
//------------------------------------------------------------------------------
// 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.
// Runtime Version:2.0.50727.1873
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -94,6 +121,15 @@ namespace WebsitePanel.Portal.CRM {
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UserSelector userSelector;
/// <summary>
/// ddlLicenseType 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 ddlLicenseType;
/// <summary>
/// Localize2 control.
/// </summary>
@ -129,14 +165,5 @@ namespace WebsitePanel.Portal.CRM {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1;
/// <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;
}
}

View file

@ -76,7 +76,7 @@ namespace WebsitePanel.Portal
else
email = filterValue;
IntResult res = ES.Services.CRM.GetCRMUserCount(itemId, name, email);
IntResult res = ES.Services.CRM.GetCRMUserCount(itemId, name, email, -1);
return res.Value;
}

View file

@ -145,7 +145,7 @@
<value>Contacts:</value>
</data>
<data name="lnkCRMUsers.Text" xml:space="preserve">
<value>CRM Users:</value>
<value>Full licenses :</value>
</data>
<data name="lnkDomains.Text" xml:space="preserve">
<value>Domain Names:</value>

View file

@ -208,12 +208,28 @@
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:HyperLink ID="lnkCRMUsers" runat="server" meta:resourcekey="lnkCRMUsers"></asp:HyperLink>
<asp:HyperLink ID="lnkCRMUsers" runat="server" meta:resourcekey="lnkCRMUsers" Text="Full licenses :"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="crmUsersStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:HyperLink ID="lnkLimitedCRMUsers" runat="server" meta:resourcekey="lnkLimitedCRMUsers" Text="Limited licenses :"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="crmLimitedUsersStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:Localize ID="locCRMDBSize" runat="server" meta:resourcekey="locCRMDBSize" Text="Storage size (ÌÂ):"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="crmDBSize" runat="server" QuotaTypeId="2" DisplayGauge="true" />
</td>
</tr>
</asp:Panel>
<asp:Panel runat="server" ID="enterpriseStorageStatsPanel">

View file

@ -246,9 +246,18 @@ namespace WebsitePanel.Portal.ExchangeServer
lnkCRMUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "crmusers",
"SpaceID=" + PanelSecurity.PackageId);
lnkLimitedCRMUsers.NavigateUrl = lnkCRMUsers.NavigateUrl;
crmUsersStats.QuotaUsedValue = stats.CreatedCRMUsers;
crmUsersStats.QuotaValue = stats.AllocatedCRMUsers;
if (stats.AllocatedCRMUsers != -1) crmUsersStats.QuotaAvailable = tenantStats.AllocatedCRMUsers - tenantStats.CreatedCRMUsers;
//if (stats.AllocatedCRMUsers != -1) crmUsersStats.QuotaAvailable = tenantStats.AllocatedCRMUsers - tenantStats.CreatedCRMUsers;
crmLimitedUsersStats.QuotaUsedValue = stats.CreatedLimitedCRMUsers;
crmLimitedUsersStats.QuotaValue = stats.AllocatedLimitedCRMUsers;
crmDBSize.QuotaUsedValue = Convert.ToInt32( stats.UsedCRMDiskSpace>0 ? stats.UsedCRMDiskSpace/(1024*1024) : -1);
crmDBSize.QuotaValue = Convert.ToInt32(stats.AllocatedCRMDiskSpace>0 ? stats.AllocatedCRMDiskSpace/(1024*1024) : -1);
}
private void BindOCSStats(OrganizationStatistics stats, OrganizationStatistics tenantStats)

View file

@ -535,6 +535,42 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmUsersStats;
/// <summary>
/// lnkLimitedCRMUsers 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.HyperLink lnkLimitedCRMUsers;
/// <summary>
/// crmLimitedUsersStats control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmLimitedUsersStats;
/// <summary>
/// locCRMDBSize 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 locCRMDBSize;
/// <summary>
/// crmDBSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmDBSize;
/// <summary>
/// enterpriseStorageStatsPanel control.
/// </summary>

View file

@ -193,6 +193,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
crmGroup.MenuItems.Add(CreateMenuItem("CRMOrganization", "CRMOrganizationDetails"));
crmGroup.MenuItems.Add(CreateMenuItem("CRMUsers", "CRMUsers"));
crmGroup.MenuItems.Add(CreateMenuItem("StorageLimits", "crm_storage_settings"));
if (crmGroup.MenuItems.Count > 0)
groups.Add(crmGroup);