Esempio n. 1
0
        /// <summary>
        /// 获取分页查询数据
        /// </summary>
        /// <param name="AwardType">奖品类型</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页容量</param>
        /// <param name="totalCount">总数据条数</param>
        /// <returns></returns>
        public List <M_LuckData> GetLuckDraw(int AwardType, string ActivityName, int PageIndex, int PageSize, out int totalCount)
        {
            string tblName      = "V_LuckDrawData";
            string strGetFields = "ID, AwardName, AwardType, UserName, AwardTime,ActivityName";
            string strWhere     = " 1=1 ";

            if (AwardType != -1)
            {
                strWhere += " and AwardType = " + AwardType;
            }
            if (AwardType == 0)
            {
                strWhere += " or AwardType = 4";
            }
            if (ActivityName != "" && ActivityName != null && ActivityName != "-1")
            {
                strWhere += " And ActivityName='" + ActivityName + "'";
            }
            string            fldName = "AwardTime";
            string            Sort    = "desc";
            D_PublicPageList  dpage   = new D_PublicPageList();
            List <M_LuckData> res     = DataHelper.GetEntities <M_LuckData>(dpage.GetPageIndexListByPage(tblName, strGetFields, fldName, PageSize, PageIndex, strWhere, Sort, out totalCount)).ToList();

            return(res);
        }
Esempio n. 2
0
        /// <summary>
        /// 根据中奖状态获取数据
        /// </summary>
        /// <param name="AwardType">奖品类型</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页容量</param>
        /// <param name="totalCount">总数据条数</param>
        /// <returns></returns>
        public List <M_GrabIphone> GetGrabIPhone(int WinningState, int PageIndex, int PageSize, out int totalCount)
        {
            string tblName      = "GrabIphone";
            string strGetFields = "ID,RegrsterID,Color,Addtime,LuckDrawState,WinningState,WinningTime,TargetID,BidRecordsID,InvestmentAmount";
            string strWhere     = "";

            if (WinningState != -1)
            {
                strWhere += "WinningState = " + WinningState;
            }
            string              fldName = "ID";
            string              Sort    = "desc";
            D_PublicPageList    dpage   = new D_PublicPageList();
            List <M_GrabIphone> res     = DataHelper.GetEntities <M_GrabIphone>(dpage.GetPageIndexListByPage(tblName, strGetFields, fldName, PageSize, PageIndex, strWhere, Sort, out totalCount)).ToList();

            return(res);
        }