using System;
using System.Collections.Generic;
using System.Linq;
using LitJson;
using MySql.Data.MySqlClient;
using Sog;
//权限-角色-菜单
namespace Operation
{
public class AdminOperator
{
private MySqlDB db;
private const int BuffLengthMax = 500 * 1024;
public static string Administrator = "Administrator";
public AdminOperator(MySqlDB mySql)
{
db = mySql;
}
//销毁的时候置空
public void Dispose()
{
db.Dispose();
db = null;
}
public void KeepAlive()
{
if (db == null)
{
return;
}
string strSql = "select id from admin_role where id=1";
MySqlDataReader reader = null;
try
{
reader = db.ExecReader(strSql);
if (reader == null)
{
TraceLog.Trace("AdminOperator.KeepAlive no record in account table, return reader is null!");
}
}
catch (Exception e)
{
TraceLog.Trace("AdminOperator.KeepAlive error!");
}
finally
{
//记住一定要Close
if (reader != null)
{
reader.Close();
}
}
}
public List