Index: branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/OrderAdminController.cs
===================================================================
--- branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/OrderAdminController.cs	(revision 9558)
+++ 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 9558)
+++ 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();
+    }
+  }
 }
