Index: branches/OaaS/HeuristicLab.Services.Optimization.Billing/DataAccess/BillingContext.cs
===================================================================
--- branches/OaaS/HeuristicLab.Services.Optimization.Billing/DataAccess/BillingContext.cs	(revision 9579)
+++ branches/OaaS/HeuristicLab.Services.Optimization.Billing/DataAccess/BillingContext.cs	(revision 9602)
@@ -1,3 +1,5 @@
-﻿using System.Data.Entity;
+﻿using System;
+using System.Collections.Generic;
+using System.Data.Entity;
 using System.Data.Entity.ModelConfiguration;
 using System.Data.Entity.ModelConfiguration.Conventions;
@@ -6,5 +8,4 @@
 namespace HeuristicLab.Services.Optimization.Billing.DataAccess {
   public class BillingContext : DbContext {
-    public DbSet<ContactInformation> ContactInformations { get; set; }
     public DbSet<Product> Products { get; set; }
     public DbSet<User> Users { get; set; }
@@ -14,4 +15,6 @@
     public DbSet<InvoiceLine> InvoiceLines { get; set; }
     public DbSet<UsageRecord> UsageRecords { get; set; }
+    public DbSet<ContactInformation> ContactInformations { get; set; }
+    public DbSet<PaymentInformation> PaymentInformations { get; set; }
 
     // enum PaymentMethod
@@ -19,5 +22,5 @@
 
     public BillingContext()
-      : base("name=BillingContext") {
+      : this("name=BillingContext") {
 
     }
@@ -34,4 +37,5 @@
       modelBuilder.Configurations.Add(new InvoiceLineConfiguration());
       modelBuilder.Configurations.Add(new UsageRecordConfiguration());
+      modelBuilder.Configurations.Add(new UserConfiguration());
 
       modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>();
@@ -77,11 +81,19 @@
     }
 
+    private class UserConfiguration : EntityTypeConfiguration<User> {
+      internal UserConfiguration() {
+        this.HasMany(u => u.PaymentInformation).WithRequired(pi => pi.User).HasForeignKey(pi => pi.UserId);
+      }
+    }
+
     #endregion
 
     #region DB Seed Methods
 
-    public class BillingContextInitiliazer : DropCreateDatabaseIfModelChanges<BillingContext> {
+    // - DropCreateDatabaseAlways<BillingContext>
+    // - DropCreateDatabaseIfModelChanges<BillingContext>
+    public class BillingContextInitiliazer : DropCreateDatabaseAlways<BillingContext> {
       protected override void Seed(BillingContext context) {
-        context.Products.Add(new Model.Product() {
+        Product p1 = new Product() {
           Name = "Optimization-as-a-Service - Experiment execution",
           Description = "Create and run your experiments within HeuristicLab Hive",
@@ -89,5 +101,51 @@
           Price = 10.0,
           ProductType = "Optimization Service"
-        });
+        };
+        p1 = context.Products.Add(p1);
+
+        User u1 = new Model.User() { Name = "spimming" };
+        User u2 = new Model.User() {
+          Name = "fschoeppl",
+          PaymentInformation = new List<PaymentInformation>() { 
+            new PaymentInformation() { 
+              PaymentMethod = PaymentMethod.Visa, 
+              CardNumber = "123456789" } }
+        };
+
+        u1 = context.Users.Add(u1);
+        u2 = context.Users.Add(u2);
+
+        ContactInformation ci1 = new ContactInformation() {
+          FirstName = "Max",
+          LastName = "Mustermann",
+          Email = "max.mustermann@fh-hagenberg.at",
+          OrganizationName = "University of Applied Sciences Upper Austria School of Informatics/Communications/Media",
+          Street = "Softwarepark 11",
+          PostalCode = "4232",
+          City = "Hagenberg"
+        };
+
+        ci1 = context.ContactInformations.Add(ci1);
+
+        Order o1 = new Order() {
+          User = u2,
+          State = OrderState.Created,
+          BillingType = BillingType.Post,
+          BillingPeriod = BillingPeriod.Monthly,
+        };
+        OrderLine ol1 = new OrderLine() {
+          Order = o1,
+          Product = p1,
+          ProductPrice = p1.Price,
+          Quantity = 1
+        };
+        o1 = context.Orders.Add(o1);
+        ol1 = context.OrderLines.Add(ol1);
+
+        context.SaveChanges();
+
+        o1.State = OrderState.Active;
+        o1.ActiveSince = DateTime.Now;
+        context.Entry(o1).State = System.Data.EntityState.Modified;
         context.SaveChanges();
       }
Index: branches/OaaS/HeuristicLab.Services.Optimization.Billing/DataAccess/BillingDao.cs
===================================================================
--- branches/OaaS/HeuristicLab.Services.Optimization.Billing/DataAccess/BillingDao.cs	(revision 9579)
+++ branches/OaaS/HeuristicLab.Services.Optimization.Billing/DataAccess/BillingDao.cs	(revision 9602)
@@ -111,4 +111,157 @@
 
     #endregion
+
+    #region OrderLine Methods
+
+    public OrderLine FindOrderLineById(long id) {
+      return ExecuteWithContext<OrderLine>((context) => {
+        return context.OrderLines.FirstOrDefault(ol => ol.OrderLineId == id);
+      });
+    }
+
+    public IEnumerable<OrderLine> FindOrderLineBy(Expression<Func<OrderLine, bool>> predicate) {
+      using (var context = CreateContext()) {
+        var orderLines = context.OrderLines.Where(predicate).ToList();
+        return orderLines;
+      }
+    }
+
+    public IEnumerable<OrderLine> FindAllOrderLines() {
+      using (var context = CreateContext()) {
+        var orderLines = context.OrderLines.ToList();
+        return orderLines;
+      }
+    }
+
+    public void AddOrderLine(OrderLine entity) {
+      ExecuteWithContext((context) => {
+        context.OrderLines.Add(entity);
+        context.SaveChanges();
+      });
+    }
+
+    public void UpdateOrderLine(OrderLine entity) {
+      ExecuteWithContext((context) => {
+        context.OrderLines.Attach(entity);
+        context.Entry(entity).State = System.Data.EntityState.Modified;
+        context.SaveChanges();
+      });
+    }
+
+    void DeleteOrderLine(OrderLine entity) {
+      ExecuteWithContext((context) => {
+        context.OrderLines.Remove(entity);
+      });
+    }
+
+    #endregion
+
+    #region User Methods
+
+    public User FindUserById(long id) {
+      return ExecuteWithContext<User>((context) => {
+        return context.Users.FirstOrDefault(user => user.UserId == id);
+      });
+    }
+
+    public IEnumerable<User> FindUserBy(Expression<Func<User, bool>> predicate) {
+      using (var context = CreateContext()) {
+        var users = context.Users.Where(predicate).ToList();
+        return users;
+      }
+    }
+
+    public IEnumerable<User> FindAllUsers() {
+      using (var context = CreateContext()) {
+        var users = context.Users.ToList();
+        return users;
+      }
+    }
+
+    public void AddUser(User entity) {
+      ExecuteWithContext((context) => {
+        context.Users.Add(entity);
+        context.SaveChanges();
+      });
+    }
+
+    public void UpdateUser(User entity) {
+      ExecuteWithContext((context) => {
+        context.Users.Attach(entity);
+        context.Entry(entity).State = System.Data.EntityState.Modified;
+        context.SaveChanges();
+      });
+    }
+
+    void DeleteUser(User entity) {
+      ExecuteWithContext((context) => {
+        context.Users.Remove(entity);
+      });
+    }
+
+    #endregion
+
+    #region UsageRecords Methods
+
+    public UsageRecord FindUsageRecordById(long id) {
+      return ExecuteWithContext<UsageRecord>((context) => {
+        return context.UsageRecords.FirstOrDefault(prod => prod.ProductId == id);
+      });
+    }
+
+    public IEnumerable<UsageRecord> FindUsageRecordsBy(Expression<Func<UsageRecord, bool>> predicate) {
+      using (var context = CreateContext()) {
+        var records = context.UsageRecords.Where(predicate).ToList();
+        return records;
+      }
+    }
+
+    public IEnumerable<UsageRecord> FindAllUsageRecords() {
+      using (var context = CreateContext()) {
+        var records = context.UsageRecords.ToList();
+        return records;
+      }
+    }
+
+    public void AddUsageRecord(UsageRecord entity) {
+      ExecuteWithContext((context) => {
+        context.UsageRecords.Add(entity);
+        context.SaveChanges();
+      });
+    }
+
+    public void UpdateUsageRecord(UsageRecord entity) {
+      ExecuteWithContext((context) => {
+        context.UsageRecords.Attach(entity);
+        context.Entry(entity).State = System.Data.EntityState.Modified;
+        context.SaveChanges();
+      });
+    }
+
+    void DeleteUsageRecord(UsageRecord entity) {
+      ExecuteWithContext((context) => {
+        context.UsageRecords.Remove(entity);
+      });
+    }
+
+    #endregion
+
+    #region Invoice Methods
+
+    public void AddInvoice(Invoice entity) {
+      ExecuteWithContext((context) => {
+        context.Invoices.Add(entity);
+        context.SaveChanges();
+      });
+    }
+
+    public IEnumerable<Invoice> FindInvoiceBy(Expression<Func<Invoice, bool>> predicate) {
+      using (var context = CreateContext()) {
+        var invoices = context.Invoices.Where(predicate).ToList();
+        return invoices;
+      }
+    }
+
+    #endregion
   }
 }
