예제 #1
0
        private void bind()
        {
            //查询条件
            LDate     = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("LDate")) == null ? "" : Utils.GetDateTimeNullable(Utils.GetQueryStringValue("LDate")).Value.ToString("yyyy-MM-dd");
            LEDate    = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("LEdate")) == null ? "" : Utils.GetDateTimeNullable(Utils.GetQueryStringValue("LEDate")).Value.ToString("yyyy-MM-dd");
            RouteName = Utils.GetQueryStringValue("RouteName").ToString();
            EyouSoft.Model.TourStructure.TourSentTaskSearch TourSentTaskSearch = new EyouSoft.Model.TourStructure.TourSentTaskSearch();
            TourSentTaskSearch.LDate     = Utils.GetDateTimeNullable(LDate);
            TourSentTaskSearch.LEDate    = Utils.GetDateTimeNullable(LEDate);
            TourSentTaskSearch.RouteName = RouteName;
            TourSentTaskSearch.CompanyId = CurrentUserCompanyID;
            //第几页
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            //用户ID
            int[] UserID = new int[1];
            UserID[0] = SiteUserInfo.ID;
            //初始化列表
            EyouSoft.BLL.TourStructure.Tour tsBLL = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo);
            IList <EyouSoft.Model.TourStructure.TourSentTask> SendTaskslist = null;

            SendTaskslist = tsBLL.GetMySendTourInfo(pageSize, pageIndex, ref recordCount, UserID, TourSentTaskSearch);
            //绑定
            retList.DataSource = SendTaskslist;
            retList.DataBind();
            Repeater1.DataSource = SendTaskslist;
            Repeater1.DataBind();
            //判断记录条数
            len = retList == null ? 0 : SendTaskslist.Count;
            Print();
            //分页
            BindPage();

            RegisterScript(string.Format("var recordCount={0};", recordCount));
        }
예제 #2
0
        /// <summary>
        /// to xls
        /// </summary>
        private void ToXls()
        {
            if (!CheckGrant(global::Common.Enum.TravelPermission.个人中心_送团任务表_栏目))
            {
                ResponseToXls(string.Empty);
            }

            int _pageSize    = Utils.GetInt(Utils.GetQueryStringValue("recordcount"));
            int _recordCount = 0;

            if (_pageSize < 1)
            {
                ResponseToXls(string.Empty);
            }

            LDate     = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("LDate")) == null ? "" : Utils.GetDateTimeNullable(Utils.GetQueryStringValue("LDate")).Value.ToString("yyyy-MM-dd");
            LEDate    = Utils.GetDateTimeNullable(Utils.GetQueryStringValue("LEdate")) == null ? "" : Utils.GetDateTimeNullable(Utils.GetQueryStringValue("LEDate")).Value.ToString("yyyy-MM-dd");
            RouteName = Utils.GetQueryStringValue("RouteName").ToString();
            EyouSoft.Model.TourStructure.TourSentTaskSearch TourSentTaskSearch = new EyouSoft.Model.TourStructure.TourSentTaskSearch();
            TourSentTaskSearch.LDate     = Utils.GetDateTimeNullable(LDate);
            TourSentTaskSearch.LEDate    = Utils.GetDateTimeNullable(LEDate);
            TourSentTaskSearch.RouteName = RouteName;
            TourSentTaskSearch.CompanyId = CurrentUserCompanyID;
            //第几页
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            //用户ID
            int[] UserID = new int[1];
            UserID[0] = SiteUserInfo.ID;
            //初始化列表
            EyouSoft.BLL.TourStructure.Tour tsBLL = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo);

            var list = tsBLL.GetMySendTourInfo(_pageSize, 1, ref _recordCount, UserID, TourSentTaskSearch);

            //取得数据表各列标题,各标题之间以\t分割,最后一个列标题后加回车符
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n", "出团日期", "集合时间", "去程航班/时间", "回程航班/时间", "  线路名称", "人数", "计调");
            foreach (EyouSoft.Model.TourStructure.TourSentTask cs in list)
            {
                cs.GatheringTime = Utils.GetDateTimeNullable(cs.GatheringTime) == null ? "" : cs.GatheringTime;
                sb.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n",
                                cs.LDate == null ? "" : Convert.ToDateTime(cs.LDate).ToString("yyyy-MM-dd"),
                                cs.GatheringTime,
                                cs.LTraffic,
                                cs.RTraffic,
                                cs.RouteName,
                                cs.PlanPeopleNumber,
                                cs.TourCoordinatorInfo[0].Name);
            }

            ResponseToXls(sb.ToString());
        }