Exemplo n.º 1
0
        //从SelectCityView中得到CityPinYin     2012/3/29
        public ViewResult Tour(string id, int?pi)
        {
            ViewBag.pinyin = id;
            //定义了一个可变化的intPi =1
            var intPi = 1;

            //如果没有的话即表示在当前页
            if (pi == null)
            {
                pi = 1;
            }
            //将pi赋值给intPi
            intPi = (int)pi;
            if (id == "")
            {
                throw new ArgumentNullException("id is null");
            }
            var cityInfo = cityInfoService.GetCityByPinYin(id);

            if (cityInfo.city == "")
            {
                throw new ArgumentNullException("cityInfo is null");
            }
            else
            {
                id = cityInfo.city;
                IQueryable <iPow.Application.dj.Dto.ListTypeMidTourPlanDto> data = null;
                int total = 0;    //总条数
                data = listService.GetTourListByCity(id, intPi, pageSize, ref total);
                PagedList <iPow.Application.dj.Dto.ListTypeMidTourPlanDto> model = new PagedList <iPow.Application.dj.Dto.ListTypeMidTourPlanDto>(data, intPi, pageSize, total);
                return(View(model));
            }
        }