Exemplo n.º 1
0
        public ActionResult Index(int CustomerId = 1)
        {
            var query = this._iCustomerService.GetEntityById(CustomerId);
            //var customer = Mapper.Map<Customer, CustomerModel>(query);
            var searchCriteria = new ProjectSearchCriteria();

            searchCriteria.Projecthot = 1;
            var searchResult = _IShopProjectService.SearchProject(searchCriteria);
            var arraylist    = Mapper.Map <ShopProject[], ProjectDetailsViewModel[]>(searchResult.Item1).OrderByDescending(p => p.CreatTime).Take(3).ToList();

            ViewBag.array = arraylist;

            return(View(query));
        }
Exemplo n.º 2
0
        public ActionResult List()
        {
            ViewBag.Title = "找需求";
            string str_QuYu   = Request.QueryString["quyu"] ?? null;   // 城区
            string str_type   = Request.QueryString["type"] ?? null;   // 物业类型
            string str_Status = Request.QueryString["status"] ?? null; // 出租出售

            int    IDQuYu   = GetID(str_QuYu);
            int    IDType   = GetID(str_type);
            int    IDStatus = GetID(str_Status);
            string isSale   = "";

            if (IDStatus == 0 || IDStatus == 197)
            {
                //  求租
                IDStatus = 197;
                isSale   = "false";
            }
            else if (IDStatus == 198)
            {
                isSale = "true";
            }
            string queryString = Request.Url.PathAndQuery;

            ViewBag.Filter = FilterBuilder(IDStatus, IDQuYu, IDType, queryString);
            // search
            int PageIndex = 1; // 页码从1 开始

            int.TryParse(Request.QueryString["PageIndex"], out PageIndex);
            if (PageIndex == 0)
            {
                PageIndex = 1;
            }

            var searchCriteria = new ShopPostingsCriteria();

            searchCriteria.PageIndex = PageIndex;
            searchCriteria.PageSize  = 6;

            // searchCriteria.AreaId = IDQuYu;
            searchCriteria.isSale = isSale;
            searchCriteria.Keys   = Request["keys"];
            ViewBag.Keys          = searchCriteria.Keys;

            var AreaItemList = _iShopAttributesService.GetListByAttributeId(AttrQuyuId);
            var AreaItem     = AreaItemList.Where(m => m.Id == IDQuYu).FirstOrDefault();

            if (AreaItem != null)
            {
                searchCriteria.distinct = AreaItem.ValueStr;
            }

            var TypeItemList = _iShopAttributesService.GetListByAttributeId(AttrTypeId);
            var TypeItem     = TypeItemList.Where(m => m.Id == IDType).FirstOrDefault();

            if (TypeItem != null)
            {
                searchCriteria.PType = TypeItem.ValueStr;
            }

            var searchResult = _iShopPostingsService.GetSearch(searchCriteria);

            ViewBag.searchResult = searchResult;

            // 分页
            int PageCount = 1;

            if (searchResult.Item2.Total == 0)
            {
                PageCount = 0;
            }
            else if (searchResult.Item2.Total <= searchResult.Item2.Top)
            {
                PageCount = 1;
            }
            else
            {
                int mote = searchResult.Item2.Total % searchResult.Item2.Top;
                if (mote == 0)
                {
                    PageCount = searchResult.Item2.Total / searchResult.Item2.Top;
                }
                else
                {
                    PageCount = searchResult.Item2.Total / searchResult.Item2.Top + 1;
                }
            }

            ViewBag.pageCount = 0;
            ViewBag.pager     = GetPageIndexFilter(queryString, PageIndex, PageCount);
            var tuijian = new ProjectSearchCriteria();

            tuijian.Projecthot = 1;
            var tuijianResult = _IShopProjectService.SearchProject(tuijian);
            var arraylist     = Mapper.Map <ShopProject[], ProjectDetailsViewModel[]>(tuijianResult.Item1).OrderByDescending(p => p.CreatTime).Take(3).ToList();

            ViewBag.array = arraylist;
            return(View());
        }
Exemplo n.º 3
0
        public ActionResult Search()
        {
            ViewBag.Title = "我要开店--开店ing,一站式开店服务平台";
            // string str_SaleOrRent = Request.QueryString["SaleOrRent"] ?? null;// //出租或出售 1:出租;  2:出售 默认为1 出租
            string str_Industry  = Request.QueryString["industry"] ?? null;  // 行业
            string str_QuYu      = Request.QueryString["quyu"] ?? null;      // 城区
            string str_SubWay    = Request.QueryString["subway"] ?? null;    // 地铁
            string str_Type      = Request.QueryString["type"] ?? null;      //(类型)
            string str_PriceRent = Request.QueryString["pricerent"] ?? null; // pricerent
            string str_PriceSale = Request.QueryString["pricesale"] ?? null; // sale
            string str_Status    = Request.QueryString["status"] ?? null;    // 出租出售
            string str_OpenTime  = Request.QueryString["opentime"] ?? null;  // 开盘时间

            // int IDSaleOrRent = GetID(str_SaleOrRent);
            int IDIndustry  = GetID(str_Industry);
            int IDQuYu      = GetID(str_QuYu);
            int IDSubWay    = GetID(str_SubWay);
            int IDType      = GetID(str_Type);
            int IDPriceRent = GetID(str_PriceRent);
            int IDPriceSale = GetID(str_PriceSale);
            int IDStatus    = GetID(str_Status);
            int OpenTimeId  = GetID(str_OpenTime);
            int IDPrice     = 0;

            if (IDStatus == 145)
            {
                //  出租
                IDPrice     = IDPriceRent;
                IDPriceSale = 0;
            }
            else if (IDStatus == 144)
            {
                IDPrice     = IDPriceSale;
                IDPriceRent = 0;
            }
            string queryString = Request.Url.PathAndQuery;

            ViewBag.Filter = FilterBuilder(IDIndustry, IDQuYu, IDSubWay, IDType, IDPrice, IDStatus, OpenTimeId, queryString);
            // search
            int PageIndex = 1;

            int.TryParse(Request.QueryString["PageIndex"], out PageIndex);
            var searchCriteria = new ProjectSearchCriteria();

            searchCriteria.PageIndex = PageIndex;
            searchCriteria.PageSize  = 6;

            searchCriteria.HangYeId      = IDIndustry;
            searchCriteria.AreaId        = IDQuYu;
            searchCriteria.SubWayId      = IDSubWay;
            searchCriteria.WuYeleixingId = IDType;
            searchCriteria.PriceRentId   = IDPriceRent;
            searchCriteria.PriceSaleId   = IDPriceSale;
            searchCriteria.StatusID      = IDStatus;
            if (OpenTimeId == 158)
            {
                searchCriteria.OpenTimeId = 30;
            }
            else if (OpenTimeId == 159)
            {
                searchCriteria.OpenTimeId = 90;
            }
            else if (OpenTimeId == 160)
            {
                searchCriteria.OpenTimeId = 182;
            }
            else if (OpenTimeId == 161)
            {
                searchCriteria.OpenTimeId = 365;
            }
            else
            {
                searchCriteria.OpenTimeId = 0;
            }
            searchCriteria.Keys = Request["keys"];

            ViewBag.Keys = searchCriteria.Keys;
            var searchResult = _iShopProjectService.SearchProject(searchCriteria);
            var arraylist    = Mapper.Map <ShopProject[], ProjectDetailsViewModel[]>(searchResult.Item1);

            ViewBag.searchResult = searchResult;
            ViewBag.array        = arraylist;

            return(View());
        }