예제 #1
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["NCIPL_Pubs"] += this.PubCoverOrderOK.CommandArgument.ToString() + ",";
                    Session["NCIPL_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";

                    OrderCover.Text     = "Covers Only - In Your Cart";
                    OrderCover.CssClass = "btn";
                }
                //    }
                //}

                //Display the master page tabs
                GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
                if (Session["NCIPL_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_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
        }
예제 #2
0
        //checks for a valid quantity
        private int CheckForValidQuantity()
        {
            int result = 1;

            //foreach (DataGridItem dItem in grdItems.Items)
            foreach (GridViewRow dItem in grdViewItems.Rows)
            {
                TextBox     txtQty             = (TextBox)dItem.FindControl("txtQty");
                Label       lblLimit           = (Label)dItem.FindControl("lblQty");
                PlaceHolder MessagePlaceHolder = (PlaceHolder)dItem.FindControl("MessagePlaceHolder");

                GlobalUtils.Utils UtilityMethods = new GlobalUtils.Utils();
                bool returnvalue = UtilityMethods.IsQtyValueValid(txtQty.Text, lblLimit.Text);
                if (returnvalue == false)
                {
                    GlobalUtils.Utils.DisplayMessage(ref MessagePlaceHolder, 2);
                    result = -1;
                    break;
                }
                else
                {
                    GlobalUtils.Utils.DisplayMessage(ref MessagePlaceHolder, 99);
                }
            }
            return(result);
        }
예제 #3
0
        protected void lnkBtnSearchRes_Click(object sender, EventArgs e)
        {
            Session["CurrentProdId"] = Request.QueryString["prodid"].ToString();
            //Begin HITT 11476
            if (Request.QueryString["mnprodid"] != null)                                                                             //Coming from searchres.aspx, cannedsearchres.aspx or newupdated.aspx - Translation Link click
            {
                if (Request.QueryString["mnprodid"].ToString().Length > 0 && Request.QueryString["mnprodid"].ToString().Length < 11) //Some checks for security
                {
                    Session["CurrentProdId"] = Request.QueryString["mnprodid"].ToString();                                           //The current product id should be the main pub id for the back to search results functionality to find the correct record in search results, if coming from a translation link click
                }
            }
            //End HITT 11476
            //if (Session["PUBENT_CannedSearch"] != null && hdnReferrer.Value.Contains("cannedsearchres.aspx"))
            //    Response.Redirect("cannedsearch.aspx",true);

            //if (hdnReferrer.Value.Contains("newupdated.aspx"))
            //    Response.Redirect("search.aspx?newupt=1", true);
            if (hdnReferrer.Value.Contains("canned=1"))
            {
                Response.Redirect("searchres.aspx?canned=1&back2result=1"); //yma add this adding back2result=1 to avoid other link on detail page be affected
            }
            if (hdnReferrer.Value.Contains("newupt=1"))
            {
                Response.Redirect("searchres.aspx?newupt=1&back2result=1"); //yma add this adding back2result=1 to avoid other link on detail page be affected
            }
            #region GenerateSearchResultsURL
            GlobalUtils.Utils objUtils    = new GlobalUtils.Utils();
            string            QueryParams = objUtils.GetQueryStringParams();
            objUtils = null;
            #endregion
            //Response.Redirect("searchres.aspx" + "?sid=" + QueryParams);
            Response.Redirect("searchres.aspx" + "?sid=" + QueryParams + "&back2result=1"); //yma add this
        }
예제 #4
0
        //***EAC update count, shipcosts etc
        protected void BindTotals(string state)
        {
            if (shoppingcartV2.isFree2Order(state))
            {
                HideBillingItems();
            }
            else
            {
                ShowBillingItems();
            }

            // Enable-disable the submit button (XPO requirement)
            if (shoppingcartV2.isOrderAllowed(state))
            {
                Button1.Enabled = true;
                lblXPO.Text     = "";
            }
            else
            {
                Button1.Enabled = false;
                lblXPO.Text     = "Please reduce total items to " + PubEnt.GlobalUtils.Const.XPOMaxQuantity.ToString() + " or less";
            }

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }
예제 #5
0
        private void SearchBar_btnSearchClick(object sender, EventArgs e)
        {
            //***EAC Perform Search
            Session["PUBENT_SearchKeyword"] = this.searchbar.Terms;

            Session["PUBENT_TypeOfCancer"]  = "";
            Session["PUBENT_Subject"]       = "";
            Session["PUBENT_Audience"]      = "";
            Session["PUBENT_Language"]      = "";
            Session["PUBENT_ProductFormat"] = "";
            Session["PUBENT_StartsWith"]    = "";
            Session["PUBENT_Series"]        = "";
            Session["PUBENT_NewOrUpdated"]  = "";
            Session["PUBENT_Race"]          = "";

            Session["PUBENT_Criteria"] = Session["PUBENT_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);
        }
예제 #6
0
        private void ResetSessions()
        {
            Session["NCIPL_cart"]   = null;     //destroy
            Session["NCIPL_shipto"] = null;     //destroy
            Session["NCIPL_billto"] = null;     //destroy
            Session["NCIPL_cc"]     = null;     //destroy
            Session["NCIPL_DONE"]   = "";       //neither done nor finished

            //***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"]          = "";

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }
예제 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //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["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "home");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "home");
            }
            UtilMethod = null;
            //End Code for Tab
        }
