Esempio n. 1
0
        public void setUpDictionary()
        {
            string query       = "";
            bool   usingQSArgs = false;

            if (Request["storedQueryID"] != null)
            {
                StoredQueries StoredQ = new StoredQueries(URL, userID, SecCred);
                query = StoredQ.getStoredQueryString(Request["storedQueryID"]);
                query = query.Replace("[TODAY]", DateTime.Now.ToShortDateString());
            }
            else
            {
                if (Request.QueryString.Count == 0)
                {
                    query = searchPageCookies.getCookieString().Replace(";", "&");
                }
                else
                {
                    query       = Request.QueryString.ToString();
                    usingQSArgs = true;
                }
            }

            if (query.Length > 0)
            {
                string[] tmp = query.Split('&');
                foreach (string s in tmp)
                {
                    if (s.Contains("=") == true)
                    {
                        string[] tmp1 = s.Split('=');
                        if (usingQSArgs == false)
                        {
                            queryString.Add(tmp1[0], tmp1[1]);
                        }
                        else
                        {
                            //get the value from request because it handles special characters correctly!!!!!!
                            string tmp2 = Request.QueryString[tmp1[0]];
                            tmp2 = tmp2.Replace("[TODAY]", DateTime.Now.ToShortDateString());
                            queryString.Add(tmp1[0], tmp2);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            searchPageCookies = new SQLCookies(_appFriendlyName + @"/SearchPage", userID, SecCred);

            ddl_Location.Attributes.Add("onchange", "fnLocationChanged()");

            if (!IsPostBack)
            {
                initForm();

                string allCookies = searchPageCookies.getCookieString();
                allCookies = allCookies.Replace(";", "&");
                prePopulateForm(allCookies);
            }

            if (Request["__EVENTTARGET"] == "Search")
            {
                string s = buildQuery();
                Response.Redirect("searchresults.aspx?" + s);
            }

            if (Request["__EVENTTARGET"] == "ClearForm")
            {
                ClearForm();
            }

            if (Request["__EVENTTARGET"] == "New")
            {
                NewWF();
            }

            //if (Request["__EVENTTARGET"] == "MyWorkfow")
            //{
            //    string s = buildQuery(true);
            //    Response.Redirect("searchresults.aspx?" + s);
            //}

            ConfigurePage();
        }