Esempio n. 1
0
        /// <summary>
        /// 查询房屋
        /// </summary>
        /// <returns>房屋视图,总页数</returns>
        public IEnumerable<object> Get()
        {
            int totalPage = 0;
            List<View_HouseAddress> result = new List<View_HouseAddress>();

            var queryString = Request.GetQueryNameValuePairs();
            var queryConditions = new HouseQueryConditions();
            queryConditions.GetValues(queryString);

            HouseFunction houseFunction = new HouseFunction();
            houseFunction.QueryHouses(queryConditions, out result, out totalPage);

            List<object> objectResult = new List<object>() { result, new { totalPage = totalPage } };
            return objectResult;
        }
Esempio n. 2
0
        /// <summary>
        /// 查询单个房屋
        /// </summary>
        /// <param name="houseID">房屋编号</param>
        /// <returns>房屋视图</returns>
        public View_HouseAddress Get(int houseID)
        {
            int totalPage = 0;
            List<View_HouseAddress> result = new List<View_HouseAddress>();

            HouseQueryConditions queryConditions = new HouseQueryConditions() { HouseID = houseID };
            HouseFunction houseFunction = new HouseFunction();
            houseFunction.QueryHouses(queryConditions, out result, out totalPage);

            return result.FirstOrDefault();
        }
Esempio n. 3
0
        //查询房屋
        public int QueryHouses(HouseQueryConditions queryConditions, out List<View_HouseAddress> result, out int totalPage)
        {
            using (var db = new HouseMarketEntities())
            {
                totalPage = 0;

                var entities = db.View_HouseAddress;
                var query = SetQuery(entities, queryConditions, out totalPage);
                result = query.ToList();

                return 0;
            }
        }