Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Utils.ValidateRedirect().Length > 0) //Important check
            {
                Response.Redirect(Utils.ValidateRedirect(), true);
            }

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

            if (!IsPostBack)
            {
                this.LoadData();
            }

            //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
        }
Example #2
0
        protected void PubCoverOrderOK_Click(object sender, EventArgs e)
        {
            if (!IsQtyValueValid(QuantityOrderedCover.Text, CoverQtyLimit.Text))
            {
                labelErrMsgPubCover.Text         = "Please enter a valid quantity.";
                UpdatePanelOrderCover.UpdateMode = UpdatePanelUpdateMode.Conditional;
                UpdatePanelOrderCover.Update();
                this.PubCoverOrderModalPopup.Show();
                return;
            }

            int qty = Int32.Parse(QuantityOrderedCover.Text);

            if (qty > 0)
            {
                if (!IsItemInCart(this.PubCoverOrderOK.CommandArgument.ToString())) //Check for browser re-load
                {
                    Session["NCIPLEX_Pubs"] += this.PubCoverOrderOK.CommandArgument.ToString() + ",";
                    Session["NCIPLEX_Qtys"] += qty + ",";
                }

                //Change the searh results listview here to show "In Cart" items
                //foreach (ListViewItem dItem in this.ListViewSearchResults.Items)
                //{
                //    if (dItem.ItemType == ListViewItemType.DataItem)
                //    {
                //        ImageButton OrderedCover = (ImageButton)dItem.FindControl("OrderCover");
                if (string.Compare(OrderCover.CommandArgument, PubCoverOrderOK.CommandArgument, true) == 0)
                {
                    OrderCover.CommandArgument = "";
                    OrderCover.ImageUrl        = "images/CoverOnlyInYourCart_off.gif";
                    OrderCover.AlternateText   = "Covers Only - In Your Cart";
                }
                //    }
                //}

                //Display the master page tabs
                GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
                if (Session["NCIPLEX_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;

                QuantityOrderedCover.Text = "1";         //Reset through code
                //BackToSearchResultsLink.Visible = false; //Do not show if pub was orded from details page
            }
            else
            {
                //dont do anything for now
            }
            //BackToSearchResultsLink.NavigateUrl = "javascript:history.go(-3);"; //Do not show once modal pop-up is displayed
        }
Example #3
0
        //BEGIN COPIED CODE#########################################
        //Server Side Event to call the Modal Popup Extender (Shopping Cart)
        //Or call method to add a single item to Shopping Cart if JavaScript is turned off
        protected void DisplayModalPopUp(object sender, CommandEventArgs e)
        {
            if (e.CommandArgument.ToString().Length == 0)
            {
                Response.Redirect("cart.aspx", true);
                return;
            }

            if (string.Compare(Session["JSTurnedOn"].ToString(), "False") == 0)
            {
                //Add a default quantity of one to the shopping cart if JavaScript is not enabled
                if (!IsItemInCart(e.CommandArgument.ToString())) //Check for browser re-load
                {
                    Session["NCIPLEX_Pubs"] += e.CommandArgument.ToString() + ",";
                    Session["NCIPLEX_Qtys"] += "1" + ",";
                }

                ImageButton OrderedPub = (ImageButton)sender;
                OrderedPub.CommandArgument = "";
                OrderedPub.ImageUrl        = "images/PublicationInYourCart_off.gif";
                OrderedPub.AlternateText   = "Publication - In Your Cart";

                //Display the master page tabs
                GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
                if (Session["NCIPLEX_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;
            }
            else
            {
                this.PubOrderOK.CommandArgument = e.CommandArgument.ToString();

                Product p = SQLDataAccess.GetProductbyPubID(Convert.ToInt32(e.CommandArgument));
                labelPubTitle.Text = p.LongTitle;
                PubQtyLimit.Text   = p.NumQtyLimit.ToString();
                PubLimitLabel.Text = "Limit " + PubQtyLimit.Text;

                //Need to call update panel update to populate the values
                UpdatePanelOrderPub.UpdateMode = UpdatePanelUpdateMode.Conditional;
                UpdatePanelOrderPub.Update();

                //Show the Modal Popup
                this.PubOrderModalPopup.Show();
                //BackToSearchResultsLink.NavigateUrl = "javascript:history.go(-2);"; //Do not show once modal pop-up is displayed
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         //Display the master page tabs
         GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
         if (Session["NCIPL_Pubs"] != null)
         {
             Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "selfprint");
         }
         else
         {
             Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "selfprint");
         }
         UtilMethod = null;
     }
 }
Example #5
0
        protected void grdViewItems_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Remove")
            {
                this.shoppingcart.Remove(this.shoppingcart[Int32.Parse(e.CommandArgument.ToString())]);
                Session["NCIPLEX_Pubs"] = this.shoppingcart.Pubs;
                Session["NCIPLEX_Qtys"] = this.shoppingcart.Qtys;

                grdViewItems.DataSource = this.shoppingcart;
                grdViewItems.DataBind();

                if (this.shoppingcart.Count > 0)
                {
                    //Do not do anything
                }
                else
                {
                    Panel1.Visible = false;
                    Panel2.Visible = true;
                }

                /*Begin HITT 8716*/
                if (this.shoppingcart.Cost > 0.0)
                {
                    CostRecoveryInd = "1";
                }
                else
                {
                    CostRecoveryInd = "";
                }
                this.ToggleCostDivs(CostRecoveryInd);
                /*End HITT 8716*/

                //Display the master page tabs
                GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
                if (Session["NCIPLEX_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "cart");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "cart");
                }
                UtilMethod = null;
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Utils.ValidateRedirect().Length > 0) //Important check
            {
                Response.Redirect(Utils.ValidateRedirect(), true);
            }

            if (!Page.IsPostBack)
            {
                //Display the master page tabs
                Utils UtilMethod = new GlobalUtils.Utils();
                if (Session["NCIPLEX_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;
            }
        }
Example #7
0
        private void ResetSessions()
        {
            Session["NCIPLEX_cart"]   = null;     //destroy
            Session["NCIPLEX_shipto"] = null;     //destroy
            Session["NCIPLEX_billto"] = null;     //destroy
            Session["NCIPLEX_cc"]     = null;     //destroy
            Session["NCIPLEX_DONE"]   = "";       //neither done nor finished

            //***EAC Create the session variables asap
            Session["NCIPLEX_Pubs"]          = "";
            Session["NCIPLEX_Qtys"]          = "";
            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_ShipLocation"] = "";   //JPJ - Comment this, to retain ship location after order submit

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPLEX_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Utils.ValidateRedirect().Length > 0) //Important check
            {
                Response.Redirect(Utils.ValidateRedirect(), true);
            }

            if (!IsPostBack)
            {
                #region NERDO_Related
                //arrlstNerdoPubIds = DAL.DAL.GetNerdoPubIds();
                kvpaircoll = SQLDataAccess.GetKVPair("sp_NCIPL_getNerdoPubIdsURLS");


                #endregion

                #region dummydata--remove before going live
                //Session["NCIPL_Pubs"] = "31,31";
                //Session["NCIPL_Qtys"] = "123,1";
                #endregion

                steps1.Activate("cell1");

                this.shoppingcart = null;     //destroy cart if it exists
                this.shoppingcart = new ProductCollection();

                //***EAC Parse the NCIPL_Pubs and NCIPL_qtys..assume they have same dimensions
                string[] pubs = Session["NCIPLEX_Pubs"].ToString().Split(new Char[] { ',' });
                string[] qtys = Session["NCIPLEX_Qtys"].ToString().Split(new Char[] { ',' });
                for (var i = 0; i < pubs.Length; i++)
                {
                    if (pubs[i].Trim() != "")
                    {
                        int     pubid = Int32.Parse(pubs[i]);
                        Product p     = Product.GetPubByPubID(pubid);
                        p.NumQtyOrdered = Int32.Parse(qtys[i]);
                        this.shoppingcart.Add(p);   //BLL will know what to do w/ dupes and 0 quantities
                    }
                }

                grdViewItems.DataSource = this.shoppingcart;
                grdViewItems.DataBind();
            }

            //Check for cart object here
            if (this.shoppingcart == null)
            {
                Response.Redirect("default.aspx?redirect=cart1", true);
            }

            if (this.shoppingcart.Count > 0)
            {
                //***EAC at this point we have a usable cart
                lblTot.Text = this.shoppingcart.TotalQty.ToString();
                //lblCost.Text = this.shoppingcart.Cost.ToString("c");

                /*Begin HITT 8716*/
                if (this.shoppingcart.Cost > 0.0)
                {
                    CostRecoveryInd = "1";
                }
                else
                {
                    CostRecoveryInd = "";
                }
                this.ToggleCostDivs(CostRecoveryInd);
                /*End HITT 8716*/

                Panel1.Visible = true;
                Panel2.Visible = false;
            }
            else//shopping cart is empty
            {
                Panel1.Visible = false;
                Panel2.Visible = true;
            }

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

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPLEX_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "cart");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "cart");
            }
            UtilMethod = null;
        }
