Skip to content

Commit

Permalink
This is the commit from MSFT
Browse files Browse the repository at this point in the history
  • Loading branch information
tameemansari committed Jan 11, 2017
1 parent a9b6c81 commit dcca405
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,20 @@ public async Task<CustomerViewModel> GetCustomerAccount()
CreationDate = item.CreationDate.ToString("d", responseCulture)
}).ToList();

List<CustomerUsageSubscriptionsModel> allUsageSubscriptionsOfCustomer = (from item in customerAllSubscriptions.Items
where item.BillingType == BillingType.Usage
select new CustomerUsageSubscriptionsModel()
{
Id = item.Id,
Name = item.FriendlyName,
Status = this.GetStatusType(item.Status),
CreationDate = item.CreationDate.ToString("d", responseCulture)
}).ToList();

return new CustomerViewModel()
{
Licenses = allSubscriptionsOfCustomer.OrderBy(items => items.OfferName)
Licenses = allSubscriptionsOfCustomer.OrderBy(items => items.OfferName),
UsageSubscriptions = allUsageSubscriptionsOfCustomer.OrderBy(items => items.Name)
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// -----------------------------------------------------------------------
// <copyright file="CustomerUsageSubscriptionsModel.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------

namespace Microsoft.Store.PartnerCenter.CustomerPortal.Models
{
/// <summary>
/// The customer licenses view model.
/// </summary>
public class CustomerUsageSubscriptionsModel
{
/// <summary>
/// Gets or sets the customer license Id.
/// </summary>
public string Id { get; set; }

/// <summary>
/// Gets or sets the friendly name.
/// </summary>
public string Name { get; set; }

/// <summary>
/// Gets or sets the customer license status like None, Active, Suspended or Deleted
/// </summary>
public string Status { get; set; }

/// <summary>
/// Gets or sets the license creation date.
/// </summary>
public string CreationDate { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,10 @@ public class CustomerViewModel
/// Gets or sets the customers licenses in this summary.
/// </summary>
public IEnumerable<CustomerLicensesModel> Licenses { get; set; }

/// <summary>
/// Gets or sets the customers usage subscriptions in this summary.
/// </summary>
public IEnumerable<CustomerUsageSubscriptionsModel> UsageSubscriptions { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@
<Compile Include="BusinessLogic\Commerce\ICommerceOperations.cs" />
<Compile Include="BusinessLogic\Commerce\PaymentGateways\PayPalGateway.cs" />
<Compile Include="BusinessLogic\Commerce\IPaymentGateway.cs" />
<Compile Include="Models\CustomerUsageSubscriptionsModel.cs" />
<Compile Include="Models\OfferCatalogViewModel.cs" />
<Compile Include="Models\Validators\ExpiryDateInTenYearsAttribute.cs" />
<Compile Include="Models\PurchaseLineItem.cs" />
Expand Down Expand Up @@ -582,6 +583,7 @@
<EmbeddedResource Include="Resources.nl.resx" />
<EmbeddedResource Include="Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
Expand Down
9 changes: 9 additions & 0 deletions Source/PartnerCenter.CustomerPortal/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Source/PartnerCenter.CustomerPortal/Resources.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1176,4 +1176,7 @@
<data name="InstrumentationKeyFieldSubText" xml:space="preserve">
<value>Sie können eine Application Insights Instrumentationsschlüssel angeben, um die Telemetrie-Daten aus dem Portal zu erfassen.</value>
</data>
<data name="UsageBasedSubscriptionsCaption" xml:space="preserve">
<value>Nutzung-Abonnements</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Source/PartnerCenter.CustomerPortal/Resources.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1176,4 +1176,7 @@
<data name="InstrumentationKeyFieldSubText" xml:space="preserve">
<value>Puede especificar una clave de instrumentación de aplicación de conocimientos con el fin de capturar los datos de telemetría desde el portal.</value>
</data>
<data name="UsageBasedSubscriptionsCaption" xml:space="preserve">
<value>Suscripciones de uso basado en</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Source/PartnerCenter.CustomerPortal/Resources.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1176,4 +1176,7 @@
<data name="InstrumentationKeyFieldSubText" xml:space="preserve">
<value>Vous pouvez spécifier une clé d’instrumentation aperçus de l’Application afin de capturer les données de télémétrie à partir du portail.</value>
</data>
<data name="UsageBasedSubscriptionsCaption" xml:space="preserve">
<value>Abonnements d’utilisation en fonction</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Source/PartnerCenter.CustomerPortal/Resources.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1176,4 +1176,7 @@
<data name="InstrumentationKeyFieldSubText" xml:space="preserve">
<value>ポータルからのテレメトリ データをキャプチャするために、アプリケーションのインサイト インストルメンテーション キーを指定できます。</value>
</data>
<data name="UsageBasedSubscriptionsCaption" xml:space="preserve">
<value>使用状況ベースのサブスクリプション</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Source/PartnerCenter.CustomerPortal/Resources.nl.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1176,4 +1176,7 @@
<data name="InstrumentationKeyFieldSubText" xml:space="preserve">
<value>U kunt een toepassing inzichten instrumentatie sleutel opgeven om te vangen telemetrie gegevens vanaf de portal.</value>
</data>
<data name="UsageBasedSubscriptionsCaption" xml:space="preserve">
<value>Gebruik op basis abonnementen</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Source/PartnerCenter.CustomerPortal/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1176,4 +1176,7 @@
<data name="InstrumentationKeyFieldSubText" xml:space="preserve">
<value>You can specify an Application Insights instrumentation key in order to capture telemetry data from the portal.</value>
</data>
<data name="UsageBasedSubscriptionsCaption" xml:space="preserve">
<value>Usage based subscriptions</value>
</data>
</root>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<tr class="SubscriptionRow">
<td>
<label class="abovemedium-text" data-bind="text: $data.OfferName"></label>
<label data-bind="text: ' - ' + $data.Id"></label>
</td>
<td class="left-aligned">
<label data-bind="text: $data.Quantity"></label>
Expand All @@ -52,5 +53,47 @@
</table>
</div>
</div>
<div class="subscriptions-content">
<div class="Padded">
<div class="row">
<label class="section">@Resources.UsageBasedSubscriptionsCaption</label>
</div>
<div class="row section-divider"></div>
<table class="subscriptions-table" cellspacing="1" cellpadding="5">
<tbody>
<tr class="medium-text">
<td>
<label>@Resources.LicenseNameCaption</label>
</td>
<td>
<label>@Resources.LicenseStatusCaption</label>
</td>
<td class="right-aligned">
<label>@Resources.LicenseCreatedDateCaption</label>
</td>
</tr>
<!-- ko foreach: viewModel.UsageSubscriptions -->
<tr class="SubscriptionRow">
<td>
<label class="abovemedium-text" data-bind="text: $data.Name"></label>
<label data-bind="text: ' - ' + $data.Id"></label>
</td>
<td>
<label data-bind="text: $data.Status"></label>
</td>
<td class="right-aligned">
<label data-bind="text: $data.CreationDate"></label>
</td>
</tr>
<!-- /ko -->
</tbody>
<tfoot>
<tr>
<td colspan="6" class="border-divider"></td>
</tr>
</tfoot>
</table>
</div>
</div>
<!-- /ko -->
</div>

0 comments on commit dcca405

Please sign in to comment.