Index: /branches/OaaS/HeuristicLab 3.3 Services.sln
===================================================================
--- /branches/OaaS/HeuristicLab 3.3 Services.sln	(revision 9575)
+++ /branches/OaaS/HeuristicLab 3.3 Services.sln	(revision 9576)
@@ -71,4 +71,6 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.Optimization.Billing", "HeuristicLab.Services.Optimization.Billing\HeuristicLab.Services.Optimization.Billing.csproj", "{5DC3E4F1-E21B-4C18-8921-88058E86FB07}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Services.Optimization.Billing.Test", "HeuristicLab.Services.Optimization.Billing.Test\HeuristicLab.Services.Optimization.Billing.Test.csproj", "{07D84A1D-56B7-4A8A-87EF-303A8518D48C}"
 EndProject
 Global
@@ -374,4 +376,16 @@
 		{5DC3E4F1-E21B-4C18-8921-88058E86FB07}.Release|x64.ActiveCfg = Release|Any CPU
 		{5DC3E4F1-E21B-4C18-8921-88058E86FB07}.Release|x86.ActiveCfg = Release|Any CPU
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Debug|x64.ActiveCfg = Debug|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Debug|x86.ActiveCfg = Debug|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Debug|x86.Build.0 = Debug|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Release|Any CPU.ActiveCfg = Release|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Release|Mixed Platforms.Build.0 = Release|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Release|x64.ActiveCfg = Release|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Release|x86.ActiveCfg = Release|x86
+		{07D84A1D-56B7-4A8A-87EF-303A8518D48C}.Release|x86.Build.0 = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
Index: /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/App.config
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/App.config	(revision 9576)
+++ /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/App.config	(revision 9576)
@@ -0,0 +1,6 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <connectionStrings>
+    <add name="BillingContext" connectionString="ADJUST_ME" providerName="System.Data.SqlClient"/>
+  </connectionStrings>
+</configuration>
Index: /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/HeuristicLab.Services.Optimization.Billing.Test.csproj
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/HeuristicLab.Services.Optimization.Billing.Test.csproj	(revision 9576)
+++ /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/HeuristicLab.Services.Optimization.Billing.Test.csproj	(revision 9576)
@@ -0,0 +1,66 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{07D84A1D-56B7-4A8A-87EF-303A8518D48C}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.Services.Optimization.Billing.Test</RootNamespace>
+    <AssemblyName>HeuristicLab.Services.Optimization.Billing.Test</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Services.Optimization.Billing\HeuristicLab.Services.Optimization.Billing.csproj">
+      <Project>{5DC3E4F1-E21B-4C18-8921-88058E86FB07}</Project>
+      <Name>HeuristicLab.Services.Optimization.Billing</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/Program.cs
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/Program.cs	(revision 9576)
+++ /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/Program.cs	(revision 9576)
@@ -0,0 +1,15 @@
+﻿using System;
+using HeuristicLab.Services.Optimization.Billing.DataAccess;
+
+namespace HeuristicLab.Services.Optimization.Billing.Test {
+  class Program {
+    static void Main(string[] args) {
+      //BillingService srv = new BillingService();
+      BillingDao dao = new BillingDao();
+      dao.FindAllProducts();
+
+      Console.WriteLine("Press any key to exit...");
+      Console.ReadKey();
+    }
+  }
+}
Index: /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/Properties/AssemblyInfo.cs
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/Properties/AssemblyInfo.cs	(revision 9576)
+++ /branches/OaaS/HeuristicLab.Services.Optimization.Billing.Test/Properties/AssemblyInfo.cs	(revision 9576)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Services.Optimization.Billing.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("FH-Hagenberg")]
+[assembly: AssemblyProduct("HeuristicLab.Services.Optimization.Billing.Test")]
+[assembly: AssemblyCopyright("Copyright © FH-Hagenberg 2013")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("87bdf333-d1d1-4fa7-a2d6-15e59882f52b")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: /branches/OaaS/HeuristicLab.Services.Optimization.Billing/HeuristicLab.Services.Optimization.Billing.csproj
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Billing/HeuristicLab.Services.Optimization.Billing.csproj	(revision 9575)
+++ /branches/OaaS/HeuristicLab.Services.Optimization.Billing/HeuristicLab.Services.Optimization.Billing.csproj	(revision 9576)
@@ -32,6 +32,11 @@
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="EntityFramework">
+      <HintPath>..\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
     <Reference Include="System.Core" />
+    <Reference Include="System.Data.Entity" />
     <Reference Include="System.ServiceModel" />
     <Reference Include="System.Xml.Linq" />
@@ -42,9 +47,20 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Business\BillingService.cs" />
+    <Compile Include="Business\BillingServiceProvider.cs" />
+    <Compile Include="DataAccess\BillingContext.cs" />
+    <Compile Include="DataAccess\BillingDao.cs" />
+    <Compile Include="Interfaces\IEntity.cs" />
+    <Compile Include="Interfaces\IGenericDao.cs" />
     <Compile Include="Interfaces\IOptimizationBilling.cs" />
-    <Compile Include="MockupOptimizationBilling.cs" />
+    <Compile Include="Business\MockupBillingService.cs" />
     <Compile Include="Model\Model.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+    <None Include="packages.config" />
+  </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
Index: /branches/OaaS/HeuristicLab.Services.Optimization.Billing/Interfaces/IOptimizationBilling.cs
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Billing/Interfaces/IOptimizationBilling.cs	(revision 9575)
+++ /branches/OaaS/HeuristicLab.Services.Optimization.Billing/Interfaces/IOptimizationBilling.cs	(revision 9576)
@@ -1,8 +1,5 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+﻿using System.Collections.Generic;
+using System.Net.Security;
 using System.ServiceModel;
-using System.Net.Security;
 using HeuristicLab.Services.Optimization.Billing.Model;
 
@@ -10,7 +7,13 @@
   [ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]
   public interface IOptimizationBilling {
+    [OperationContract]
     IList<Product> GetProducts();
+
     // payment methods via enumeration
+
+    [OperationContract]
     void SaveOrder(Order order);
+
+    [OperationContract]
     IList<Order> GetOrdersByState(OrderState state);
   }
Index: anches/OaaS/HeuristicLab.Services.Optimization.Billing/MockupOptimizationBilling.cs
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Billing/MockupOptimizationBilling.cs	(revision 9575)
+++ 	(revision )
@@ -1,52 +1,0 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using HeuristicLab.Services.Optimization.Billing.Interfaces;
-
-namespace HeuristicLab.Services.Optimization.Billing {
-  public class MockupOptimizationBilling : IOptimizationBilling {
-    
-    private static IList<Model.Product> products;
-    private static IDictionary<string, IList<Model.Order>> userToOrders;
-    private static IList<Model.Order> allOrders;
-
-    static MockupOptimizationBilling() {
-      products = new List<Model.Product>();
-      products.Add(new Model.Product() {
-        Name = "Optimization-as-a-Service - Experiment execution",
-        Description = "Create and run your experiments within HeuristicLab Hive",
-        Id = 1,
-        Price = 10.0,
-        ProductType = "Optimization Service"
-      });
-      products.Add(new Model.Product() {
-        Name = "Whatever-o-matic - Experiment execution",
-        Description = "Another fine product",
-        Id = 2,
-        Price = 100.0,
-        ProductType = "Product"
-      });
-
-      userToOrders = new Dictionary<string, IList<Model.Order>>();
-      allOrders = new List<Model.Order>();
-    }
-
-    public IList<Model.Product> GetProducts() {
-      return products;
-    }
-
-    public void SaveOrder(Model.Order order) {
-      IList<Model.Order> orders;
-      if (!userToOrders.TryGetValue(order.User.Name, out orders)) {
-        userToOrders[order.User.Name] = orders = new List<Model.Order>();
-      }
-      orders.Add(order);
-      allOrders.Add(order);
-    }
-
-    public IList<Model.Order> GetOrdersByState(Model.OrderState state) {
-      return (from o in allOrders where o.State == state select o).ToList();
-    }
-  }
-}
Index: /branches/OaaS/HeuristicLab.Services.Optimization.Billing/Model/Model.cs
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Billing/Model/Model.cs	(revision 9575)
+++ /branches/OaaS/HeuristicLab.Services.Optimization.Billing/Model/Model.cs	(revision 9576)
@@ -1,10 +1,8 @@
 ﻿using System;
 using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 
 namespace HeuristicLab.Services.Optimization.Billing.Model {
   public class ContactInformation {
-    public long Id { get; set; }
+    public long ContactInformationId { get; set; }
     public string OrganizationName { get; set; }
     public string Street { get; set; }
@@ -26,5 +24,5 @@
 
   public class Product {
-    public long Id { get; set; }
+    public long ProductId { get; set; }
     public string Name { get; set; }
     public string Description { get; set; }
@@ -34,4 +32,5 @@
 
   public class User {
+    public long UserId { get; set; }
     public string Name { get; set; }
   }
@@ -46,51 +45,68 @@
 
   public class Order {
-    public long Id { get; set; }
-    public User User { get; set; }
+    public long OrderId { get; set; }
+    public long UserId { get; set; }
     public string BillingType { get; set; }
-    public OrderState State { get; set; }
+    public long OrderStateId { get; set; }
     public string BillingPeriod { get; set; }
     public DateTime ActiveSince { get; set; }
     public DateTime ActiveUntil { get; set; }
-    public IList<Invoice> Invoices { get; set; }
-    public IList<OrderLine> OrderLines { get; set; }
+
+
+    public virtual User User { get; set; }
+    public virtual OrderState State { get; set; }
+    public virtual IList<Invoice> Invoices { get; set; }
+    public virtual IList<OrderLine> OrderLines { get; set; }
   }
 
   public class OrderLine {
-    public long Id { get; set; }
-    public Order Order { get; set; }
-    public Product Product { get; set; }
+    public long OrderLineId { get; set; }
+    public long OrderId { get; set; }
+    public long ProductId { get; set; }
     public int Quantity { get; set; }
     public double ProductPrice { get; set; }
+
+    public virtual Order Order { get; set; }
+    public virtual Product Product { get; set; }
   }
 
   public class Invoice {
-    public long Id { get; set; }
-    public User User { get; set; }
+    public long InvoiceId { get; set; }
+    public long UserId { get; set; }
+    public long OrderId { get; set; }
     public DateTime Due { get; set; }
     public string Status { get; set; }
     public string InvoiceDocument { get; set; }
-    public Order Order { get; set; }
+
+    public virtual User User { get; set; }
+    public virtual Order Order { get; set; }
   }
 
   public class InvoiceLine {
-    public long Id { get; set; }
-    public Invoice Invoice { get; set; }
-    public Product Product { get; set; }
+    public long InvoiceLineId { get; set; }
+    public long InvoiceId { get; set; }
+    public long ProductId { get; set; }
     public int Quantity { get; set; }
     public double ProductPrice { get; set; }
+
+    public virtual Invoice Invoice { get; set; }
+    public virtual Product Product { get; set; }
   }
 
-  public class Usage {
-    public long Id { get; set; }
-    public User User { get; set; }
-    public IList<UsageLine> UsageLines { get; set; }
+  public class UsageRecord {
+    public long UsageRecordId { get; set; }
+    public long UserId { get; set; }
+
+    public virtual User User { get; set; }
+    public virtual IList<UsageRecordLine> UsageRecordLines { get; set; }
   }
 
-  public class UsageLine {
-    public long Id { get; set; }
-    public Usage Usage { get; set; }
+  public class UsageRecordLine {
+    public long UsageRecordLineId { get; set; }
+    public long UsageRecordId { get; set; }
     public DateTime Begin { get; set; }
     public DateTime End { get; set; }
+
+    public virtual UsageRecord UsageRecord { get; set; }
   }
 }
Index: /branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/OrderAdminController.cs
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/OrderAdminController.cs	(revision 9575)
+++ /branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/OrderAdminController.cs	(revision 9576)
@@ -1,36 +1,30 @@
-﻿using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Web;
+﻿using System.Linq;
 using System.Web.Mvc;
+using HeuristicLab.Services.Optimization.Billing.Business;
+using HeuristicLab.Services.Optimization.Billing.Interfaces;
 using HeuristicLab.Services.Optimization.Web.Models;
-using HeuristicLab.Services.Optimization.Billing.Interfaces;
-using HeuristicLab.Services.Optimization.Billing;
 
-namespace HeuristicLab.Services.Optimization.Web.Controllers
-{
-    [Authorize(Roles = "Web User")]
-    public class OrderAdminController : Controller
-    {
-        private IOptimizationBilling billing = new MockupOptimizationBilling();
+namespace HeuristicLab.Services.Optimization.Web.Controllers {
+  [Authorize(Roles = "Web User")]
+  public class OrderAdminController : Controller {
+    private IOptimizationBilling billing = BillingServiceProvider.Instance;
 
-        //
-        // GET: /OrderAdmin/
+    //
+    // GET: /OrderAdmin/
 
-        public ActionResult Index()
-        {
-            var orders = billing.GetOrdersByState(Billing.Model.OrderState.Created);
-            return View(new OrderAdminModel() { Orders = orders });
-        }
+    public ActionResult Index() {
+      var orders = billing.GetOrdersByState(Billing.Model.OrderState.Created);
+      return View(new OrderAdminModel() { Orders = orders });
+    }
 
-        [HttpPost]
-        public ActionResult ActivateOrder(OrderAdminModel model) {
-          var order = (from o in billing.GetOrdersByState(Billing.Model.OrderState.Created) where o.Id == model.OrderId select o).FirstOrDefault();
-          order.State = Billing.Model.OrderState.Active;
-          // TODO: Probably activate order via different method
-          billing.SaveOrder(order);
-          return RedirectToAction("Index");
-        }
+    [HttpPost]
+    public ActionResult ActivateOrder(OrderAdminModel model) {
+      var order = (from o in billing.GetOrdersByState(Billing.Model.OrderState.Created) where o.OrderId == model.OrderId select o).FirstOrDefault();
+      order.State = Billing.Model.OrderState.Active;
+      // TODO: Probably activate order via different method
+      billing.SaveOrder(order);
+      return RedirectToAction("Index");
+    }
 
-    }
+  }
 }
Index: /branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/OrderController.cs
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/OrderController.cs	(revision 9575)
+++ /branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/OrderController.cs	(revision 9576)
@@ -1,89 +1,84 @@
-﻿using System;
-using System.Collections.Generic;
+﻿using System.Collections.Generic;
 using System.Linq;
-using System.Web;
 using System.Web.Mvc;
+using System.Web.Security;
+using HeuristicLab.Services.Optimization.Billing.Business;
+using HeuristicLab.Services.Optimization.Billing.Interfaces;
+using HeuristicLab.Services.Optimization.Billing.Model;
 using HeuristicLab.Services.Optimization.Web.Models;
-using HeuristicLab.Services.Optimization.Billing.Model;
-using HeuristicLab.Services.Optimization.Billing.Interfaces;
-using HeuristicLab.Services.Optimization.Billing;
-using System.Web.Security;
 
-namespace HeuristicLab.Services.Optimization.Web.Controllers
-{
-    [Authorize(Roles = "Web User")]
-    public class OrderController : Controller
-    {
-        private IOptimizationBilling billing = new MockupOptimizationBilling();
+namespace HeuristicLab.Services.Optimization.Web.Controllers {
+  [Authorize(Roles = "Web User")]
+  public class OrderController : Controller {
+    private IOptimizationBilling billing = BillingServiceProvider.Instance;
 
-        //
-        // GET: /Order/
+    //
+    // GET: /Order/
 
-        public ActionResult Index()
-        {
-          return CreateOrder(new OrderModel()); //View();
-        }
+    public ActionResult Index() {
+      return CreateOrder(new OrderModel()); //View();
+    }
 
 
-        [HttpPost]
-        public ActionResult CreateOrder(OrderModel model) {
-          Session["order"] = model;
-          return AddProduct();
-        }
+    [HttpPost]
+    public ActionResult CreateOrder(OrderModel model) {
+      Session["order"] = model;
+      return AddProduct();
+    }
 
-        public ActionResult AddProduct() {
-          return View("AddProduct", new ProductsModel() { Products = billing.GetProducts() });
-        }
+    public ActionResult AddProduct() {
+      return View("AddProduct", new ProductsModel() { Products = billing.GetProducts() });
+    }
 
-        [HttpPost]
-        public ActionResult AddProduct(ProductsModel product) {
-          var order = Session["order"] as OrderModel;
-          var prod = (from b in billing.GetProducts() 
-                      where b.Id == product.ProductId
-                      select b).FirstOrDefault();
-          order.ProductQuantities[prod.Id] = product.Quantity;
-          return AddProduct();
-        }
+    [HttpPost]
+    public ActionResult AddProduct(ProductsModel product) {
+      var order = Session["order"] as OrderModel;
+      var prod = (from b in billing.GetProducts()
+                  where b.ProductId == product.ProductId
+                  select b).FirstOrDefault();
+      order.ProductQuantities[prod.ProductId] = product.Quantity;
+      return AddProduct();
+    }
 
-        public ActionResult SaveOrder() {
-          var orderModel = Session["order"] as OrderModel;
-          foreach (var key in orderModel.ProductQuantities.Keys) {
-            var product = (from p in billing.GetProducts() where p.Id == key select p).FirstOrDefault();
-            orderModel.Products[key] = product;            
-          }
-          return View(orderModel);
-        }
+    public ActionResult SaveOrder() {
+      var orderModel = Session["order"] as OrderModel;
+      foreach (var key in orderModel.ProductQuantities.Keys) {
+        var product = (from p in billing.GetProducts() where p.ProductId == key select p).FirstOrDefault();
+        orderModel.Products[key] = product;
+      }
+      return View(orderModel);
+    }
 
-        [HttpPost]
-        [ActionName("SaveOrder")]
-        public ActionResult SaveOrderPost() {
-          var orderModel = Session["order"] as OrderModel;
-          //TODO: Save order via back-end
-          var order = new Order() {
-            State = OrderState.Created,
-            User = new User() { Name = Membership.GetUser().UserName },
-            BillingType = orderModel.BillingType,
-            BillingPeriod = orderModel.BillingPeriod
-          };
-          
-          var orderLines = new List<OrderLine>();
-          var products = billing.GetProducts();
-          foreach (var key in orderModel.ProductQuantities.Keys) {
-            var product = (from p in products where p.Id == key select p).FirstOrDefault();
-            orderLines.Add(new OrderLine() {
-               Order = order,
-               Product = product,
-               ProductPrice = product.Price,
-               Quantity = orderModel.ProductQuantities[key]
-            });
-          }
-          order.OrderLines = orderLines;
-          billing.SaveOrder(order);
-          return RedirectToAction("OrderSaved");
-        }
+    [HttpPost]
+    [ActionName("SaveOrder")]
+    public ActionResult SaveOrderPost() {
+      var orderModel = Session["order"] as OrderModel;
+      //TODO: Save order via back-end
+      var order = new Order() {
+        State = OrderState.Created,
+        User = new User() { Name = Membership.GetUser().UserName },
+        BillingType = orderModel.BillingType,
+        BillingPeriod = orderModel.BillingPeriod
+      };
 
-        public ActionResult OrderSaved() {
-          return View();
-        }
+      var orderLines = new List<OrderLine>();
+      var products = billing.GetProducts();
+      foreach (var key in orderModel.ProductQuantities.Keys) {
+        var product = (from p in products where p.ProductId == key select p).FirstOrDefault();
+        orderLines.Add(new OrderLine() {
+          Order = order,
+          Product = product,
+          ProductPrice = product.Price,
+          Quantity = orderModel.ProductQuantities[key]
+        });
+      }
+      order.OrderLines = orderLines;
+      billing.SaveOrder(order);
+      return RedirectToAction("OrderSaved");
     }
+
+    public ActionResult OrderSaved() {
+      return View();
+    }
+  }
 }
Index: /branches/OaaS/HeuristicLab.Services.Optimization.Web/WebRole.cs
===================================================================
--- /branches/OaaS/HeuristicLab.Services.Optimization.Web/WebRole.cs	(revision 9575)
+++ /branches/OaaS/HeuristicLab.Services.Optimization.Web/WebRole.cs	(revision 9576)
@@ -1,6 +1,3 @@
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.WindowsAzure;
 using Microsoft.WindowsAzure.Diagnostics;
 using Microsoft.WindowsAzure.ServiceRuntime;
@@ -23,5 +20,5 @@
         }
       }
-      catch (RoleEnvironmentException ex) {
+      catch (RoleEnvironmentException) {
         // diagnostics connection string not in configuration
         // -> diagnostics disabled
Index: /branches/OaaS/packages/repositories.config
===================================================================
--- /branches/OaaS/packages/repositories.config	(revision 9575)
+++ /branches/OaaS/packages/repositories.config	(revision 9576)
@@ -3,4 +3,5 @@
   <repository path="..\HeuristicLab.Services.Hive.Scaler\packages.config" />
   <repository path="..\HeuristicLab.Services.Hive.WebRole\packages.config" />
+  <repository path="..\HeuristicLab.Services.Optimization.Billing\packages.config" />
   <repository path="..\HeuristicLab.Services.Optimization.Controller\packages.config" />
   <repository path="..\HeuristicLab.Services.Optimization.Web\packages.config" />
