Changeset 9653 for branches/OaaS
- Timestamp:
- 06/24/13 14:04:56 (12 years ago)
- Location:
- branches/OaaS/HeuristicLab.Services.Optimization.Billing
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS/HeuristicLab.Services.Optimization.Billing/BillingEngine/BillingEngine.cs
r9645 r9653 61 61 // An invoice has never been generated from this order 62 62 order.NextBillableDay = currentDate; 63 order.EntityState = State.Modified; 63 64 } 64 65 -
branches/OaaS/HeuristicLab.Services.Optimization.Billing/BillingEngine/PlainTextInvoiceFormattingEngine.cs
r9641 r9653 38 38 } 39 39 40 public string Generate( Model.Invoice invoice) {40 public string Generate(Invoice invoice) { 41 41 invoiceText = string.Copy(template); 42 42 -
branches/OaaS/HeuristicLab.Services.Optimization.Billing/DataAccess/BillingContext.cs
r9645 r9653 20 20 public DbSet<PaymentInformation> PaymentInformations { get; set; } 21 21 22 // enum PaymentMethod23 // enum OrderState24 25 22 public BillingContext() 26 23 : this("name=BillingContext") { … … 31 28 : base(connectionString) { 32 29 33 Database.SetInitializer(new HeuristicLab.Services.Optimization.Billing.DataAccess.BillingContext.BillingContextInitiliazer());30 Database.SetInitializer(new BillingContextInitiliazer()); 34 31 35 32 // Hook up event to mark existing entities as Unchanged -
branches/OaaS/HeuristicLab.Services.Optimization.Billing/DataAccess/BillingDao.cs
r9645 r9653 2 2 using System; 3 3 using System.Collections.Generic; 4 using System.Data;5 4 using System.Data.Entity; 6 5 using System.Linq; … … 11 10 public class BillingDao { 12 11 13 #region Context Creation and Execution12 #region Context Creation 14 13 15 14 private BillingContext CreateContext() { … … 32 31 var products = context.Products.Where(predicate).ToList(); 33 32 return products; 33 } 34 } 35 36 public IEnumerable<Product> FindProductBy(Expression<Func<Product, bool>> query, params Expression<Func<Product, object>>[] includes) { 37 using (var context = CreateContext()) { 38 IQueryable<Product> products = context.Products.Where(query); 39 40 if (includes != null) { 41 products = includes.Aggregate(products, (current, include) => current.Include(include)); 42 } 43 44 return products.ToList(); 34 45 } 35 46 } -
branches/OaaS/HeuristicLab.Services.Optimization.Billing/Interfaces/IGenericDao.cs
r9577 r9653 9 9 IQueryable<T> FindBy(Expression<Func<T, bool>> predicate); 10 10 IQueryable<T> FindAll(); 11 void Add(T entity); 12 void Update(T entity); 11 void InsertOrUpdate(T entity); 13 12 void Delete(T entity); 14 13 void Commit();
Note: See TracChangeset
for help on using the changeset viewer.