예제 #8
0
        //***EAC update count, shipcosts etc
        protected void BindTotals()
        {
            if (Zipcode.isXPO(shipto != null ? shipto.State : ""))
            {
                divCCExplanation.Visible = false;
                lblTot.Text = this.shoppingcart.TotalQty.ToString();
                divOrderingHelp.InnerText = "Please note: We will provide free shipping via U.S. Postal Service for orders up to " + PubEnt.GlobalUtils.Const.XPOMaxQuantity.ToString() + " items to your location. We are sorry we cannot send orders of more than " + PubEnt.GlobalUtils.Const.XPOMaxQuantity.ToString() + " items or send items via FedEx or UPS to your shipping address.";
            }
            else
            {
                if (shoppingcart.isFree2Order(shipto != null ? shipto.State : ""))
                {
                    divCCExplanation.Visible = false;
                    lblTot.Text = this.shoppingcart.TotalQty.ToString();
                    divOrderingHelp.InnerText = "";
                }
                else
                {
                    divCCExplanation.Visible = true;
                    lblTot.Text = this.shoppingcart.TotalQty.ToString() + " (" + this.shoppingcart.TotalWeight.ToString(".#") + " lbs)<sup>*</sup>";
                    divOrderingHelp.InnerHtml = "Ordering more than 20 items? You will be asked to log in or register, and provide a FedEx or UPS shipping number to pay actual shipping costs. <a href='nciplhelp.aspx#register'>Learn more about registering for an account</a>";
                }
            }

            //Hide or unhide the cart
            if (this.shoppingcart.Count > 0)
            {
                //***EAC at this point we have a usable cart
                Panel1.Visible = true;
                Panel2.Visible = false;
            }
            else//shopping cart is empty
            {
                Panel1.Visible = false;
                Panel2.Visible = true;
            }

            // Enable-disable the submit button (XPO requirement)
            if (shoppingcart.isOrderAllowed(shipto != null ? shipto.State : ""))
            {
                btn2shipping.Enabled = true;
                divOrderingHelp.Attributes["style"] = "text-align: left; padding-bottom: 10px;";
            }
            else
            {
                btn2shipping.Enabled = false;
                divOrderingHelp.Attributes["style"] = "text-align: left; padding-bottom: 10px; color: #FF0000";
            }
            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "cart");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "cart");
            }
            UtilMethod = null;
        }
예제 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                lblGuamMsg.Visible = false;

                //***EAC Store in a session var the page that called login.aspx (REFERER)
                if (Request.QueryString["redir"] != null && Request.QueryString["redir"].ToString().Length > 0)
                {
                    Session["NCIPL_REGISTERREFERRER"] = Request.QueryString["redir"].ToString();
                }
                else
                {
                    Session["NCIPL_REGISTERREFERRER"] = Request.UrlReferrer != null?Request.UrlReferrer.ToString() : "";
                }
            }
            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }
예제 #10
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);
            }

            //--- Get data from query string

            /*if (Request.QueryString["CustID"] != null)
             * {
             *  CustID = Request.QueryString["CustID"].ToString();
             * }
             * if (Request.QueryString["OrderNum"] != null)
             * {
             *  OrderNum = Request.QueryString["OrderNum"].ToString();
             * }
             * if (Request.QueryString["PrevPage"] != null)
             * {
             *  PrevPage = Request.QueryString["PrevPage"].ToString();
             * }*/

            if (Session["VIEW_CUSTID"] != null)
            {
                CustID = Session["VIEW_CUSTID"].ToString();
            }
            if (Session["VIEW_ORDERNUM"] != null)
            {
                OrderNum = Session["VIEW_ORDERNUM"].ToString();
            }
            if (Session["VIEW_PREVPAGE"] != null)
            {
                PrevPage = Session["VIEW_PREVPAGE"].ToString();
            }

            if (!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(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;

                GetOrderInfo();
            }
            else
            {
            }
        }
예제 #11
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);
            }

            //Hide label error message
            lblErrorMsg.Visible = false;

            //Reset Session SEARCHORDER_CURRPAGE
            Session["SEARCHORDER_CURRPAGE"] = null;     //destroy

            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(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;

                #region Bind the form here!
                //NCIPL_CC - Populate Customer Type Dropdown
                KVPairCollection kvpairColl = KVPair.GetKVPair("sp_NCIPLCC_getAllTypeOfCustomers");
                foreach (KVPair kvpair in kvpairColl)
                {
                    ListItem li = new ListItem();
                    li.Value = kvpair.Key;
                    li.Text  = kvpair.Val;
                    drpCustomerType.Items.Add(li);
                }
                kvpairColl = null;

                #endregion

                //Reset Sessions for Search Order Look up
                Session["SEARCHORDER_CUSTOMERTYPE"]     = null;     //destroy
                Session["SEARCHORDER_CUSTOMERTYPEDESC"] = null;     //destroy
                Session["SEARCHORDER_KEYWORD"]          = null;     //destroy

                Session["SEARCHORDER_SDATE"] = null;                //destroy
                Session["SEARCHORDER_EDATE"] = null;                //destroy

                Session["VIEW_CUSTID"]   = null;
                Session["VIEW_ORDERNUM"] = null;
                Session["VIEW_PREVPAGE"] = null;
            }
        }
예제 #12
0
        public string strSearchSort = "CASE WHEN (SHIPTOEMAIL IS NULL OR SHIPTOEMAIL = '') THEN 1 ELSE 0 END, SHIPTOEMAIL, SHIPTONAME, CUSTID ASC"; //"SHIPTONAME, SHIPTOEMAIL, CUSTID ASC";

        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);
            }

            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(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;

                bTotalPage = true;

                Session["VIEW_CUSTID"]   = "";
                Session["VIEW_CUSTID"]   = "";
                Session["VIEW_PREVPAGE"] = "";

                DoSearch();
            }
            else
            {
                if (hidCustID.Value != "" && hidOrderNum.Value != "")
                {
                    Session["VIEW_CUSTID"]   = hidCustID.Value;
                    Session["VIEW_ORDERNUM"] = hidOrderNum.Value;
                    Session["VIEW_PREVPAGE"] = hidPrevPage.Value;

                    Response.Redirect("OrderDetail.aspx");
                }
                else
                {
                    Session["VIEW_CUSTID"]   = "";
                    Session["VIEW_CUSTID"]   = "";
                    Session["VIEW_PREVPAGE"] = "";

                    GetPostBackValue();
                }
            }
        }
예제 #13
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["NCIPL_Pubs"] += e.CommandArgument.ToString() + ",";
                    Session["NCIPL_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["NCIPL_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;
            }
            else
            {
                this.PubOrderOK.CommandArgument = e.CommandArgument.ToString();

                Product p = DAL.DAL.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
            }
        }
