|
|
@ -1,4 +1,6 @@ |
|
|
|
using Pingchuan.BeijingSafeguard.Model; |
|
|
|
using PetaPoco; |
|
|
|
using Pingchuan.BeijingSafeguard.Model; |
|
|
|
using System.Collections.Generic; |
|
|
|
|
|
|
|
namespace Pingchuan.BeijingSafeguard.DAL |
|
|
|
{ |
|
|
@ -19,5 +21,26 @@ namespace Pingchuan.BeijingSafeguard.DAL |
|
|
|
|
|
|
|
return db.SingleOrDefault<User>(sql, realName); |
|
|
|
} |
|
|
|
|
|
|
|
public static int Add(User user) |
|
|
|
{ |
|
|
|
return (int)db.Insert(user); |
|
|
|
} |
|
|
|
|
|
|
|
public static int Edit(User user) |
|
|
|
{ |
|
|
|
return db.Update(user); |
|
|
|
} |
|
|
|
|
|
|
|
public static int Delete(int id) |
|
|
|
{ |
|
|
|
return db.Delete<User>(id); |
|
|
|
} |
|
|
|
|
|
|
|
public static Page<User> Query(int pageIndex, int pageSize) |
|
|
|
{ |
|
|
|
string sql = $@"select * from users order by create_time desc"; |
|
|
|
return db.Page<User>(pageIndex, pageSize, sql); |
|
|
|
} |
|
|
|
} |
|
|
|
} |