1 | using System.Collections.Generic;
|
---|
2 | using System.Linq;
|
---|
3 | using System.ServiceModel;
|
---|
4 | using HeuristicLab.Services.Optimization.Billing.DataAccess;
|
---|
5 | using HeuristicLab.Services.Optimization.Billing.Interfaces;
|
---|
6 | using HeuristicLab.Services.Optimization.Billing.Model;
|
---|
7 |
|
---|
8 | namespace 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 | }
|
---|