StoreSystem.cs
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using log4net;
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.ServiceProcess;
using System.Text;
namespace KTKSingleStoreSystem
{
public partial class StoreSystem : ServiceBase
{
public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public StoreSystem()
{
InitializeComponent();
}
private KTK_SA_BoxBean store = null;
protected override void OnStart(string[] args)
{
LogUtil.info(LOGGER, "Server OnStart Begin!");
this.store = SAStoreManager.InitStore();
if (store == null)
{
LogUtil.error(LOGGER, "加载料仓失败");
return;
}
// store.StartRun();
LogUtil.info(LOGGER, "Server OnStart End!");
}
protected override void OnStop()
{
LogUtil.info(LOGGER, "Server OnStop Begin !");
if (store != null)
{
if (store.storeRunStatus > StoreRunStatus.Wait)
{
store.StopRun();
}
KNDManager.CloseAllDO();
KNDManager.CloseAllConnection();
}
LogUtil.info(LOGGER, "Server OnStop End !");
}
}
}