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