예제 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Missing Session
            if (Session["JSTurnedOn"] == null)
            {
                Response.Redirect("PEAUHErrorScreen.htm?missingsession=true", true);
            }
            //Other important checks - redirect to default page
            if (Request.QueryString["prodid"] == null)
            {
                Response.Redirect("PEAUHErrorScreen.htm?redirect=dispimage", true);
            }
            else if (Request.QueryString["prodid"].Length > 10)
            {
                Response.Redirect("PEAUHErrorScreen.htm?redirect=dispimage", true);
            }

            if (!Page.IsPostBack)
            {
                if (Request.QueryString["prodid"] != null)
                {
                    GlobalUtils.Utils UtilMethodClean = new GlobalUtils.Utils();
                    _prodid         = UtilMethodClean.Clean(Request.QueryString["prodid"].ToString());
                    UtilMethodClean = null;

                    ProductCollection pColl = DAL.DAL.GetProductbyProductIDWithRules(_prodid);

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

                    Product p = pColl[0];

                    Image PubLargeImage = (Image)this.FindControl("PubLargeImage");
                    PubLargeImage.AlternateText = p.ShortTitle;
                    string imagepath = ConfigurationManager.AppSettings["PubLargeImagesURL"];
                    PubLargeImage.ImageUrl = imagepath + "/" + p.PubLargeImage;
                }
                else
                {
                    throw new ArgumentException("Missing parameter in dispimage.aspx", "value");
                }
            }
        }
예제 #15
0
        //checks for a valid quantity
        private int CheckForValidQuantity()
        {
            int  result      = 1;
            int  Counter     = 0;
            bool returnvalue = true;

            //Loop through the grid rows
            foreach (GridViewRow dItem in grdViewItems.Rows)
            {
                Label       lblQty       = (Label)dItem.FindControl("lblQty");
                HiddenField hdnQty       = (HiddenField)dItem.FindControl("hdnQty");
                LinkButton  lnkBtnItem   = (LinkButton)dItem.FindControl("lnkBtnItem");
                HiddenField hdnPubLimit  = (HiddenField)dItem.FindControl("hdnPubLimit");
                Label       lblEmailOnly = (Label)dItem.FindControl("lblEmailOnly");
                if (!lblEmailOnly.Visible)  //***EAC dirty hack to tell if the line item is physical/virtual
                {
                    lblQty.Text = hdnQty.Value;
                    int valQty = Int32.Parse(hdnQty.Value);
                    if (valQty > 0 && returnvalue == true)
                    {
                        Counter += Int32.Parse(hdnQty.Value);
                        GlobalUtils.Utils UtilityMethods = new GlobalUtils.Utils();

                        returnvalue = UtilityMethods.IsQtyValueValid(hdnQty.Value, hdnPubLimit.Value);
                        if (returnvalue == false)
                        {
                            result = -1;
                            if (string.Compare(hdnPubLimit.Value, "1") == 0)
                            {
                                lblMessage.Text = "Sorry, you cannot order more than " + hdnPubLimit.Value + " copy of " + lnkBtnItem.Text + ".";
                            }
                            else
                            {
                                lblMessage.Text = "Sorry, you cannot order more than " + hdnPubLimit.Value + " copies of " + lnkBtnItem.Text + ".";
                            }
                        }
                    }
                }
            }

            //Check for max order limit
            if (Counter > Int32.Parse(hdnTotalLimit.Value) && result == 1)
            {
                result          = -1;
                lblMessage.Text = "Sorry, you cannot order more than " + hdnTotalLimit.Value + " items.";
            }

            return(result);
        }
예제 #16
0
 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(), "");
         }
         else
         {
             Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
         }
         UtilMethod = null;
     }
 }
예제 #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Reset Session for using existing CUSTID
            Session.Abandon();
            //Session["SEARCHORDER_CUSTID"] = null;       //destroy

            if (!IsPostBack)
            {
                lblGuamMsg.Visible = false;

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

                //Show user a message if the rol for the log on did not work properly
                if (Request.QueryString["msg"] != null && lblGuamMsg.Visible == false)
                {
                    if (string.Compare(Request.QueryString["msg"].ToString(), "invaliduser", 0) == 0)
                    {
                        lblGuamMsg.Text    = "Invalid User or Role.";
                        lblGuamMsg.Visible = true;
                    }
                }

                //this.Master.TopRightPanelVisible = false;

                this.Master.LogoImage1Visible = false;
                this.Master.LogoImage2Visible = true;

                //Display the master page tabs
                GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
                if (Session["NCIPL_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;
            }
        }
예제 #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sPreviousPage  = "home.aspx";
            string sForgotPwdPage = "forgotpwd.aspx";

            if (Session["NCIPL_REGISTERREFERRER"] != null)
            {
                if (Session["NCIPL_REGISTERREFERRER"].ToString() != "")
                {
                    sPreviousPage = Session["NCIPL_REGISTERREFERRER"].ToString();
                }
            }
            btnCancel.Attributes.Add("onclick", "window.location='" + sPreviousPage + "'; return(false);");

            btnForgotPassword.Attributes.Add("onclick", "window.location='" + sForgotPwdPage + "'; return(false);");

            if (!IsPostBack)
            {
                divChangePwdConfirmation.Visible = false;
                lblGuamMsg.Visible = false;

                if (Session["NCIPL_User"] != null)
                {
                    if (Session["NCIPL_User"].ToString() != "")
                    {
                        lblUser.Text = Session["NCIPL_User"].ToString();
                    }
                }
            }
            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }
예제 #19
0
        private void SearchBar_btnSearchClick(object sender, EventArgs e)
        {
            Session["PUBENT_SearchKeyword"] = searchbar.Terms;
            Session["PUBENT_TypeOfCancer"]  = "";
            Session["PUBENT_Subject"]       = "";
            Session["PUBENT_Audience"]      = "";
            Session["PUBENT_Language"]      = "";
            Session["PUBENT_ProductFormat"] = "";
            Session["PUBENT_StartsWith"]    = "";
            Session["PUBENT_Series"]        = "";
            Session["PUBENT_NewOrUpdated"]  = "";
            Session["PUBENT_Race"]          = "";

            Session["PUBENT_Criteria"] = Session["PUBENT_SearchKeyword"]; //For displaying criteria

            GlobalUtils.Utils objUtils    = new GlobalUtils.Utils();
            string            QueryParams = objUtils.GetQueryStringParams();

            objUtils = null;
            Response.Redirect("searchres.aspx" + "?sid=" + QueryParams);
        }
