protected void Page_Load(object sender, EventArgs e) { SectionTitle = "Wallet"; RequireSecurePage(); ThisCustomer.RequireCustomerRecord(); }
void AddressList_ItemCommand(object source, RepeaterCommandEventArgs e) { switch (e.CommandName) { case "edit": Response.Redirect(String.Format("editaddress.aspx?Checkout={0}&AddressType={1}&AddressID={2}&ReturnURL={3}", Checkout.ToString(), AddressType, e.CommandArgument, ReturnURL)); break; case "delete": DB.ExecuteSQL("exec aspdnsf_DeleteAddress " + e.CommandArgument + ", " + ThisCustomer.CustomerID.ToString()); InitializePageContent(); break; case "makeprimary": int AddressID = System.Int32.Parse(e.CommandArgument.ToString()); DB.ExecuteSQL("update customer set " + CommonLogic.IIF(AddressType == AddressTypes.Billing || AddressType == AddressTypes.Unknown, "BillingAddressID=", "ShippingAddressID=") + AddressID.ToString() + " where customerid = " + ThisCustomer.CustomerID.ToString()); // make sure cart is now updated to use this shipping address id, but not if multi-ship is enabled if (AddressType == AddressTypes.Shipping) { ThisCustomer.SetPrimaryShippingAddressForShoppingCart(ThisCustomer.PrimaryShippingAddressID, AddressID); } InitializePageContent(); break; } }
protected override void OnInit(EventArgs e) { base.OnInit(e); // Check for paypal _isFromPayPal = (CommonLogic.QueryStringCanBeDangerousContent("PayPal") == bool.TrueString && CommonLogic.QueryStringCanBeDangerousContent("token") != null); ctrlShippingMethod.ThisCustomer = ThisCustomer; if (ThisCustomer.IsInEditingMode()) { PageNoCache(); } else { SetCacheability(); } RequireSecurePage(); RequireCustomerRecord(); InitializeShoppingCart(); PerformPageAccessLogic(); CheckWhetherToRequireShipping(); DisplayCheckOutStepsImage(); InitializeShippingMethodCaptions(); InitializeShippingMethodControlValues(); DisplayOrderSummary(); ShowFreeshippingInfo(); AssignCheckOutButtonCaption(); RegisterPageScript(); }
protected void Page_Load(object sender, EventArgs e) { bool phoneCustomer = ((HttpContext.Current.Items["IsBeingImpersonated"] != null) && ((string)HttpContext.Current.Items["IsBeingImpersonated"] == "true")); if (phoneCustomer) { Response.Redirect("checkoutshipping.aspx"); } SectionTitle = AppLogic.GetString("smartcheckout.aspx.164", SkinID, Customer.Current.LocaleSetting); Response.CacheControl = "private"; Response.Expires = -1; Response.AddHeader("pragma", "no-cache"); RequireSecurePage(); ThisCustomer.RequireCustomerRecord(); if (!Page.IsPostBack) { ((SkinBase)Page).OPCShoppingCart.ValidProceedCheckout(); // will not come back from this if any issue. they are sent back to the cart page! } if (AppLogic.AppConfigBool("PayPal.Express.UseIntegratedCheckout")) { ltPayPalIntegratedCheckout.Text = AspDotNetStorefrontGateways.Processors.PayPalController.GetExpressCheckoutIntegratedScript(false); } }
private void InitializeShippingMethodCaptions() { if (!_cart.CartAllowsShippingMethodSelection) { return; } if (_cartHasCouponAndIncludesFreeShipping) { lblSelectShippingMethod.Text = AppLogic.GetString("checkoutshipping.aspx.5", ThisCustomer.SkinID, ThisCustomer.LocaleSetting); } else { if (ThisCustomer.IsRegistered && Shipping.MultiShipEnabled() && _cart.TotalQuantity() > 1 && !_isFromPayPal) { lblSelectShippingMethod.Text = String.Format(AppLogic.GetString("checkoutshipping.aspx.7", SkinID, ThisCustomer.LocaleSetting, true), "checkoutshippingmult.aspx"); if (ThisCustomer.IsInEditingMode()) { lblSelectShippingMethod.Attributes.Add("data-contentKey", "checkoutshipping.aspx.7"); lblSelectShippingMethod.Attributes.Add("data-contentValue", AppLogic.GetString("checkoutshipping.aspx.7", SkinID, ThisCustomer.LocaleSetting, true)); lblSelectShippingMethod.Attributes.Add("data-contentType", "string resource"); } } else { lblSelectShippingMethod.Text = AppLogic.GetString("checkout1.aspx.4", ThisCustomer.SkinID, ThisCustomer.LocaleSetting); } } }
/// <summary> /// Save Form Data /// </summary> protected void btnSave_Click(object sender, EventArgs e) { try { Address anyAddress = LoadClassData(); anyAddress.InsertDB(); int addressID = anyAddress.AddressID; if (ThisCustomer.PrimaryBillingAddressID == 0) { DB.ExecuteSQL("Update Customer set BillingAddressID=" + addressID + " where CustomerID=" + ThisCustomer.CustomerID.ToString()); } if (ThisCustomer.PrimaryShippingAddressID == 0) { DB.ExecuteSQL("Update Customer set ShippingAddressID=" + addressID + " where CustomerID=" + ThisCustomer.CustomerID.ToString()); ThisCustomer.SetPrimaryShippingAddressForShoppingCart(ThisCustomer.PrimaryShippingAddressID, addressID); } Response.Redirect(hfPreviousURL.Value, false); Context.ApplicationInstance.CompleteRequest(); } catch (Exception ex) { SysLog.LogMessage(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString() + " :: " + System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message + ((ex.InnerException != null && string.IsNullOrEmpty(ex.InnerException.Message)) ? " :: " + ex.InnerException.Message : ""), MessageTypeEnum.GeneralException, MessageSeverityEnum.Error); } }
protected void Page_Load(object sender, System.EventArgs e) { Response.CacheControl = "private"; Response.Expires = 0; Response.AddHeader("pragma", "no-cache"); String PM = AppLogic.CleanPaymentMethod(AppLogic.ro_PMPayPal); AppLogic.ValidatePM(PM); // this WILL throw a hard security exception on any problem! ThisCustomer.RequireCustomerRecord(); if (!ThisCustomer.IsRegistered && !AppLogic.AppConfigBool("PasswordIsOptionalDuringCheckout")) { Response.Redirect("createaccount.aspx?checkout=true"); } SectionTitle = AppLogic.GetString("paypalcancel.aspx.1", SkinID, ThisCustomer.LocaleSetting); int OrderNumber = CommonLogic.QueryStringUSInt("OrderNumber"); if (OrderNumber != 0 && AppLogic.AppConfigBool("PayPal.UseInstantNotification")) { if (!Order.OrderHasCleared(OrderNumber)) { } } Label1.Text = AppLogic.GetString("paypalcancel.aspx.2", SkinID, ThisCustomer.LocaleSetting); }
private void InitHeaderText() { string saveKey = String.Empty; var registryID = DomainConstants.GIFTREGISTRYPARAMCHAR.ToQueryStringDecode().TryParseGuid(); if (!registryID.HasValue) { litRegistryHeader.Text = AppLogic.GetString("editgiftregistry.aspx.1", SkinID, ThisCustomer.LocaleSetting); btnSave.Text = AppLogic.GetString("editgiftregistry.aspx.13", SkinID, ThisCustomer.LocaleSetting, true); saveKey = "editgiftregistry.aspx.13"; } else { litRegistryHeader.Text = AppLogic.GetString("editgiftregistry.aspx.2", SkinID, ThisCustomer.LocaleSetting); btnSave.Text = AppLogic.GetString("editgiftregistry.aspx.14", SkinID, ThisCustomer.LocaleSetting, true); saveKey = "editgiftregistry.aspx.14"; } btnShare.Text = AppLogic.GetString("editgiftregistry.aspx.18", SkinID, ThisCustomer.LocaleSetting, true); btnShowAllRegistry.Text = AppLogic.GetString("editgiftregistry.aspx.22", SkinID, ThisCustomer.LocaleSetting, true); if (ThisCustomer.IsInEditingMode()) { AppLogic.EnableButtonCaptionEditing(btnSave, saveKey); AppLogic.EnableButtonCaptionEditing(btnShare, "editgiftregistry.aspx.18"); AppLogic.EnableButtonCaptionEditing(btnShowAllRegistry, "editgiftregistry.aspx.22"); } }
private void LoadAddresses() { using (SqlConnection con = DB.NewSqlConnection()) { con.Open(); using (IDataReader reader = DB.GetRSFormat(con, string.Format("exec EcommerceGetAddressList @CustomerCode = {0}, @AddressType = {1}, @ContactCode = {2} ", DB.SQuote(ThisCustomer.CustomerCode), (int)AddressType, DB.SQuote(ThisCustomer.ContactCode)))) { AddressList.DataSource = reader; AddressList.DataBind(); reader.Close(); btnReturn.Text = AppLogic.GetString("account.aspx.25", SkinID, ThisCustomer.LocaleSetting, true); btnReturn.OnClientClick = "self.location='account.aspx?checkout=" + checkOutMode.ToString() + "';return false"; btnCheckOut.Visible = checkOutMode; btnCheckOut.Text = AppLogic.GetString("account.aspx.24", SkinID, ThisCustomer.LocaleSetting); string redirecTo = (checkOutMode && ReturnURL.IsNullOrEmpty()) ? "checkoutshipping.aspx" : ReturnURL; if (checkOutMode && AppLogic.AppConfigBool("Checkout.UseOnePageCheckout")) { redirecTo = "checkout1.aspx"; } btnCheckOut.OnClientClick = String.Format("self.location='{0}';return false;", redirecTo); if (ThisCustomer.IsInEditingMode()) { AppLogic.EnableButtonCaptionEditing(btnReturn, "account.aspx.25"); AppLogic.EnableButtonCaptionEditing(btnCheckOut, "account.aspx.24"); } } } }
protected override void OnInit(EventArgs e) { ctrlGiftRegistryShareForm.ThisCustomer = ThisCustomer; var giftRegistry = this.GiftRegistryFromQueryString; if (giftRegistry != null) { //block the access if registry is not owned by the current user if (!ThisCustomer.IsRegistryOwnedByCustomer(giftRegistry.RegistryID)) { Response.Redirect("giftregistry.aspx"); } ctrlGiftRegistryShareForm.LoadGiftRegistry(giftRegistry); string defaultMessage = string.Format(AppLogic.GetString("editgiftregistry.aspx.44", SkinID, ThisCustomer.LocaleSetting), giftRegistry.URLForViewing); ctrlGiftRegistryShareForm.HtmlMessage = defaultMessage; StartDate = giftRegistry.StartDate; EndDate = giftRegistry.EndDate; Title = giftRegistry.Title; CustomURL = giftRegistry.CustomURLPostfix; } else { //registry not found Response.Redirect("giftregistry.aspx"); } btnSend.Click += (sender, ex) => SendNow(); btnSend.Text = AppLogic.GetString("editgiftregistry.aspx.40", SkinID, ThisCustomer.LocaleSetting); }
private void ProcessViewProductWhoViewed() { int sessionLifetime = AppLogic.AppConfigUSInt("ViewedProductsSessionLifetime"); if (sessionLifetime == null) { sessionLifetime = 1; } if (!ThisCustomer.HasCustomerRecord) { ThisCustomer.RequireCustomerRecord(); } DateTime expirationdatetime = DateTime.Now.AddDays(-sessionLifetime); string updatevieweditems = string.Format("exec UpdateRecordsEcommerceViewedItems @ExpirationDate = {0}, @WebSiteCode = {1}, @ContactCode = {2}, @ItemCode = {3}, @CurrentDate = {4}, @SessionID = {5}", DB.SQuote(Localization.DateTimeStringForDB(expirationdatetime)), DB.SQuote(InterpriseHelper.ConfigInstance.WebSiteCode), DB.SQuote(ThisCustomer.ContactCode), DB.SQuote(_itemCode), DB.SQuote(Localization.DateTimeStringForDB(DateTime.Now)), ThisCustomer.CurrentSessionID); DB.ExecuteSQL(updatevieweditems); }
protected override void RenderContents(System.Web.UI.HtmlTextWriter writer) { String salesOrderCode = CommonLogic.QueryStringCanBeDangerousContent("so"); if (!ThisCustomer.OwnsThisOrder(salesOrderCode)) { Response.Redirect(SE.MakeDriverLink("ordernotfound")); } if (salesOrderCode == String.Empty) { writer.Write("<p>" + String.Format(AppLogic.GetString("reorder.aspx.2", SkinID, ThisCustomer.LocaleSetting), "account.aspx") + "</p>"); } String StatusMsg = String.Empty; if (InterpriseHelper.ReOrderToCart(salesOrderCode, ThisCustomer, base.EntityHelpers, ref StatusMsg)) { Response.Redirect(String.Format("shoppingcart.aspx{0}", StatusMsg)); } else { Response.Write("<p>There were some errors in trying to create the order.</p>"); Response.Write("<p>Error: " + StatusMsg + "</p>"); Response.Write("<p>" + String.Format(AppLogic.GetString("reorder.aspx.2", SkinID, ThisCustomer.LocaleSetting), "shoppingcart.aspx", AppLogic.GetString("AppConfig.CartPrompt", SkinID, ThisCustomer.LocaleSetting)) + "</p>"); } }
private void InitControlText() { btnCompletePurchase.Text = AppLogic.GetString("checkoutshippingmult.aspx.6", ThisCustomer.SkinID, ThisCustomer.LocaleSetting, true); if (ThisCustomer.IsInEditingMode()) { AppLogic.EnableButtonCaptionEditing(btnCompletePurchase, "checkoutshippingmult.aspx.6"); } }
protected override void OnInit(EventArgs e) { ctrlGiftRegistryForm.ThisCustomer = ThisCustomer; ctrlGiftRegistryItemList.ThisCustomer = ThisCustomer; ctrlGiftRegistryItemListOptions.ThisCustomer = ThisCustomer; string urlRegistryId = string.Empty; btnSave.Click += (sender, ex) => SaveRegistry(); btnShowAllRegistry.Click += (sender, ex) => Response.Redirect("~/giftregistry.aspx"); btnShare.Click += (sender, ex) => { urlRegistryId = DomainConstants.GIFTREGISTRYPARAMCHAR.ToQueryStringDecode(); Response.Redirect(string.Format("~/sharegiftregistry.aspx?{0}={1}", DomainConstants.GIFTREGISTRYPARAMCHAR, urlRegistryId)); }; ctrlGiftRegistryForm.CustomURL = ThisCustomer.GenerateRandomCustomURLForGiftRegistry(); urlRegistryId = DomainConstants.GIFTREGISTRYPARAMCHAR.ToQueryStringDecode(); if (!urlRegistryId.IsNullOrEmptyTrimmed()) { //check if invalid registryid if (urlRegistryId.TryParseGuid().HasValue) { var giftRegistry = GiftRegistryFromQueryString; //check if invalid registryid if (giftRegistry == null) { RedirectToEditRegistry(); } //check if viewer is owner of the registry if (!this.ThisCustomer.IsRegistryOwnedByCustomer(urlRegistryId.TryParseGuid().Value)) { RedirectToEditRegistry(); } //unable to share if registry is not active if (giftRegistry.IsActive) { btnShare.Visible = true; } ctrlGiftRegistryForm.RegistryID = giftRegistry.RegistryID; ctrlGiftRegistryForm.IsEditMode = true; UpdatePreview(); LoadRegistry(giftRegistry); } } InitHeaderText(); base.OnInit(e); }
public void btnUpdateAccount_Click(object sender, EventArgs e) { if (!this.IsValid) { return; } ThisCustomer.Update(); AccountUpdated = true; RefreshPage(); }
private void UpdateAnonForAge13() { if (ThisCustomer.IsRegistered) { return; } int isupdated = 1; string updateAnonRecordIfIsover13checked = string.Format("UPDATE EcommerceCustomer SET IsOver13 = 1, IsUpdated = {0} WHERE CustomerID = {1}", DB.SQuote(isupdated.ToString()), DB.SQuote(ThisCustomer.CustomerID.ToString())); DB.ExecuteSQL(updateAnonRecordIfIsover13checked); ThisCustomer.Update(); }
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() { 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"); } }
/// <summary> /// Checks if the inheriting page requires a script manager declared and creates the necessary scripts /// </summary> private void CheckIfRequireScriptManager() { if (!this.RequireScriptManager) { return; } HtmlForm frm = ThisForm; if (frm != null && frm.FindControl("ScriptManager") == null) { var pnlScriptManager = new Panel { ID = "pnlScriptManager" }; var manager = new ScriptManager { ID = "ScriptManager", EnablePartialRendering = this.EnablePartialRendering, EnableScriptGlobalization = this.EnableScriptGlobalization, LoadScriptsBeforeUI = false, ScriptMode = ScriptMode.Release }; if (CurrentContext.IsRequestingFromMobileMode(ThisCustomer)) { manager.Scripts.Add(new ScriptReference("~/mobile/js/base_ajax.js")); manager.Scripts.Add(new ScriptReference("~/mobile/js/system/config-loader.js")); } else { manager.Scripts.Add(new ScriptReference("~/jscripts/base_ajax.js")); manager.Scripts.Add(new ScriptReference("~/jscripts/system/config-loader.js")); //load here the tiny mce when editing mode for the topic //since it cannot be loaded using getscript of jquery if (ThisCustomer.IsInEditingMode() && Security.IsAdminCurrentlyLoggedIn()) { manager.Scripts.Add(new ScriptReference("~/jscripts/tiny_mce/tiny_mce.js")); } } frm.Controls.AddAt(0, manager); // allow page to register scripts and web services RegisterScriptsAndServices(manager); } }
/// <summary> /// Select Primary Address /// </summary> /// <param name="addressID">addressID</param> private void SelectPrimaryAddress(int addressID) { int addressType = GetAddressType(Request.QueryString["AddressType"]); if (addressType == (int)AddressTypes.Billing) { ThisCustomer.UpdateCustomer(new SqlParameter[] { new SqlParameter("BillingAddressID", addressID) }); } else if (addressType == (int)AddressTypes.Shipping) { ThisCustomer.UpdateCustomer(new SqlParameter[] { new SqlParameter("ShippingAddressID", addressID) }); } LoadAddresses(addressType); }
protected void InitPageContent() { SectionTitle = AppLogic.GetString("contactus.aspx.1", ThisCustomer.SkinID, ThisCustomer.LocaleSetting, true); btnSendMessage.Text = AppLogic.GetString("contactus.aspx.11", ThisCustomer.SkinID, ThisCustomer.LocaleSetting, true); if (!AppLogic.AppConfigBool("SecurityCodeRequiredOnContactUs")) { pnlSecurityCode.Visible = false; } if (ThisCustomer.IsInEditingMode()) { AppLogic.EnableButtonCaptionEditing(btnSendMessage, "contactus.aspx.11"); } ContactUsFormHelpFulTipsTopic.SetContext = this; }
private void InitAuthentication() { var giftRegistry = this.GiftRegistryFromQueryString; if (giftRegistry != null) { bool registryOwnedByCustomer = ThisCustomer.IsRegistryOwnedByCustomer(giftRegistry.RegistryID); if (registryOwnedByCustomer) { LoadRegistry(giftRegistry); pnlMain.Visible = true; pnlPassword.Visible = false; return; } if ((giftRegistry.IsPrivate && !giftRegistry.GuestPassword.IsNullOrEmptyTrimmed())) { string viewedRegID = this.ThisCustomer.ThisCustomerSession["ViewedRegistryID"]; if (!viewedRegID.IsNullOrEmptyTrimmed() && viewedRegID == giftRegistry.RegistryID.ToString()) { LoadRegistry(giftRegistry); pnlMain.Visible = true; pnlPassword.Visible = false; return; } else { pnlMain.Visible = false; pnlPassword.Visible = true; } } else { pnlMain.Visible = true; pnlPassword.Visible = false; LoadRegistry(giftRegistry); } } else { Response.Redirect(CurrentContext.FullyQualifiedApplicationPath()); } }
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"); }
public void btnUpdateAccount_Click(object sender, EventArgs e) { if (!this.IsValid) { return; } ThisCustomer.EMail = ctrlBillingAddress.Email; ThisCustomer.Password = ctrlBillingAddress.Password; ThisCustomer.FirstName = ctrlBillingAddress.FirstName; ThisCustomer.LastName = ctrlBillingAddress.LastName; ThisCustomer.Phone = ctrlBillingAddress.PhoneNumber; ThisCustomer.IsOver13 = ctrlBillingAddress.Over13Checked; ThisCustomer.IsOKToEMail = ctrlBillingAddress.OkToEmailChecked; ThisCustomer.Salutation = ctrlBillingAddress.Salutation; ThisCustomer.Update(); AccountUpdated = true; RefreshPage(); }
private void AssignCheckOutButtonCaption() { string contentKey = String.Empty; if (_cartHasCouponAndIncludesFreeShipping) { btnCompletePurchase.Text = AppLogic.GetString("checkoutshipping.aspx.8", ThisCustomer.SkinID, ThisCustomer.LocaleSetting, true); contentKey = "checkoutshipping.aspx.8"; } else { btnCompletePurchase.Text = AppLogic.GetString("checkoutshipping.aspx.6", ThisCustomer.SkinID, ThisCustomer.LocaleSetting, true); contentKey = "checkoutshipping.aspx.6"; } if (ThisCustomer.IsInEditingMode()) { AppLogic.EnableButtonCaptionEditing(btnCompletePurchase, contentKey); } }
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); } }
private void UpdatePreview() { string giftRegistryviewerRoot = CurrentContext.FullyQualifiedApplicationPath() + "viewregistry.aspx?" + DomainConstants.GIFTREGISTRYPARAMCHAR + "="; ctrlGiftRegistryForm.PrimaryURLText = giftRegistryviewerRoot; string customURL = GiftRegistryDA.GetCustomURLByRegistryID(ctrlGiftRegistryForm.RegistryID.Value); ctrlGiftRegistryForm.LinkPreview.Visible = true; ctrlGiftRegistryForm.LinkPreview.HRef = giftRegistryviewerRoot + customURL; ctrlGiftRegistryForm.LinkPreview.InnerText = AppLogic.GetString("editgiftregistry.aspx.16", ThisCustomer.SkinID, ThisCustomer.LocaleSetting, true); if (ThisCustomer.IsInEditingMode()) { ctrlGiftRegistryForm.LinkPreview.Attributes.Add("data-contentKey", "editgiftregistry.aspx.16"); ctrlGiftRegistryForm.LinkPreview.Attributes.Add("data-contentValue", AppLogic.GetString("editgiftregistry.aspx.16", ThisCustomer.SkinID, ThisCustomer.LocaleSetting, true)); ctrlGiftRegistryForm.LinkPreview.Attributes.Add("data-contentType", "string resource"); } ctrlGiftRegistryForm.CustomURL = customURL; }
private void HandleKitUpdate() { ThisCustomer.RequireCustomerRecord(); AppLogic.ProcessKitForm(ThisCustomer, ProductID); if (CommonLogic.FormUSInt("CartRecID") > 0) { switch (ShoppingCart.CartTypeFromRecID(CommonLogic.FormUSInt("CartRecID"))) { case CartTypeEnum.GiftRegistryCart: Response.Redirect(ResolveClientUrl("~/giftregistry.aspx")); break; case CartTypeEnum.ShoppingCart: Response.Redirect(ResolveClientUrl("~/shoppingcart.aspx")); break; case CartTypeEnum.WishCart: Response.Redirect(ResolveClientUrl("~/wishlist.aspx")); break; } } }
/// <summary> /// Performs the necessary action for this control per postback /// </summary> /// <param name="selectedValue"></param> protected override void DoPostbackRoutine(string selectedValue) { ThisCustomer.RequireCustomerRecord(); ThisCustomer.LocaleSetting = selectedValue; String CurrencySetting = AppLogic.GetLocaleDefaultCurrency(selectedValue); if (CommonLogic.IsStringNullOrEmpty(CurrencySetting)) { CurrencySetting = CommonLogic.QueryStringCanBeDangerousContent("Currency"); } if (CommonLogic.IsStringNullOrEmpty(CurrencySetting)) { CurrencySetting = Localization.GetPrimaryCurrency(); } AppLogic.CheckForScriptTag(CurrencySetting); CurrencySetting = Localization.CheckCurrencySettingForProperCase(CurrencySetting); ThisCustomer.CurrencySetting = CurrencySetting; RefreshPage(); }
protected void Page_Load(object sender, System.EventArgs e) { Response.CacheControl = "private"; Response.Expires = 0; Response.AddHeader("pragma", "no-cache"); RequireSecurePage(); Checkout = CommonLogic.QueryStringBool("checkout"); AddressTypes ats = DetermineAddressType(CommonLogic.QueryStringCanBeDangerousContent("AddressType").ToLowerInvariant()); String AddressTypeString = ats.ToString(); AddressID = CommonLogic.QueryStringUSInt("AddressID"); theAddress.LoadFromDB(AddressID); Prompt = CommonLogic.QueryStringCanBeDangerousContent("Prompt"); if (CommonLogic.QueryStringCanBeDangerousContent("RETURNURL") != "") { ViewState["RETURNURL"] = CommonLogic.QueryStringCanBeDangerousContent("RETURNURL"); } if (!ThisCustomer.OwnsThisAddress(AddressID)) { Response.Redirect("default.aspx"); } AppLogic.CheckForScriptTag(AddressTypeString); SectionTitle = "<a href=\"selectaddress.aspx?checkout=" + Checkout.ToString() + "&AddressType=" + AddressTypeString + "\">" + String.Format(AppLogic.GetString("selectaddress.aspx.1", SkinID, ThisCustomer.LocaleSetting), AddressTypeString) + "</a> → "; SectionTitle += AppLogic.GetString("editaddress.aspx.1", SkinID, ThisCustomer.LocaleSetting); AddressType = DetermineAddressType(AddressTypeString); CanDelete = (0 == DB.GetSqlN(String.Format("select count(0) as N from ShoppingCart with (NOLOCK) where (ShippingAddressID={0} or BillingAddressID={0}) and CartType={1}", AddressID, (int)CartTypeEnum.RecurringCart))); if (!IsPostBack) { InitializePageContent(); } }