private void InitializePageContent() { pnlCheckoutImage.Visible = checkOutMode; CheckoutImage.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_2.gif"); pnlAddressList.Visible = (custAddresses.Count > 0 || addMode); pnlAddressListMain.Visible = (!addMode); pnlNewAddress.Visible = (addMode); lnkAddAddress.Text = AppLogic.GetString("selectaddress.aspx.3", SkinID, ThisCustomer.LocaleSetting); lnkAddAddress.NavigateUrl = "selectaddress.aspx?add=true&checkout=" + checkOutMode.ToString() + "&addressType=" + AddressType.ToString() + "&returnURL=" + Server.UrlEncode(ReturnURL); lnkAddAddress.Visible = (!addMode); liAdd.Visible = (!addMode); if (addMode) { pnlSaveAddress.Visible = true; string addressType = CommonLogic.QueryStringCanBeDangerousContent("AddressType"); if (addressType.ToLower() != "shipping") { AddressControl.showResidenceTypes = false; } else { AddressControl.showResidenceTypes = true; } } }
private void DisplayCheckOutStepsImage() { checkoutheadergraphic.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_4.gif"); for (int i = 0; i < checkoutheadergraphic.HotSpots.Count; i++) { var rhs = (RectangleHotSpot)checkoutheadergraphic.HotSpots[i]; if (rhs.NavigateUrl.IndexOf("shoppingcart") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutpayment.aspx.2", SkinID, ThisCustomer.LocaleSetting, true); } if (rhs.NavigateUrl.IndexOf("account") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutpayment.aspx.3", SkinID, ThisCustomer.LocaleSetting, true); } if (rhs.NavigateUrl.IndexOf("checkoutshipping") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutpayment.aspx.4", SkinID, ThisCustomer.LocaleSetting, true); } } if (!AppLogic.AppConfigBool("SkipShippingOnCheckout")) { checkoutheadergraphic.HotSpots[2].HotSpotMode = HotSpotMode.Navigate; if (AppLogic.AppConfigBool("Checkout.UseOnePageCheckout")) { checkoutheadergraphic.HotSpots[2].NavigateUrl = "checkout1.aspx"; } else { checkoutheadergraphic.HotSpots[2].NavigateUrl = CommonLogic.IIF(_cart.HasMultipleShippingAddresses(), "checkoutshippingmult.aspx", "checkoutshipping.aspx"); } } }
private void InitializePageContent() { JSPopupRoutines.Text = AppLogic.GetJSPopupRoutines(); pnlHeaderGraphic.Visible = Checkout; checkoutheadergraphic.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/step_3_2.gif"); if (ContainsEmailGiftCards) { lnkGiftCard.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/step_3_2.gif"); lnkGiftCard.Visible = false; } if (lblErrMsg.Text.Length != 0) { lblErrMsg.Visible = true; } else { lblErrMsg.Visible = false; } string sql = "select p.name productname, case when isnull(pv.name, '')='' then '' else ' - ' + pv.name end variantname, g.* from GiftCard g join ShoppingCart s on g.ShoppingCartRecID = s.ShoppingCartRecID join product p on s.productid = p.productid join productvariant pv on s.variantid = pv.variantid where g.GiftCardTypeID in (" + AppLogic.AppConfig("GiftCard.EmailProductTypeIDs").TrimEnd(',').TrimStart(',') + ") and g.PurchasedByCustomerID = " + ThisCustomer.CustomerID.ToString(); using (SqlConnection con = new SqlConnection(DB.GetDBConn())) { con.Open(); using (IDataReader dr = DB.GetRS(sql, con)) { rptrEmailGiftCards.DataSource = dr; rptrEmailGiftCards.DataBind(); } } }
private void InitializePageContent() { JSPopupRoutines.Text = AppLogic.GetJSPopupRoutines(); CheckoutMap.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/step_2.gif"); if (AppLogic.AppConfigBool("SecurityCodeRequiredOnStoreLogin")) { // Create a random code and store it in the Session object. Session["SecurityCode"] = CommonLogic.GenerateRandomCode(6); } }
private void DisplayCheckOutStepsImage() { checkoutheadergraphic.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_3.gif"); ((RectangleHotSpot)checkoutheadergraphic.HotSpots[0]).AlternateText = AppLogic.GetString("checkoutshipping.aspx.3", SkinID, ThisCustomer.LocaleSetting); ((RectangleHotSpot)checkoutheadergraphic.HotSpots[1]).AlternateText = AppLogic.GetString("checkoutshipping.aspx.4", SkinID, ThisCustomer.LocaleSetting); if (_IsPayPal) { checkoutheadergraphic.HotSpots[1].HotSpotMode = HotSpotMode.Inactive; } }
private void PerformPageAccessLogic() { if (!_checkOutMode) { return; } // ----------------------------------------------------------------------------------------------- // NOTE ON PAGE LOAD LOGIC: // We are checking here for required elements to allowing the customer to stay on this page. // Many of these checks may be redundant, and they DO add a bit of overhead in terms of db calls, but ANYTHING really // could have changed since the customer was on the last page. Remember, the web is completely stateless. Assume this // page was executed by ANYONE at ANYTIME (even someone trying to break the cart). // It could have been yesterday, or 1 second ago, and other customers could have purchased limitied inventory products, // coupons may no longer be valid, etc, etc, etc... // ----------------------------------------------------------------------------------------------- if (_cart.IsEmpty()) { Response.Redirect("shoppingcart.aspx?resetlinkback=1"); } if (_cart.InventoryTrimmed) { Response.Redirect("shoppingcart.aspx?resetlinkback=1&errormsg=" + Server.UrlEncode(AppLogic.GetString("shoppingcart.aspx.1", SkinID, ThisCustomer.LocaleSetting, true))); } string couponCode = string.Empty; string couponErrorMessage = string.Empty; if (_cart.HasCoupon(ref couponCode) && !_cart.IsCouponValid(ThisCustomer, couponCode, ref couponErrorMessage)) { Response.Redirect("shoppingcart.aspx?resetlinkback=1&discountvalid=false"); } if (!_cart.MeetsMinimumOrderAmount(AppLogic.AppConfigUSDecimal("CartMinOrderAmount"))) { Response.Redirect("shoppingcart.aspx?resetlinkback=1"); } if (!_cart.MeetsMinimumOrderWeight(AppLogic.AppConfigUSDecimal("MinOrderWeight"))) { Response.Redirect("shoppingcart.aspx?resetlinkback=1"); } if (!_cart.MeetsMinimumOrderQuantity(AppLogic.AppConfigUSInt("MinCartItemsBeforeCheckout"))) { Response.Redirect("shoppingcart.aspx?resetlinkback=1"); } pnlCheckoutImage.Visible = true; CheckoutImage.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_2.gif"); }
protected void Page_Load(object sender, System.EventArgs e) { if (AppLogic.AppConfigBool("GoNonSecureAgain")) { SkinBase.GoNonSecureAgain(); } // this may be overwridden by the XmlPackage below! SectionTitle = "<img src=\"" + AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/downarrow.gif") + "\" align=\"absmiddle\" border=\"0\"> " + AppLogic.GetString("galleries.aspx.1", SkinID, ThisCustomer.LocaleSetting); // set the Customer context, and set the SkinBase context, so meta tags to be set if they are not blank in the XmlPackage results XmlPackage1.SetContext = this; }
void AddressList_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ImageButton MakePrimaryBtn = (ImageButton)e.Item.FindControl("btnMakePrimary"); ImageButton EditBtn = (ImageButton)e.Item.FindControl("btnEdit"); MakePrimaryBtn.Visible = (((DbDataRecord)e.Item.DataItem)["PrimaryAddress"].ToString() == "0"); MakePrimaryBtn.ImageUrl = ButtonImage; EditBtn.ImageUrl = AppLogic.LocateImageURL("skins/Skin_" + SkinID.ToString() + "/images/edit.gif"); } }
private void InitializePageContent() { pnlCheckoutImage.Visible = checkOutMode; CheckoutImage.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_2.gif"); //add new mobile resources litAddressPrompt.Text = CommonLogic.IIF(AddressType == AddressTypes.Shipping, AppLogic.GetString("mobile.editaddress.aspx.1", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("mobile.editaddress.aspx.2", SkinID, ThisCustomer.LocaleSetting)); btnReturn.Text = AppLogic.GetString("account.aspx.27", SkinID, ThisCustomer.LocaleSetting); btnReturn.OnClientClick = "self.location='selectaddress.aspx?checkout=" + checkOutMode.ToString() + "&AddressType=" + AddressTypeString + "';return false;"; //add new mobile resources btnSaveAddress.Text = AppLogic.GetString("mobile.editaddress.aspx.3", SkinID, ThisCustomer.LocaleSetting); btnSaveAddress.CommandArgument = AddressID.ToString(); }
private void PerformPageAccessLogic() { ReturnURL = CommonLogic.QueryStringCanBeDangerousContent("ReturnURL"); if (ReturnURL.IndexOf("<script>", StringComparison.InvariantCultureIgnoreCase) != -1) { throw new ArgumentException("SECURITY EXCEPTION"); } AddressTypeString = CommonLogic.QueryStringCanBeDangerousContent("AddressType"); if (AddressTypeString.IndexOf("<script>", StringComparison.InvariantCultureIgnoreCase) != -1) { throw new ArgumentException("SECURITY EXCEPTION"); } ThisCustomer.RequireCustomerRecord(); if (CommonLogic.QueryStringBool("editaddress") && !ThisCustomer.IsRegistered) { string url = CommonLogic.IIF(AppLogic.AppConfigBool("Checkout.UseOnePageCheckout"), "checkout1.aspx", String.Format("createaccount.aspx?checkout=true&skipreg=true&editaddress=true")); Response.Redirect(url); } if (!Shipping.MultiShipEnabled()) { RequiresLogin(CommonLogic.GetThisPageName(false) + "?" + CommonLogic.ServerVariables("QUERY_STRING")); } if (AddressTypeString.Length != 0) { AddressType = (AddressTypes)Enum.Parse(typeof(AddressTypes), AddressTypeString, true); } if (AddressType == AddressTypes.Unknown) { AddressType = AddressTypes.Shipping; AddressTypeString = "Shipping"; } custAddresses = new Addresses(); custAddresses.LoadCustomer(ThisCustomer, AddressType); if (AddressType == AddressTypes.Shipping) { ButtonImage = AppLogic.LocateImageURL("skins/Skin_" + SkinID.ToString() + "/images/usethisshippingaddress.gif", ThisCustomer.LocaleSetting); } else { ButtonImage = AppLogic.LocateImageURL("skins/Skin_" + SkinID.ToString() + "/images/usethisbillingaddress.gif", ThisCustomer.LocaleSetting); } }
private void InitializePageContent() { pnlCheckoutImage.Visible = Checkout; CheckoutImage.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/step_2.gif"); pnlAddressList.Visible = (custAddresses.Count > 0 || CommonLogic.QueryStringCanBeDangerousContent("add").Length != 0); tblAddressList.Attributes.Add("style", "border-style: solid; border-width: 0px; border-color: #" + AppLogic.AppConfig("HeaderBGColor")); tblAddressListBox.Attributes.Add("style", AppLogic.AppConfig("BoxFrameStyle")); lnkAddAddress.Text = AppLogic.GetString("selectaddress.aspx.6", SkinID, ThisCustomer.LocaleSetting); lnkAddAddress.NavigateUrl = "selectaddress.aspx?add=true&checkout=" + Checkout.ToString() + "&addressType=" + AddressType.ToString() + "&returnURL=" + Server.UrlEncode(ReturnURL); lnkAddAddress.Visible = (CommonLogic.QueryStringCanBeDangerousContent("add").Length == 0); if (CommonLogic.QueryStringCanBeDangerousContent("add").Length != 0) { pnlNewAddress.Visible = true; Address newAddress = new Address(); newAddress.AddressType = AddressType; litNewAddressForm.Text = newAddress.InputHTML(); litNewAddressForm.Visible = true; btnNewAddress.Text = AppLogic.GetString("selectaddress.aspx.5", SkinID, ThisCustomer.LocaleSetting); AppLogic.GetButtonDisable(btnNewAddress); } addressbook_gif.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/addressbook.gif", ThisCustomer.LocaleSetting); string sql = String.Empty; if (AddressType == AddressTypes.Shipping) { sql = "select a.*, isnull(City + ', ', '') + isnull(State,'') + isnull(' ' + ZIP, '') CityStateZip, case when c.customerid is null then 0 else 1 end PrimaryAddress from Address a left join Customer c on a.AddressID = c.ShippingAddressID where a.customerid = " + ThisCustomer.CustomerID.ToString(); } else { sql = "select a.*, isnull(City + ', ', '') + isnull(State,'') + isnull(' ' + ZIP, '') CityStateZip, case when c.customerid is null then 0 else 1 end PrimaryAddress from Address a left join Customer c on a.AddressID = c.BillingAddressID where a.customerid = " + ThisCustomer.CustomerID.ToString(); } using (SqlConnection dbconn = new SqlConnection(DB.GetDBConn())) { dbconn.Open(); using (IDataReader dr = DB.GetRS(sql, dbconn)) { AddressList.DataSource = dr; AddressList.DataBind(); } } btnReturn.Text = AppLogic.GetString("account.aspx.61", SkinID, ThisCustomer.LocaleSetting); btnReturn.OnClientClick = "self.location='account.aspx?checkout=" + Checkout.ToString() + "';return false"; btnCheckOut.Visible = Checkout; btnCheckOut.Text = AppLogic.GetString("account.aspx.60", SkinID, ThisCustomer.LocaleSetting); btnCheckOut.OnClientClick = "self.location='checkoutshipping.aspx';return false;"; }
private void InitializePageContent() { CheckoutMap.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_2.gif"); btnSignInAndCheckout.Text = AppLogic.GetString("checkoutanon.aspx.12", ThisCustomer.SkinID, ThisCustomer.LocaleSetting, true); RegisterAndCheckoutButton.Text = AppLogic.GetString("checkoutanon.aspx.13", ThisCustomer.SkinID, ThisCustomer.LocaleSetting, true); Skipregistration.Text = AppLogic.GetString("checkoutanon.aspx.14", ThisCustomer.SkinID, ThisCustomer.LocaleSetting, true); if (ThisCustomer.IsInEditingMode()) { AppLogic.EnableButtonCaptionEditing(btnSignInAndCheckout, "checkoutanon.aspx.12"); AppLogic.EnableButtonCaptionEditing(RegisterAndCheckoutButton, "checkoutanon.aspx.13"); AppLogic.EnableButtonCaptionEditing(Skipregistration, "checkoutanon.aspx.14"); } }
private void InitializePageContent() { RenderAddressDetails(); pnlCheckoutImage.Visible = _checkOutMode; CheckoutImage.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_2.gif"); btnReturn.Text = AppLogic.GetString("account.aspx.27", SkinID, ThisCustomer.LocaleSetting, true); string returnTo = (_checkOutMode && !_returnURL.IsNullOrEmptyTrimmed()) ? String.Format("&ReturnUrl={0}", _returnURL) : String.Empty; btnReturn.OnClientClick = String.Format("self.location='selectaddress.aspx?checkout={0}&&AddressType={1}{2}';return false;", _checkOutMode.ToStringLower(), _addressTypeString, returnTo); if (ThisCustomer.IsInEditingMode()) { AppLogic.EnableButtonCaptionEditing(btnReturn, "account.aspx.27"); } AddressControl.showResidenceTypes = (CommonLogic.QueryStringCanBeDangerousContent("AddressType").ToLowerInvariant() == "shipping"); }
private void InitializePageContent() { pnlCheckoutImage.Visible = checkOutMode; CheckoutImage.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_2.gif"); pnlAddressList.Visible = (custAddresses.Count > 0 || addMode); pnlAddressListMain.Visible = (!addMode); pnlNewAddress.Visible = (addMode); lnkAddAddress.Text = AppLogic.GetString("selectaddress.aspx.3", SkinID, ThisCustomer.LocaleSetting); lnkAddAddress.NavigateUrl = "selectaddress.aspx?add=true&checkout=" + checkOutMode.ToString() + "&addressType=" + AddressType.ToString() + "&returnURL=" + Server.UrlEncode(ReturnURL); lnkAddAddress.Visible = (!addMode); liAdd.Visible = (!addMode); if (addMode) { ctrlAddress.Visible = true; btnNewAddress.Text = AppLogic.GetString("selectaddress.aspx.2", SkinID, ThisCustomer.LocaleSetting); } }
private void PerformPageAccessLogic() { ReturnURL = CommonLogic.QueryStringCanBeDangerousContent("ReturnURL"); if (ReturnURL.IndexOf("<script>", StringComparison.InvariantCultureIgnoreCase) != -1) { throw new ArgumentException("SECURITY EXCEPTION"); } AddressTypeString = CommonLogic.QueryStringCanBeDangerousContent("AddressType"); if (AddressTypeString.IndexOf("<script>", StringComparison.InvariantCultureIgnoreCase) != -1) { throw new ArgumentException("SECURITY EXCEPTION"); } ThisCustomer.RequireCustomerRecord(); if (!Shipping.MultiShipEnabled()) { RequiresLogin(CommonLogic.GetThisPageName(false) + "?" + CommonLogic.ServerVariables("QUERY_STRING")); } if (AddressTypeString.Length != 0) { AddressType = (AddressTypes)Enum.Parse(typeof(AddressTypes), AddressTypeString, true); } if (AddressType == AddressTypes.Unknown) { AddressType = AddressTypes.Shipping; AddressTypeString = "Shipping"; } custAddresses = new Addresses(); custAddresses.LoadCustomer(ThisCustomer, AddressType); if (AddressType == AddressTypes.Shipping) { ButtonImage = AppLogic.LocateImageURL("skins/Skin_" + SkinID.ToString() + "/images/usethisshippingaddress.gif", ThisCustomer.LocaleSetting); } else { ButtonImage = AppLogic.LocateImageURL("skins/Skin_" + SkinID.ToString() + "/images/usethisbillingaddress.gif", ThisCustomer.LocaleSetting); } }
public Color GetColorData(SkinID id, string index) { Dictionary <string, string[]> colorDict = null; switch (id) { case SkinID.Default: colorDict = defaultColorDict; break; case SkinID.FreshGreen: colorDict = greenColorDict; break; case SkinID.RosePink: colorDict = pinkColorDict; break; case SkinID.SkyBlue: colorDict = blueColorDict; break; } string[] colorArray = null; colorDict.TryGetValue(index, out colorArray); if (colorArray == null) { MyDebug.LogYellow("Get Color Error! SkinID: " + id.ToString() + ",index:" + index); return(Color.white); } Color color = new Color(); color.r = float.Parse(colorArray[0]) / 255f; color.g = float.Parse(colorArray[1]) / 255f; color.b = float.Parse(colorArray[2]) / 255f; color.a = float.Parse(colorArray[3]) / 255f; return(color); }
protected virtual void FindLocaleStrings(Control c) { try { System.Web.UI.WebControls.Image i = c as System.Web.UI.WebControls.Image; if (i != null) { if (i.ImageUrl.IndexOf("(!") >= 0) { i.ImageUrl = AppLogic.LocateImageURL(i.ImageUrl.Replace("(!SKINID!)", SkinID.ToString()).Replace("(!", string.Empty).Replace("!)", string.Empty), ThisCustomer.LocaleSetting); } if (i.AlternateText.IndexOf("(!") >= 0) { i.AlternateText = AppLogic.GetString(i.AlternateText, SkinID, ThisCustomer.LocaleSetting); } } else { System.Web.UI.WebControls.ImageButton b = c as System.Web.UI.WebControls.ImageButton; if (b != null) { if (b.ImageUrl.IndexOf("(!") >= 0) { b.ImageUrl = AppLogic.LocateImageURL(b.ImageUrl.Replace("(!SKINID!)", SkinID.ToString()).Replace("(!", string.Empty).Replace("!)", string.Empty), ThisCustomer.LocaleSetting); } } else { IEditableTextControl e = c as IEditableTextControl; if (e != null) { if (!(e is ListControl)) { e.Text = AppLogic.GetString(e.Text.Replace("(!SKINID!)", SkinID.ToString()).Replace("(!", "").Replace("!)", ""), SkinID, ThisCustomer.LocaleSetting); } } else { IValidator v = c as IValidator; if (v != null) { v.ErrorMessage = AppLogic.GetString(v.ErrorMessage.Replace("(!SKINID!)", SkinID.ToString()).Replace("(!", "").Replace("!)", ""), SkinID, ThisCustomer.LocaleSetting); } ITextControl t = c as ITextControl; if (t != null) { t.Text = AppLogic.GetString(t.Text.Replace("(!SKINID!)", SkinID.ToString()).Replace("(!", "").Replace("!)", ""), SkinID, ThisCustomer.LocaleSetting); } Button b2 = c as Button; if (b2 != null) { b2.Text = AppLogic.GetString(b2.Text.Replace("(!SKINID!)", SkinID.ToString()).Replace("(!", "").Replace("!)", ""), SkinID, ThisCustomer.LocaleSetting); } LinkButton l = c as LinkButton; if (l != null) { l.Text = AppLogic.GetString(l.Text.Replace("(!SKINID!)", SkinID.ToString()).Replace("(!", "").Replace("!)", ""), SkinID, ThisCustomer.LocaleSetting); } HyperLink h = c as HyperLink; if (h != null) { h.Text = AppLogic.GetString(h.Text.Replace("(!SKINID!)", SkinID.ToString()).Replace("(!", "").Replace("!)", ""), SkinID, ThisCustomer.LocaleSetting); } RadioButton r = c as RadioButton; if (r != null) { r.Text = AppLogic.GetString(r.Text.Replace("(!SKINID!)", SkinID.ToString()).Replace("(!", "").Replace("!)", ""), SkinID, ThisCustomer.LocaleSetting); } } } } if (c.HasControls()) { foreach (Control cx in c.Controls) { FindLocaleStrings(cx); } } } catch { } // for admin site, a hack really, will fix with master pages }
private void InitializePageContent() { GetJavaScriptFunctions(); JSPopupRoutines.Text = AppLogic.GetJSPopupRoutines(); AppConfigAffiliateProgramName.Text = AppLogic.GetString("AppConfig.AffiliateProgramName", SkinID, ThisCustomer.LocaleSetting) + " Sign-In"; AppConfigAffiliateProgramName2.Text = AppLogic.GetString("AppConfig.AffiliateProgramName", SkinID, ThisCustomer.LocaleSetting); AppConfigAffiliateProgramName3.Text = AppLogic.GetString("AppConfig.AffiliateProgramName", SkinID, ThisCustomer.LocaleSetting) + " Sign-Up"; AppConfigAffiliateProgramName4.Text = AppLogic.GetString("AppConfig.AffiliateProgramName", SkinID, ThisCustomer.LocaleSetting) + " Sign Out"; CustSvcEmailLink.NavigateUrl = "mailto:" + AppLogic.AppConfig("AffiliateEMailAddress"); lnkAskAQuestion.NavigateUrl = "mailto:" + AppLogic.AppConfig("AffiliateEMailAddress"); AffiliateHeader.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/affiliateheader_small.jpg"); imgLogin.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/login.gif"); imgLogout.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/logout.gif"); TermsLink.Text = "<a onClick=\"popuptopicwh('" + Server.UrlEncode(AppLogic.GetString("AppConfig.AffiliateProgramName", SkinID, ThisCustomer.LocaleSetting).Replace("'", "")) + " Terms & Conditions','affiliate_terms',650,550,'yes')\" href=\"javascript:void(0);\">Terms & Conditions</a>"; accountinfo_gif.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/accountinfo.gif"); WebSiteInfoImage.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/onlineinfo.gif"); using (SqlConnection conn = DB.dbConn()) { conn.Open(); using (IDataReader dr = DB.GetRS("select * from State with (NOLOCK) order by DisplayOrder,Name", conn)) { State.DataSource = dr; State.DataTextField = "Name"; State.DataValueField = "Abbreviation"; State.DataBind(); } } using (SqlConnection conn = DB.dbConn()) { conn.Open(); using (IDataReader dr2 = DB.GetRS("select * from Country with (NOLOCK) where Published = 1 order by DisplayOrder,Name", conn)) { Country.DataSource = dr2; Country.DataTextField = "Name"; Country.DataValueField = "Name"; Country.DataBind(); } } if (AffiliateID == 0) { pnlBeforeSignup.Visible = true; pnlAfterSignup.Visible = false; pnlSignedInMsg.Visible = false; pnlSignUpForm.Visible = true; YourAccountLinkPanel.Visible = false; } else { BillingAddress = new Address(); BillingAddress.LoadByCustomer(ThisCustomer.CustomerID, ThisCustomer.PrimaryBillingAddressID, AddressTypes.Billing); pnlBeforeSignup.Visible = false; pnlAfterSignup.Visible = true; pnlSignedInMsg.Visible = true; pnlSignUpForm.Visible = false; YourAccountLinkPanel.Visible = true; tblAccount.Attributes.Add("style", "border-style: solid; border-width: 0px; border-color: #" + AppLogic.AppConfig("HeaderBGColor")); tblAcctInfoBox.Attributes.Add("style", AppLogic.AppConfig("BoxFrameStyle")); this.AppConfigAffiliateProgramName3.Text = "Your account information will be used to login to your " + AppLogic.GetString("AppConfig.AffiliateProgramName", SkinID, ThisCustomer.LocaleSetting) + " account page later, so please save your password in a safe place."; FirstName.Text = ThisCustomer.FirstName; LastName.Text = ThisCustomer.LastName; EMail.Text = ThisCustomer.EMail.ToLowerInvariant().Trim(); AffPassword.Text = String.Empty; AffPassword2.Text = String.Empty; Company.Text = Server.HtmlEncode(BillingAddress.Company); Address1.Text = Server.HtmlEncode(BillingAddress.Address1); Address2.Text = Server.HtmlEncode(BillingAddress.Address2); Suite.Text = Server.HtmlEncode(BillingAddress.Suite); City.Text = Server.HtmlEncode(BillingAddress.City); Zip.Text = Server.HtmlEncode(BillingAddress.Zip); Phone.Text = Server.HtmlEncode(BillingAddress.Phone); tblAffWebInfo.Attributes.Add("style", "border-style: solid; border-width: 0px; border-color: #" + AppLogic.AppConfig("HeaderBGColor")); tblWebSiteInfoBox.Attributes.Add("style", AppLogic.AppConfig("BoxFrameStyle")); } AppLogic.GetButtonDisable(btnJoin); }
private void InitializePageContent() { lblError.Visible = (lblError.Text.Trim() != ""); valAddressIsPOBox.ErrorMessage = AppLogic.GetString("createaccount_process.aspx.3", SkinID, ThisCustomer.LocaleSetting); tblAddressList.Attributes.Add("style", "border-style: solid; border-width: 0px; border-color: #" + AppLogic.AppConfig("HeaderBGColor")); tblAddressListBox.Attributes.Add("style", AppLogic.AppConfig("BoxFrameStyle")); editaddress_gif.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/editaddress.gif"); litAddressPrompt.Text = CommonLogic.IIF(AddressType == AddressTypes.Shipping, AppLogic.GetString("editaddress.aspx.2", SkinID, ThisCustomer.LocaleSetting), AppLogic.GetString("editaddress.aspx.12", SkinID, ThisCustomer.LocaleSetting)); if (Prompt.Length > 0) { litAddressPrompt.Text += "<strong><font color=\"red\">" + Prompt + "</font></strong>"; } bool CustCCRequired = ThisCustomer.MasterShouldWeStoreCreditCardInfo; pnlBillingData.Visible = (AddressType == AddressTypes.Billing && CustCCRequired); editaddress_aspx_4.Text = AppLogic.GetString("editaddress.aspx.4", SkinID, ThisCustomer.LocaleSetting); editaddress_aspx_5.Text = AppLogic.GetString("editaddress.aspx.5", SkinID, ThisCustomer.LocaleSetting); editaddress_aspx_6.Text = AppLogic.GetString("editaddress.aspx.6", SkinID, ThisCustomer.LocaleSetting); editaddress_aspx_7.Text = AppLogic.GetString("editaddress.aspx.7", SkinID, ThisCustomer.LocaleSetting); litCCForm.Text = theAddress.InputCardHTML(ThisCustomer, false, false); editaddress_aspx_8.Text = AppLogic.GetString("editaddress.aspx.8", SkinID, ThisCustomer.LocaleSetting); litECheckForm.Text = theAddress.InputECheckHTML(false); btnSaveAddress.Text = AppLogic.GetString("editaddress.aspx.9", SkinID, ThisCustomer.LocaleSetting); btnSaveAddress.CommandArgument = AddressID.ToString(); btnDeleteAddress.Visible = CanDelete; btnDeleteAddress.CommandArgument = AddressID.ToString(); btnDeleteAddress.Text = AppLogic.GetString("editaddress.aspx.10", SkinID, ThisCustomer.LocaleSetting); pnlEcheckData.Attributes.Add("style", "display:none;"); pnlCCData.Attributes.Add("style", "display:none;"); btnValidateAddress.Text = AppLogic.GetString("editaddress.aspx.14", SkinID, ThisCustomer.LocaleSetting); btnValidateAddress.CommandArgument = AddressID.ToString(); btnValidateAddress.Visible = ValidateAddress; lblValidateAddressSpacer.Visible = ValidateAddress; if (!IsPostBack) { if (CustCCRequired) { CreditCard.Checked = true; } if (!ShowEcheck) { editaddress_aspx_6.Visible = false; ECheck.Visible = false; } } if (CreditCard.Checked || ECheck.Checked) { if (CreditCard.Checked) { CreditCard.Checked = true; pnlCCData.Attributes.Add("style", "display:block;"); pnlEcheckData.Attributes.Add("style", "display:none;"); } else if (ECheck.Checked) { ECheck.Checked = true; pnlCCData.Attributes.Add("style", "display:none;"); pnlEcheckData.Attributes.Add("style", "display:block;"); } } else { if (theAddress.PaymentMethodLastUsed == AppLogic.ro_PMCreditCard) { CreditCard.Checked = true; pnlCCData.Attributes.Add("style", "display:block;"); } else if (theAddress.PaymentMethodLastUsed == AppLogic.ro_PMECheck && ShowEcheck) { ECheck.Checked = true; pnlEcheckData.Attributes.Add("style", "display:block;"); } } txtAddressNickName.Text = theAddress.NickName; txtFirstName.Text = theAddress.FirstName; txtLastName.Text = theAddress.LastName; txtPhone.Text = theAddress.Phone; txtCompany.Text = theAddress.Company; ddlResidenceType.Items.Add(new ListItem(AppLogic.GetString("address.cs.55", SkinID, ThisCustomer.LocaleSetting), ((int)ResidenceTypes.Unknown).ToString())); ddlResidenceType.Items.Add(new ListItem(AppLogic.GetString("address.cs.56", SkinID, ThisCustomer.LocaleSetting), ((int)ResidenceTypes.Residential).ToString())); ddlResidenceType.Items.Add(new ListItem(AppLogic.GetString("address.cs.57", SkinID, ThisCustomer.LocaleSetting), ((int)ResidenceTypes.Commercial).ToString())); ddlResidenceType.SelectedValue = ((int)theAddress.ResidenceType).ToString(); txtAddress1.Text = theAddress.Address1; txtAddress2.Text = theAddress.Address2; txtSuite.Text = theAddress.Suite; txtCity.Text = theAddress.City; txtZip.Text = theAddress.Zip; using (SqlConnection conn = DB.dbConn()) { conn.Open(); using (IDataReader dr = DB.GetRS("select * from Country with (NOLOCK) where Published = 1 order by DisplayOrder,Name", conn)) { ddlCountry.DataSource = dr; ddlCountry.DataTextField = "Name"; ddlCountry.DataValueField = "Name"; ddlCountry.DataBind(); } } ddlCountry.SelectedValue = theAddress.Country; SetStateList(theAddress.Country); if (ddlState.Items.FindByValue(theAddress.State) != null) { ddlState.SelectedValue = theAddress.State; } GetJS(); }
private void UpdatePageContent() { AppConfigAffiliateProgramName.Text = AppLogic.GetString("AppConfig.AffiliateProgramName", SkinID, ThisCustomer.LocaleSetting) + " Member Sign-Out"; imgLogOut.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/logout.gif"); AskAQuestion.NavigateUrl = "mailto:" + AppLogic.AppConfig("AffiliateEMailAddress"); affiliateheader_small_gif.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/affiliateheader_small.jpg"); String TN = CommonLogic.QueryStringCanBeDangerousContent("topic"); AppLogic.CheckForScriptTag(TN); Topic t = new Topic(TN, ThisCustomer.LocaleSetting, SkinID, base.GetParser); if (t.Contents.Length == 0) { PageTopic.Text = "<img src=\"images/spacer.gif\" border=\"0\" height=\"100\" width=\"1\"><br/>\n"; PageTopic.Text += "<p align=\"center\"><font class=\"big\"><b>This page is currently empty. Please check back again for an update.</b></font></p>"; } else { PageTopic.Text = "<!-- READ FROM " + CommonLogic.IIF(t.FromDB, "DB", "FILE") + ": " + " -->"; PageTopic.Text += t.Contents.Replace("%AFFILIATEID%", AffiliateID.ToString()); PageTopic.Text += "<!-- END OF " + CommonLogic.IIF(t.FromDB, "DB", "FILE") + ": " + " -->"; } }
private void InitializePageContent() { checkoutheadergraphic.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_5.gif"); for (int i = 0; i < checkoutheadergraphic.HotSpots.Count; i++) { var rhs = checkoutheadergraphic.HotSpots[i] as RectangleHotSpot; if (rhs.NavigateUrl.IndexOf("shoppingcart") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.2", SkinID, ThisCustomer.LocaleSetting); } if (rhs.NavigateUrl.IndexOf("account") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.3", SkinID, ThisCustomer.LocaleSetting); } if (rhs.NavigateUrl.IndexOf("checkoutshipping") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.4", SkinID, ThisCustomer.LocaleSetting); } if (rhs.NavigateUrl.IndexOf("checkoutpayment") != -1) { rhs.AlternateText = AppLogic.GetString("checkoutreview.aspx.5", SkinID, ThisCustomer.LocaleSetting); } } if (!AppLogic.AppConfigBool("SkipShippingOnCheckout")) { checkoutheadergraphic.HotSpots[2].HotSpotMode = HotSpotMode.Navigate; if (AppLogic.AppConfigBool("Checkout.UseOnePageCheckout")) { checkoutheadergraphic.HotSpots[2].NavigateUrl = "checkout1.aspx"; } else { checkoutheadergraphic.HotSpots[2].NavigateUrl = CommonLogic.IIF(cart.HasMultipleShippingAddresses(), "checkoutshippingmult.aspx", "checkoutshipping.aspx"); } } if (AppLogic.AppConfigBool("Checkout.UseOnePageCheckout")) { checkoutheadergraphic.HotSpots[3].NavigateUrl = "checkout1.aspx"; } if (IsPayPalCheckout) { checkoutheadergraphic.HotSpots[1].HotSpotMode = HotSpotMode.Inactive; checkoutheadergraphic.HotSpots[2].NavigateUrl += string.Format("?PayPal={0}&token={1}", bool.TrueString, Request.QueryString["token"]); checkoutheadergraphic.HotSpots[3].HotSpotMode = HotSpotMode.Inactive; } String XmlPackageName = AppLogic.AppConfig("XmlPackage.CheckoutReviewPageHeader"); if (XmlPackageName.Length != 0) { XmlPackage_CheckoutReviewPageHeader.Text = "<br/>" + AppLogic.RunXmlPackage(XmlPackageName, base.GetParser, ThisCustomer, SkinID, String.Empty, null, true, true); } if (cart.HasMultipleShippingAddresses()) { var splittedCarts = cart.SplitIntoMultipleOrdersByDifferentShipToAddresses(); foreach (var splitCart in splittedCarts) { splitCart.BuildSalesOrderDetails(); CartSummary.Text += splitCart.RenderHTMLLiteral(new MobileCheckOutPaymentPageLiteralRenderer()); } litShippingAddress.Text = "<br/>Multiple Ship Addresses"; } else { //If the shopping cart contains only Electronic Downloads or Services then pass a "false" parameter for computeFreight. if (cart.IsNoShippingRequired()) { cart.BuildSalesOrderDetails(false, true); } else { cart.BuildSalesOrderDetails(); } Address shippingAddress = null; //added for PayPal ADDRESSOVERRIDE if (IsPayPalCheckout && !AppLogic.AppConfigBool("PayPalCheckout.OverrideAddress")) { if (!cart.HasShippableComponents()) { shippingAddress = ThisCustomer.PrimaryShippingAddress; } else { pp = new PayPalExpress(); var GetPayPalDetails = pp.GetExpressCheckoutDetails(Request.QueryString["token"]).GetExpressCheckoutDetailsResponseDetails; var GetShippingAddress = new Address(); GetShippingAddress.Name = GetPayPalDetails.PayerInfo.Address.Name; GetShippingAddress.Address1 = GetPayPalDetails.PayerInfo.Address.Street1 + (GetPayPalDetails.PayerInfo.Address.Street2 != String.Empty ? Environment.NewLine : String.Empty) + GetPayPalDetails.PayerInfo.Address.Street2; GetShippingAddress.City = GetPayPalDetails.PayerInfo.Address.CityName; GetShippingAddress.State = GetPayPalDetails.PayerInfo.Address.StateOrProvince; GetShippingAddress.PostalCode = GetPayPalDetails.PayerInfo.Address.PostalCode; GetShippingAddress.Country = AppLogic.ResolvePayPalAddressCode(GetPayPalDetails.PayerInfo.Address.CountryName.ToString()); GetShippingAddress.CountryISOCode = AppLogic.ResolvePayPalAddressCode(GetPayPalDetails.PayerInfo.Address.Country.ToString()); GetShippingAddress.Phone = GetPayPalDetails.PayerInfo.ContactPhone; shippingAddress = GetShippingAddress; } } else { if (cart.OnlyShippingAddressIsNotCustomerDefault()) { shippingAddress = Address.Get(ThisCustomer, AddressTypes.Shipping, cart.FirstItem().m_ShippingAddressID); } else { shippingAddress = ThisCustomer.PrimaryShippingAddress; } } litShippingAddress.Text = shippingAddress.DisplayString(true, true, true, "<br/>"); CartSummary.Text = cart.RenderHTMLLiteral(new MobileCheckOutPaymentPageLiteralRenderer()); } if (AppLogic.AppConfigBool("ShowEditAddressLinkOnCheckOutReview")) { pnlEditBillingAddress.Visible = true; pnlEditShippingAddress.Visible = true; //removed image arrow in mobile //imgBillingRedArrow.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/redarrow.gif"); //imgShippingRedArrow.ImageUrl = AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/redarrow.gif"); } litBillingAddress.Text = ThisCustomer.PrimaryBillingAddress.DisplayString(true, true, true, "<br/>"); if (IsPayPalCheckout) { litPaymentMethod.Text = "PayPal Express Checkout"; } else { litPaymentMethod.Text = GetPaymentMethod(ThisCustomer.PrimaryBillingAddress); } string XmlPackageName2 = AppLogic.AppConfig("XmlPackage.CheckoutReviewPageFooter"); if (XmlPackageName2.Length != 0) { XmlPackage_CheckoutReviewPageFooter.Text = "<br/>" + AppLogic.RunXmlPackage(XmlPackageName2, base.GetParser, ThisCustomer, SkinID, String.Empty, null, true, true); } //mobile button AppLogic.GetButtonDisable(btnContinueCheckout1.TheButton); CheckoutReviewPageHeader.SetContext = this; CheckoutReviewPageFooter.SetContext = this; }
protected void Page_Load(object sender, System.EventArgs e) { SetCustomerSkinID(); SkinImagePath = "skins/skin_" + SkinID.ToString() + "/images/"; this.RequireCustomerRecord(); RequireSecurePage(); SectionTitle = AppLogic.GetString("AppConfig.CartPrompt", SkinID, ThisCustomer.LocaleSetting); ClearErrors(); if (!this.IsPostBack) { string returnurl = CommonLogic.QueryStringCanBeDangerousContent("ReturnUrl"); if (returnurl.IndexOf("<script>", StringComparison.InvariantCultureIgnoreCase) != -1) { throw new ArgumentException("SECURITY EXCEPTION"); } ViewState["returnurl"] = returnurl; InitializePageContent(); } //for optimization string[] formkeys = Request.Form.AllKeys; if (formkeys.Any(k => k.Contains("bt_Delete"))) { ProcessCart(false); ProcessDelete(); RenderOrderOptions(); } InitializePageContent(); //foreach (string s in formkeys) //{ // if (s != "bt_Delete") { continue; } // ProcessCart(false); // InitializePageContent(); //} //Check if alternate checkout methods are supported (PayPal and GoogleCheckout) if (AppLogic.IsSupportedAlternateCheckout) { //note false just to disable the section //modified for mobile design AlternativeCheckouts.Visible = true; //Set the image url for the google button. if (AppLogic.AppConfigBool("GoogleCheckout.UseSandbox")) { //modified for mobile design btnGoogleCheckout.ImageUrl = string.Format(AppLogic.AppConfig("GoogleCheckout.SandBoxCheckoutButton"), AppLogic.AppConfig("GoogleCheckout.SandboxMerchantId")); } else { //modified for mobile design btnGoogleCheckout.ImageUrl = string.Format(AppLogic.AppConfig("GoogleCheckout.LiveCheckoutButton"), AppLogic.AppConfig("GoogleCheckout.MerchantId")); } //modified for mobile design bool hidePaypalOptionIfMultiShip = !(cart.HasMultipleShippingAddresses()); if (AppLogic.AppConfigBool("PayPalCheckout.ShowOnCartPage") && hidePaypalOptionIfMultiShip) { PayPalExpressSpan.Visible = true; } //modified for mobile design if (AppLogic.AppConfigBool("GoogleCheckout.ShowOnCartPage")) { GoogleCheckoutSpan.Visible = InterpriseShoppingCart.IsWebCheckOutIncluded("Google"); } //modified for mobile design if (cart != null && cart.IsShipSeparatelyCount() > 0) { GoogleCheckoutSpan.Visible = false; } } //modified for mobile design //if no alternative methods are visible, hide the whole row AlternativeCheckouts.Visible = (PayPalExpressSpan.Visible || GoogleCheckoutSpan.Visible); if (!AppLogic.IsSupportedAlternateCheckout && AlternativeCheckouts.Visible == true) { ErrorMsgLabel.Text = PayPalExpress.ErrorMsg; AlternativeCheckouts.Visible = false; } HeaderMsg.SetContext = this; CartPageFooterTopic.SetContext = this; }
protected override void RenderContents(System.Web.UI.HtmlTextWriter writer) { String CustomerID = ThisCustomer.CustomerCode; String OrderNumber = CommonLogic.QueryStringCanBeDangerousContent("OrderNumber", true); bool isvalid = false; decimal orderTotal = Decimal.Zero; decimal freightRate = Decimal.Zero; decimal freightTaxRate = Decimal.Zero; decimal taxRate = Decimal.Zero; //don't allow the customer any further if they dont own this order. foreach (string salesOrderToCheck in OrderNumber.Split(',')) { if (ThisCustomer.IsUnregisteredAnonymous || !ThisCustomer.OwnsThisOrder(salesOrderToCheck)) { Response.Redirect(SE.MakeDriverLink("ordernotfound")); } } //Assign anonymous id as customer id for report generation. if (!ThisCustomer.IsRegistered && OrderNumber != "") { ThisCustomer.EMail = ThisCustomer.GetAnonEmail(); ThisCustomer.CustomerCode = ThisCustomer.AnonymousCustomerCode; CustomerID = ThisCustomer.CustomerCode; } // ---------------------------------------------------------------------------------------- // WRITE OUT ANY HEADER CHECKOUT SEQUENCE GRAPHIC: // ---------------------------------------------------------------------------------------- writer.Write("<div align=\"center\">"); writer.Write("<img src=\"" + AppLogic.LocateImageURL("skins/skin_" + SkinID.ToString() + "/images/step_6.gif") + "\" width=\"550\" height=\"54\" border=\"0\" >\n"); writer.Write("</div>"); if (CustomerID != String.Empty && OrderNumber != String.Empty) { String multiOrderNumber = DB.SQuote(OrderNumber); multiOrderNumber = "(" + multiOrderNumber.Replace(",", "','") + ")"; bool hasFailedTransaction = false; hasFailedTransaction = DB.GetSqlN(string.Format("SELECT COUNT(*) AS N FROM CustomerSalesOrder with (NOLOCK) WHERE SalesOrderCode IN {0} AND IsVoided = 1", multiOrderNumber)) > 0; using (SqlConnection con = DB.NewSqlConnection()) { con.Open(); using (IDataReader rs = DB.GetRSFormat(con, "select SUM(TotalRate) AS TotalRate, SUM(FreightRate) AS FreightRate, SUM(TaxRate) AS TaxRate FROM CustomerSalesOrder with (NOLOCK) where BillToCode=" + DB.SQuote(CustomerID) + " and SalesOrderCode IN" + multiOrderNumber)) { if (rs.Read()) { orderTotal = rs.ToRSFieldDecimal("TotalRate"); freightRate = rs.ToRSFieldDecimal("FreightRate"); taxRate = rs.ToRSFieldDecimal("TaxRate"); isvalid = true; } } } if (isvalid) { String PM = AppLogic.CleanPaymentMethod(ThisCustomer.PaymentMethod); bool AlreadyConfirmed = false; String StoreName = AppLogic.AppConfig("StoreName"); bool UseLiveTransactions = AppLogic.AppConfigBool("UseLiveTransactions"); InterpriseShoppingCart cart = new InterpriseShoppingCart(base.EntityHelpers, SkinID, ThisCustomer, CartTypeEnum.ShoppingCart, String.Empty, false, true); bool multipleAttachment = false; if (multiOrderNumber.IndexOf(',') != -1) { multipleAttachment = true; } //Send mail. foreach (string salesOrderToEmail in OrderNumber.Split(',')) { if (ThisCustomer.PaymentTermCode.ToUpper() != "REQUEST QUOTE" && ThisCustomer.PaymentTermCode.ToUpper() != "PURCHASE ORDER") { AppLogic.SendOrderEMail(ThisCustomer, cart, salesOrderToEmail, false, PM, true, multipleAttachment); } else { //This will only send email to admin. AppLogic.SendOrderEMail(ThisCustomer, cart, salesOrderToEmail, false, PM, multipleAttachment); } } String XmlPackageName = AppLogic.AppConfig("XmlPackage.OrderConfirmationPage"); if (XmlPackageName.Length == 0) { XmlPackageName = "page.orderconfirmation.xml.config"; } if (XmlPackageName.Length != 0) { string[] salesOrderCodes = OrderNumber.Split(','); for (int ctr = 0; ctr < salesOrderCodes.Length; ctr++) { string salesOrderCode = salesOrderCodes[ctr]; List <XmlPackageParam> runtimeParams = new List <XmlPackageParam>(); if (ctr == 0) { runtimeParams.Add(new XmlPackageParam("IncludeHeader", true.ToString().ToLowerInvariant())); } else { runtimeParams.Add(new XmlPackageParam("IncludeHeader", false.ToString().ToLowerInvariant())); } string salesOrderStage = string.Empty; using (SqlConnection con = DB.NewSqlConnection()) { con.Open(); using (IDataReader rs = DB.GetRSFormat(con, "SELECT Stage from CustomerSalesOrderWorkFlowView where salesOrderCode=" + DB.SQuote(salesOrderCode))) { if (rs.Read()) { salesOrderStage = DB.RSField(rs, "Stage"); } } } runtimeParams.Add(new XmlPackageParam("OrderNumber", salesOrderCode)); runtimeParams.Add(new XmlPackageParam("SalesOrderStage", salesOrderStage)); if (ThisCustomer.PaymentTermCode.ToUpper() == "REQUEST QUOTE") { runtimeParams.Add(new XmlPackageParam("PaymentMethod", "REQUESTQUOTE")); } else if (ThisCustomer.PaymentTermCode.ToUpper() == "PURCHASE ORDER") { runtimeParams.Add(new XmlPackageParam("PaymentMethod", "PURCHASEORDER")); } else { runtimeParams.Add(new XmlPackageParam("PaymentMethod", ThisCustomer.PaymentMethod)); } runtimeParams.Add(new XmlPackageParam("Email", ThisCustomer.EMail)); if (ctr + 1 == salesOrderCodes.Length) { runtimeParams.Add(new XmlPackageParam("IncludeFooter", true.ToString().ToLowerInvariant())); runtimeParams.Add(new XmlPackageParam("WriteFailedTransaction", hasFailedTransaction.ToString().ToLowerInvariant())); } else { runtimeParams.Add(new XmlPackageParam("IncludeFooter", false.ToString().ToLowerInvariant())); } writer.Write(AppLogic.RunXmlPackage(XmlPackageName, base.GetParser, ThisCustomer, SkinID, String.Empty, runtimeParams, true, true)); } } #region Conversion if (!AlreadyConfirmed) { #region Google Analytics if (AppLogic.AppConfigBool("GoogleAnalytics.ConversionTracking")) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), DB.GetNewGUID(), AppLogic.GAEcommerceTracking(ThisCustomer), false); } // Google AdWords conversion trackng code (added 7-10-14) { writer.Write("<!-- Google Code for Sales Conversion Page --> <script type='text/javascript'> "); writer.Write("/* <![CDATA[ */ "); writer.Write("var google_conversion_id = 986485184; "); writer.Write("var google_conversion_language = 'en'; "); writer.Write("var google_conversion_format = '2'; "); writer.Write("var google_conversion_color = 'ffffff'; "); writer.Write("var google_conversion_label = 'u53nCIDh8woQwKOy1gM'; var google_conversion_value = 1.00; var google_remarketing_only = false; "); writer.Write("/* ]]> */ "); writer.Write("</script> "); writer.Write("<script type='text/javascript' "); writer.Write("src='//www.googleadservices.com/pagead/conversion.js'> "); writer.Write("</script> "); writer.Write("<noscript> "); writer.Write("<div style='display:inline;''> "); writer.Write("<img height='1' width='1' style='border-style:none;' alt='' "); writer.Write("src='//www.googleadservices.com/pagead/conversion/986485184/?value=1.00&label=u53nCIDh8woQwKOy1gM&guid=ON&script=0'/> "); writer.Write("</div> "); writer.Write("</noscript> "); } #endregion #region Buy Safe string buySafeSealHash = AppLogic.AppConfig("BuySafe.SealHash"); bool registerBuySafeScript = AppLogic.AppConfigBool("BuySafe.Enabled") && !buySafeSealHash.IsNullOrEmptyTrimmed() && !ThisCustomer.EMail.IsNullOrEmptyTrimmed(); if (registerBuySafeScript) { var buySAFEGuaranteed = new StringBuilder(); buySAFEGuaranteed.Append("<span id='BuySafeGuaranteeSpan'></span>"); buySAFEGuaranteed.Append("<script src='//seal.buysafe.com/private/rollover/rollover.js'></script>"); buySAFEGuaranteed.Append("<script type='text/javascript'>"); buySAFEGuaranteed.Append(" if(window.buySAFE && buySAFE.Loaded){ "); buySAFEGuaranteed.AppendFormat(" buySAFE.Hash = '{0}'; ", buySafeSealHash); buySAFEGuaranteed.AppendFormat(" buySAFE.Guarantee.order = '{0}'; ", OrderNumber); buySAFEGuaranteed.AppendFormat(" buySAFE.Guarantee.subtotal = {0}; ", orderTotal); buySAFEGuaranteed.AppendFormat(" buySAFE.Guarantee.email = '{0}'; ", ThisCustomer.EMail); buySAFEGuaranteed.Append(" WriteBuySafeGuarantee('JavaScript'); "); buySAFEGuaranteed.Append(" }"); buySAFEGuaranteed.Append("</script>"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), DB.GetNewGUID(), buySAFEGuaranteed.ToString(), false); } #endregion #region Bing Ads string bingAdsTrackingScript = AppLogic.GetBingAdsTrackingScript(AppLogic.BING_ADS_TYPE_CONVERSION, freightRate, taxRate, orderTotal); if (!bingAdsTrackingScript.IsNullOrEmptyTrimmed()) { ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), DB.GetNewGUID(), bingAdsTrackingScript, false); } #endregion } #endregion } else { writer.Write("<div align=\"center\">"); writer.Write("<br/><br/><br/><br/><br/>"); writer.Write(AppLogic.GetString("orderconfirmation.aspx.15", SkinID, ThisCustomer.LocaleSetting)); writer.Write("<br/><br/><br/><br/><br/>"); writer.Write("</div>"); } } else { writer.Write("<p><b>Error: Invalid Customer ID or Invalid Order Number</b></p>"); } if (!ThisCustomer.IsRegistered || AppLogic.AppConfigBool("ForceSignoutOnOrderCompletion")) { //Setting cookie values for anonymous receipts. We should look into a more secure way to do this, but for now //it's better than what we had. AppLogic.SetSessionCookie("ContactGUID", ThisCustomer.ContactGUID.ToString()); AppLogic.SetSessionCookie("OrderNumber", CommonLogic.QueryStringCanBeDangerousContent("OrderNumber", true)); if (AppLogic.AppConfigBool("SiteDisclaimerRequired")) { AppLogic.SetSessionCookie("SiteDisclaimerAccepted", String.Empty); } //V3_9 Kill the Authentication ticket. Session.Clear(); Session.Abandon(); ThisCustomer.ThisCustomerSession.Clear(); FormsAuthentication.SignOut(); } }
public void LoadSkinTemplate() { SkinID = 1; if (m_IGD.Length != 0) { m_TemplateName = "empty.ascx"; // force override for admin phone order pages } if (m_TemplateName.Length == 0) { m_TemplateName = "template.ascx"; } m_TemplateFN = string.Empty; if (m_TemplateName.Length != 0) { SkinID = CommonLogic.QueryStringUSInt("SkinID"); if (SkinID == 0 && CommonLogic.QueryStringCanBeDangerousContent("AffiliateID").Length != 0) { DataSet ds = DB.GetDS("Select DefaultSkinID from CustomerSalesRep with (NOLOCK) where SalesRepGroupCode=" + DB.SQuote(CommonLogic.QueryStringCanBeDangerousContent("AffiliateID")), AppLogic.CachingOn, System.DateTime.Now.AddMinutes(AppLogic.CacheDurationMinutes())); if (ds.Tables[0].Rows.Count > 0) { SkinID = DB.RowFieldInt(ds.Tables[0].Rows[0], "DefaultSkinID"); } ds.Dispose(); } if (SkinID == 0) { SkinID = m_DefaultSkinID; } if (SkinID == 0) { SkinID = CommonLogic.CookieUSInt(ro_SkinCookieName); } if (SkinID == 0) { SkinID = 1; } AppLogic.SetCookie(ro_SkinCookieName, SkinID.ToString(), new TimeSpan(365, 0, 0, 0, 0)); m_ThisCustomer.SkinID = SkinID; string LocaleTemplateURLCacheName = string.Format("template_{0}_{1}_{1}", m_TemplateName, SkinID.ToString(), ThisCustomer.LocaleSetting); string WebLocaleTemplateURLCacheName = string.Format("template_{0}_{1}_{1}", m_TemplateName, SkinID.ToString(), Localization.WebConfigLocale); string TemplateURLCacheName = string.Format("template_{0}_{1}_{1}", m_TemplateName, SkinID.ToString(), ""); // try customer locale: string webLocale = Localization.WebConfigLocale; string localeSetting = ThisCustomer.LocaleSetting; DateTime mins = System.DateTime.Now.AddMinutes(AppLogic.CacheDurationMinutes()); string _url = Path.Combine(SkinRoot, m_TemplateName.Replace(".ascx", "." + localeSetting + ".ascx")); m_TemplateFN = CommonLogic.SafeMapPath(_url); if (!CommonLogic.FileExists(m_TemplateFN)) { // try default store locale path: _url = Path.Combine(SkinRoot, m_TemplateName.Replace(".ascx", "." + webLocale + ".ascx")); m_TemplateFN = CommonLogic.SafeMapPath(_url); } if (!CommonLogic.FileExists(m_TemplateFN)) { _url = Path.Combine(SkinRoot, m_TemplateName); m_TemplateFN = CommonLogic.SafeMapPath(_url); } if (AppLogic.CachingOn) { HttpContext.Current.Cache.Insert(TemplateURLCacheName, _url, null, mins, TimeSpan.Zero); } if (_url != null && _url != string.Empty && !CommonLogic.FileExists(_url)) { SkinID = 1; AppLogic.SetCookie(ro_SkinCookieName, SkinID.ToString(), new TimeSpan(365, 0, 0, 0, 0)); m_ThisCustomer.SkinID = SkinID; // try customer locale: _url = Path.Combine(SkinRoot, m_TemplateName.Replace(".ascx", "." + localeSetting + ".ascx")); m_TemplateFN = _url.ToMapPath(); if (!CommonLogic.FileExists(m_TemplateFN)) { // try default store locale path: _url = Path.Combine(SkinRoot, m_TemplateName.Replace(".ascx", "." + webLocale + ".ascx")); m_TemplateFN = _url.ToMapPath(); } if (!CommonLogic.FileExists(m_TemplateFN)) { // try base (NULL) locale path: _url = Path.Combine(SkinRoot, m_TemplateName); m_TemplateFN = _url.ToMapPath(); } if (AppLogic.CachingOn) { HttpContext.Current.Cache.Insert(TemplateURLCacheName, _url, null, mins, TimeSpan.Zero); } } try { m_Template = (TemplateBase)LoadControl(_url); } catch { } // if defined template not FOUND... } if (m_Template != null) { m_Template.AppRelativeTemplateSourceDirectory = "~/"; // move it from skins/skin_N to root relative, so all links/image refs are from root of site } }
/// <summary> /// Takes command string and parameters and returns the result string of the command. /// </summary> protected string DispatchCommand(string command, Hashtable parameters) { string result = "(!" + command + "!)"; command = command.ToLowerInvariant().Replace("username", "user_name"); XSLTExtensions ExtObj = new XSLTExtensions(m_ThisCustomer, m_SkinID); switch (command) { case "obfuscatedemail": { String EMail = CommonLogic.HashtableParam(parameters, "email"); //No longer supported. Just return the email address. result = EMail; break; } case "remoteurl": // (!RemoteUrl URL=""!) { String URL = CommonLogic.HashtableParam(parameters, "url"); if (URL.Length != 0) { result = ExtObj.RemoteUrl(URL); } break; } case "pagingcontrol": { // (!PagingControl BaseURL="" PageNum="N" NumPages="M"!) String BaseURL = CommonLogic.HashtableParam(parameters, "baseurl"); // optional, will use existing QUERY_STRING if not provided int PageNum = CommonLogic.HashtableParamUSInt(parameters, "pagenum"); // optional, can get from QUERY_STRING if not provided int NumPages = CommonLogic.HashtableParamUSInt(parameters, "numpages"); // required result = ExtObj.PagingControl(BaseURL, PageNum.ToString(), NumPages.ToString()); break; } case "skinid": { // (!SKINID!) result = SkinID.ToString(); break; } case "customerid": { // (!CUSTOMERID!) if (ThisCustomer != null) { result = ThisCustomer.CustomerID.ToString(); } else { result = String.Empty; } break; } case "user_name": { result = ExtObj.User_Name(); break; } case "user_menu_name": { result = ExtObj.User_Menu_Name(); break; } case "store_version": { // (!STORE_VERSION!) result = String.Empty; break; } case "manufacturerlink": { // (!ManufacturerLink ManufacturerID="N" SEName="xxx" IncludeATag="true/false" InnerText="Some Text"!) int ManufacturerID = CommonLogic.HashtableParamUSInt(parameters, "manufacturerid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.ManufacturerLink(ManufacturerID.ToString(), SEName, IncludeATag.ToString()); break; } case "categorylink": { // (!CategoryLink CategoryID="N" SEName="xxx" IncludeATag="true/false"!) int CategoryID = CommonLogic.HashtableParamUSInt(parameters, "categoryid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.CategoryLink(CategoryID.ToString(), SEName, IncludeATag.ToString()); break; } case "sectionlink": { // (!SectionLink SectionID="N" SEName="xxx" IncludeATag="true/false"!) int SectionID = CommonLogic.HashtableParamUSInt(parameters, "sectionid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.SectionLink(SectionID.ToString(), SEName, IncludeATag.ToString()); break; } case "librarylink": { // (!LibraryLink LibraryID="N" SEName="xxx" IncludeATag="true/false"!) int LibraryID = CommonLogic.HashtableParamUSInt(parameters, "libraryid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.LibraryLink(LibraryID.ToString(), SEName, IncludeATag.ToString()); break; } case "productlink": { // (!ProductLink ProductID="N" SEName="xxx" IncludeATag="true/false"!) int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.ProductLink(ProductID.ToString(), SEName, IncludeATag.ToString()); break; } case "upsellproducts": { // (!UpsellProducts ProductID="N"!) int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); result = ExtObj.ShowUpsellProducts(ProductID.ToString()); break; } case "relatedproducts": { // (!RelatedProducts ProductID="N"!) int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); result = ExtObj.RelatedProducts(ProductID.ToString()); break; } case "documentlink": { // (!DocumentLink DocumentID="N" SEName="xxx" IncludeATag="true/false"!) int DocumentID = CommonLogic.HashtableParamUSInt(parameters, "documentid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.DocumentLink(DocumentID.ToString(), SEName, IncludeATag.ToString()); break; } case "productandcategorylink": { // (!ProductAndCategoryLink ProductID="N" CategoryID="M" SEName="xxx" IncludeATag="true/false"!) int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); int CategoryID = CommonLogic.HashtableParamUSInt(parameters, "categoryid"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.ProductandCategoryLink(ProductID.ToString(), SEName, CategoryID.ToString(), IncludeATag.ToString()); break; } case "productandsectionlink": { // (!ProductAndSectionLink ProductID="N" SectionID="M" SEName="xxx" IncludeATag="true/false"!) int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); int SectionID = CommonLogic.HashtableParamUSInt(parameters, "sectionid"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.ProductandSectionLink(ProductID.ToString(), SEName, SectionID.ToString(), IncludeATag.ToString()); break; } case "productandmanufacturerlink": { // (!ProductAndManufacturerLink ProductID="N" ManufacturerID="M" SEName="xxx" IncludeATag="true/false"!) int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); int ManufacturerID = CommonLogic.HashtableParamUSInt(parameters, "manufacturerid"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.ProductandManufacturerLink(ProductID.ToString(), SEName, ManufacturerID.ToString(), IncludeATag.ToString()); break; } case "productpropername": { // (!ProductProperName ProductID="N" VariantID="M"!) int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); int VariantID = CommonLogic.HashtableParamUSInt(parameters, "variantid"); result = ExtObj.ProductProperName(ProductID.ToString(), VariantID.ToString()); break; } case "documentandlibrarylink": { // (!DocumentAndLibraryLink DocumentID="N" LibraryID="M" SEName="xxx" IncludeATag="true/false"!) int DocumentID = CommonLogic.HashtableParamUSInt(parameters, "documentid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); int LibraryID = CommonLogic.HashtableParamUSInt(parameters, "libraryid"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.DocumentandLibraryLink(DocumentID.ToString(), SEName, LibraryID.ToString(), IncludeATag.ToString()); break; } case "entitylink": { // (!EntityLink EntityID="N" EntityName="xxx" SEName="xxx" IncludeATag="true/false"!) int EntityID = CommonLogic.HashtableParamUSInt(parameters, "entityid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); String EntityName = CommonLogic.HashtableParam(parameters, "entityname"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.EntityLink(EntityID.ToString(), SEName, EntityName, IncludeATag.ToString()); break; } case "objectlink": { // (!ObjectLink ObjectID="N" ObjectName="xxx" SEName="xxx" IncludeATag="true/false"!) int ObjectID = CommonLogic.HashtableParamUSInt(parameters, "objectid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); String ObjectName = CommonLogic.HashtableParam(parameters, "objectname"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.ObjectLink(ObjectID.ToString(), SEName, ObjectName, IncludeATag.ToString()); break; } case "productandentitylink": { // (!ProductAndEntityLink ProductID="N" EntityID="M" EntityName="xxx" SEName="xxx" IncludeATag="true/false"!) int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); String SEName = CommonLogic.HashtableParam(parameters, "sename"); int EntityID = CommonLogic.HashtableParamUSInt(parameters, "entityid"); String EntityName = CommonLogic.HashtableParam(parameters, "entityname"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); String InnerText = CommonLogic.HashtableParam(parameters, "innertext"); result = ExtObj.ProductandEntityLink(ProductID.ToString(), SEName, EntityID.ToString(), EntityName, IncludeATag.ToString()); break; } case "topic": { // (!Topic TopicID="M"!) or (!Topic ID="M"!) or (!Topic Name="xxx"!) int TopicID = CommonLogic.HashtableParamUSInt(parameters, "id"); if (TopicID == 0) { TopicID = CommonLogic.HashtableParamUSInt(parameters, "topicid"); } String LS = Localization.GetDefaultLocale(); if (ThisCustomer != null) { LS = ThisCustomer.LocaleSetting; } if (TopicID != 0) { Topic t = new Topic(TopicID, LS, SkinID, null); result = t.Contents; } else { String TopicName = CommonLogic.HashtableParam(parameters, "name"); if (TopicName.Length != 0) { Topic t = new Topic(TopicName, LS, SkinID, null); result = t.Contents; } } break; } case "appconfig": { // (!AppConfig Name="xxx"!) String AppConfigName = CommonLogic.HashtableParam(parameters, "name"); result = ExtObj.AppConfig(AppConfigName); break; } case "stringresource": { // (!StringResource Name="xxx"!) String StringResourceName = CommonLogic.HashtableParam(parameters, "name"); result = ExtObj.StringResource(StringResourceName); break; } case "getstring": { // (!GetString Name="xxx"!) String StringResourceName = CommonLogic.HashtableParam(parameters, "name"); result = ExtObj.StringResource(StringResourceName); break; } case "loginoutprompt": { // (!LoginOutPrompt!) result = AppLogic.GetLoginBox(SkinID); break; } case "searchbox": { // (!SearchBox!) result = ExtObj.SearchBox(); break; } case "helpbox": { // (!HelpBox!) result = ExtObj.HelpBox(); break; } case "addtocartform": { int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); int VariantID = CommonLogic.HashtableParamUSInt(parameters, "variantid"); bool ColorChangeProductImage = CommonLogic.HashtableParamBool(parameters, "colorchangeproductimage"); result = ExtObj.AddtoCartForm(ProductID.ToString(), VariantID.ToString(), ColorChangeProductImage.ToString()); break; } case "lookupimage": { int ID = CommonLogic.HashtableParamUSInt(parameters, "id"); String EntityOrObjectName = CommonLogic.HashtableParam(parameters, "type"); String DesiredSize = CommonLogic.HashtableParam(parameters, "size"); bool IncludeATag = CommonLogic.HashtableParamBool(parameters, "includeatag"); result = ExtObj.LookupImage(ID.ToString(), EntityOrObjectName, DesiredSize, IncludeATag.ToString()); break; } case "productnavlinks": { int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); int CategoryID = CommonLogic.QueryStringUSInt("CategoryID"); // should really get them from parameters, NOT from the querystring, but whatever... int SectionID = CommonLogic.QueryStringUSInt("SectionID"); // should really get them from parameters, NOT from the querystring, but whatever... bool UseGraphics = CommonLogic.HashtableParamBool(parameters, "usegraphics"); result = ExtObj.ProductNavLinks(ProductID.ToString(), CategoryID.ToString(), SectionID.ToString(), UseGraphics.ToString()); break; } case "emailproducttofriend": { int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); int CategoryID = CommonLogic.HashtableParamUSInt(parameters, "categoryid"); result = ExtObj.EmailProductToFriend(ProductID.ToString(), CategoryID.ToString()); break; } case "productdescriptionfile": { int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); bool IncludeBRBefore = CommonLogic.HashtableParamBool(parameters, "includebrbefore"); result = ExtObj.ProductDescriptionFile(ProductID.ToString(), IncludeBRBefore.ToString()); break; } case "productspecs": { int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); bool IncludeBRBefore = CommonLogic.HashtableParamBool(parameters, "includebrbefore"); result = ExtObj.ProductSpecs(ProductID.ToString(), IncludeBRBefore.ToString()); break; } case "productratings": { int ProductID = CommonLogic.HashtableParamUSInt(parameters, "productid"); int CategoryID = CommonLogic.QueryStringUSInt("CategoryID"); // should really get them from parameters, NOT from the querystring, but whatever... int SectionID = CommonLogic.QueryStringUSInt("SectionID"); // should really get them from parameters, NOT from the querystring, but whatever... int ManufacturerID = CommonLogic.QueryStringUSInt("ManufacturerID"); // should really get them from parameters, NOT from the querystring, but whatever... bool IncludeBRBefore = CommonLogic.HashtableParamBool(parameters, "includebrbefore"); result = ExtObj.ProductRatings(ProductID.ToString(), CategoryID.ToString(), SectionID.ToString(), ManufacturerID.ToString(), IncludeBRBefore.ToString()); break; } case "formatcurrency": { decimal CurrencyValue = CommonLogic.HashtableParamNativeDecimal(parameters, "value"); String LocaleSetting = CommonLogic.HashtableParam(parameters, "localesetting"); result = ExtObj.FormatCurrency(CurrencyValue.ToString()); break; } case "getspecialsboxexpandedrandom": { int CategoryID = CommonLogic.HashtableParamUSInt(parameters, "categoryid"); bool ShowPics = CommonLogic.HashtableParamBool(parameters, "showpics"); bool IncludeFrame = CommonLogic.HashtableParamBool(parameters, "includeframe"); String Teaser = CommonLogic.HashtableParam(parameters, "teaser"); result = ExtObj.GetSpecialsBoxExpandedRandom(CategoryID.ToString(), ShowPics.ToString(), IncludeFrame.ToString(), Teaser); break; } case "getspecialsboxexpanded": { int CategoryID = CommonLogic.HashtableParamUSInt(parameters, "categoryid"); int ShowNum = CommonLogic.HashtableParamUSInt(parameters, "shownum"); bool ShowPics = CommonLogic.HashtableParamBool(parameters, "showpics"); bool IncludeFrame = CommonLogic.HashtableParamBool(parameters, "includeframe"); String Teaser = CommonLogic.HashtableParam(parameters, "teaser"); result = ExtObj.GetSpecialsBoxExpanded(CategoryID.ToString(), ShowNum.ToString(), ShowPics.ToString(), IncludeFrame.ToString(), Teaser); break; } case "getnewsboxexpanded": { bool ShowCopy = CommonLogic.HashtableParamBool(parameters, "showcopy"); int ShowNum = CommonLogic.HashtableParamUSInt(parameters, "shownum"); bool IncludeFrame = CommonLogic.HashtableParamBool(parameters, "includeframe"); String Teaser = CommonLogic.HashtableParam(parameters, "teaser"); result = ExtObj.GetNewsBoxExpanded(ShowCopy.ToString(), ShowNum.ToString(), IncludeFrame.ToString(), Teaser); break; } case "xmlpackage": { // (!XmlPackage Name="xxx" version="N"!) // version can only be 2 at this time, or blank String PackageName = CommonLogic.HashtableParam(parameters, "name"); String VersionID = CommonLogic.HashtableParam(parameters, "version"); // optional Hashtable userruntimeparams = parameters; userruntimeparams.Remove("name"); userruntimeparams.Remove("version"); string runtimeparams = String.Empty; foreach (DictionaryEntry de in userruntimeparams) { runtimeparams += de.Key.ToString() + "=" + de.Value.ToString() + "&"; } if (runtimeparams.Length > 0) { runtimeparams = runtimeparams.Substring(0, runtimeparams.Length - 1); } if (PackageName.Length != 0) { if (PackageName.EndsWith(".xslt", StringComparison.InvariantCultureIgnoreCase) && VersionID != "2") { throw new ArgumentException("Version 1 XmlPackages are no longer supported!"); } else { // WARNING YOU COULD CAUSE ENDLESS RECURSION HERE! if your XmlPackage refers to itself in some direct, or INDIRECT! way!! result = AppLogic.RunXmlPackage(PackageName, this, ThisCustomer, SkinID, String.Empty, runtimeparams, true, true); } } break; } } return(result); }
private void Render() { StringBuilder writer = new StringBuilder(); bool AllowShipToDifferentThanBillTo = AppLogic.AppConfigBool("AllowShipToDifferentThanBillTo") && !AppLogic.AppConfigBool("SkipShippingOnCheckout"); String TabImage = String.Empty; AddressTypes AddressType = AddressTypes.Unknown; String AddressTypeString = CommonLogic.QueryStringCanBeDangerousContent("AddressType"); AddressType = (AddressTypes)Enum.Parse(typeof(AddressTypes), AddressTypeString, true); if (AddressType == AddressTypes.Billing) { TabImage = AppLogic.LocateImageURL("~/App_Themes/Admin_Default/images/selectbillingaddress.gif"); } if (AddressType == AddressTypes.Shipping) { TabImage = AppLogic.LocateImageURL("~/App_Themes/Admin_Default/images/selectshippingaddress.gif"); } int OriginalRecurringOrderNumber = CommonLogic.QueryStringUSInt("OriginalRecurringOrderNumber"); string ReturnUrl = CommonLogic.QueryStringCanBeDangerousContent("ReturnUrl"); // ACCOUNT BOX: writer.Append("<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\" style=\"border-style: solid; border-width: 0px; border-color: #" + AppLogic.AppConfig("HeaderBGColor") + "\">\n"); writer.Append("<tr><td align=\"left\" valign=\"top\">\n"); writer.Append("<img src=\"skins/Skin_" + SkinID.ToString() + "/images/" + TabImage + "\" border=\"0\"><br/>"); writer.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"0\" border=\"0\" style=\"" + AppLogic.AppConfig("BoxFrameStyle") + "\">\n"); writer.Append("<tr><td align=\"left\" valign=\"top\">\n"); writer.Append("</td><tr><td>\n"); writer.Append("<table width=\"100%\" border=\"0\">"); writer.Append("<tr>"); Addresses custAddresses = new Addresses(); custAddresses.LoadCustomer(TargetCustomer.CustomerID); int pos = 0; foreach (Address adr in custAddresses) { writer.Append("<td align=\"left\" valign=\"top\">\n"); writer.Append(String.Format("<img style=\"cursor:hand;cursor:pointer;\" src=\"" + AppLogic.LocateImageURL("~/App_Themes/Admin_Default/images/usethisaddress.gif") + "\" onClick=\"self.location='" + AppLogic.AdminLinkUrl("cst_selectaddress_process.aspx") + "?CustomerID={0}&AddressType={1}&AddressID={2}&OriginalRecurringOrderNumber={3}&ReturnUrl={4}'\"><br/>", TargetCustomer.CustomerID, AddressType, adr.AddressID, OriginalRecurringOrderNumber, ReturnUrl)); writer.Append(adr.DisplayHTML(false)); if (adr.CardNumber.Length != 0) { writer.Append(adr.DisplayCardHTML()); } writer.Append(String.Format("<img style=\"cursor:hand;cursor:pointer;\" src=\"" + AppLogic.LocateImageURL("~/App_Themes/Admin_Default/images/edit2.gif") + "\" onClick=\"self.location='" + AppLogic.AdminLinkUrl("cst_editaddress.aspx") + "?CustomerID={0}&AddressType={1}&AddressID={2}&ReturnUrl={3}'\"><br/><br/>", TargetCustomer.CustomerID, AddressType, adr.AddressID, ReturnUrl)); writer.Append("</td>"); pos++; if ((pos % 2) == 0) { writer.Append("</tr><tr>"); } } writer.Append("</tr></table>"); writer.Append("</td></tr>"); writer.Append("<tr><td align=\"left\" valign=\"top\">\n"); // ADDRESS BOX: Address newAddress = new Address(); newAddress.AddressType = AddressType; String act = String.Format(AppLogic.AdminLinkUrl("cst_selectaddress_process.aspx") + "?CustomerID={0}&AddressType={1}&ReturnUrl={2}", TargetCustomer.CustomerID, AddressType, AppLogic.ReturnURLEncode(ReturnUrl)); if (OriginalRecurringOrderNumber != 0) { act += String.Format("OriginalRecurringOrderNumber={0}&", OriginalRecurringOrderNumber); } writer.Append("<form method=\"POST\" action=\"" + act + "\" name=\"SelectAddressForm\" id=\"SelectAddressForm\" onSubmit=\"return (validateForm(this))\">"); writer.Append(String.Format("<hr/><b>" + AppLogic.GetString("admin.cst_selectaddress.OrEnterNewAddress", SkinID, LocaleSetting) + "</b><hr/>", AddressType)); //Display the Address input form fields writer.Append(newAddress.InputHTML()); //Button to submit the form writer.Append("<p align=\"center\"><input type=\"submit\" value=\"" + AppLogic.GetString("admin.cst_selectaddress.AddNewAddress", SkinID, LocaleSetting) + "\" name=\"Continue\" class=\"normalButtons\"></p>"); writer.Append("</td></tr>\n"); writer.Append("</table>\n"); writer.Append("</form>"); writer.Append("</td></tr>\n"); writer.Append("</table>\n"); writer.Append("</td></tr>\n"); writer.Append("</table>\n"); ltContent.Text = writer.ToString(); }
protected void dlAddress_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.EditItem) { AddressControl ctrlAddress = e.Item.FindControl("ctrlAddress") as AddressControl; CreditCardPanel ctrlCreditCard = e.Item.FindControl("ctrlCreditCard") as CreditCardPanel; Echeck ctrlECheck = e.Item.FindControl("ctrlECheck") as Echeck; int addyID = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "AddressID")); PopulateAddressControlValues(ctrlAddress, ctrlCreditCard, ctrlECheck, e.Item.ItemIndex, addyID); if (CustomerCCRequired) { TableRow trCCInformation = e.Item.FindControl("trCCInformation") as TableRow; if (trCCInformation != null) { if (AddressMode == AddressTypes.Billing) { RadioButtonList rblPaymentMethodInfo = e.Item.FindControl("rblPaymentMethodInfo") as RadioButtonList; Panel pnlCCData = e.Item.FindControl("pnlCCData") as Panel; Panel pnlECData = e.Item.FindControl("pnlECData") as Panel; if (rblPaymentMethodInfo.SelectedValue.Equals(AppLogic.ro_PMCreditCard, StringComparison.InvariantCultureIgnoreCase)) { trCCInformation.Visible = true; rblPaymentMethodInfo.Items[0].Enabled = true; pnlCCData.Visible = true; } if (!ShowEcheck) { rblPaymentMethodInfo.Items.Remove(rblPaymentMethodInfo.Items[1]); } //Image for eCheck if (ShowEcheck && ctrlECheck != null) { ctrlECheck = e.Item.FindControl("ctrlECheck") as Echeck; ctrlECheck.ECheckBankABAImage1 = AppLogic.LocateImageURL(String.Format("~/App_Themes/skin_{0}/images/check_aba.gif", SkinID.ToString())); ctrlECheck.ECheckBankABAImage2 = AppLogic.LocateImageURL(String.Format("~/App_Themes/skin_{0}/images/check_aba.gif", SkinID.ToString())); ctrlECheck.ECheckBankAccountImage = AppLogic.LocateImageURL(String.Format("~/App_Themes/skin_{0}/images/check_account.gif", SkinID.ToString())); ctrlECheck.ECheckNoteLabel = string.Format(AppLogic.GetString("address.cs.48", SkinID, ThisCustomer.LocaleSetting), AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/check_micr.gif")); } //hide payment methods if storeccindb = false } else if (AddressMode == AddressTypes.Shipping) { trCCInformation.Visible = false; } } } } if (e.Item.ItemType == ListItemType.Footer) { LinkButton lbAddNewAddress = e.Item.FindControl("lbAddNewAddress") as LinkButton; ImageButton ibAddNewAddress = e.Item.FindControl("ibAddNewAddress") as ImageButton; if (lbAddNewAddress != null) { if (AddressMode == AddressTypes.Billing) { string billingText = AppLogic.GetString("address.cs.70", SkinID, ThisCustomer.LocaleSetting); lbAddNewAddress.Text = billingText; if (ibAddNewAddress != null) { ibAddNewAddress.ToolTip = billingText; ibAddNewAddress.AlternateText = billingText; } } else if (AddressMode == AddressTypes.Shipping) { string shippingText = AppLogic.GetString("address.cs.71", SkinID, ThisCustomer.LocaleSetting); lbAddNewAddress.Text = shippingText; if (ibAddNewAddress != null) { ibAddNewAddress.ToolTip = shippingText; ibAddNewAddress.AlternateText = shippingText; } } } } if ((e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)) { //Assign numbering for individual address (e.Item.FindControl("lblIndexOrder") as Label).Text = String.Format("{0}.", (e.Item.ItemIndex + 1).ToString()); int itemAddressID = Int32.Parse((e.Item.FindControl("hfAddressID") as HiddenField).Value); int primaryID = 0; ImageButton ibDelete = e.Item.FindControl("ibDelete") as ImageButton; ImageButton ibEdit = e.Item.FindControl("ibEdit") as ImageButton; DisableEditButtonsForAddressWithOpenOrder(ibDelete, ibEdit, itemAddressID); ImageButton ibMakePrimaryAddress = e.Item.FindControl("ibMakePrimary") as ImageButton; //Check if the address mode from the querystring to know what will be the primary address if (AddressMode == AddressTypes.Billing) { primaryID = AppLogic.GetPrimaryBillingAddressID(ThisCustomer.CustomerID); ibMakePrimaryAddress.ToolTip = AppLogic.GetString("account.aspx.87", SkinID, ThisCustomer.LocaleSetting); ibMakePrimaryAddress.ImageUrl = String.Format("~/App_Themes/Skin_{0}/images/icons/check_disabled.png", SkinID); } else if (AddressMode == AddressTypes.Shipping) { primaryID = AppLogic.GetPrimaryShippingAddressID(ThisCustomer.CustomerID); ibMakePrimaryAddress.ToolTip = AppLogic.GetString("account.aspx.88", SkinID, ThisCustomer.LocaleSetting); ibMakePrimaryAddress.ImageUrl = String.Format("~/App_Themes/Skin_{0}/images/icons/check_disabled.png", SkinID); } if (itemAddressID == primaryID) { Label AddressHTML = e.Item.FindControl("lblAddressHTML") as Label; //Display the last payment method used if (CustomerCCRequired && AddressMode == AddressTypes.Billing) { string paymentMethodDisplay = DisplayPaymentMethod(primaryID); if (!CommonLogic.IsStringNullOrEmpty(paymentMethodDisplay)) { AddressHTML.Text += paymentMethodDisplay; } } AddressHTML.Style["font-weight"] = "bold"; if (AddressMode == AddressTypes.Billing) { ibMakePrimaryAddress.ToolTip = AppLogic.GetString("account.aspx.89", SkinID, ThisCustomer.LocaleSetting); } else if (AddressMode == AddressTypes.Shipping) { ibMakePrimaryAddress.ToolTip = AppLogic.GetString("account.aspx.90", SkinID, ThisCustomer.LocaleSetting); } ibMakePrimaryAddress.ImageUrl = String.Format("~/App_Themes/Skin_{0}/images/icons/check_enabled.png", SkinID); } //shows the footer where you can click add dlAddress.ShowFooter = !tblNewAddress.Visible; } }
protected void Page_Load(object sender, System.EventArgs e) { Response.CacheControl = "private"; Response.Expires = 0; Response.AddHeader("pragma", "no-cache"); RequireSecurePage(); ReturnURL = CommonLogic.QueryStringCanBeDangerousContent("ReturnURL"); AppLogic.CheckForScriptTag(ReturnURL); AddressTypeString = CommonLogic.QueryStringCanBeDangerousContent("AddressType"); AppLogic.CheckForScriptTag(AddressTypeString); ThisCustomer.RequireCustomerRecord(); if (!Shipping.MultiShipEnabled()) { RequiresLogin(CommonLogic.GetThisPageName(false) + "?" + CommonLogic.ServerVariables("QUERY_STRING")); } SectionTitle = String.Format(AppLogic.GetString("selectaddress.aspx.1", SkinID, ThisCustomer.LocaleSetting), AddressTypeString); Checkout = CommonLogic.QueryStringBool("checkout"); if (DB.GetSqlN("select count(*) as N from Address with (NOLOCK) where CustomerID=" + ThisCustomer.CustomerID.ToString()) == 0) { pnlAddressListBottom.Visible = false; } if (CommonLogic.QueryStringCanBeDangerousContent("add").Equals("TRUE", StringComparison.InvariantCultureIgnoreCase)) { liAdd.Visible = false; } if (AddressTypeString.Length != 0) { AddressType = (AddressTypes)Enum.Parse(typeof(AddressTypes), AddressTypeString, true); } if (AddressType == AddressTypes.Unknown) { AddressType = AddressTypes.Shipping; AddressTypeString = "Shipping"; } if (AddressType == AddressTypes.Billing) { SectionTitle += " - " + AppLogic.GetString("order.cs.58", SkinID, ThisCustomer.LocaleSetting); } else { SectionTitle += " - " + AppLogic.GetString("order.cs.57", SkinID, ThisCustomer.LocaleSetting); } custAddresses = new Addresses(); custAddresses.LoadCustomer(ThisCustomer.CustomerID); if (AddressType == AddressTypes.Shipping) { ButtonImage = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/usethisshippingaddress.gif", ThisCustomer.LocaleSetting); } else { ButtonImage = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/usethisbillingaddress.gif", ThisCustomer.LocaleSetting); } PaymentMethodPrompt = "<b>" + AppLogic.GetString("selectaddress.aspx.8", SkinID, ThisCustomer.LocaleSetting) + "</b>"; if (!IsPostBack) { InitializePageContent(); } }
private void UpdatepageContent() { //set header graphic image and set the hotspot alternate text checkoutheadergraphic.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/step_3.gif"); ((RectangleHotSpot)checkoutheadergraphic.HotSpots[0]).AlternateText = AppLogic.GetString("checkoutshippingmult.aspx.3", SkinID, ThisCustomer.LocaleSetting); ((RectangleHotSpot)checkoutheadergraphic.HotSpots[1]).AlternateText = AppLogic.GetString("checkoutshippingmult.aspx.4", SkinID, ThisCustomer.LocaleSetting); if (CommonLogic.QueryStringNativeInt("ErrorMsg") > 0) { ErrorMessage e = new ErrorMessage(CommonLogic.QueryStringNativeInt("ErrorMsg")); ErrorMsgLabel.Text = "<p align=\"left\"><span class=\"errorLg\">" + Server.HtmlEncode(e.Message) + "</span></p>"; pnlErrorMsg.Visible = true; } else { pnlErrorMsg.Visible = false; } //write out header package is it exists String XmlPackageName = AppLogic.AppConfig("XmlPackage.CheckoutShippingMultPageHeader"); if (XmlPackageName.Length != 0) { XmlPackage_CheckoutShippingPageHeader.Text = AppLogic.RunXmlPackage(XmlPackageName, base.GetParser, ThisCustomer, SkinID, String.Empty, String.Empty, true, true); } // if (!cart.ShippingIsFree && cart.MoreNeededToReachFreeShipping != 0.0M) { GetFreeShipping.Text = "<div class=\"FreeShippingThresholdPrompt\">"; GetFreeShipping.Text += String.Format(AppLogic.GetString("checkoutshippingmult.aspx.2", SkinID, ThisCustomer.LocaleSetting), ThisCustomer.CurrencyString(cart.FreeShippingThreshold), CommonLogic.Capitalize(cart.FreeShippingMethod)); GetFreeShipping.Text += "<br/> "; GetFreeShipping.Text += "</div>"; pnlGetFreeShipping.Visible = true; } else { pnlGetFreeShipping.Visible = false; } checkoutshippingmultaspx16.Text = "<p><b>" + AppLogic.GetString("checkoutshippingmult.aspx.16", SkinID, ThisCustomer.LocaleSetting) + "</b></p>"; checkoutshippingmultaspx18.Text = "<p>" + String.Format(AppLogic.GetString("checkoutshippingmult.aspx.18", SkinID, ThisCustomer.LocaleSetting), "account.aspx?checkout=true", "checkoutshippingmult.aspx?setallprimary=true") + "</p>"; String XmlPackageName2 = AppLogic.AppConfig("XmlPackage.CheckoutShippingMultPageFooter"); if (XmlPackageName2.Length != 0) { XmlPackage_CheckoutShippingMultPageFooter.Text = AppLogic.RunXmlPackage(XmlPackageName2, base.GetParser, ThisCustomer, SkinID, String.Empty, String.Empty, true, true); } }
public Font GetFont(SkinID sID, LanguageID lID) { GameObject resouce = Resources.Load <GameObject>(string.Format(path, sID, lID)); return(resouce.GetComponent <GUIText>().font); }