Beispiel #1
0
        /// <summary>
        /// 查询酒店常旅客,得到常旅客列表
        /// </summary>
        /// <param name="CompanyId">公司ID</param>
        /// <param name="VisitorName">常旅客姓名</param>
        /// <param name="VisitorType">常旅客类型</param>
        /// <param name="PageSize">每页显示的记录</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="RecordCount">总记录数</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.TicketStructure.TicketVistorInfo> GetHotelVistorList(string CompanyId, string VisitorName, EyouSoft.Model.TicketStructure.TicketVistorType?VisitorType, int PageSize, int PageIndex, ref int RecordCount)
        {
            var searchInfo = new EyouSoft.Model.TicketStructure.MVisitorSearchInfo()
            {
                Type  = EyouSoft.Model.TicketStructure.TicketDataType.酒店常旅客,
                VType = VisitorType,
                Name  = VisitorName
            };

            return(_GetVisitors(PageSize, PageIndex, ref RecordCount, CompanyId, true, searchInfo));
        }
Beispiel #2
0
        /// <summary>
        /// 酒店-匹配常旅客姓名,根据姓名模糊查询常旅客集合
        /// </summary>
        /// <param name="VistorName">常旅客姓名</param>
        /// <param name="CompanyId">公司ID</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.TicketStructure.TicketVistorInfo> GetHotelListByName(string VistorName, string CompanyId)
        {
            var searchInfo = new EyouSoft.Model.TicketStructure.MVisitorSearchInfo()
            {
                Type = EyouSoft.Model.TicketStructure.TicketDataType.酒店常旅客,
                Name = VistorName
            };

            int recordCount = 0;

            return(_GetVisitors(0, 0, ref recordCount, CompanyId, false, searchInfo));
        }
Beispiel #3
0
        /// <summary>
        /// 获取常旅客信息集合
        /// </summary>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="pageIndex">页索引</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="companyId">公司编号</param>
        /// <param name="isPaging">是否分页</param>
        /// <param name="searchInfo">查询信息</param>
        /// <returns></returns>
        private IList <EyouSoft.Model.TicketStructure.TicketVistorInfo> _GetVisitors(int pageSize, int pageIndex, ref int recordCount, string companyId, bool isPaging, EyouSoft.Model.TicketStructure.MVisitorSearchInfo searchInfo)
        {
            if (string.IsNullOrEmpty(companyId))
            {
                return(null);
            }

            return(idal.GetVisitors(pageSize, pageIndex, ref recordCount, companyId, isPaging, searchInfo));
        }
Beispiel #4
0
        /// <summary>
        /// 获取常旅客信息集合
        /// </summary>
        /// <param name="companyId">公司编号</param>
        /// <param name="searchInfo">查询信息</param>
        /// <returns></returns>
        public IList <EyouSoft.Model.TicketStructure.TicketVistorInfo> GetVisitors(string companyId, EyouSoft.Model.TicketStructure.MVisitorSearchInfo searchInfo)
        {
            int recordCount = 0;

            return(_GetVisitors(0, 0, ref recordCount, companyId, false, searchInfo));
        }
Beispiel #5
0
 /// <summary>
 /// 获取常旅客信息集合
 /// </summary>
 /// <param name="pageSize">每页记录数</param>
 /// <param name="pageIndex">页索引</param>
 /// <param name="recordCount">总记录数</param>
 /// <param name="companyId">公司编号</param>
 /// <param name="searchInfo">查询信息</param>
 /// <returns></returns>
 public IList <EyouSoft.Model.TicketStructure.TicketVistorInfo> GetVisitors(int pageSize, int pageIndex, ref int recordCount, string companyId, EyouSoft.Model.TicketStructure.MVisitorSearchInfo searchInfo)
 {
     return(_GetVisitors(pageSize, pageIndex, ref recordCount, companyId, true, searchInfo));
 }
Beispiel #6
0
        /// <summary>
        /// 获取常旅客信息集合
        /// </summary>
        /// <param name="pageSize">每页记录数</param>
        /// <param name="pageIndex">页索引</param>
        /// <param name="recordCount">总记录数</param>
        /// <param name="companyId">公司编号</param>
        /// <param name="isPaging">是否分页</param>
        /// <param name="searchInfo">查询信息</param>
        /// <returns></returns>
        public virtual IList <EyouSoft.Model.TicketStructure.TicketVistorInfo> GetVisitors(int pageSize, int pageIndex, ref int recordCount, string companyId, bool isPaging, EyouSoft.Model.TicketStructure.MVisitorSearchInfo searchInfo)
        {
            IList <EyouSoft.Model.TicketStructure.TicketVistorInfo> items = new List <EyouSoft.Model.TicketStructure.TicketVistorInfo>();
            string        tableName = "tbl_TicketVistorInfo";
            string        fileds    = "*";
            string        orderby   = " IssueTime ASC";
            StringBuilder query     = new StringBuilder();

            #region 拼接查询
            query.AppendFormat(" CompanyId='{0}' ", companyId);

            if (searchInfo != null)
            {
                if (searchInfo.Type.HasValue)
                {
                    query.AppendFormat(" AND [DataType]='{0}' ", (int)searchInfo.Type.Value);
                }

                if (!string.IsNullOrEmpty(searchInfo.Name))
                {
                    if (IsLetter(searchInfo.Name))
                    {
                        query.AppendFormat(" AND EnglishName LIKE '%{0}%' ", searchInfo.Name);
                    }
                    else
                    {
                        query.AppendFormat(" AND ChinaName LIKE '%{0}%' ", searchInfo.Name);
                    }
                }

                if (searchInfo.VType.HasValue)
                {
                    query.AppendFormat(" AND VistorType='{0}' ", (int)searchInfo.VType);
                }

                if (!string.IsNullOrEmpty(searchInfo.KeyWord))
                {
                    query.AppendFormat(
                        " AND isnull(ChinaName,'') + isnull(EnglishName,'') + isnull(Mobile,'') like '%{0}%' ",
                        searchInfo.KeyWord);
                }
            }
            #endregion

            using (IDataReader dr = isPaging ? DbHelper.ExecuteReader(this._db, pageSize, pageIndex, ref recordCount, tableName, "ID", fileds, query.ToString(), orderby)
                : DbHelper.ExecuteReader(_db, tableName, fileds, query.ToString(), orderby))
            {
                while (dr.Read())
                {
                    var item = new EyouSoft.Model.TicketStructure.TicketVistorInfo();
                    InputModelValue(item, dr);
                    items.Add(item);
                }
            }

            return(items);
        }