Example #9
0
        protected void UpdateQty(object sender, EventArgs e)
        {
            if (CheckForValidQuantity() < 0)
            {
                return;
            }

            //try
            //{
            //foreach (DataGridItem item in grdItems.Items)
            //{
            //    TextBox txtQty = (TextBox)item.FindControl("txtQty");
            //    HiddenField hdnPubID = (HiddenField)item.FindControl("hdnPubID");
            //    this.shoppingcart.UpdateQty(Int32.Parse(hdnPubID.Value), Int32.Parse(txtQty.Text));
            //    Session["NCIPL_Pubs"] = this.shoppingcart.Pubs;
            //    Session["NCIPL_Qtys"] = this.shoppingcart.Qtys;
            //}
            //grdItems.DataSource = this.shoppingcart;
            //grdItems.DataBind();

            //NCIPLex - new code
            int itemsCount = 0;

            foreach (GridViewRow item in grdViewItems.Rows)
            {
                TextBox txtQty = (TextBox)item.FindControl("txtQty");
                itemsCount += Int32.Parse(txtQty.Text);
            }
            if (itemsCount > Utils.GetOrderLimit())
            {
                //Please enter a valid quantity.The limit is X total items per order.
                Utils.DisplayMessage(ref MessagePlaceHolder2, 3);
                return;
            }
            //End new code


            foreach (GridViewRow item in grdViewItems.Rows)
            {
                TextBox     txtQty   = (TextBox)item.FindControl("txtQty");
                HiddenField hdnPubID = (HiddenField)item.FindControl("hdnPubID");
                this.shoppingcart.UpdateQty(Int32.Parse(hdnPubID.Value), Int32.Parse(txtQty.Text));
                Session["NCIPLEX_Pubs"] = this.shoppingcart.Pubs;
                Session["NCIPLEX_Qtys"] = this.shoppingcart.Qtys;
            }
            grdViewItems.DataSource = this.shoppingcart;
            grdViewItems.DataBind();

            //}
            //catch (Exception ex)
            //{
            //    throw new ArgumentException(ex.Message);
            //}

            /*Begin HITT 8716*/
            if (this.shoppingcart.Cost > 0.0)
            {
                CostRecoveryInd = "1";
            }
            else
            {
                CostRecoveryInd = "";
            }
            this.ToggleCostDivs(CostRecoveryInd);
            /*End HITT 8716*/

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPLEX_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "cart");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "cart");
            }
            UtilMethod = null;
        }