예제 #20
0
        //***EAC update count, shipcosts etc
        protected void BindTotals(string state)
        {
            if (Zipcode.isXPO(state))
            {
                HideBillingItems();
            }
            else
            {
                ShowBillingItems();
            }

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }
예제 #21
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //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["NCIPL_Pubs"] == null)
                {
                    Session["NCIPL_Pubs"] = "";
                }
                if (Session["NCIPL_Qtys"] == null)
                {
                    Session["NCIPL_Qtys"] = "";
                }
                if (Session["PUBENT_SearchKeyword"] == null)
                {
                    Session["PUBENT_SearchKeyword"] = "";
                }
                if (Session["PUBENT_TypeOfCancer"] == null)
                {
                    Session["PUBENT_TypeOfCancer"] = "";
                }
                if (Session["PUBENT_Subject"] == null)
                {
                    Session["PUBENT_Subject"] = "";
                }
                if (Session["PUBENT_Audience"] == null)
                {
                    Session["PUBENT_Audience"] = "";
                }
                if (Session["PUBENT_ProductFormat"] == null)
                {
                    Session["PUBENT_ProductFormat"] = "";
                }
                if (Session["PUBENT_Language"] == null)
                {
                    Session["PUBENT_Language"] = "";
                }
                if (Session["PUBENT_StartsWith"] == null)
                {
                    Session["PUBENT_StartsWith"] = "";
                }
                if (Session["PUBENT_Series"] == null)
                {
                    Session["PUBENT_Series"] = ""; //Or collection
                }
                if (Session["PUBENT_NewOrUpdated"] == null)
                {
                    Session["PUBENT_NewOrUpdated"] = "";
                }
                if (Session["PUBENT_Race"] == null)
                {
                    Session["PUBENT_Race"] = "";
                }
                if (Session["PUBENT_CannedSearch"] == null)
                {
                    Session["PUBENT_CannedSearch"] = "";
                }
            }
            //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 = DAL.DAL.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;
                    lblTitlesm.Text  = p.LongTitle;
                    lblFormat.Text   = p.Format;
                    lblFormatsm.Text = p.Format;
                    if (lblFormat.Text.Length <= 0)
                    {
                        lblFormatText.Visible = false; lblFormatTextsm.Visible = false;
                    }
                    lblNumPages.Text = p.NumPages;
                    if (lblNumPages.Text.Length <= 0)
                    {
                        lblNumPagesText.Visible = false;
                    }
                    //Image1.ImageUrl = "pubimages/" + p.PubImage;
                    lblAud.Text   = p.Audience;
                    lblAudsm.Text = p.Audience;
                    if (lblAud.Text.Length <= 0)
                    {
                        lblAudText.Visible = false; lblAudTextsm.Visible = false;
                    }
                    lblLang.Text = p.Language;
                    if (lblLang.Text.Length <= 0)
                    {
                        lblLangText.Visible = false;
                    }
                    //lblSumm.Text = p.Summary;
                    lblDesc.Text   = p.Abstract;
                    lblDescsm.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;
                    lblProductIDsm.Text = p.ProductId;
                    if (lblProductID.Text.Length <= 0)
                    {
                        lblProductIDText.Visible = false; lblProductIDTextsm.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;
                    lblNIHsm.Text = p.NIHNum;
                    if (lblNIH.Text.Length <= 0)
                    {
                        lblNIHText.Visible = false; lblNIHTextsm.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;
                    lblAwardssm.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;
                        //Image3.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;
                        }
                    }

                    #region PATCH for Omniture order buttons (20130221)
                    if (Session["NCIPL_Pubs"] == null || Session["NCIPL_Pubs"].ToString() == "")
                    {
                        OrderPublication.Attributes.Add("prodid", p.ProductId);
                        OrderPublication.Attributes.Add("onclick", "NCIAnalytics.CartStarted(this.getAttribute('prodid'));");
                        OrderCover.Attributes.Add("prodid", p.ProductId + "C");
                        OrderCover.Attributes.Add("onclick", "NCIAnalytics.CartStarted(this.getAttribute('prodid'));");
                    }
                    #endregion

                    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;
                            varHtmlLink            = p.Url;
                            HtmlLinksm.Visible     = true;
                            HtmlLinksm.NavigateUrl = p.Url;
                        }

                        if (p.PDFUrl.Length > 0)
                        {
                            //textbreaker2.Visible = true;
                            PdfLink.Visible       = true;
                            PdfLink.NavigateUrl   = p.PDFUrl;
                            PdfLinksm.Visible     = true;
                            PdfLinksm.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;
                        KindleLinksm.Visible     = true;
                        KindleLinksm.NavigateUrl = kindle;
                    }

                    string epub = DAL2.DAL.EbookUrl(p.PubId, "epub");
                    if (epub.Length > 0)
                    {
                        EpubLink.Visible       = true;
                        EpubLink.NavigateUrl   = epub;
                        EpubLinksm.Visible     = true;
                        EpubLinksm.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;
                    }

                    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();

                        //OrderPublication.ImageUrl = "images/order_off.gif";
                        //OrderPublication.AlternateText = "Order Publication";
                        //OrderPublication.AlternateText = "Order";
                        OrderPublication.Text = "Order Publication";
                    }
                    else
                    {
                        OrderPublication.CommandArgument = "";
                        //OrderPublication.ImageUrl = "images/PublicationInYourCart_off.gif";
                        //OrderPublication.AlternateText = "Publication - In Your Cart";
                        OrderPublication.Text     = "Publication - In Your Cart";
                        OrderPublication.CssClass = "btn";
                    }

                    //Check whether this pub is already in cart
                    if (!IsItemInCart(p.PubIdCover.ToString()))
                    {
                        OrderCover.CommandArgument = p.PubIdCover.ToString();

                        //OrderCover.ImageUrl = "images/ordercovers_off.gif";
                        //CR 28 OrderCover.AlternateText = "Order Covers Only";
                        //OrderCover.AlternateText = "Order Covers";
                        OrderCover.Text = "Order Covers";
                    }
                    else
                    {
                        OrderCover.CommandArgument = "";
                        //OrderCover.ImageUrl = "images/CoverOnlyInYourCart_off.gif";
                        //OrderCover.AlternateText = "Covers Only - In Your Cart";
                        OrderCover.Text     = "Covers Only - In Your Cart";
                        OrderCover.CssClass = "btn";
                    }

                    //_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 = DAL.DAL.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 = DAL.DAL.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
                    if (p.UrlNerdo.Length > 0 && p.UrlCover.Length > 0)
                    {
                        NerdoContentsLink.Text        = "Print Contents";
                        NerdoContentsLink.NavigateUrl = p.UrlNerdo;
                        NerdoCoverLink.Text           = "Print Cover";
                        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)DAL.DAL.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["NCIPL_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_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 = DAL.DAL.GetPubIdFromProductId(Request.QueryString["prodid"]);
                int   counter    = 0;
                Panel linksPanel = new Panel();
                foreach (Product tranlatedproduct in DAL.DAL.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
        }
예제 #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (shoppingcartV2 == null || shoppingcartV2.Count < 1)   //***EAC I need a shopping cart at this point
            {
                GlobalUtils.Utils.ClearAllSessions();
                Response.Redirect("~/login.aspx", true);
            }
            if (!GlobalUtils.Utils.isLoggedin())
            {  //***EAC I need a logged in user at this point
                GlobalUtils.Utils.ClearAllSessions();
                Response.Redirect("~/login.aspx", true);
            }
            string role = GlobalUtils.Utils.LoggedinRole();

            if (role != "NCIPL_LM")
            {
                throw (new ArgumentException("Your role is not allowed at this point."));
            }
            if (!IsPostBack)
            {
                //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);
                }

                Session["NCIPL_DONE"] = "false";
                steps1.Activate("cell4");

                cc = new CreditCard();  //***EAC Create a dummy credit card object

                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);
                lblemail.Text   = "E-mail: " + this.shipto.Email;
                lblphone.Text   = "Phone: " + this.shipto.Phone;
                lblcountry.Text = DAL2.DAL.GetCountryByID(shipto.Country);

                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;
                lbl2country.Text = DAL2.DAL.GetCountryByID(billto.Country);

                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;
                }

                pnlSplitOrder.Visible = (shoppingcartV2.SplitOrder == "1") ? true : 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;
                }

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

                lblTotalItems.Text = this.shoppingcartV2.TotalQty.ToString();
                lblCost.Text       = this.shoppingcartV2.ShipCost.ToString("c");

                if (Nerdos.Count > 0)
                {
                    ListNerdos.DataSource = Nerdos;
                    ListNerdos.DataBind();
                    pnlContentDownload.Visible = true;
                }
                //***EAC test the address
                if (shoppingcartV2.ShipMethod == "")
                {
                    USPS(this.shipto);
                }
                else if (shoppingcartV2.ShipMethod[0] == 'F')
                {
                    FEDEX(shipto);
                }
                else if (shoppingcartV2.ShipMethod[0] == 'U')
                {
                    UPS(shipto);
                }

                if (shoppingcartV2.isFree2Order(shipto != null ? shipto.State : ""))
                {
                    //lblCCText.Visible = false;
                    divCost.Visible          = false;
                    divCCExplanation.Visible = false;
                    pnlBillingInfo.Visible   = false;
                    pnlPaymentInfo.Visible   = false;
                    btn2Shipping.Text        = "Change Address";
                    divCCPrompt.Visible      = false;
                }
                else
                {
                    //lblCCText.Visible = true;
                    divCost.Visible          = true;
                    divCCExplanation.Visible = true;
                    pnlBillingInfo.Visible   = true;
                    pnlPaymentInfo.Visible   = false;
                    lblCost.Text             = shoppingcartV2.ShipCost.ToString("c");
                    btn2Shipping.Text        = "Change Addresses or Payment Information";
                    divCCPrompt.Visible      = true;
                }

                //***EAC check if order within the last 30 days
                if (btn2Submit.Enabled == true && ConfigurationManager.AppSettings["AllowCheckRecentOrder"] == "1") //NCIPLCC - Check only if other validations are okay and if web config setting value is 1
                {
                    CheckRecentOrders(this.shipto);
                }

                if (btn2Submit.Enabled == true) //NCIPLCC - Check for No Ship flag, only if other validations are okay
                {
                    CheckNoShipFlag(this.shipto);
                }
            }

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }
예제 #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string Username      = "";
            string sPreviousPage = "home.aspx";

            divConfirmation.Visible = false;
            lblGuamMsg.Visible      = false;

            if (Session["NCIPL_REGISTERREFERRER"] != null)
            {
                if (Session["NCIPL_REGISTERREFERRER"].ToString() != "")
                {
                    sPreviousPage = Session["NCIPL_REGISTERREFERRER"].ToString();
                }
            }
            btnCancel.Attributes.Add("onclick", "window.location='" + sPreviousPage + "'; return(false);");

            if (!IsPostBack)
            {
                //--- Get data from query string
                //if (Request.QueryString["Username"] != null)
                //{
                //    Username = Request.QueryString["Username"].ToString();
                //}
                //else
                //{
                //    if (Session["NCIPL_User"] != null)
                //    {
                //        if (Session["NCIPL_User"].ToString() != "")
                //        {
                //            Username = Session["NCIPL_User"].ToString();
                //        }
                //    }
                //}

                if (Session["Username_Forgot"] != null)
                {
                    Username = Session["Username_Forgot"].ToString();
                }
                else
                {
                    if (Session["NCIPL_User"] != null)
                    {
                        if (Session["NCIPL_User"].ToString() != "")
                        {
                            Username = Session["NCIPL_User"].ToString();
                        }
                    }
                }


                if (Username.Trim() != "")
                {
                    getSecurityQuestion(Username);
                    if (SecurityQuestion != "")
                    {
                        lblUser.Text                = Username;
                        lblSecurityQuestion.Text    = SecurityQuestion;
                        HidSecurityQuestionID.Value = SecurityQuestionID;
                        divUserName.Visible         = false;
                        divSecurityQuestion.Visible = true;
                    }
                    else
                    {
                        HidSecurityQuestionID.Value = "";
                        divSecurityQuestion.Visible = false;
                        divUserName.Visible         = true;

                        txtUserName.Text     = Username;
                        lblGuamMsg.Text      = UserNotFoundErrorMsg;
                        lblGuamMsg.Visible   = true;
                        divChangePwd.Visible = true;
                    }
                }
                else
                {
                    HidSecurityQuestionID.Value = "";
                    divSecurityQuestion.Visible = false;
                    divUserName.Visible         = true;
                }

                //***EAC Store in a session var the page that called login.aspx (REFERER)
                //if (Request.QueryString["redir"] != null && Request.QueryString["redir"].ToString().Length > 0)
                //Session["NCIPL_REGISTERREFERRER"] = Request.QueryString["redir"].ToString();
                //else
                //Session["NCIPL_REGISTERREFERRER"] = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : "";
            }
            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }
