3 changed files with 63 additions and 0 deletions
@ -0,0 +1,21 @@ |
|||||
|
using System; |
||||
|
using PetaPoco; |
||||
|
|
||||
|
using Pingchuan.BeijingSafeguard.DAL; |
||||
|
using Pingchuan.BeijingSafeguard.Model; |
||||
|
|
||||
|
namespace Pingchuan.BeijingSafeguard.BLL |
||||
|
{ |
||||
|
public class ConfigBLL |
||||
|
{ |
||||
|
public static int Update(Config config) |
||||
|
{ |
||||
|
return ConfigDAL.Update(config); |
||||
|
} |
||||
|
|
||||
|
public static Page<Config> Query(int pageIndex, int pageSize) |
||||
|
{ |
||||
|
return ConfigDAL.Query(pageIndex, pageSize); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
using System; |
||||
|
using PetaPoco; |
||||
|
using Pingchuan.BeijingSafeguard.Model; |
||||
|
|
||||
|
namespace Pingchuan.BeijingSafeguard.DAL |
||||
|
{ |
||||
|
public class ConfigDAL : BaseDAL |
||||
|
{ |
||||
|
public static int Update(Config config) |
||||
|
{ |
||||
|
return db.Update(config); |
||||
|
} |
||||
|
|
||||
|
public static Page<Config> Query(int pageIndex, int pageSize) |
||||
|
{ |
||||
|
string sql = $@"select * from configs order by id desc"; |
||||
|
return db.Page<Config>(pageIndex, pageSize, sql); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
using System; |
||||
|
using PetaPoco; |
||||
|
|
||||
|
namespace Pingchuan.BeijingSafeguard.Model |
||||
|
{ |
||||
|
[TableName("configs")] |
||||
|
[PrimaryKey("id", AutoIncrement = false)] |
||||
|
public class Config |
||||
|
{ |
||||
|
[Column("id")] |
||||
|
public string Id { get; set; } |
||||
|
|
||||
|
[Column("value")] |
||||
|
public string Value { get; set; } |
||||
|
|
||||
|
[Column("unit")] |
||||
|
public string Unit { get; set; } |
||||
|
|
||||
|
[Column("description")] |
||||
|
public string Description { get; set; } |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue