You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
875 B

using System;
using PetaPoco;
using Pingchuan.BeijingSafeguard.Model;
namespace Pingchuan.BeijingSafeguard.DAL
{
public class OrgDAL : BaseDAL
{
public static int Add(Org org)
{
return (int)db.Insert(org);
}
public static int Update(Org org)
{
return db.Update(org);
}
public static int Delete(int id)
{
return db.Delete<Org>(id);
}
public static int Enable(int id, int enable)
{
string sql = $@"update orgs set enable = {enable} where id = {id}";
return db.Execute(sql);
}
public static Page<Org> Query(int pageIndex, int pageSize)
{
string sql = $@"select * from orgs order by create_time desc";
return db.Page<Org>(pageIndex, pageSize, sql);
}
}
}