コード例 #1
0
        /// <summary>
        /// 页面加载事件
        /// 作者:姚东
        /// 时间:20100927
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            //获取类型
            if (Request.QueryString["SurveyType"] != null)
            {
                SurveyType = Request.QueryString["SurveyType"].ToString();
            }

            //根据类型改变背景图片
            switch (SurveyType)
            {
            case "-1":
            case "0":
                divTop.Style.Add("background", "url(../../css/image/Index/wdwj.jpg) no-repeat");
                break;

            case "1":
                divTop.Style.Add("background", "url(../../css/image/Index/wdcp.jpg) no-repeat");
                break;

            case "2":
                divTop.Style.Add("background", "url(../../css/image/Index/wdtp.jpg) no-repeat");
                break;

            default:
                divTop.Style.Add("background", "url(../../css/image/Index/wdwj.jpg) no-repeat");
                break;
            }

            if (Session["UserGUID"] != null)
            {
                Anthem.Manager.Register(this);
                _repeaterSelect = new RepeaterSelect(Page, rptSurveyMain, TableSourceCount, GridFirstPage, GridBefore, GridNext, GridEnd, GridJump, DdlgridSourceCount);
                //if (Request.QueryString["sql"] != null)
                //{
                BLL.Query.SurveyTableQuery query = new BLL.Query.SurveyTableQuery();
                string sql = query.GetMySurveySql(Session["UserIDClient"].ToString(), SurveyType);
                Xorder = "createdate desc";
                _repeaterSelect.Xorder = "createdate desc";
                _repeaterSelect.Type   = "2";
                _repeaterSelect.LoadData(sql);
                if (!IsPostBack)
                {
                    if (Request.QueryString["KeyCode"] != null)
                    {
                        ((TextBox)Page.FindControl("utlTop1$txtSearchCondition")).Text = Request.QueryString["KeyCode"].ToString();
                        _repeaterSelect.SimpleSearch(Request.QueryString["KeyCode"].ToString());
                    }
                }
                SetParas();
            }
            else
            {
                //页面跳转
                Response.Redirect("../../Error/WebErrorPage.aspx?RedirectURL=" + Request.Url.ToString().Replace('&', '^'));
            }
        }
        /// <summary>
        /// 页面加载事件
        /// 作者:姚东
        /// 时间:20100927
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{



            //获取类型
            if (Request.QueryString["SurveyType"] != null)
            {
                SurveyType = Request.QueryString["SurveyType"].ToString();
            }

            //根据类型改变背景图片
            switch (SurveyType)
            {
            case "-1":
            case "0":
                divTop.Style.Add("background", "url(../../css/image/Index/wjzs.jpg) no-repeat");
                break;

            case "1":
                divTop.Style.Add("background", "url(../../css/image/Index/cpzs.jpg) no-repeat");
                break;

            case "2":
                divTop.Style.Add("background", "url(../../css/image/Index/tpzs.jpg) no-repeat");
                break;

            default:
                divTop.Style.Add("background", "url(../../css/image/Index/wjzs.jpg) no-repeat");
                break;
            }

            Anthem.Manager.Register(this);
            _repeaterSelect = new RepeaterSelect(Page, rptSurveyMain, TableSourceCount, GridFirstPage, GridBefore, GridNext, GridEnd, GridJump, DdlgridSourceCount);
            //if (Request.QueryString["sql"] != null)
            //{
            BLL.Query.SurveyTableQuery query = new BLL.Query.SurveyTableQuery();
            string sql = query.GetSurveySql(SurveyType);

            Xorder = "createdate desc";
            _repeaterSelect.Xorder = "createdate desc";
            _repeaterSelect.Type   = "2";
            _repeaterSelect.LoadData(sql);
            if (!IsPostBack)
            {
                if (Request.QueryString["KeyCode"] != null)
                {
                    ((TextBox)Page.FindControl("utlTop1$txtSearchCondition")).Text = Request.QueryString["KeyCode"].ToString();
                    _repeaterSelect.SimpleSearch(Request.QueryString["KeyCode"].ToString());
                }
            }
            SetParas();
        }