using System;
|
using System.Collections.Generic;
|
using System.ComponentModel;
|
using System.Data;
|
using System.Diagnostics;
|
using System.Linq;
|
using System.ServiceProcess;
|
using System.Text;
|
using CY.WebService;
|
using System.Data.SqlClient;
|
using CY.WebService.Logging;
|
namespace CyinOrderWebService
|
{
|
public partial class OrderWebService : ServiceBase
|
{
|
System.Timers.Timer time = null; // 定时器
|
|
public OrderWebService()
|
{
|
InitializeComponent();
|
//log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(AppDomain.CurrentDomain.BaseDirectory + "CyinOrderWebService.exe.config"));
|
time = new System.Timers.Timer();
|
int interval = 0;
|
System.Collections.Specialized.NameValueCollection appSettings = System.Configuration.ConfigurationManager.AppSettings;
|
interval = int.Parse(appSettings["Interval"]);
|
time.Interval = interval; // 设置引发 Elapsed 事件间隔时间,单位毫秒
|
time.AutoReset = true;
|
|
time.Enabled = false; // 指示引发 Elapsed 事件
|
|
time.Elapsed += new System.Timers.ElapsedEventHandler(time_Elapsed);
|
}
|
|
// 定时触发事件
|
private void time_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
{
|
WebServiceBLL bll_WebServiceBLL = new WebServiceBLL();
|
bll_WebServiceBLL.AcceptOverTimeOrder();
|
bll_WebServiceBLL.DelOverTimeOrder();
|
bll_WebServiceBLL.RemovedlOverTimeOrder();
|
bll_WebServiceBLL.SetMemberStatus();
|
bll_WebServiceBLL.LowerCreditLevel();
|
}
|
|
protected override void OnStart(string[] args)
|
{
|
time.Start();
|
}
|
|
protected override void OnStop()
|
{
|
time.Stop();
|
}
|
}
|
}
|