Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Services.Optimization.Web/Controllers/InvoiceController.cs @ 14534

Last change on this file since 14534 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.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using System.Web.Mvc;
6using HeuristicLab.Services.Optimization.Billing.Interfaces;
7using HeuristicLab.Services.Optimization.Billing.Business;
8using HeuristicLab.Services.Optimization.Billing;
9using HeuristicLab.Services.Optimization.Billing.Model;
10using HeuristicLab.Services.Optimization.Web.Models;
11using HeuristicLab.Services.Optimization.Web.Helpers;
12
13namespace HeuristicLab.Services.Optimization.Web.Controllers {
14  [BillingFilterActionAttribute]
15  public class InvoiceController : BaseController {
16    private IOptimizationBilling billing = BillingServiceProvider.Instance;
17
18    //
19    // GET: /Invoice/
20
21    public ActionResult Index() {
22      if (RedirectToLoginIfNecessary("%2fInvoice", false)) {
23        return View();
24      }
25      var invoice = billing.GetInvoices(UserName);
26      return View(new InvoiceModel() {
27         PaidInvoices = (from i in invoice where i.Status == InvoiceStatus.Paid select i).ToList(),
28         OpenInvoices = (from i in invoice where i.Status == InvoiceStatus.Open select i).ToList(),
29         OverdueInvoices = (from i in invoice where i.Status == InvoiceStatus.Overdue select i).ToList()
30      });
31    }
32
33  }
34}
Note: See TracBrowser for help on using the repository browser.