예제 #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //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);
                }

                divChangePwdConfirmation.Visible = false;
                lblGuamMsg.Visible = false;

                if (Session["NCIPL_User"] != null)
                {
                    if (Session["NCIPL_User"].ToString() != "")
                    {
                        lblUser.Text = Session["NCIPL_User"].ToString();
                    }
                }

                //**** Retrieve Security Questions List
                new UserServiceClient().Using(client =>
                {
                    var application_info        = client.GetApplicationInformation();
                    ddlQuestions.DataSource     = application_info.Questions;
                    ddlQuestions.DataValueField = "QuestionID";
                    ddlQuestions.DataTextField  = "QuestionText";
                    ddlQuestions.DataBind();
                    ddlQuestions.Items.Insert(0, new ListItem("[Select from the list]", ""));

                    //Get questions and answers
                    string strSecQuestionID = "";
                    string strSecQuestion   = "";
                    string strSecAnswer     = "";
                    if (Session["NCIPL_User"] != null)
                    {
                        if (Session["NCIPL_User"].ToString() != "")
                        {
                            var questions = client.GetUserQuestions(Session["NCIPL_User"].ToString()).ReturnValue as UserQuestion[];
                            if (questions != null && questions.Count() != 0)
                            {
                                strSecQuestionID = questions[0].UserQuestionID.ToString();
                                strSecQuestion   = questions[0].QuestionText;
                                strSecAnswer     = questions[0].Answer;
                            }

                            if (strSecQuestion != "")
                            {
                                for (int i = 0; i < ddlQuestions.Items.Count; i++)
                                {
                                    if (ddlQuestions.Items[i].Text.ToString() != "")
                                    {
                                        if (strSecQuestion == ddlQuestions.Items[i].Text.ToString())
                                        {
                                            ddlQuestions.Items[i].Selected = true;
                                        }
                                    }
                                }
                            }
                        }
                    }
                });

                //***EAC Store in a session var the page that called login.aspx (REFERER)

                /*if (Request.QueryString["redir"] != null && Request.QueryString["redir"].ToString().Length > 0)
                 *  Session["NCIPL_REGISTERREFERRER"] = Request.QueryString["redir"].ToString();
                 * else
                 * {
                 *  //NCIPL_CC Session["NCIPL_REGISTERREFERRER"] = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : "";
                 *  Session["NCIPL_REGISTERREFERRER"] = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : "home.aspx";
                 *  if (Request.QueryString["js"] != null)
                 *      if (string.Compare(Request.QueryString["js"].ToString(), "2") == 0)
                 *          Session["JSTurnedOn"] = "False";
                 * }*/

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

            string sPreviousPage = "home.aspx";

            if (Session["NCIPL_REGISTERREFERRER"] != null)
            {
                if (Session["NCIPL_REGISTERREFERRER"].ToString() != "")
                {
                    sPreviousPage = Session["NCIPL_REGISTERREFERRER"].ToString();
                }
            }
            btnCancel.Attributes.Add("onclick", "window.location='" + sPreviousPage + "'; return(false);");

            //if (!GlobalUtils.Utils.isLoggedin())
            //{
            //    this.Master.LogoImage1Visible = false;
            //    this.Master.LogoImage2Visible = true;
            //}
        }