Example #10
0
        //NCIPLex KVPairCollection Nerdos = new KVPairCollection();

        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Request.QueryString["confid"] == null)
            //{
            //    Utils.ResetSessions();
            //    Response.Redirect("default.aspx?redirect=verify", true);
            //}
            //else
            //    strConfId = Request.QueryString["confid"].ToString();

            if (Utils.ValidateRedirect().Length > 0) //Important check
            {
                Response.Redirect(Utils.ValidateRedirect(), true);
            }

            strConfId = Session["NCIPLEX_ConfId"].ToString();

            if (strConfId.Length > 4 || strConfId == "") //potentially an intrusion
            {
                ResetSessions();
                Response.Redirect("location.aspx?redirect=verify", true);
            }
            else
            {
                ConfId = Int32.Parse(strConfId);
            }

            if (this.shoppingcart == null || this.shoppingcart.Count < 1)
            {  //***EAC I need a shopping cart at this point
                ResetSessions();
                Response.Redirect("location.aspx?missingsession=true", true);
            }

            if (Session["NCIPLEX_ShipLocation"] != null)
            {
                if (Session["NCIPLEX_ShipLocation"].ToString().Length > 0)
                {
                    if (string.Compare(Session["NCIPLEX_ShipLocation"].ToString(), "Domestic", true) == 0)
                    {
                        ShipLocation = "Domestic";
                    }
                    else if (string.Compare(Session["NCIPLEX_ShipLocation"].ToString(), "International", true) == 0)
                    {
                        ShipLocation = "International";
                    }
                }
            }

            if (ShipLocation.Length == 0)
            {
                ResetSessions();
                Response.Redirect("location.aspx", true);
            }


            if (!IsPostBack)
            {
                Session["NCIPLEX_DONE"] = "false";
                steps1.Activate("cell4");

                //PubEnt.shipping.US

                lblname.Text  = this.shipto.Fullname;
                lblOrg.Text   = this.shipto.Organization;
                lbladdr1.Text = this.shipto.Addr1;
                lbladdr2.Text = this.shipto.Addr2;
                lblcity.Text  = this.shipto.City;
                lblst.Text    = this.shipto.State;
                lblzip.Text   = this.shipto.Zip5 + ((this.shipto.Zip4.Trim() == "") ? "" : "-" + this.shipto.Zip4);

                lblCountry.Text = this.shipto.Country;
                if (string.Compare(ShipLocation, "International", true) == 0)
                {
                    divCountry.Visible = true;
                }

                lblemail.Text = "E-mail: " + this.shipto.Email;
                lblphone.Text = "Phone: " + this.shipto.Phone;


                lbl2name.Text  = this.billto.Fullname;
                lbl2addr1.Text = this.billto.Addr1;
                lbl2addr2.Text = this.billto.Addr2;
                lbl2city.Text  = this.billto.City;
                lbl2st.Text    = this.billto.State;
                lbl2zip.Text   = this.billto.Zip5 + ((this.billto.Zip4.Trim() == "") ? "" : "-" + this.billto.Zip4);
                lbl2email.Text = "E-mail: " + this.billto.Email;
                lbl2phone.Text = "Phone: " + this.billto.Phone;
                lbl2org.Text   = this.billto.Organization;

                if (this.shipto.Organization.Trim().Length < 1)
                {
                    lblOrg.Visible = false;
                }
                if (this.shipto.Addr2.Trim().Length < 1)
                {
                    lbladdr2.Visible = false;
                }
                if (this.shipto.Email.Trim().Length < 1)
                {
                    lblemail.Visible = false;
                }
                if (this.shipto.Phone.Trim().Length < 1)
                {
                    lblphone.Visible = false;
                }

                if (this.billto.Organization.Trim().Length < 1)
                {
                    lbl2org.Visible = false;
                }
                if (this.billto.Addr2.Trim().Length < 1)
                {
                    lbl2addr2.Visible = false;
                }
                if (this.billto.Email.Trim().Length < 1)
                {
                    lbl2email.Visible = false;
                }
                if (this.billto.Phone.Trim().Length < 1)
                {
                    lbl2phone.Visible = false;
                }

                //JPJ 03-10-11 NCIPLex does not accept credit card orders
                //if (this.cc != null && this.cc.Cost > 0.0)
                //{
                //    pnlPaymentInfo.Visible = true;
                //    lblcc.Text = "Credit Card: " + this.cc.CompanyText ;
                //    lblccnum.Text = "Credit Card Number: ************" + this.cc.CCnum.Substring(12);
                //    lblexpires.Text = "Expiration Date: " + this.cc.ExpMon + "/" + this.cc.ExpYr;
                //    lblCost.Text = this.cc.Cost.ToString("c");
                //    btn2Shipping.Text = "Change Addresses or Payment Information";
                //    CostRecoveryInd = "1"; //HITT 8716
                //}
                //else
                //{
                pnlPaymentInfo.Visible = false;
                pnlBillingInfo.Visible = false;
                btn2Shipping.Text      = "Change Address";
                //}

                grdItems.DataSource = this.shoppingcartV2;
                grdItems.DataBind();


                //***EAC housekeeping
                lblTotalItems.Text = this.shoppingcartV2.TotalQty.ToString();
                lblCost.Text       = this.shoppingcartV2.Cost.ToString("c");

                //NCIPLex does not allow Nerdos
                //if (Nerdos.Count > 0)
                //{
                //    ListNerdos.DataSource = Nerdos;
                //    ListNerdos.DataBind();
                //    pnlContentDownload.Visible = true;
                //}

                ////***EAC test the address
                //if (shoppingcartV2.TotalQty <= 20)
                ////if (true)
                //    USPS(this.shipto);
                //else
                //    FEDEX(this.shipto);

                //JPJ 03-10-11 NCIPLex does not use FedEx because irders more than 20 are not allowed

                //Address Verification only for domestic orders
                if (string.Compare(ShipLocation, "Domestic", true) == 0)
                {
                    ////***EAC test the address
                    //if (shoppingcartV2.TotalQty <= 20)
                    //    //if (true)
                    USPS(this.shipto);
                    //else
                    //    FEDEX(this.shipto);
                }


                /*Begin HITT 8716*/
                if (string.Compare(CostRecoveryInd, "") == 0)
                {
                    lblCCText.Visible        = false;
                    divCost.Visible          = false;
                    divCCExplanation.Visible = false;
                }
                /*End HITT 8716*/
            }

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPLEX_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }
Example #11
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
        }
