Beispiel #1
0
 /// <summary>
 /// 获取当前类的实例
 /// </summary>
 /// <returns></returns>
 public static ModelOperate <T> Instance()
 {
     if (_modelHelper == null)
     {
         _modelHelper = new ModelOperate <T>();
     }
     return(_modelHelper);
 }
Beispiel #2
0
 /// <summary>
 /// 根据where条件删除记录
 /// </summary>
 /// <param name="where"></param>
 public virtual void Delete(string where)
 {
     ModelOperate <T> .Instance().Delete(where);
 }
Beispiel #3
0
 /// <summary>
 /// 查找单个实体类
 /// </summary>
 /// <param name="where"></param>
 /// <returns></returns>
 public virtual T SelectEntity(string where)
 {
     return(ModelOperate <T> .Instance().SelectEntity(where));
 }
Beispiel #4
0
 /// <summary>
 /// 根据where条件修改指定字段
 /// </summary>
 /// <param name="listField">需要跟新的字段集合</param>
 /// <param name="where">where条件字符串</param>
 public virtual void Update(List <UpdateField> listField, string where)
 {
     ModelOperate <T> .Instance().Update(listField, where);
 }
Beispiel #5
0
 /// <summary>
 /// 根据实体类主键删除记录
 /// </summary>
 /// <param name="entity"></param>
 public virtual void Delete(T entity)
 {
     ModelOperate <T> .Instance().Delete(entity);
 }
Beispiel #6
0
 /// <summary>
 /// 根据主键修改记录
 /// </summary>
 /// <param name="entity"></param>
 public virtual void Update(T entity)
 {
     ModelOperate <T> .Instance().Update(entity);
 }
Beispiel #7
0
 /// <summary>
 /// 根据where条件修改指定字段
 /// </summary>
 /// <param name="listField"></param>
 /// <param name="listWhere"></param>
 public virtual void Update(List <UpdateField> listField, List <WhereField> listWhere)
 {
     ModelOperate <T> .Instance().Update(listField, listWhere);
 }
Beispiel #8
0
 /// <summary>
 /// 获取数据总条数
 /// </summary>
 /// <param name="listWhere"></param>
 /// <returns></returns>
 public virtual int SelectCount(List <WhereField> listWhere)
 {
     return(ModelOperate <T> .Instance().SelectCount(listWhere));
 }
Beispiel #9
0
 /// <summary>
 /// 新增一条记录
 /// </summary>
 public virtual int Add(T entity)
 {
     return(ModelOperate <T> .Instance().Add(entity));
 }
Beispiel #10
0
 /// <summary>
 /// 获取数据总条数
 /// </summary>
 /// <param name="where"></param>
 /// <returns></returns>
 public virtual int SelectCount(string where = "")
 {
     return(ModelOperate <T> .Instance().SelectCount(where));
 }
Beispiel #11
0
 /// <summary>
 /// 绑定Mode实体类
 /// </summary>
 public virtual T BindModel()
 {
     return(ModelOperate <T> .Instance().BindModel());
 }
Beispiel #12
0
 /// <summary>
 /// 查找数据
 /// </summary>
 /// <param name="page"></param>
 /// <param name="pagesize"></param>
 /// <param name="sort"></param>
 /// <param name="field"></param>
 /// <param name="listWhere"></param>
 /// <returns></returns>
 public virtual DataTable SelectDataTable(string field = "", List <WhereField> listWhere = null, string sort = "")
 {
     return(ModelOperate <T> .Instance().SelectDataTable(field, listWhere, sort));
 }
Beispiel #13
0
 /// <summary>
 /// 查找数据
 /// </summary>
 /// <param name="field"></param>
 /// <param name="where"></param>
 /// <param name="sort"></param>
 /// <returns></returns>
 public DataTable SelectDataTable(string field = "", string where = "", string sort = "")
 {
     return(ModelOperate <T> .Instance().SelectDataTable(field, where, sort));
 }
Beispiel #14
0
 /// <summary>
 /// 查找实体类集合
 /// </summary>
 /// <param name="field"></param>
 /// <param name="where"></param>
 /// <param name="sort"></param>
 /// <returns></returns>
 public virtual List <T> SelectList(string field = "", string where = "", string sort = "")
 {
     return(ModelOperate <T> .Instance().SelectList(field, where, sort));
 }