53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using System;
|
|
using System.Data;
|
|
using ChaosBot.Attribute;
|
|
|
|
namespace ChaosBot.Database.Entity
|
|
{
|
|
[DBEntity("CommandPermissions")]
|
|
public class CommandPermissions : BaseEntity
|
|
{
|
|
[DBPrimaryKey]
|
|
[DBAutoIncrement]
|
|
[DBNotNull]
|
|
[DBUnique]
|
|
public Nullable<long> id { get; private set; }
|
|
public string type { get; private set; }
|
|
public string value { get; private set; }
|
|
public string cmd { get; private set; }
|
|
public long guildId { get; private set; }
|
|
|
|
public CommandPermissions() {}
|
|
|
|
public CommandPermissions(int id, string type, string value, string cmd, long guildId)
|
|
{
|
|
this.id = id;
|
|
this.type = type;
|
|
this.value = value;
|
|
this.cmd = cmd;
|
|
this.guildId = guildId;
|
|
}
|
|
|
|
public CommandPermissions(string type, string value, string cmd, long guildId)
|
|
{
|
|
this.type = type;
|
|
this.value = value;
|
|
this.cmd = cmd;
|
|
this.guildId = guildId;
|
|
}
|
|
|
|
public static QueryBuilder<CommandPermissions> Query()
|
|
{
|
|
return BaseEntity.Query<CommandPermissions>();
|
|
}
|
|
|
|
public override void SetFromRow(DataRow row)
|
|
{
|
|
id = (long)row["id"];
|
|
type = (string)row["type"];
|
|
value = (string)row["value"];
|
|
cmd = (string)row["cmd"];
|
|
guildId = (long) row["guildid"];
|
|
}
|
|
}
|
|
} |