old_flsystem/应用/CouponsSend/Class1.cs

85 lines
2.2 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Api.Framework;
using Api.Framework.SDK;
using CouponsSend.Properties;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Api.Framework.Utils;
using CouponsSend.Entitys;
using Api.Framework.Tools;
namespace CouponsSend
{
public class Class1 : Plugin
{
public Class1()
{
this.Name = Resources.PluginName;
this.Note = Resources.PluginNote;
this.Logo = Resources.;
}
#region
public static Config Config;
private MainForm mainForm = null;
#endregion
public override void Start()
{
try
{
var session = ApiClient.GetSession();
#region
if (!session.TableExist<fl_plugin_couponssend_goodsinfos>()) session.CreateTable<fl_plugin_couponssend_goodsinfos>();
#endregion
//创建配置文件
Config = this.ReadConfig<Config>();
}
catch (Exception ex)
{
this.OnLog(ex.Message);
}
TimerTask.NewTimer<SendCouponThread>(10); //创建线程 - 10秒
}
public override void ShowForm()
{
try
{
if (mainForm == null || mainForm.IsDisposed)
{
mainForm = new MainForm();
mainForm.Show();
}
mainForm.TopMost = true;
mainForm.TopMost = false;
}
catch (Exception ex)
{
this.OnLog(ex.Message);
}
}
public override void Stop()
{
try
{
TimerTask.Close<SendCouponThread>();
if (mainForm != null)
{
mainForm.CloseForm();
mainForm = null;
}
}
catch (Exception ex)
{
this.OnLog(ex.Message);
}
}
}
}