예제 #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Reset Session for using existing CUSTID
            Session["SEARCHORDER_CUSTID"] = null;       //destroy

            if (!IsPostBack)
            {
                lblGuamMsg.Visible = false;

                #region CommentedFor_HITT12013
                ////***EAC Store in a session var the page that called login.aspx (REFERER)
                //if (Request.QueryString["redir"] != null && Request.QueryString["redir"].ToString().Length > 0)
                //    Session["NCIPL_REGISTERREFERRER"] = Request.QueryString["redir"].ToString();
                //else
                //{
                //    //NCIPL_CC Session["NCIPL_REGISTERREFERRER"] = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : "";

                //    //NCIPL_CC Firefox and IE is behaving differently for the Referrer, in FF UrlReferrer is default.aspx, in IE it is null when the application is loaded
                //    //NCIPL_CC Session["NCIPL_REGISTERREFERRER"] = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : "home.aspx";
                //    Session["NCIPL_REGISTERREFERRER"] = (Request.UrlReferrer != null && !(Request.UrlReferrer.ToString().Contains("default.aspx"))) ? Request.UrlReferrer.ToString() : "home.aspx";
                //    if (Request.QueryString["js"] != null)
                //        if (string.Compare(Request.QueryString["js"].ToString(), "2") == 0)
                //            Session["JSTurnedOn"] = "False";
                //}
                #endregion

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

                //Show user a message if the rol for the log on did not work properly
                if (Request.QueryString["msg"] != null && lblGuamMsg.Visible == false)
                {
                    if (string.Compare(Request.QueryString["msg"].ToString(), "invaliduser", 0) == 0)
                    {
                        lblGuamMsg.Text    = "Invalid User or Role.";
                        lblGuamMsg.Visible = true;
                    }
                }

                //this.Master.TopRightPanelVisible = false;

                //this.Master.LogoImage1Visible = false;
                //this.Master.LogoImage2Visible = true;

                //Display the master page tabs
                GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
                if (Session["NCIPL_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;
            }
        }
예제 #26
0
        protected void chkReOrder_CheckedChanged(object sender, EventArgs e)
        {
            if (chkReOrder.Checked)
            {
                this.shoppingcart = null;     //destroy cart if it exists
                this.shoppingcart = new ProductCollection();

                ProductCollection colOrigOrder = DAL.DAL.GetOrigOrderDetail(OrderNum);

                /*foreach (GridViewRow item in grdViewItems.Rows)
                 * {
                 *  TextBox txtQty = (TextBox)item.FindControl("txtQty");
                 *  HiddenField hdnPubID = (HiddenField)item.FindControl("hdnPubID");
                 *
                 *  int pubid = Int32.Parse(hdnPubID.Value);
                 *  Product p = Product.GetCartPubByPubID(pubid);
                 *  p.NumQtyOrdered = Int32.Parse(txtQty.Text);
                 *  this.shoppingcart.Add(p);
                 *
                 *  Session["NCIPL_Pubs"] = this.shoppingcart.Pubs;
                 *  Session["NCIPL_Qtys"] = this.shoppingcart.Qtys;
                 * }*/


                foreach (Product item in colOrigOrder)
                {
                    //TextBox txtQty = (TextBox)item.FindControl("txtQty");
                    //HiddenField hdnPubID = (HiddenField)item.FindControl("hdnPubID");

                    int pubid = item.PubId;
                    //Do not add to the cart if Pub is a Promotion Pub
                    if (DAL.DAL.IsPromotionPub(pubid) == 0)
                    {
                        Product p = Product.GetCartPubByPubID(pubid);
                        p.NumQtyOrdered = item.NumQtyOrdered;
                        this.shoppingcart.Add(p);

                        Session["NCIPL_Pubs"] = this.shoppingcart.Pubs;
                        Session["NCIPL_Qtys"] = this.shoppingcart.Qtys;
                    }
                }

                if (chkUseAddress4NewOrder.Checked)
                {
                }
                else
                {
                    Session["SEARCHORDER_CUSTID"] = CustID;

                    Customer Cust = DAL.DAL.GetOrderCustInfobyCustID(CustID);
                    this.shipto = new Person(1, Cust.ShipToName, Cust.ShipToOrg, Cust.ShipToEmail, Cust.ShipToAddr1, Cust.ShipToAddr2, Cust.ShipToCity, Cust.ShipToState, Cust.ShipToZip5, Cust.ShipToZip4, Cust.ShipToPhone);
                    this.billto = new Person(1, Cust.BillToName, Cust.BillToOrg, Cust.BillToEmail, Cust.BillToAddr1, Cust.BillToAddr2, Cust.BillToCity, Cust.BillToState, Cust.BillToZip5, Cust.BillToZip4, Cust.BillToPhone);
                }
            }
            else
            {
                Session["NCIPL_cart"] = null;           //destroy
                Session["NCIPL_Pubs"] = null;           //destroy
                Session["NCIPL_Qtys"] = null;           //destroy

                if (chkUseAddress4NewOrder.Checked)
                {
                }
                else
                {
                    Session["SEARCHORDER_CUSTID"] = null;   //destroy

                    Session["NCIPL_shipto"] = null;         //destroy
                    Session["NCIPL_billto"] = null;         //destroy
                }
            }

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPL_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "cart");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "cart");
            }
            UtilMethod = null;
        }
