63 lines
1.9 KiB
C#
63 lines
1.9 KiB
C#
using HL_FristAidPlatform_Help;
|
|
using HL_FristAidPlatform_IDataBase;
|
|
using HL_FristAidPlatform_Models;
|
|
using SqlSugar;
|
|
using System.Collections.Generic;
|
|
namespace HL_FristAidPlatform_DataBase
|
|
{
|
|
/// <summary>
|
|
/// 短信
|
|
/// </summary>
|
|
public class T_Service_NoticeSMSDB : BaseDB, IT_Service_NoticeSMS
|
|
{
|
|
public SqlSugarClient db = GetClient();
|
|
|
|
/// <summary>
|
|
/// 增加一条数据
|
|
/// </summary>
|
|
public T_Service_NoticeSMS Add(T_Service_NoticeSMS model)
|
|
{
|
|
return db.Insertable(model).IgnoreColumns(ignoreNullColumn: true).IgnoreColumns(it => new {it.ID }).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新一条数据
|
|
/// </summary>
|
|
public bool Update(T_Service_NoticeSMS model)
|
|
{
|
|
return db.Updateable(model).ExecuteCommand() == 0 ? false : true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除一条数据
|
|
/// </summary>
|
|
public bool Delete(long ID)
|
|
{
|
|
return db.Deleteable<T_Service_NoticeSMS>(it => it.ID == ID).ExecuteCommand() == 0 ? false : true; ;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获得数据列表
|
|
/// </summary>
|
|
public TableModel<T_Service_NoticeSMS> GetPageList(int pageIndex, int pageSize)
|
|
{
|
|
int total = 0;
|
|
List<T_Service_NoticeSMS> data = db.Queryable<T_Service_NoticeSMS>().ToPageList(pageIndex, pageSize, ref total);
|
|
TableModel<T_Service_NoticeSMS> t = new TableModel<T_Service_NoticeSMS>();
|
|
t.Code = 0;
|
|
t.PageCount = data.Count;
|
|
t.TotalNumber = total;
|
|
t.Data = data;
|
|
t.Msg = "成功";
|
|
return t;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获得前几行数据
|
|
/// </summary>
|
|
public T_Service_NoticeSMS Get(long ID)
|
|
{
|
|
return db.Queryable<T_Service_NoticeSMS>().First(it => it.ID == ID);
|
|
}
|
|
}
|
|
} |