Пример #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void DataInit(string pathtype, string pathname, string datacount, string auther, DateTime?starttime, DateTime?endtime)
        {
            //获取分页参数并强转
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"));

            EyouSoft.BLL.SourceStructure.BSource           bsource   = new EyouSoft.BLL.SourceStructure.BSource();
            EyouSoft.Model.SourceStructure.MRouteListModel listmodel = new EyouSoft.Model.SourceStructure.MRouteListModel();
            listmodel.DayCount     = Utils.GetInt(datacount);
            listmodel.OperatorName = auther;
            listmodel.RouteName    = pathname;
            listmodel.RouteAreaId  = Utils.GetInt(pathtype);
            listmodel.CompanyId    = this.SiteUserInfo.CompanyId;
            IList <EyouSoft.Model.SourceStructure.MRouteListModel> Pathlist = bsource.GetRouteShowModel(listmodel, starttime, endtime, this.pageIndex, this.pageSize, ref recordCount);

            if (Pathlist != null && Pathlist.Count > 0)
            {
                rptList.DataSource = Pathlist;
                rptList.DataBind();
            }
            else
            {
                this.rptList.Controls.Add(new Label()
                {
                    Text = "<tr><td colspan='8' align='center'>对不起,没有相关数据!</td></tr>"
                });
                ExporPageInfoSelect1.Visible = false;
            }
            //绑定分页
            BindPage();
        }
Пример #2
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        /// <param name="id">操作ID</param>
        protected void PageInit()
        {
            EyouSoft.BLL.SourceStructure.BSource           bll        = new EyouSoft.BLL.SourceStructure.BSource();
            EyouSoft.Model.SourceStructure.MRouteListModel seachModel = new EyouSoft.Model.SourceStructure.MRouteListModel();
            seachModel.CompanyId   = SiteUserInfo.CompanyId;
            seachModel.RouteAreaId = Utils.GetInt(Utils.GetQueryStringValue("areaId"));
            seachModel.RouteName   = Utils.GetQueryStringValue("txtRouteName");
            IList <EyouSoft.Model.SourceStructure.MRouteListModel> list = bll.GetRouteShowModel(seachModel, null, null, pageIndex, pageSize, ref recordCount);

            rpt_List.DataSource = list;
            rpt_List.DataBind();
            BindPage();
            if (list == null || list.Count < 40)
            {
                this.ExporPageInfoSelect1.Visible = false;
            }
        }
Пример #3
0
        /// <summary>
        /// 导出Excel
        /// </summary>
        private void ListToExcel(string pathtype, string pathname, string datacount, string auther, DateTime?starttime, DateTime?endtime)
        {
            int toXlsRecordCount = UtilsCommons.GetToXlsRecordCount();

            if (toXlsRecordCount < 1)
            {
                ResponseToXls(string.Empty);
            }
            var s = new StringBuilder();

            //线路区域  线路名称    天数  发布日期    发布人     上团数     收客数
            s.Append("线路区域\t线路名称\t天数\t发布日期\t发布人\t上团数\t收客数\n");
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"));
            EyouSoft.BLL.SourceStructure.BSource           bsource   = new EyouSoft.BLL.SourceStructure.BSource();
            EyouSoft.Model.SourceStructure.MRouteListModel listmodel = new EyouSoft.Model.SourceStructure.MRouteListModel();
            listmodel.DayCount     = Utils.GetInt(datacount);
            listmodel.OperatorName = auther;
            listmodel.RouteName    = pathname;
            listmodel.RouteAreaId  = Utils.GetInt(pathtype);
            listmodel.CompanyId    = this.SiteUserInfo.CompanyId;
            IList <EyouSoft.Model.SourceStructure.MRouteListModel> list = bsource.GetRouteShowModel(listmodel, starttime, endtime, this.pageIndex, this.pageSize, ref recordCount);

            if (list != null && list.Count > 0)
            {
                foreach (var t in list)
                {
                    s.AppendFormat(
                        "{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n",
                        t.RouteTypeName,
                        t.RouteName,
                        t.DayCount.ToString(),
                        EyouSoft.Common.UtilsCommons.GetDateString(t.IssueTime, ProviderToDate),
                        t.OperatorName,
                        t.STCount.ToString(),
                        t.SKCount.ToString());
                }
            }

            ResponseToXls(s.ToString());
        }