Example #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Utils.ValidateRedirect().Length > 0) //Important check
            {
                Response.Redirect(Utils.ValidateRedirect(), true);
            }

            if (this.shoppingcart == null || this.shoppingcart.Count < 1)
            {  //***EAC I need a shopping cart at this point
                ResetSessions();
                Response.Redirect("home.aspx?missingcart=true", true);
            }

            IsOrderIntl = Utils.IsOrderInternational(); //NCIPLex - International or domestic

            if (!IsPostBack)
            {
                steps1.Activate("cell3");

                this.shoppingcartV2 = VirtualizedCart(this.shoppingcart);
                if (this.cc == null)
                {
                    this.cc = new CreditCard();
                }
                this.cc.Cost = this.shoppingcartV2.Cost;      //assume cart exists...if not error handler will take care of it

                for (int i = DateTime.Now.Year; i < DateTime.Now.Year + 9; i++)
                {
                    drpyr.Items.Add(new ListItem(i.ToString(), i.ToString().Substring(2)));
                }

                ddlIntlCountry.DataSource    = NCIPLex.DAL.SQLDataAccess.GetKVPairStr("SP_NCIPLex_GetCountry");
                ddlIntlCountry.DataTextField = "Val";
                //ddlIntlCountry.DataValueField = "Key";
                ddlIntlCountry.DataValueField = "Val";
                ddlIntlCountry.DataBind();
                ddlIntlCountry.Items.Insert(0, new ListItem("[Select from the list]", ""));

                if (this.shipto != null)
                {
                    #region Restore ship vals
                    try
                    {
                        txtzip5.Text  = shipto.Zip5;
                        txtzip4.Text  = shipto.Zip4;
                        txtcity.Text  = shipto.City;
                        txtstate.Text = shipto.State;
                        //foreach (KVPair city in Zipcode.GetCities(Convert.ToInt32(shipto.Zip5)))
                        //    drpcity.Items.Add(new ListItem(city.Key, city.Key));
                        //drpcity.SelectedValue = shipto.City;
                        txtcity.Text    = shipto.City;
                        txtcity.Visible = true;
                        drpcity.Visible = false;
                        txtname.Text    = shipto.Fullname;
                        txtorg.Text     = shipto.Organization;
                        txtaddr1.Text   = shipto.Addr1;
                        txtaddr2.Text   = shipto.Addr2;
                        txtphone.Text   = shipto.Phone;
                        txtemail.Text   = shipto.Email;

                        if (IsOrderIntl)
                        {
                            txtIntlZip.Text   = shipto.Zip5;
                            txtIntlState.Text = shipto.State;
                            //txtIntlCountry.Text = shipto.Country;
                            ddlIntlCountry.SelectedValue = shipto.Country;
                        }
                    }
                    catch (Exception)
                    {
                    }

                    #endregion
                }

                if (this.billto != null)
                {
                    #region Restore bill vals
                    try
                    {
                        txt2zip5.Text  = billto.Zip5;
                        txt2zip4.Text  = billto.Zip4;
                        txt2city.Text  = billto.City;
                        txt2state.Text = billto.State;
                        foreach (KVPair city in Zipcode.GetCities(Convert.ToInt32(billto.Zip5)))
                        {
                            drpcity2.Items.Add(new ListItem(city.Key, city.Key));
                        }
                        drpcity2.SelectedValue = billto.City;
                        txt2name.Text          = billto.Fullname;
                        txt2org.Text           = billto.Organization;
                        txt2addr1.Text         = billto.Addr1;
                        txt2addr2.Text         = billto.Addr2;
                        txt2phone.Text         = billto.Phone;
                        txt2email.Text         = billto.Email;
                    }
                    catch (Exception)
                    {
                    }
                    #endregion
                }

                //JPJ 03-10-11 NCIPLex does not accept credit card orders
                //if (this.cc != null && this.cc.Cost > 0.0)
                //{
                //    Label1.Text = "Shipping & Payment";
                //    pnlPaymentInfo.Visible = true;
                //    #region Restor CC field values
                //    drpcard.SelectedValue = cc.Company;
                //    txtccnum.Text = cc.CCnum;
                //    txtcvv2.Text = cc.CVV2;
                //    drpmonth.SelectedValue = cc.ExpMon;
                //    drpyr.SelectedValue = cc.ExpYr;
                //    lblCost.Text = this.cc.Cost.ToString("c");
                //    #endregion
                //}
                //else
                //{
                Label1.Text            = "Shipping";
                pnlPaymentInfo.Visible = false;
                pnlBIllingInfo.Visible = false;
                chkSameaddress.Visible = false;
                lblBill.Visible        = false;
                lblShip.Visible        = false;
                rowIntlCountry.Visible = false;
                //}

                if (IsOrderIntl)
                {
                    lbltxtzip5.Visible  = false;
                    txtzip5.Visible     = false;
                    lbltxtzip4.Visible  = false;
                    txtzip4.Visible     = false;
                    lbltxtstate.Visible = false;
                    txtstate.Visible    = false;

                    txtphone.ToolTip = "";

                    RegularExpressionValidator3.Visible = false;
                    RegularExpressionValidator6.Visible = false;
                    RequiredFieldValidator13.Visible    = false;
                    RegularExpressionValidator5.Visible = false;
                    RequiredFieldValidator6.Visible     = false;


                    lblIntltxtzip.Visible     = true;
                    txtIntlZip.Visible        = true;
                    lbltxtIntlState.Visible   = true;
                    txtIntlState.Visible      = true;
                    rowIntlCountry.Visible    = true;
                    divlblCountry.Visible     = true;
                    lbltxtIntlCountry.Visible = true;
                    divtxtCountry.Visible     = true;
                    //txtIntlCountry.Visible = true;
                    ddlIntlCountry.Visible           = true;
                    RequiredFieldIntlZip.Visible     = true;
                    RequiredFieldIntlCountry.Visible = true;
                }
            }

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPLEX_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }
Example #13
0
        protected void DisplayModalPopUpCover(object sender, CommandEventArgs e)
        {
            if (e.CommandArgument.ToString().Length == 0)
            {
                Response.Redirect("cart.aspx", true);
                return;
            }

            if (string.Compare(Session["JSTurnedOn"].ToString(), "False") == 0)
            {
                //Add a default quantity of one to the shopping cart if JavaScript is not enabled
                if (!IsItemInCart(e.CommandArgument.ToString())) //Check for browser re-load
                {
                    Session["NCIPLEX_Pubs"] += e.CommandArgument.ToString() + ",";
                    Session["NCIPLEX_Qtys"] += "1" + ",";
                }

                ImageButton OrderedCover = (ImageButton)sender;
                OrderedCover.CommandArgument = "";
                OrderedCover.ImageUrl        = "images/CoverOnlyInYourCart_off.gif";
                OrderedCover.AlternateText   = "Covers Only - In Your Cart";

                //Display the master page tabs
                GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
                if (Session["NCIPLEX_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;
            }
            else
            {
                this.PubCoverOrderOK.CommandArgument = e.CommandArgument.ToString();

                Product p = SQLDataAccess.GetProductbyPubID(Convert.ToInt32(e.CommandArgument));
                labelCoverPubTitle.Text = p.LongTitle;
                CoverQtyLimit.Text      = p.NumQtyLimit.ToString(); //p.NumQtyAvailable.ToString();
                CoverLimitLabel.Text    = "Pack of 25 covers" + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + "Limit " + CoverQtyLimit.Text;

                //Get the content URL - TO DO, can be optimized later to use a stored procedure
                //that returns only one value.
                KVPairCollection kvpaircoll = SQLDataAccess.GetKVPair("sp_NCIPL_getNerdoPubIdsURLS");;
                foreach (KVPair kvpair in kvpaircoll)
                {
                    if (string.Compare(kvpair.Key, p.PubId.ToString()) == 0)
                    {
                        linkCoverPubUrl.NavigateUrl = kvpair.Val;
                        break;
                    }
                }

                //Need to call update panel update to populate the values
                UpdatePanelOrderCover.UpdateMode = UpdatePanelUpdateMode.Conditional;
                UpdatePanelOrderCover.Update();

                //Show the Modal Popup
                this.PubCoverOrderModalPopup.Show();
                //BackToSearchResultsLink.NavigateUrl = "javascript:history.go(-2);"; //Do not show once modal pop-up is displayed
            }
        }
Example #14
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (Utils.ValidateRedirect().Length > 0) //Important check
            {
                Response.Redirect(Utils.ValidateRedirect(), true);
            }

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

            //Just for the details page--allow users to come in directly
            if (Session["JSTurnedOn"] == null)
            {
                Session["JSTurnedOn"] = "True"; //Assuming JavaScript is enabled, by default.
                if (Session["NCIPLEX_Pubs"] == null)
                {
                    Session["NCIPLEX_Pubs"] = "";
                }
                if (Session["NCIPLEX_Qtys"] == null)
                {
                    Session["NCIPLEX_Qtys"] = "";
                }
                if (Session["NCIPLEX_SearchKeyword"] == null)
                {
                    Session["NCIPLEX_SearchKeyword"] = "";
                }
                if (Session["NCIPLEX_TypeOfCancer"] == null)
                {
                    Session["NCIPLEX_TypeOfCancer"] = "";
                }
                if (Session["NCIPLEX_Subject"] == null)
                {
                    Session["NCIPLEX_Subject"] = "";
                }
                if (Session["NCIPLEX_Audience"] == null)
                {
                    Session["NCIPLEX_Audience"] = "";
                }
                if (Session["NCIPLEX_ProductFormat"] == null)
                {
                    Session["NCIPLEX_ProductFormat"] = "";
                }
                if (Session["NCIPLEX_Language"] == null)
                {
                    Session["NCIPLEX_Language"] = "";
                }
                if (Session["NCIPLEX_StartsWith"] == null)
                {
                    Session["NCIPLEX_StartsWith"] = "";
                }
                if (Session["NCIPLEX_Series"] == null)
                {
                    Session["NCIPLEX_Series"] = ""; //Or collection
                }
                if (Session["NCIPLEX_NewOrUpdated"] == null)
                {
                    Session["NCIPLEX_NewOrUpdated"] = "";
                }
                if (Session["NCIPLEX_Race"] == null)
                {
                    Session["NCIPLEX_Race"] = "";
                }
            }
            //End of code

            //Some more checks -- for HailStorm
            if (QuantityOrdered.Text.Length > 4)
            {
                Response.Redirect("default.aspx?redirect=detail1", true);
            }
            else if (PubQtyLimit.Text.Length > 5)
            {
                Response.Redirect("default.aspx?redirect=detail2", true);
            }
            else if (QuantityOrderedCover.Text.Length > 4)
            {
                Response.Redirect("default.aspx?redirect=detail3", true);
            }
            else if (CoverQtyLimit.Text.Length > 5)
            {
                Response.Redirect("default.aspx?redirect=detail4", true);
            }
            //End of HailStorm checks

            //Other important checks - redirect to default page
            if (Request.QueryString["prodid"] == null)
            {
                Response.Redirect("default.aspx?redirect=detail", true);
            }
            else if (Request.QueryString["prodid"].Length > 10)
            {
                Response.Redirect("default.aspx?redirect=detail", true);
            }

            if (!Page.IsPostBack)
            {
                //***EAC decided to use product ID instead on PUBID to dicourage users from guessing this param
                if (Request.QueryString["prodid"] != null)
                {
                    GlobalUtils.Utils UtilMethodClean = new GlobalUtils.Utils();
                    _prodid         = UtilMethodClean.Clean(Request.QueryString["prodid"].ToString());
                    UtilMethodClean = null;

                    ProductCollection pColl = SQLDataAccess.GetProductbyProductIDWithRules(_prodid);
                    //Product p = Product.GetPubByProductID(Request.QueryString["prodid"].ToString());

                    //Checking for a valid Product Id
                    if (pColl == null)
                    {
                        Response.Redirect("default.aspx?redirect=detail", true);
                    }
                    else if (pColl.Pubs.Length == 0)
                    {
                        Response.Redirect("default.aspx?redirect=detail", true);
                    }

                    Product p = pColl[0];

                    lblTitle.Text  = p.LongTitle;
                    lblFormat.Text = p.Format;
                    if (lblFormat.Text.Length <= 0)
                    {
                        lblFormatText.Visible = false;
                    }
                    lblNumPages.Text = p.NumPages;
                    if (lblNumPages.Text.Length <= 0)
                    {
                        lblNumPagesText.Visible = false;
                    }
                    //Image1.ImageUrl = "pubimages/" + p.PubImage;
                    lblAud.Text = p.Audience;
                    if (lblAud.Text.Length <= 0)
                    {
                        lblAudText.Visible = false;
                    }
                    lblLang.Text = p.Language;
                    if (lblLang.Text.Length <= 0)
                    {
                        lblLangText.Visible = false;
                    }
                    //lblSumm.Text = p.Summary;
                    lblDesc.Text = p.Abstract;
                    //if (lblDesc.Text.Length <= 0)
                    //lblDescText.Visible = false; //LSK no label for description


                    string LastUpdatedMon  = "";
                    string LastUpdatedDay  = "";
                    string LastUpdatedYear = "";
                    string LastUpdatedText = "";

                    LastUpdatedMon  = p.RevisedMonth;
                    LastUpdatedDay  = p.RevisedDay;
                    LastUpdatedYear = p.RevisedYear;

                    if (LastUpdatedMon.Length > 0 && LastUpdatedDay.Length > 0 && LastUpdatedYear.Length > 0)
                    {
                        LastUpdatedText = LastUpdatedMon + " " + LastUpdatedDay + ", " + LastUpdatedYear;
                    }
                    else if (LastUpdatedMon.Length > 0 && LastUpdatedYear.Length > 0)
                    {
                        LastUpdatedText = LastUpdatedMon + " " + LastUpdatedYear;
                    }
                    else if (LastUpdatedYear.Length > 0)
                    {
                        LastUpdatedText = LastUpdatedYear;
                    }
                    else
                    {
                        LastUpdatedText = "";
                    }

                    lblLastupd.Text = LastUpdatedText;
                    //lblLastupdText.Text = p.RevisedDateType;
                    lblLastupdText.Text = p.RevisedDateType.ToLower();

                    if (lblLastupd.Text.Length <= 0)
                    {
                        lblLastupdText.Visible = false;
                    }
                    lblProductID.Text = p.ProductId;
                    if (lblProductID.Text.Length <= 0)
                    {
                        lblProductIDText.Visible = false;
                    }
                    lblOrderLimit.Text = p.NumQtyLimit.ToString(); //HITT 8288
                    if (p.CanOrder == 0)                           //HITT 8288
                    {
                        lblOrderLimit.Visible     = false;
                        lblOrderLimitText.Visible = false;
                    }
                    lblNIH.Text = p.NIHNum;
                    if (lblNIH.Text.Length <= 0)
                    {
                        lblNIHText.Visible = false;
                    }
                    //if (lblNIHText.Visible == true) //CR-10 HITT 9456
                    //{
                    //    if (p.NIHNum.Length > 7)
                    //        lblNIHText.Text = "NIH Number(s):&nbsp;";
                    //}
                    lblAwards.Text = p.Awards;
                    //if (lblAwards.Text.Length > 0)
                    //    lblAwards.Text = p.Awards;
                    //lblAwardsText.Visible = false; //LSK no longer show awards label
                    if (p.PubImage.Length > 0)
                    {
                        panelThumbImg.Visible = true;
                        string imagepath = ConfigurationManager.AppSettings["PubImagesURL"];
                        //Image1.ImageUrl = "pubimages/" + p.PubImage;
                        Image1.ImageUrl      = imagepath + "/" + p.PubImage;
                        Image1.AlternateText = p.ShortTitle;
                        if (p.PubLargeImage.Length > 0)
                        {
                            panelThumbImg.Visible = false;
                            panelLargeImg.Visible = true;
                            string lgimagepath = ConfigurationManager.AppSettings["PubLargeImagesURL"];
                            Image2.AlternateText      = p.ShortTitle;
                            Image2.ImageUrl           = lgimagepath + "/" + p.PubLargeImage;
                            Image3.AlternateText      = p.ShortTitle;
                            Image3.ImageUrl           = lgimagepath + "/" + p.PubLargeImage;
                            MagnifierLink.Visible     = true;
                            MagnifierLink.NavigateUrl = "dispimage.aspx?prodid=" + p.ProductId;
                        }
                    }

                    OrderPublication.CommandArgument = p.PubId.ToString();
                    OrderCover.CommandArgument       = p.PubIdCover;

                    if (p.CanView == 1)
                    {
                        //ReadOnlineLink.Visible = true;
                        //ReadOnlineLink.Target = "_blank";
                        //ReadOnlineLink.NavigateUrl = p.Url;

                        if (p.Url.Length > 0)
                        {
                            //textbreaker1.Visible = true;
                            HtmlLink.Visible     = true;
                            HtmlLink.NavigateUrl = p.Url;
                        }

                        if (p.PDFUrl.Length > 0)
                        {
                            //textbreaker2.Visible = true;
                            PdfLink.Visible     = true;
                            PdfLink.NavigateUrl = p.PDFUrl;
                        }
                    }
                    #region SHOW EBOOK URLS IF ANY
                    string kindle = DAL2.DAL.EbookUrl(p.PubId, "kindle");
                    if (kindle.Length > 0)
                    {
                        KindleLink.Visible     = true;
                        KindleLink.NavigateUrl = kindle;
                    }

                    string epub = DAL2.DAL.EbookUrl(p.PubId, "epub");
                    if (epub.Length > 0)
                    {
                        EpubLink.Visible     = true;
                        EpubLink.NavigateUrl = epub;
                    }
                    #endregion
                    if (p.OrderMsg.Length > 0)
                    {
                        //HITT 7445 labelOrderMsg.Visible = true;
                        labelOrderMsg.Text = p.OrderMsg;
                    }

                    if (p.CanOrder == 1)
                    {
                        OrderPublication.Visible = true;
                    }
                    else //HITT 10265
                    {
                        HiddenPopUpButton.Visible = false;
                        PubOrderPanel.Visible     = false;
                    }

                    if (p.CoverMsg.Length > 0)
                    {
                        //HITT 7445 labelCoverMsg.Visible = true;
                        labelCoverMsg.Text = p.CoverMsg;
                    }

                    /*JPJ 03-10-11 NCIPLex should not allow Nerdo pubs cover ordering.*/
                    //if (p.CanOrderCover == 1)
                    //{
                    //    OrderCover.Visible = true;
                    //}
                    //else //HITT 10265
                    //{
                    HiddenCoverPopUpButton.Visible = false;
                    PubCoverOrderPanel.Visible     = false;
                    //}

                    //Check whether this pub is already in cart
                    if (!IsItemInCart(p.PubId.ToString()))
                    {
                        OrderPublication.CommandArgument = p.PubId.ToString();
                        //CR 28 OrderPublication.ImageUrl = "images/OrderPublicationGreen_off.gif";
                        OrderPublication.ImageUrl = "images/order_off.gif";
                        //OrderPublication.AlternateText = "Order Publication";
                        OrderPublication.AlternateText = "Order";

                        if (Utils.remainderOrderQtyForOrder(Session["NCIPLEX_Qtys"].ToString()) <= 0) //new code
                        {
                            OrderPublication.CommandArgument = "";
                            OrderPublication.ImageUrl        = "images/LimitReached.gif";
                            OrderPublication.AlternateText   = "Limit Reached";
                        }
                    }
                    else
                    {
                        OrderPublication.CommandArgument = "";
                        OrderPublication.ImageUrl        = "images/PublicationInYourCart_off.gif";
                        OrderPublication.AlternateText   = "Publication - In Your Cart";
                    }

                    //Check whether this pub is already in cart
                    if (!IsItemInCart(p.PubIdCover.ToString()))
                    {
                        OrderCover.CommandArgument = p.PubIdCover.ToString();
                        //CR 28 OrderCover.ImageUrl = "images/OrderCoverOnlyGreen_off.gif";
                        OrderCover.ImageUrl = "images/ordercovers_off.gif";
                        //CR 28 OrderCover.AlternateText = "Order Covers Only";
                        OrderCover.AlternateText = "Order Covers";
                    }
                    else
                    {
                        OrderCover.CommandArgument = "";
                        OrderCover.ImageUrl        = "images/CoverOnlyInYourCart_off.gif";
                        OrderCover.AlternateText   = "Covers Only - In Your Cart";
                    }

                    //_pubid = DAL.DAL.GetPubIdFromProductId(Request.QueryString["prodid"]);
                    //_pubid = DAL.DAL.GetPubIdFromProductId(_prodid);
                    _pubid = p.PubId;


                    //Code for physical description
                    string Dimension = "";
                    string Color     = "";
                    string Other     = "";
                    //Get the physical description of the product from the database
                    IDataReader dr = SQLDataAccess.GetPubPhysicalDesc(_pubid);
                    try
                    {
                        using (dr)
                        {
                            while (dr.Read())
                            {
                                Dimension = dr["DIMENSION"].ToString();
                                Color     = dr["COLOR"].ToString();
                                Other     = dr["OTHER"].ToString();
                            }
                        }
                    }
                    catch (Exception Ex)
                    {
                        //TO DO: log any error
                        if (!dr.IsClosed)
                        {
                            dr.Close();
                        }
                    }

                    //Assigning to label
                    string phydesc = "";
                    if (Dimension.Length > 0)
                    {
                        phydesc += Dimension + "; ";
                    }
                    if (Color.Length > 0)
                    {
                        phydesc += Color + "; ";
                    }
                    if (Other.Length > 0)
                    {
                        phydesc += Other + "; ";
                    }

                    char [] temparr = { ';', ' ' };

                    if (phydesc.Length > 2)
                    {
                        phydesc = phydesc.TrimEnd(temparr);
                    }

                    lblPhysicalDesc.Text = phydesc;

                    //if (lblPhysicalDesc.Text.Length <= 0)
                    //lblPhysicalDescText.Visible = false; //LSK label for physdesc no longer shown
                    //End code for physical description

                    //Get Collections that this pub belongs to
                    try
                    {
                        grdViewPubCollections.DataSource = SQLDataAccess.GetPubCollections(_pubid);
                        grdViewPubCollections.DataBind();
                    }
                    catch (Exception Ex)
                    {
                        //Do nothing
                    }
                    if (grdViewPubCollections.Rows.Count > 0)
                    {
                        //Display singular label
                        lblPubCollections.Text = "part of the collection:&nbsp;";
                        if (grdViewPubCollections.Rows.Count > 1)
                        {
                            //Display plural label
                            lblPubCollections.Text = "part of the collections:&nbsp;";
                        }
                    }
                    else
                    {
                        lblPubCollections.Visible = false;
                    }
                    //End code for displaying the publication collection

                    //Begin code for Contents & Cover URL
                    /*JPJ 03-10-11 NCIPLex should not allow Nerdo pubs cover ordering.*/
                    //if (p.UrlNerdo.Length > 0 && p.UrlCover.Length > 0)
                    //{
                    //    NerdoContentsLink.Text = "Contents PDF";
                    //    NerdoContentsLink.NavigateUrl = p.UrlNerdo;
                    //    NerdoCoverLink.Text = "Cover PDF";
                    //    NerdoCoverLink.NavigateUrl = p.UrlCover;
                    //}
                    //else
                    //{
                    //lblNerdo.Visible = false;
                    NerdoContentsLink.Visible = false;
                    //lblNerdoSpace.Visible = false;
                    NerdoCoverLink.Visible = false;
                    //}

                    ////Begin CR-30: HITT 8719 - Pub Translations
                    ////PlaceHolder plcTranslations = (PlaceHolder)e.Item.FindControl("plcTranslations");
                    //int counter = 0;
                    //Panel linksPanel = new Panel();
                    //foreach (Product tranlatedproduct in DAL.DAL.GetProductTranslations(p.PubId))
                    //{
                    //    HyperLink TranslationsLink = new HyperLink();
                    //    TranslationsLink.CssClass = "linkDefault";
                    //    TranslationsLink.Text = tranlatedproduct.Language;
                    //    TranslationsLink.NavigateUrl = "detail.aspx?prodid=" + tranlatedproduct.ProductId;
                    //    Label spaceLabel = new Label();
                    //    //if (counter > 0 && counter % 3 == 0)
                    //    //    spaceLabel.Text = "<br/>";
                    //    //else
                    //    spaceLabel.Text = "&nbsp;&nbsp;";
                    //    linksPanel.Controls.Add(TranslationsLink);
                    //    linksPanel.Controls.Add(spaceLabel);
                    //    TranslationsLink = null;
                    //    spaceLabel = null;
                    //    counter++;
                    //}
                    //if (counter > 0)
                    //{
                    //    //Label Translations = new Label();
                    //    //Translations.CssClass = "textDefault";
                    //    //Translations.Text = "Translations: ";
                    //    //linksPanel.Controls.AddAt(0, Translations);
                    //    //Translations = null;
                    //    plcTranslations.Controls.Add(linksPanel);
                    //}
                    //else
                    //    lblTranslations.Visible = false;
                    //linksPanel = null;
                    ////End CR-30

                    //Manage div heights here
                    //pnlTitleLabel.Height = pnlTitleText.Height;
                    //lblDescText.Height = lblDesc.Height;

                    //End of Code

                    //Add controls to the dynamic table here

                    //End code to add controls to dynamic table

                    if (Request.UrlReferrer != null)
                    {
                        hdnReferrer.Value = Request.UrlReferrer.ToString();
                    }
                    if (Session["JSTurnedOn"] != null && Request.UrlReferrer != null)
                    {
                        if (string.Compare(Session["JSTurnedOn"].ToString(), "True", true) == 0 &&
                            (this.Page.Request.UrlReferrer.ToString().Contains("searchres.aspx") || this.Page.Request.UrlReferrer.ToString().Contains("newupdated.aspx")))
                        {
                            //BackToSearchResultsLink.Visible = true;
                            lnkBtnSearchRes.Visible = true;
                        }
                    }
                }
                else
                {
                    throw new ArgumentException("Missing parameter in detail.aspx", "value");
                }


                PubOrderOK.OnClientClick      = String.Format("fnAddItemToCart('{0}','{1}')", PubOrderOK.UniqueID, "");
                PubCoverOrderOK.OnClientClick = String.Format("fnAddItemToCart('{0}','{1}')", PubCoverOrderOK.UniqueID, "");

                //Newly added code to reset textbox when cancel button is clicked on popup
                PubOrderCancel.OnClientClick      = String.Format("fnCancelClick('{0}')", QuantityOrdered.ClientID);
                PubCoverOrderCancel.OnClientClick = String.Format("fnCancelClick('{0}')", QuantityOrderedCover.ClientID);

                PubOrderLink.Attributes.Add("href", "javascript:fnPostBack(" + "'" + PubOrderOK.UniqueID + "','" + "','" + QuantityOrdered.ClientID + "','" + PubQtyLimit.ClientID + "','" + labelErrMsgPubOrder.ClientID + "','" + PubOrderModalPopup.BehaviorID + "')");
                PubCoverOrderLink.Attributes.Add("href", "javascript:fnPostBack(" + "'" + PubCoverOrderOK.UniqueID + "','" + "','" + QuantityOrderedCover.ClientID + "','" + CoverQtyLimit.ClientID + "','" + labelErrMsgPubCover.ClientID + "','" + PubCoverOrderModalPopup.BehaviorID + "')");


                dlistRelatedProducs.DataSource = (ProductCollection)SQLDataAccess.GetRelatedProducts(_pubid);
                dlistRelatedProducs.DataBind();

                if (dlistRelatedProducs.Items.Count > 0)
                {
                    //Do not do anything
                }
                else
                {
                    divRelatedProducts.Visible = false;
                }

                //Display the master page tabs
                GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
                if (Session["NCIPLEX_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;
            }

            #region Rebuild Dynamic Controls
            //Begin HITT - 9846 - Dynamic Controls need to re-initalized each time when the page posts back
            try
            {
                //Begin CR-30: HITT 8719 - Pub Translations
                _pubid = SQLDataAccess.GetPubIdFromProductId(Request.QueryString["prodid"]);
                int   counter    = 0;
                Panel linksPanel = new Panel();
                foreach (Product tranlatedproduct in SQLDataAccess.GetProductTranslations(_pubid))
                {
                    HyperLink TranslationsLink = new HyperLink();
                    TranslationsLink.CssClass    = "linkDefault";
                    TranslationsLink.Text        = tranlatedproduct.Language;
                    TranslationsLink.NavigateUrl = "detail.aspx?prodid=" + tranlatedproduct.ProductId;
                    Label spaceLabel = new Label();

                    spaceLabel.Text = "&nbsp;&nbsp;";
                    linksPanel.Controls.Add(TranslationsLink);
                    linksPanel.Controls.Add(spaceLabel);
                    TranslationsLink = null;
                    spaceLabel       = null;
                    counter++;
                }
                if (counter > 0)
                {
                    plcTranslations.Controls.Add(linksPanel);
                }
                else
                {
                    lblTranslations.Visible = false;
                }
                linksPanel = null;
                //End CR-30
            }
            catch (Exception Ex)
            {
                LogEntry logEnt     = new LogEntry();
                string   logmessage = "\r\n";
                logmessage    += "Translation Pubs Error on detail: " + "\r\n";
                logmessage    += Ex.Message + Ex.StackTrace;
                logEnt.Message = logmessage;
                Logger.Write(logEnt, "Logs");
            }
            //End HITT - 9846
            #endregion
        }