예제 #1
0
 /// <summary>
 /// 执行分页查询(不反回总页数)
 /// </summary>
 /// <param name="auto"></param>
 /// <param name="strOrderBy"></param>
 /// <param name="iPageIndex"></param>
 /// <param name="iPageSize"></param>
 /// <param name="iCount"></param>
 /// <returns></returns>
 public static DataSet SelectPaging(this AutoPar auto, string strOrderBy, int iPageIndex, int iPageSize)
 {
     using (DBDalOperate dal = new DBDalOperate())
     {
         auto.End();
         return(dal.Paging(auto.strSql, strOrderBy, iPageIndex, iPageSize, auto.pars));
     }
 }
예제 #2
0
 /// <summary>
 /// 获取对象集合
 /// </summary>
 public static List <T> GetList <T>(this  AutoPar auto)
 {
     using (DBDalOperate dal = new DBDalOperate())
     {
         auto.End();
         return(dal.GetList <T>(auto.strSql, auto.pars));
     }
 }
예제 #3
0
 /// <summary>
 /// 执行查询的sql语句[带输入参数]
 /// </summary>
 /// <param name="sql"></param>
 /// <param name="prams"></param>
 /// <returns></returns>
 public static DataSet Select(this AutoPar auto)
 {
     using (DBDalOperate dal = new DBDalOperate())
     {
         auto.End();
         return(dal.ExecSqlQuery(auto.strSql, auto.pars));
     }
 }
예제 #4
0
 /// <summary>
 /// 执行数据更新的sql语句[带输入参数]
 /// </summary>
 /// <param name="sql"></param>
 /// <param name="parms"></param>
 /// <returns></returns>
 public static bool Sql(this AutoPar auto)
 {
     using (DBDalOperate dal = new DBDalOperate())
     {
         auto.End();
         return(dal.ExecSqlNoQuery(auto.strSql, auto.pars) > 0 ? true : false);
     }
 }
예제 #5
0
 /// <summary>
 /// 获取第一个行第一列结果
 /// </summary>
 public static object GetSingle(this AutoPar auto)
 {
     using (DBDalOperate dal = new DBDalOperate())
     {
         auto.End();
         return(dal.GetSingle(auto.strSql, auto.pars));
     }
 }
예제 #6
0
 /// <summary>
 /// 检查是否存在 (count)
 /// </summary>
 public static bool Exists(this AutoPar auto)
 {
     using (DBDalOperate dal = new DBDalOperate())
     {
         auto.End();
         return(dal.Exists(auto.strSql, auto.pars));
     }
 }
예제 #7
0
 public void Add(int order, AutoPar auto)
 {
     auto.End();
     base.Add(new TranMdl()
     {
         Order = order,
         Sql   = auto.strSql,
         Pars  = auto.pars
     });
 }