예제 #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string Username      = "";
            string sPreviousPage = "login.aspx";

            divConfirmation.Visible = false;
            lblGuamMsg.Visible      = false;

            /*if (Session["NCIPL_REGISTERREFERRER"] != null)
             * {
             *  if (Session["NCIPL_REGISTERREFERRER"].ToString() != "")
             *  {
             *      sPreviousPage = Session["NCIPL_REGISTERREFERRER"].ToString();
             *  }
             * }*/
            btnCancel.Attributes.Add("onclick", "window.location='" + sPreviousPage + "'; return(false);");

            if (!IsPostBack)
            {
                //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);
                //}

                //--- Get data from query string
                //if (Request.QueryString["Username"] != null)
                //{
                //    Username = Request.QueryString["Username"].ToString();
                //}

                if (Session["Username_Forgot"] != null)
                {
                    Username = Session["Username_Forgot"].ToString();
                }

                if (Username.Trim() != "")
                {
                    getSecurityQuestion(Username);
                    if (SecurityQuestion != "")
                    {
                        lblUser.Text                = Username;
                        lblSecurityQuestion.Text    = SecurityQuestion;
                        HidSecurityQuestionID.Value = SecurityQuestionID;
                        divUserName.Visible         = false;
                        divSecurityQuestion.Visible = true;
                    }
                    else
                    {
                        HidSecurityQuestionID.Value = "";
                        divSecurityQuestion.Visible = false;
                        divUserName.Visible         = true;

                        txtUserName.Text     = Username;
                        lblGuamMsg.Text      = UserNotFoundErrorMsg;
                        lblGuamMsg.Visible   = true;
                        divChangePwd.Visible = true;
                    }
                }
                else
                {
                    HidSecurityQuestionID.Value = "";
                    divSecurityQuestion.Visible = false;
                    divUserName.Visible         = true;
                }

                //***EAC Store in a session var the page that called login.aspx (REFERER)
                //if (Request.QueryString["redir"] != null && Request.QueryString["redir"].ToString().Length > 0)
                //Session["NCIPL_REGISTERREFERRER"] = Request.QueryString["redir"].ToString();
                //else
                //Session["NCIPL_REGISTERREFERRER"] = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : "";

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

            //this.Master.TopRightPanelVisible = false;
            //this.Master.LogoImage1Visible = false;
            //this.Master.LogoImage2Visible = true;
        }
