コード例 #1
0
ファイル: LogDAL.cs プロジェクト: MateralCMX/Koten-bu
        /// <summary>
        /// 根据条件查询日志分页信息
        /// </summary>
        /// <param name="qModel">查询条件</param>
        /// <param name="pageM">分页对象</param>
        /// <returns>日志信息</returns>
        public MPagingData <List <LogModel> > GetInfoByWhere(LogQueryModel qModel, MPagingModel pageM)
        {
            DataSet ds = SQLServerManager.Pagination(qModel.GetQuerySQL(false), qModel.GetGroupStr(), pageM.PagingIndex, pageM.PagingSize);
            MPagingData <List <LogModel> > resM = new MPagingData <List <LogModel> >();

            resM.Data         = ConvertManager.DataTableToList <LogModel>(ds.Tables[0]);
            pageM.PagingIndex = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
            pageM.DataCount   = Convert.ToInt32(ds.Tables[1].Rows[0][1]);
            pageM.PagingCount = Convert.ToInt32(ds.Tables[1].Rows[0][2]);
            resM.PageInfo     = pageM;
            return(resM);
        }
コード例 #2
0
 public void GetInfoByWhereTest1()
 {
     LogQueryModel qModel = new LogQueryModel
     {
         ID     = Guid.Parse("37689F18-E5F2-42AE-9610-273DA251A80B"),
         GroupM = new GroupModel(GroupType.Asc, "CreateTime")
     };
     MPagingModel pageM = new MPagingModel()
     {
         PagingIndex = 1,
         PagingSize  = 20
     };
     MPagingData <List <LogModel> > listM = logDal.GetInfoByWhere(qModel, pageM);
 }