Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Services.Optimization.Billing/Business/BillingService.cs @ 9586

Last change on this file since 9586 was 9586, checked in by fschoepp, 11 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: 1.9 KB
Line 
1using System.Collections.Generic;
2using System.Linq;
3using System.ServiceModel;
4using HeuristicLab.Services.Optimization.Billing.DataAccess;
5using HeuristicLab.Services.Optimization.Billing.Interfaces;
6using HeuristicLab.Services.Optimization.Billing.Model;
7
8namespace HeuristicLab.Services.Optimization.Billing.Business {
9  [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
10  public class BillingService : IOptimizationBilling {
11    #region Properties
12
13    private BillingDao billingDao;
14    private BillingDao BillingDao {
15      get {
16        if (billingDao == null) billingDao = new BillingDao();
17        return billingDao;
18      }
19    }
20
21    #endregion
22
23    #region Product Methods
24
25    public IList<Product> GetProducts() {
26      //TODO: Authentication
27      //TODO: Enable Transaction
28      return BillingDao.FindAllProducts().ToList();
29    }
30
31    #endregion
32
33    #region Order Methods
34
35    public void SaveOrder(Order order) {
36      //TODO: Authentication
37      //TODO: Enable Transaction
38      BillingDao.AddOrder(order);
39    }
40
41    public IList<Order> GetOrdersByState(OrderState state) {
42      //TODO: Authentication
43      //TODO: Enable Transaction
44      return BillingDao.FindOrderBy(order => order.State == state).ToList();
45    }
46
47    #endregion
48
49
50    public IList<Order> GetOrders(string userName) {
51      throw new System.NotImplementedException();
52    }
53
54
55    public User GetUser(string userName) {
56      throw new System.NotImplementedException();
57    }
58
59    public void SaveUser(User user) {
60      throw new System.NotImplementedException();
61    }
62
63
64    public IList<UsageRecord> GetUsageRecords(string userName) {
65      throw new System.NotImplementedException();
66    }
67
68
69    public IList<Invoice> GetInvoices(string userName) {
70      throw new System.NotImplementedException();
71    }
72  }
73}
Note: See TracBrowser for help on using the repository browser.