|
|
@ -1,6 +1,5 @@ |
|
|
|
using PetaPoco; |
|
|
|
using Pingchuan.BeijingSafeguard.Model; |
|
|
|
using System.Collections.Generic; |
|
|
|
|
|
|
|
namespace Pingchuan.BeijingSafeguard.DAL |
|
|
|
{ |
|
|
@ -27,7 +26,7 @@ namespace Pingchuan.BeijingSafeguard.DAL |
|
|
|
return (int)db.Insert(user); |
|
|
|
} |
|
|
|
|
|
|
|
public static int Edit(User user) |
|
|
|
public static int Update(User user) |
|
|
|
{ |
|
|
|
return db.Update(user); |
|
|
|
} |
|
|
@ -37,6 +36,12 @@ namespace Pingchuan.BeijingSafeguard.DAL |
|
|
|
return db.Delete<User>(id); |
|
|
|
} |
|
|
|
|
|
|
|
public static int Enable(int id, int enable) |
|
|
|
{ |
|
|
|
string sql = $@"update users set enable = {enable} where id = {id}"; |
|
|
|
return db.Execute(sql); |
|
|
|
} |
|
|
|
|
|
|
|
public static Page<User> Query(int pageIndex, int pageSize) |
|
|
|
{ |
|
|
|
string sql = $@"select * from users order by create_time desc"; |
|
|
|