12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using Cksoft.Data;
- using DllEapEntity;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace DllEapDal
- {
- public class PPSubDetailDal
- {
- private IDatabase CurrDb;
- public PPSubDetailDal(IDatabase db)
- {
- CurrDb = db;
- }
- public IEnumerable<PPSubDetail> Get(int start, int length, string order, string sort, string filter, string errorinfo)
- {
- var pros = CurrDb.FindListForCondition<PPSubDetail>($" {filter} order by {sort} {order} limit {start - 1},{length}", ref errorinfo);
- return pros;
- }
- public int GetCount(string filter)
- {
- string errorinfo = string.Empty;
- //string sql = $"select count(1) from ProgramRule a where 1=1 {filter}";
- var entities = CurrDb.FindListForCondition<PPSubDetail>(filter, ref errorinfo);
- if (entities != null)
- {
- return entities.Count();
- }
- return 0;
- }
- public PPSubDetail Get(int id)
- {
- var pro = CurrDb.FindEntityFor<PPSubDetail>(id);
- return pro;
- }
- public int ChangeIsCompare(int id, int isControl)
- {
- string sql = string.Format($"update PPSubDetail set IsCompare={isControl} where id={id}");
- return CurrDb.ExecuteBySql(sql);
- }
- }
- }
|