Ejemplo n.º 1
0
        /// <summary>
        /// 页面初始化方法
        /// </summary>
        /// <param name="areaName">线路名称</param>
        /// <param name="beginDate">出发时间</param>
        /// <param name="endDate">结束时间</param>
        /// <param name="areaId">线路区域ID</param>
        /// <param name="cityId">出港城市ID</param>
        protected void DataInit(string areaName, DateTime?beginDate, DateTime?endDate, int?areaId, int?cityId)
        {
            if (areaId == 0)
            {
                areaId = null;
            }
            if (cityId == 0)
            {
                cityId = null;
            }


            EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(null, false);
            //声明查询model
            EyouSoft.Model.TourStructure.TourSearchInfo searchModel = new EyouSoft.Model.TourStructure.TourSearchInfo();
            //查询model 属性赋值
            searchModel.AreaId     = areaId;
            searchModel.SDate      = beginDate;
            searchModel.EDate      = endDate;
            searchModel.RouteName  = areaName;
            searchModel.TourCityId = cityId;
            IList <EyouSoft.Model.TourStructure.LBZTTours> list = bll.GetToursSiteHot(companyId, pageSize, pageIndex, ref recordCount, searchModel, CompanyStructure.TourDisplayType.明细团);

            if (list != null && list.Count > 0)
            {
                this.rptTourList.DataSource = list;
                this.rptTourList.DataBind();
                BindPage();
                this.lblMsg.Visible = false;
            }
            else
            {
                //如果默认省份的第一个城市无数据,则取消第一城市
                searchModel.TourCityId = null;
                list = bll.GetToursSiteHot(companyId, pageSize, pageIndex, ref recordCount, searchModel, CompanyStructure.TourDisplayType.明细团);
                if (list != null && list.Count > 0)
                {
                    this.rptTourList.DataSource = list;
                    this.rptTourList.DataBind();
                    BindPage();
                    this.lblMsg.Visible = false;
                }
                else
                {
                    this.ExporPageInfoSelect1.Visible = false;
                    this.lblMsg.Text = "未找到相关线路信息!";
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 页面初始化方法
        /// </summary>
        /// <param name="areaName">线路名称</param>
        /// <param name="beginDate">出发时间</param>
        /// <param name="endDate">结束时间</param>
        /// <param name="areaId">线路区域ID</param>
        /// <param name="cityId">出港城市ID</param>
        protected void DataInit(string areaName, DateTime?beginDate, DateTime?endDate, int?areaId, int?cityId)
        {
            DdlAreaInit(areaId.ToString());
            EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(null, false);
            //声明查询model
            EyouSoft.Model.TourStructure.TourSearchInfo searchModel = new EyouSoft.Model.TourStructure.TourSearchInfo();
            //查询model 属性赋值
            searchModel.AreaId    = areaId;
            searchModel.SDate     = beginDate;
            searchModel.EDate     = endDate;
            searchModel.RouteName = areaName;
            if (cityId != 0)
            {
                searchModel.TourCityId = cityId;
            }

            //根据查询条件取得的结果集list
            IList <EyouSoft.Model.TourStructure.LBZTTours> list = bll.GetToursSiteHot(companyId, pageSize, pageIndex, ref recordCount, searchModel, CompanyStructure.TourDisplayType.明细团);

            if (list != null && list.Count > 0)
            {
                //显示分页控件
                this.ExporPageInfoSelect1.Visible = true;
                //将list赋给repeater的数据源
                this.rptTourList.DataSource = list;
                //绑定数据
                this.rptTourList.DataBind();
                //绑定分页数据
                BindPage();
                //隐藏无数据提示控件
                this.lblMsg.Visible = false;
            }
            else
            {
                //隐藏分页控件
                this.ExporPageInfoSelect1.Visible = false;
                this.lblMsg.Text = "未找到相关线路信息!";
                //显示无数据提示控件
                this.lblMsg.Visible = true;
            }
        }