Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Check GUAM UserId, Role for NCIPL_CC
            if (GlobalUtils.UserRoles.getLoggedInUserId().Length == 0 || GlobalUtils.UserRoles.getLoggedInUserRole() < 1)
            {
                string currASPXfilename = System.IO.Path.GetFileName(Request.Path).ToString();
                Session["NCIPL_REGISTERREFERRER"] = currASPXfilename;
                Response.Redirect("~/login.aspx?msg=invaliduser&redir=" + currASPXfilename, true);
            }

            //Moving this to default page
            //if (Session["JSTurnedOn"] == null)
            //    Session["JSTurnedOn"] = "True"; //Assuming JavaScript is enabled, by default.

            ////Missing Session -- COMMENTED FOR NCIPLCC
            //if (Session["JSTurnedOn"] == null)
            //    Response.Redirect("default.aspx?missingsession=true", true);

            //For Hailstorm check length
            if (this.searchbar.Terms.Length > 100) //Using a hundred limit for search contains sp
            {
                Response.Redirect("default.aspx", true);
            }

            if (!Page.IsPostBack)
            {
                if (Request.QueryString["js"] != null) //Test for JavaScript
                {
                    if (string.Compare(Request.QueryString["js"].ToString(), "2") == 0)
                    {
                        Session["JSTurnedOn"] = "False";
                    }
                }

                //Begin CR-36 - A quick way to turn off Featured Images
                if (ConfigurationManager.AppSettings["TurnOffFeaturedImages"] != null)
                {
                    TurnOffFeaturedImages = ConfigurationManager.AppSettings["TurnOffFeaturedImages"];
                }
                //End CR-36

                ////***EAC Create the session variables asap
                Session["PUBENT_SearchKeyword"] = "";
                Session["PUBENT_TypeOfCancer"]  = "";
                Session["PUBENT_Subject"]       = "";
                Session["PUBENT_Audience"]      = "";
                Session["PUBENT_ProductFormat"] = "";
                Session["PUBENT_Language"]      = "";
                Session["PUBENT_StartsWith"]    = "";
                Session["PUBENT_Series"]        = ""; //Or collection
                Session["PUBENT_NewOrUpdated"]  = "";
                Session["PUBENT_Race"]          = "";
                Session["PUBENT_Criteria"]      = "";


                ListCancerTypes.DataSource = KVPair.GetKVPair("sp_NCIPLCC_getCancerTypes");
                ListCancerTypes.DataBind();
                ListSubjs.DataSource = KVPair.GetKVPair("sp_NCIPLCC_getSubjects");
                ListSubjs.DataBind();
                ListProductFormat.DataSource = KVPair.GetKVPair("sp_NCIPLCC_getProductFormats");
                ListProductFormat.DataBind();
                ListCollections.DataSource = KVPair.GetKVPair("sp_NCIPLCC_getCollections");
                ListCollections.DataBind();
                //CR 11-001-36 ListProductUpdates.DataSource = KVPair.GetKVPair("sp_NCIPL_getProductUpdates");
                //CR 11-001-36 ListProductUpdates.DataBind();
                ListLanguages.DataSource = KVPair.GetKVPair("sp_NCIPLCC_getLanguages");
                ListLanguages.DataBind();
                ListAudience.DataSource = KVPair.GetKVPair("sp_NCIPLCC_getAudience");
                ListAudience.DataBind();
                ListRace.DataSource = KVPair.GetKVPair("sp_NCIPLCC_getRace");
                ListRace.DataBind();

                //ListAnnouncements.DataSource = KVPair.GetKVPair("sp_NCIPL_getAnnouncements");
                //ListAnnouncements.DataBind();
                ListAnnouncements.DataSource = Announcement.GetAnnouncements();
                ListAnnouncements.DataBind();
                if (ListAnnouncements.Items.Count == 0)
                {
                    divAnnouncements.Visible = false;
                }
                //ListFeatures.DataSource = KVPair.GetKVPair("sp_NCIPL_getFeatures");
                //ListFeatures.DataBind();
                //CR-36 ProductCollection p = DAL.DAL.GetProductFeatures();
                //CR-36 ListFeatures.DataSource = p;
                //CR-36 ListFeatures.DataBind();

                #region StackRelated
                //ListFeatures.DataSource = DAL.DAL.GetStacks(); //CR-36
                //ListFeatures.DataBind(); //CR-36
                #endregion
            }

            //Begin - Code for Appropriate Tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "home");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "home");
            }
            UtilMethod = null;
            //End Code for Tab
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Utils.ValidateRedirect().Length > 0) //Important check
            {
                Response.Redirect(Utils.ValidateRedirect(), true);
            }

            //Moving this to default page
            //if (Session["JSTurnedOn"] == null)
            //    Session["JSTurnedOn"] = "True"; //Assuming JavaScript is enabled, by default.

            ////Missing Session
            //if (Session["JSTurnedOn"] == null)
            //    //Response.Redirect("default.aspx?missingsession=true", true);
            //    Response.Redirect("conf.aspx?missingjs=true", true);

            //For Hailstorm check length
            if (this.searchbar.Terms.Length > 100) //Using a hundred limit for search contains sp
            {
                Response.Redirect("default.aspx", true);
            }

            if (!Page.IsPostBack)
            {
                if (Request.QueryString["js"] != null) //Test for JavaScript
                {
                    if (string.Compare(Request.QueryString["js"].ToString(), "2") == 0)
                    {
                        Session["JSTurnedOn"] = "False";
                    }
                }

                ////***EAC Create the session variables asap
                //Session["NCIPL_Pubs"] = "";
                //Session["NCIPL_Qtys"] = "";
                //Session["PUBENT_SearchKeyword"] = "";
                //Session["PUBENT_TypeOfCancer"] = "";
                //Session["PUBENT_Subject"] = "";
                //Session["PUBENT_Audience"] = "";
                //Session["PUBENT_ProductFormat"] = "";
                //Session["PUBENT_Language"] = "";
                //Session["PUBENT_StartsWith"] = "";
                //Session["PUBENT_Series"] = ""; //Or collection
                //Session["PUBENT_NewOrUpdated"] = "";
                //Session["PUBENT_Race"] = "";


                //Added the session values clearing (other than pubids qtys) back for HITT 7432
                Session["NCIPLEX_SearchKeyword"] = "";
                Session["NCIPLEX_TypeOfCancer"]  = "";
                Session["NCIPLEX_Subject"]       = "";
                Session["NCIPLEX_Audience"]      = "";
                Session["NCIPLEX_ProductFormat"] = "";
                Session["NCIPLEX_Language"]      = "";
                Session["NCIPLEX_StartsWith"]    = "";
                Session["NCIPLEX_Series"]        = ""; //Or collection
                Session["NCIPLEX_NewOrUpdated"]  = "";
                Session["NCIPLEX_Race"]          = "";
                Session["NCIPLEX_Criteria"]      = "";


                ListCancerTypes.DataSource = KVPair.GetKVPair("sp_NCIPLex_getCancerTypes");
                ListCancerTypes.DataBind();
                ListSubjs.DataSource = KVPair.GetKVPair("sp_NCIPLex_getSubjects");
                ListSubjs.DataBind();
                ListProductFormat.DataSource = KVPair.GetKVPair("sp_NCIPLex_getProductFormats");
                ListProductFormat.DataBind();
                ListCollections.DataSource = KVPair.GetKVPair("sp_NCIPLex_getCollections");
                ListCollections.DataBind();
                ListProductUpdates.DataSource = KVPair.GetKVPair("sp_NCIPLex_getProductUpdates");
                ListProductUpdates.DataBind();
                ListLanguages.DataSource = KVPair.GetKVPair("sp_NCIPLex_getLanguages");
                ListLanguages.DataBind();
                ListAudience.DataSource = KVPair.GetKVPair("sp_NCIPLex_getAudience");
                ListAudience.DataBind();
                ListRace.DataSource = KVPair.GetKVPair("sp_NCIPLex_getRace");
                ListRace.DataBind();

                ////ListAnnouncements.DataSource = KVPair.GetKVPair("sp_NCIPL_getAnnouncements");
                ////ListAnnouncements.DataBind();
                //ListAnnouncements.DataSource = Announcement.GetAnnouncements();
                //ListAnnouncements.DataBind();
                //if (ListAnnouncements.Items.Count == 0)
                //    divAnnouncements.Visible = false;
                ////ListFeatures.DataSource = KVPair.GetKVPair("sp_NCIPL_getFeatures");
                ////ListFeatures.DataBind();
                //ProductCollection p = DAL.DAL.GetProductFeatures();
                //ListFeatures.DataSource = p;
                //ListFeatures.DataBind();
            }
            else //HITT 7426 - The else code is added to handle enter key pressed in the text box
            {
                //txtSearch.Text = Session["PUBENT_SearchKeyword"].ToString();
                Session["NCIPLEX_SearchKeyword"] = this.searchbar.Terms;

                Session["NCIPLEX_TypeOfCancer"]  = "";
                Session["NCIPLEX_Subject"]       = "";
                Session["NCIPLEX_Audience"]      = "";
                Session["NCIPLEX_Language"]      = "";
                Session["NCIPLEX_ProductFormat"] = "";
                Session["NCIPLEX_StartsWith"]    = "";
                Session["NCIPLEX_Series"]        = "";
                Session["NCIPLEX_NewOrUpdated"]  = "";
                Session["NCIPLEX_Race"]          = "";

                Session["NCIPLEX_Criteria"] = Session["NCIPLEX_SearchKeyword"];

                /*Begin CR-31 - HITT 9815 */
                GlobalUtils.Utils objUtils    = new GlobalUtils.Utils();
                string            QueryParams = objUtils.GetQueryStringParams();
                objUtils = null;
                /*End CR-31 - HITT 9815 */

                //CR-31 HITT 9815 Response.Redirect("searchres.aspx");
                Response.Redirect("searchres.aspx" + "?sid=" + QueryParams);
            }


            //Set the appropriate tab
            //int intTotalQty = 0;
            //if (Session["NCIPL_Qtys"] != null)
            //{
            //    string[] qtys = Session["NCIPL_Qtys"].ToString().Split(new Char[] { ',' });
            //    for (int i = 0; i < qtys.Length; i++)
            //    {
            //        if (qtys[i].Length > 0)
            //            intTotalQty += Int32.Parse(qtys[i].ToString());
            //    }
            //}

            //string litText1 = @"<li id=""selected""><a href=""home.aspx"">Home</a></li>";
            //string litText2 = @"<li><a href=""self.aspx"">Self-Printing Options</a></li>";
            //string litText3 = @"<li><a href=""cart.aspx"">" + "Shopping Cart (" + intTotalQty.ToString() + ") </a></li>";
            //Master.LiteralText = "<ul>" + litText1 + litText2 + litText3 + "</ul>";

            //Begin - Code for Appropriate Tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPLEX_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "home");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "home");
            }
            UtilMethod = null;
            //End Code for Tab
        }