Ejemplo n.º 1
0
        /// <summary>
        /// 获得LIST方法
        /// </summary>
        /// <param name="type">类型</param>
        /// <param name="cityCode">城市编号</param>
        /// <param name="topNum">条数</param>
        /// <returns></returns>
        protected IList <EyouSoft.Model.HotelStructure.HotelLocalInfo> GetList(EyouSoft.Model.HotelStructure.HotelShowType type, string cityCode, int topNum)
        {
            IList <EyouSoft.Model.HotelStructure.HotelLocalInfo> list = null;

            iBll = new EyouSoft.BLL.HotelStructure.HotelLocalInfo();
            list = iBll.GetList(type, cityCode, topNum);
            if (list != null && list.Count > 0)
            {
                return(list);
            }
            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据类型获取酒店系统的首页酒店板块信息集合
        /// </summary>
        /// <param name="type">类型</param>
        /// <param name="CityCode">城市三字码(为空时,不做条件)</param>
        /// <param name="topNum">数据条数 0:获取所有</param>
        /// <returns></returns>
        public virtual IList <EyouSoft.Model.HotelStructure.HotelLocalInfo> GetList(EyouSoft.Model.HotelStructure.HotelShowType type, string CityCode, int topNum)
        {
            IList <EyouSoft.Model.HotelStructure.HotelLocalInfo> lists = null;

            EyouSoft.Model.HotelStructure.HotelLocalInfo model = null;
            string StrSql = string.Empty;

            if (topNum > 0)
            {
                StrSql = string.Format("SELECT TOP {0} [ID],[HotelCode],[HotelName],[ShortDesc],[Rank],[MarketingPrice],[CityCode],[HotelImg],[ShowType],[SortId],[IsTop] ,[IssueTime] FROM [dbo].[tbl_HotelLocalInfo] WHERE [ShowType]={1} ", topNum, (int)type);
            }
            else
            {
                StrSql = string.Format("SELECT [ID],[HotelCode],[HotelName],[ShortDesc],[Rank],[MarketingPrice],[CityCode],[HotelImg],[ShowType],[SortId],[IsTop] ,[IssueTime] FROM [dbo].[tbl_HotelLocalInfo] WHERE [ShowType]={0} ", (int)type);
            }
            if (!string.IsNullOrEmpty(CityCode))
            {
                StrSql = StrSql + " AND [CityCode]=@CityCode";
            }
            StrSql = StrSql + " ORDER BY [IsTop] DESC,[SortId] DESC,IssueTime DESC";
            DbCommand dc = this._db.GetSqlStringCommand(StrSql);

            this._db.AddInParameter(dc, "ShowType", DbType.Byte, (int)type);
            if (!string.IsNullOrEmpty(CityCode))
            {
                this._db.AddInParameter(dc, "CityCode", DbType.AnsiString, CityCode);
            }
            using (IDataReader dr = DbHelper.ExecuteReader(dc, this._db))
            {
                lists = new List <EyouSoft.Model.HotelStructure.HotelLocalInfo>();
                while (dr.Read())
                {
                    model = new EyouSoft.Model.HotelStructure.HotelLocalInfo();
                    InputModelValue(model, dr);
                    lists.Add(model);
                    model = null;
                }
            }
            return(lists);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 根据酒店模块类型获取城市信息集合
        /// </summary>
        /// <param name="type">类型</param>
        /// <returns></returns>
        public virtual IList <EyouSoft.Model.HotelStructure.HotelCity> GetList(EyouSoft.Model.HotelStructure.HotelShowType type)
        {
            IList <EyouSoft.Model.HotelStructure.HotelCity> lists = null;

            EyouSoft.Model.HotelStructure.HotelCity model = null;
            DbCommand dc = this._db.GetSqlStringCommand(Sql_Select_HotelCity);

            this._db.AddInParameter(dc, "ShowType", DbType.Byte, (int)type);
            using (IDataReader dr = DbHelper.ExecuteReader(dc, this._db))
            {
                lists = new List <EyouSoft.Model.HotelStructure.HotelCity>();
                while (dr.Read())
                {
                    model          = new EyouSoft.Model.HotelStructure.HotelCity();
                    model.CityCode = dr.GetString(dr.GetOrdinal("CityCode"));
                    model.CityName = dr.GetString(dr.GetOrdinal("CityName"));
                    lists.Add(model);
                    model = null;
                }
            }
            return(lists);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 根据类型获取所有的酒店信息集合(分页)
 /// </summary>
 /// <param name="PageSize"></param>
 /// <param name="PageIndex"></param>
 /// <param name="RecordCount"></param>
 /// <param name="type">类型</param>
 /// <returns></returns>
 public IList <EyouSoft.Model.HotelStructure.HotelLocalInfo> GetList(int PageSize, int PageIndex, ref int RecordCount, EyouSoft.Model.HotelStructure.HotelShowType type)
 {
     return(dal.GetList(PageSize, PageIndex, ref RecordCount, type));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 根据类型获取酒店系统的首页酒店板块信息集合
 /// </summary>
 /// <param name="type">类型</param>
 /// <param name="CityCode">城市三字码(为空时,不做条件)</param>
 /// <param name="topNum">数据条数 0:获取所有</param>
 /// <returns></returns>
 public IList <EyouSoft.Model.HotelStructure.HotelLocalInfo> GetList(EyouSoft.Model.HotelStructure.HotelShowType type, string CityCode, int topNum)
 {
     return(dal.GetList(type, CityCode, topNum));
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 根据类型获取所有的酒店信息集合(分页)
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="RecordCount"></param>
        /// <param name="type">类型</param>
        /// <returns></returns>
        public virtual IList <EyouSoft.Model.HotelStructure.HotelLocalInfo> GetList(int PageSize, int PageIndex, ref int RecordCount, EyouSoft.Model.HotelStructure.HotelShowType type)
        {
            IList <EyouSoft.Model.HotelStructure.HotelLocalInfo> lists = null;
            string StrTableName  = "tbl_HotelLocalInfo";
            string StrFiledName  = " [ID],[HotelCode],[HotelName],[ShortDesc],[Rank],[MarketingPrice],[CityCode],[HotelImg],[ShowType],[SortId],[IsTop] ,[IssueTime] ";
            string StrWhereQuery = string.Format("[ShowType]='{0}' ", (int)type);
            string StrOrderBy    = " IsTop,IssueTime DESC";

            #region List赋值
            using (IDataReader dr = DbHelper.ExecuteReader(this._db, PageSize, PageIndex, ref RecordCount, StrTableName, "ID", StrFiledName, StrWhereQuery, StrOrderBy))
            {
                lists = new List <EyouSoft.Model.HotelStructure.HotelLocalInfo>();
                EyouSoft.Model.HotelStructure.HotelLocalInfo model = null;
                while (dr.Read())
                {
                    model = new EyouSoft.Model.HotelStructure.HotelLocalInfo();
                    InputModelValue(model, dr);
                    lists.Add(model);
                    model = null;
                }
            }
            #endregion
            return(lists);
        }