Free cookie consent management tool by TermsFeed Policy Generator

source: branches/1888_OaaS/HeuristicLab.Services.Optimization.Web/Helpers/BillingComponent.cs @ 16127

Last change on this file since 16127 was 9586, checked in by fschoepp, 12 years ago

#1888:

  • Billing Component may now be deactivated by setting the BillingEnabled flag within the OaaS service configuration.
  • Added views for invoices and usage data.
  • Changed appearance of the SaveOrder view.
File size: 774 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using Microsoft.WindowsAzure.ServiceRuntime;
6using System.Configuration;
7
8namespace HeuristicLab.Services.Optimization.Web.Helpers {
9  public static class BillingComponent {
10    public static bool Enabled {
11      get {
12        try {
13          if (RoleEnvironment.IsAvailable) {
14            return Convert.ToBoolean(RoleEnvironment.GetConfigurationSettingValue("BillingEnabled"));
15          }
16          else {
17            return Convert.ToBoolean(ConfigurationManager.AppSettings["BillingEnabled"]);
18          }
19        }
20        catch (Exception) {
21          // simply disallow billing component if not set
22          return false;
23        }
24      }
25    }
26  }
27}
Note: See TracBrowser for help on using the repository browser.