100 lines
2.6 KiB
C#
100 lines
2.6 KiB
C#
|
using Api.Framework;
|
|||
|
using Api.Framework.SDK;
|
|||
|
using Easy4net.Context;
|
|||
|
using ReportData.Properties;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace ReportData
|
|||
|
{
|
|||
|
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;
|
|||
|
private static object MyLock = new object();
|
|||
|
#endregion
|
|||
|
|
|||
|
public override void Start()
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
var session = ApiClient.GetSession();
|
|||
|
#region 判断表是否存在,不存在创建表
|
|||
|
//if (!session.TableExist<fl_plugin_pointmanage_checkin_info>())
|
|||
|
//{
|
|||
|
// session.CreateTable<fl_plugin_pointmanage_checkin_info>();
|
|||
|
// session.AddIndex<fl_plugin_pointmanage_checkin_info>("uid");
|
|||
|
//}
|
|||
|
//if (!session.TableExist<fl_plugin_pointmanage_exchange_list>()) session.CreateTable<fl_plugin_pointmanage_exchange_list>();
|
|||
|
#endregion
|
|||
|
|
|||
|
//创建配置文件
|
|||
|
Config = this.ReadConfig<Config>();
|
|||
|
TimerTask.NewTimer<GenerateReportsThread>(24);
|
|||
|
SDK.ReciveIMEvent += SDK_ReciveIMEvent;
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
this.OnLog(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public override void ShowForm()
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
if (mainForm == null || mainForm.IsDisposed)
|
|||
|
{
|
|||
|
mainForm = new MainForm();
|
|||
|
mainForm.Show();
|
|||
|
}
|
|||
|
mainForm.Activate();
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
this.OnLog(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public override void Stop()
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
if (mainForm != null)
|
|||
|
{
|
|||
|
mainForm.CloseForm();
|
|||
|
mainForm = null;
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
this.OnLog(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
private void SDK_ReciveIMEvent(object sender, ReciveIMEvent e)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
this.OnLog(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|