CRM Module update

This commit is contained in:
dev_amdtel 2013-12-10 22:34:39 +04:00
parent 4f6d1f2c50
commit f500906c68
18 changed files with 150 additions and 17 deletions

View file

@ -42,10 +42,19 @@ namespace WebsitePanel.Portal
protected void Page_Load(object sender, EventArgs e)
{
warningValue.UnlimitedText = GetLocalizedString("WarningUnlimitedValue");
if (!IsPostBack)
{
BindValues();
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
if (org.CrmOrganizationId == Guid.Empty)
{
messageBox.ShowErrorMessage("NOT_CRM_ORGANIZATION");
StorageLimits.Enabled = false;
btnSave.Enabled = false;
}
else
{
BindValues();
}
}
}
@ -77,9 +86,9 @@ namespace WebsitePanel.Portal
try
{
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
int limitSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
long limitSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
int maxSize = maxStorageSettingsValue.QuotaValue;
long maxSize = maxStorageSettingsValue.QuotaValue;
if (limitSize != -1)
{

View file

@ -56,6 +56,7 @@
<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:ListItem Value="22" meta:resourcekey="ddlLicenseTypeESS">ESS</asp:ListItem>
</asp:DropDownList>
</td>
</tr>

View file

@ -59,12 +59,13 @@ namespace WebsitePanel.Portal.CRM
lblEmailAddress.Text = user.PrimaryEmailAddress;
lblDomainName.Text = user.DomainUserName;
int cALType = userResult.Value.CALType;
int cALType = userResult.Value.CALType + ((int)userResult.Value.ClientAccessMode) * 10;
switch (cALType)
{
case 0 :
case 2 :
case 22:
ddlLicenseType.SelectedValue = cALType.ToString();
break;
default:

View file

@ -97,6 +97,14 @@
<wsp:QuotaViewer ID="limitedusersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locESSQuota" runat="server" meta:resourcekey="locESSQuota" Text="ESS licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="essusersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
</table>
</div>

View file

@ -57,6 +57,10 @@ namespace WebsitePanel.Portal.CRM
//if (stats.AllocatedCRMUsers != -1) usersQuota.QuotaAvailable = tenantStats.AllocatedCRMUsers - tenantStats.CreatedCRMUsers;
//if (stats.AllocatedLimitedCRMUsers != -1) limitedusersQuota.QuotaAvailable = tenantStats.AllocatedLimitedCRMUsers - tenantStats.CreatedLimitedCRMUsers;
essusersQuota.QuotaUsedValue = stats.CreatedESSCRMUsers;
essusersQuota.QuotaValue = stats.AllocatedESSCRMUsers;
}
}

View file

@ -201,5 +201,23 @@ namespace WebsitePanel.Portal.CRM {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer limitedusersQuota;
/// <summary>
/// locESSQuota 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 locESSQuota;
/// <summary>
/// essusersQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer essusersQuota;
}
}

View file

@ -45,6 +45,7 @@
<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:ListItem Value="22" meta:resourcekey="ddlLicenseTypeESS">ESS</asp:ListItem>
</asp:DropDownList>
</td>
</tr>

View file

@ -224,7 +224,15 @@
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:HyperLink ID="lnkCRMDBSize" runat="server" meta:resourcekey="lnkCRMDBSize" Text="Storage size (ÌÂ):"></asp:HyperLink>
<asp:HyperLink ID="lnkESSCRMUsers" runat="server" meta:resourcekey="lnkESSCRMUsers" Text="ESS licenses :"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="crmESSUsersStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:HyperLink ID="lnkCRMDBSize" runat="server" meta:resourcekey="lnkCRMDBSize" Text="Storage size (MB):"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="crmDBSize" runat="server" QuotaTypeId="2" DisplayGauge="true" />

View file

@ -247,6 +247,7 @@ namespace WebsitePanel.Portal.ExchangeServer
"SpaceID=" + PanelSecurity.PackageId);
lnkLimitedCRMUsers.NavigateUrl = lnkCRMUsers.NavigateUrl;
lnkESSCRMUsers.NavigateUrl = lnkCRMUsers.NavigateUrl;
lnkCRMDBSize.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "crm_storage_settings",
"SpaceID=" + PanelSecurity.PackageId);
@ -259,7 +260,10 @@ namespace WebsitePanel.Portal.ExchangeServer
crmLimitedUsersStats.QuotaUsedValue = stats.CreatedLimitedCRMUsers;
crmLimitedUsersStats.QuotaValue = stats.AllocatedLimitedCRMUsers;
crmDBSize.QuotaUsedValue = Convert.ToInt32( stats.UsedCRMDiskSpace>0 ? stats.UsedCRMDiskSpace/(1024*1024) : -1);
crmESSUsersStats.QuotaUsedValue = stats.CreatedESSCRMUsers;
crmESSUsersStats.QuotaValue = stats.AllocatedESSCRMUsers;
crmDBSize.QuotaUsedValue = Convert.ToInt32(stats.UsedCRMDiskSpace > 0 ? stats.UsedCRMDiskSpace / (1024 * 1024) : -1);
crmDBSize.QuotaValue = Convert.ToInt32(stats.AllocatedCRMDiskSpace>0 ? stats.AllocatedCRMDiskSpace/(1024*1024) : -1);
}

View file

@ -553,6 +553,24 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmLimitedUsersStats;
/// <summary>
/// lnkESSCRMUsers 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 lnkESSCRMUsers;
/// <summary>
/// crmESSUsersStats control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmESSUsersStats;
/// <summary>
/// lnkCRMDBSize control.
/// </summary>