예제 #28
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //***EAC Check for CONFID
            if (Request.QueryString["ConfID"] == null)
            {
                throw new ArgumentException("Required parameter missing: ", "Conference ID");
            }
            conferenceid = Request.QueryString["ConfID"].ToString();

            //***EAC Check for PRODID
            if (Request.QueryString["prodid"] == null || Request.QueryString["prodid"].Length > 10)
            {
                throw new ArgumentException("Missing parameter in detail.aspx", "value");
            }

            //***EAC Check for location  (20130308)
            if (Session["KIOSK_ShipLocation"] == null || Session["KIOSK_ShipLocation"].ToString().Trim() == "")
            {
                Response.Redirect("location.aspx?ConfID=" + Request.QueryString["ConfID"].ToString() + "&prodid=" + Request.QueryString["prodid"], true);
            }


            //***EAC Hide ViewCart button or not...Better to do on PageLoad for each page than in Master.cs!
            if (Session["KIOSK_Qtys"].ToString() != "" || Session["KIOSK_Urls"].ToString() != "")
            {
                Master.FindControl("btnViewCart").Visible = true;
            }
            else
            {
                Master.FindControl("btnViewCart").Visible = false;
            }
            Master.FindControl("btnFinish").Visible       = false;
            Master.FindControl("lblFreePubsInfo").Visible = false;

            ContinueSearch.Attributes.Add("onmousedown", "this.src='images/continuered_on.jpg'");
            ContinueSearch.Attributes.Add("onmouseup", "this.src='images/continuered_off.jpg'");
            OrderPublication.Attributes.Add("onmousedown", "this.src='images/addtocart_on.jpg'");
            OrderPublication.Attributes.Add("onmouseup", "this.src='images/addtocart_off.jpg'");
            URLPublication.Attributes.Add("onmousedown", "this.src='images/addurl_on.jpg'");
            URLPublication.Attributes.Add("onmouseup", "this.src='images/addurl_off.jpg'");


            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;

                    Product p = Product.GetPubByProductID(_prodid);

                    //Checking for a valid Product Id
                    if (p == null)
                    {
                        throw new ArgumentException("Unable to find product", "value");
                    }



                    //***EAC Everything checks out at this point...start populating fields

                    #region Load FLEXSLIDER with TOC images
                    flexslider = "<div class='flexslider'>  <ul class='slides'>";
                    try
                    {
                        string   tocUrl  = ConfigurationManager.AppSettings["TOCImageURL"];
                        string   tocpath = Server.MapPath(tocUrl);
                        string[] x       = System.IO.Directory.GetFiles(tocpath, _prodid + "_toc*.jpg");

                        //***EAC TODO: you may have to pre-load images if images are delayed

                        if (x.Count() > 0)
                        {
                            for (int i = 0; i < x.Count(); i++)
                            {
                                flexslider += "<li>      <img src='pubimages/kiosktocs/" + Path.GetFileName(x[i]) + "' />";
                            }
                        }
                        else
                        {
                            flexslider += "<li>      <img src='pubimages/kiosktocs/blank_toc.jpg' />";
                        }
                    }
                    catch (Exception myerr)
                    {
                        //do nothing..no images so what?!?  Just give them the text so they can still order using buttons
                    }
                    flexslider += "</ul></div>";
                    #endregion


                    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;
                    }

                    lblAud.Text = p.Audience;
                    if (lblAud.Text.Length <= 0)
                    {
                        lblAudText.Visible = false;
                    }
                    lblLang.Text = p.Language;
                    if (lblLang.Text.Length <= 0)
                    {
                        lblLangText.Visible = false;
                    }

                    lblDesc.Text = p.Abstract;
                    if (lblDesc.Text.Length <= 0)
                    {
                        lblDescText.Visible = false;
                    }


                    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;
                    if (lblLastupd.Text.Length <= 0)
                    {
                        lblLastupdText.Visible = false;
                    }
                    lblProductID.Text = p.ProductId;

                    lblNIH.Text = p.NIHNum;
                    if (lblNIH.Text.Length <= 0)
                    {
                        lblNIHText.Visible = false;
                    }
                    if (lblNIHText.Visible == true)
                    {
                        //if (p.NIHNum.Length > 7)
                        //    lblNIHText.Text = "NIH Number(s):&nbsp;";
                    }
                    string imagepath = ConfigurationManager.AppSettings["PubImagesURL"];

                    _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 = DAL.DAL.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;
                    }

                    #region SHOW EBOOK URLS IF ANY
                    pnlHtmlPdf.Visible = false;
                    pnlKindle.Visible  = false;
                    pnlOther.Visible   = false;

                    string htmlpdf = DAL2.DAL.EbookUrl(p.PubId, "htmlpdf");
                    if (htmlpdf.Length > 0)
                    {
                        pnlHtmlPdf.Visible  = true;
                        imgHtmlPdf.ImageUrl = Server.HtmlDecode("https://chart.googleapis.com/chart?cht=qr&chs=120x120&chld=M&choe=UTF-8&chl=" + htmlpdf);
                    }

                    string kindle = DAL2.DAL.EbookUrl(p.PubId, "kindle");
                    if (kindle.Length > 0)
                    {
                        pnlKindle.Visible  = true;
                        imgKindle.ImageUrl = Server.HtmlDecode("https://chart.googleapis.com/chart?cht=qr&chs=120x120&chld=M&choe=UTF-8&chl=" + kindle);
                    }

                    string epub = DAL2.DAL.EbookUrl(p.PubId, "epub");
                    if (epub.Length > 0)
                    {
                        pnlOther.Visible  = true;
                        imgOther.ImageUrl = Server.HtmlDecode("https://chart.googleapis.com/chart?cht=qr&chs=120x120&chld=M&choe=UTF-8&chl=" + epub);
                    }
                    #endregion

                    //**EAC hide order/email buttons for now
                    OrderPublication.Visible = false;
                    URLPublication.Visible   = false;

                    if (p.OrderDisplayStatus.Contains("ORDER") && Session["KIOSK_ShipLocation"].ToString() == "Domestic" && p.NumQtyAvailable > 0)
                    {
                        //***EAC determine the image to use
                        OrderPublication.Visible  = true;
                        OrderPublication.ImageUrl = "images/addtocart_off.jpg";
                        OrderPublication.Enabled  = true;

                        //***EAC is item in cart?
                        if (IsItemInCart(p.PubId.ToString()))
                        {
                            OrderPublication.ImageUrl = "images/alreadyincart.jpg";
                            OrderPublication.Enabled  = false;
                        }

                        //***EAC limit reached
                        if (LimitReached())
                        {
                            OrderPublication.ImageUrl = "images/limitreached.jpg";
                            OrderPublication.Enabled  = false;
                        }
                    }
                    else if (p.OnlineDisplayStatus.Contains("ONLINE"))
                    {
                        URLPublication.Visible  = true;
                        URLPublication.ImageUrl = "images/addurl_off.jpg";
                        URLPublication.Enabled  = true;

                        //***EAC is item in cart?
                        if (IsItemInCart(p.PubId.ToString()))
                        {
                            URLPublication.ImageUrl = "images/alreadyincart.jpg";
                            URLPublication.Enabled  = false;
                        }

                        //***EAC limit reached
                        if (URLLimitReached())
                        {
                            URLPublication.ImageUrl = "images/limitreached.jpg";
                            URLPublication.Enabled  = false;
                        }
                    }
                }
                else
                {
                    throw new ArgumentException("Missing parameter in detail.aspx", "value");
                }
            }
        }
예제 #29
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
        }
예제 #30
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["NCIPL_Pubs"] += e.CommandArgument.ToString() + ",";
                    Session["NCIPL_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["NCIPL_Pubs"] != null)
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPL_Qtys"].ToString(), "");
                }
                else
                {
                    Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
                }
                UtilMethod = null;
            }
            else
            {
                this.PubCoverOrderOK.CommandArgument = e.CommandArgument.ToString();

                Product p = DAL.DAL.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 = DAL.DAL.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
            }
        }