Last change
on this file since 15830 was
10013,
checked in by spimming, 11 years ago
|
#1888:
- enabled transactions
- enabled tracing output
- set correct invoice data
- saving invoices
|
File size:
1.6 KB
|
Rev | Line | |
---|
[9576] | 1 | using System;
|
---|
[9602] | 2 | using System.Data.Entity.Infrastructure;
|
---|
[9619] | 3 | using System.Diagnostics;
|
---|
[9602] | 4 | using System.IO;
|
---|
[9619] | 5 | using System.Threading;
|
---|
[9576] | 6 | using HeuristicLab.Services.Optimization.Billing.DataAccess;
|
---|
[9579] | 7 | using HeuristicLab.Services.Optimization.Billing.Model;
|
---|
[9576] | 8 |
|
---|
| 9 | namespace HeuristicLab.Services.Optimization.Billing.Test {
|
---|
| 10 | class Program {
|
---|
[10013] | 11 | private static HeuristicLab.Services.Optimization.Billing.BillingEngine.BillingEngine billingEngine;
|
---|
[9619] | 12 | private static Thread billingEngineThread;
|
---|
| 13 |
|
---|
[9576] | 14 | static void Main(string[] args) {
|
---|
[9602] | 15 | string ddlScript;
|
---|
[9579] | 16 | using (var context = new BillingContext()) {
|
---|
[9602] | 17 | ddlScript = (((IObjectContextAdapter)context).ObjectContext.CreateDatabaseScript());
|
---|
[9579] | 18 | }
|
---|
| 19 |
|
---|
[9602] | 20 | using (StreamWriter writer = new StreamWriter(@"..\..\DDLScript.sql")) {
|
---|
| 21 | writer.Write(ddlScript);
|
---|
| 22 | }
|
---|
| 23 |
|
---|
[9576] | 24 | //BillingService srv = new BillingService();
|
---|
| 25 | BillingDao dao = new BillingDao();
|
---|
[9579] | 26 | var products = dao.FindAllProducts();
|
---|
| 27 | foreach (Product p in products) {
|
---|
| 28 | Console.WriteLine(string.Format("{0}: {1}", p.ProductId, p.Name));
|
---|
| 29 | }
|
---|
[9576] | 30 |
|
---|
[9619] | 31 | // Start BillingEngine Service:
|
---|
| 32 | Trace.WriteLine("Starting BillingEngine ...");
|
---|
| 33 | try {
|
---|
| 34 | billingEngine = new BillingEngine.BillingEngine();
|
---|
| 35 | billingEngineThread = new Thread(billingEngine.Run);
|
---|
| 36 | billingEngineThread.IsBackground = true; //dont keep app alive
|
---|
| 37 | billingEngineThread.Start();
|
---|
| 38 | }
|
---|
| 39 | catch (Exception e) {
|
---|
| 40 | Trace.WriteLine("Error during BillingEngine startup: " + e.Message);
|
---|
| 41 | }
|
---|
| 42 |
|
---|
[9576] | 43 | Console.WriteLine("Press any key to exit...");
|
---|
| 44 | Console.ReadKey();
|
---|
| 45 | }
|
---|
| 46 | }
|
---|
| 47 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.