Пример #1
0
        private void PassEnquiryToCrm()
        {
            Store store = AbleContext.Current.Store;
            StoreSettingsManager settings = store.Settings;

            Order order = new Order();

            order.BillToEmail     = StringHelper.StripHtml(Email.Text);
            order.BillToFirstName = StringHelper.StripHtml(FirstName.Text);
            order.BillToLastName  = StringHelper.StripHtml(LastName.Text);
            order.BillToPhone     = StringHelper.StripHtml(Phone.Text);
            order.BillToCompany   = StringHelper.StripHtml(Company.Text);
            order.OrderDate       = DateTime.Now;

            // The list of files that have been uploaded are included in the HiddenFilesField.
            var files = (List <FileAttachment>)Session["UPLOADED"];

            if (files == null)
            {
                files = new List <FileAttachment>();
            }

            CrmHelper.SaveEnquiry(order, StringHelper.StripHtml(Comments.Text), files, store);


            FailureMessage.Visible   = false;
            SuccessMessage.Visible   = true;
            MessagePanel.Visible     = true;
            ContactFormPanel.Visible = false;
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _settings    = AbleContext.Current.Store.Settings;
            _appSettings = ApplicationSettings.Instance;
            if (!Page.IsPostBack)
            {
                if (_appSettings.GoogleFeedInterval > 0)
                {
                    EnableFeed.Checked = true;
                }
                TimeInterval.Text = _appSettings.GoogleFeedInterval.ToString();
                if (_settings.GoogleFeedIncludeAllProducts)
                {
                    AllProducts.Checked    = true;
                    MarkedProducts.Checked = false;
                }
                else
                {
                    AllProducts.Checked    = false;
                    MarkedProducts.Checked = true;
                }
                DefaultBrand.Text    = _settings.GoogleFeedDefaultBrand;
                DefaultCategory.Text = _settings.GoogleFeedDefaultCategory;
                string storeUrl = AbleContext.Current.Store.StoreUrl;
                if (!storeUrl.EndsWith("/"))
                {
                    storeUrl += "/";
                }
                FeedURL.Text = storeUrl + "Feeds/GoogleFeedData.txt";
            }

            RegisterJs();
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _ProductId = AbleCommerce.Code.PageHelper.GetProductId();
            _Product   = ProductDataSource.Load(_ProductId);
            _settings  = AbleContext.Current.Store.Settings;
            _user      = AbleContext.Current.User;
            if (_Product != null)
            {
                ProductName.Text = _Product.Name;

                CategoryBreadCrumbs1.Visible = DisplayBreadCrumbs;

                //if (_Product.Manufacturer != null)
                //{
                //    Manufacturer manufacturer = _Product.Manufacturer;
                //    ManufacturerDetails.Controls.Add(new LiteralControl("Other products by "));
                //    ManufacturerDetails.Controls.Add(new LiteralControl(string.Format("<a href='{0}?m={1}' itemprop='manufacturer'>{2}</a><br />", Page.ResolveUrl("~/Search.aspx"), manufacturer.Id, manufacturer.Name)));
                //}

                // update moreitems tab text with category name
                int      categoryId = PageHelper.GetCategoryId();
                Category category   = CategoryDataSource.Load(categoryId);
                if (category != null)
                {
                    MoreItemsTabText.Text = string.Format(MoreItemsTabText.Text, category.Name);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _CategoryCount = CategoryDataSource.CountAll();
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;
            bool displayCategorySearch    = settings.CategorySearchDisplayLimit > 0 && _CategoryCount >= settings.CategorySearchDisplayLimit;


            if (!Page.IsPostBack && !displayCategorySearch)
            {
                InitializeCategoryTree();
                SelectCategoryLabel.Visible = true;
                EnterCategoryLabel.Visible  = false;
            }
            else if (displayCategorySearch)
            {
                // DISPLAY AUTO COMPLETE FOR CATEGORY SEARCH OPTION
                string js = PageHelper.GetAutoCompleteScript(Page.ResolveClientUrl("~/CategorySuggest.ashx"), CategoryAutoComplete, HiddenSelectedCategoryId, "Key", "Value");

                ScriptManager.RegisterStartupScript(SearchAjax, this.GetType(), "CATEGORY_SUGGEST", js, true);
                CategoryAutoComplete.Visible = true;
                CategoryList.Visible         = false;
                SelectCategoryLabel.Visible  = false;
                EnterCategoryLabel.Visible   = true;
            }
            AbleCommerce.Code.PageHelper.SetDefaultButton(Keywords, SearchButton.ClientID);
            AbleCommerce.Code.PageHelper.SetDefaultButton(LowPrice, SearchButton.ClientID);
            AbleCommerce.Code.PageHelper.SetDefaultButton(HighPrice, SearchButton.ClientID);

            int minLength = AbleContext.Current.Store.Settings.MinimumSearchLength;

            KeywordValidator.MinimumLength = minLength;
            KeywordValidator.ErrorMessage  = String.Format(KeywordValidator.ErrorMessage, minLength);
        }
Пример #5
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            AbleCommerce.Code.PageHelper.SetDefaultButton(AddAffiliateName, AddAffiliateButton.ClientID);
            AddAffiliateName.Focus();

            if (!Page.IsPostBack)
            {
                Store store = AbleContext.Current.Store;
                StoreSettingsManager settings = store.Settings;

                AffiliateParameter.Text = settings.AffiliateParameterName;
                TrackerUrl.Text         = settings.AffiliateTrackerUrl;

                // ENSURE THE CORRECT SETTING FORM ELEMENTS ARE DISPLAYED
                SelfSignup.Checked = settings.AffiliateAllowSelfSignup;
                ListItem itemAffiliatePersistence = AffiliatePersistence.Items.FindByValue(((byte)settings.AffiliatePersistence).ToString());
                if (itemAffiliatePersistence != null)
                {
                    AffiliatePersistence.SelectedIndex = AffiliatePersistence.Items.IndexOf(itemAffiliatePersistence);
                }
                ReferralPeriod.Text = settings.AffiliateReferralPeriod.ToString();
                CommissionRate.Text = settings.AffiliateCommissionRate.ToString();
                if (!settings.AffiliateCommissionIsPercent)
                {
                    CommissionType.SelectedIndex = 0;
                }
                else
                {
                    CommissionType.SelectedIndex = (settings.AffiliateCommissionOnTotal ? 2 : 1);
                }
                SelfSignup_CheckedChanged(sender, e);

                AffiliateReferralRule.SelectedIndex = (int)settings.AffiliateReferralRule;
            }
        }
Пример #6
0
        private void BindLayouts()
        {
            _Layouts = LayoutDataSource.LoadAll();

            LayoutsGrid.DataBind();

            // INIT DEFAULTS
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;

            WebpagesDefault.DataSource = _Layouts;
            WebpagesDefault.DataBind();
            if (!string.IsNullOrEmpty(settings.WebpagesDefaultLayout))
            {
                SelectItem(WebpagesDefault, settings.WebpagesDefaultLayout);
            }

            CategoriesDefault.DataSource = _Layouts;
            CategoriesDefault.DataBind();
            if (!string.IsNullOrEmpty(settings.CategoriesDefaultLayout))
            {
                SelectItem(CategoriesDefault, settings.CategoriesDefaultLayout);
            }

            ProductsDefault.DataSource = _Layouts;
            ProductsDefault.DataBind();
            if (!string.IsNullOrEmpty(settings.ProductsDefaultLayout))
            {
                SelectItem(ProductsDefault, settings.ProductsDefaultLayout);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int categoryCount             = CategoryDataSource.CountAll();
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;

            _DisplayCategorySearch = settings.CategorySearchDisplayLimit > 0 && categoryCount >= settings.CategorySearchDisplayLimit;

            if (!Page.IsPostBack)
            {
                InitializeCategoryTree();
                LoadSearchFilter();
            }

            if (_DisplayCategorySearch)
            {
                // DISPLAY AUTO COMPLETE FOR CATEGORY SEARCH OPTION
                string js = PageHelper.GetAutoCompleteScript("../../CategorySuggest.ashx", CategoryAutoComplete, HiddenSelectedCategoryId, "Key", "Value");
                js += PageHelper.GetAutoCompleteScript("../../CategorySuggest.ashx", NewProductCategory, HiddenNewProductCategoryId, "Key", "Value");

                ScriptManager.RegisterStartupScript(PageAjax, this.GetType(), "CATEGORY_SUGGEST", js, true);
                CategoryAutoComplete.Visible = true;
                CategoriesList.Visible       = false;

                CategoryDropDown.Visible   = false;
                NewProductCategory.Visible = true;
            }
        }
Пример #8
0
        protected void ForexProvider_SelectedIndexChanged(object sender, EventArgs e)
        {
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;

            settings.ForexProviderClassId = ForexProvider.SelectedValue;
            settings.Save();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _ProductId = AlwaysConvert.ToInt(Request.QueryString["ProductId"]);
            _Product   = ProductDataSource.Load(_ProductId);
            if (_Product == null)
            {
                Response.Redirect(AbleCommerce.Code.NavigationHelper.GetAdminUrl("Catalog/Browse.aspx"));
            }
            Caption.Text     = string.Format(Caption.Text, _Product.Name);
            ProductName.Text = _Product.Name;
            ValidFiles.Text  = AbleContext.Current.Store.Settings.FileExt_Assets;
            if (string.IsNullOrEmpty(ValidFiles.Text))
            {
                ValidFiles.Text = "any";
            }
            trSku.Visible = !string.IsNullOrEmpty(_Product.Sku);
            if (trSku.Visible)
            {
                Sku.Text = _Product.Sku;
            }
            if (!Page.IsPostBack)
            {
                StoreSettingsManager settings = AbleContext.Current.Store.Settings;
                CustomWidth.Text  = settings.StandardImageWidth.ToString();
                CustomHeight.Text = settings.StandardImageHeight.ToString();
            }

            FileDataMaxSize.Text = String.Format(FileDataMaxSize.Text, AbleContext.Current.Store.Settings.MaxRequestLength);
        }
Пример #10
0
 protected void SaveButton_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         // UPDATE THE SETTINGS
         StoreSettingsManager settings = AbleContext.Current.Store.Settings;
         settings.AffiliateParameterName   = StringHelper.Truncate(AffiliateParameter.Text.Trim(), 200);
         settings.AffiliateTrackerUrl      = StringHelper.Truncate(TrackerUrl.Text.Trim(), 200);
         settings.AffiliateAllowSelfSignup = SelfSignup.Checked;
         settings.AffiliateReferralRule    = AlwaysConvert.ToEnum <ReferralRule>(AffiliateReferralRule.SelectedValue, ReferralRule.NewSignupsOnly);
         settings.AffiliatePersistence     = ((AffiliateReferralPeriod)AlwaysConvert.ToByte(AffiliatePersistence.SelectedValue));
         AffiliateReferralPeriod referralPeriod = ((AffiliateReferralPeriod)AlwaysConvert.ToByte(AffiliatePersistence.SelectedValue));
         if ((referralPeriod != AffiliateReferralPeriod.Persistent && referralPeriod != AffiliateReferralPeriod.FirstOrder))
         {
             settings.AffiliateReferralPeriod = AlwaysConvert.ToInt16(ReferralPeriod.Text);
         }
         else
         {
             settings.AffiliateReferralPeriod = 0;
         }
         settings.AffiliateCommissionRate      = AlwaysConvert.ToDecimal(CommissionRate.Text);
         settings.AffiliateCommissionIsPercent = (CommissionType.SelectedIndex > 0);
         settings.AffiliateCommissionOnTotal   = (CommissionType.SelectedIndex == 2);
         settings.Save();
         AffiliateSettingsMessage.Text    = string.Format(AffiliateSettingsMessage.Text, LocaleHelper.LocalNow);
         AffiliateSettingsMessage.Visible = true;
     }
 }
Пример #11
0
        private void SaveSettings()
        {
            if (Page.IsValid)
            {
                StoreSettingsManager settings = AbleContext.Current.Store.Settings;

                settings.StoreFrontClosed        = (StoreClosureType)AlwaysConvert.ToInt(StoreClosedOptions.SelectedValue);
                settings.StoreFrontClosedMessage = StoreClosedMessage.Text;

                //USER MAINTENANCE
                settings.AnonymousUserLifespan          = AlwaysConvert.ToInt(AnonymousLifespan.Text);
                settings.AnonymousAffiliateUserLifespan = AlwaysConvert.ToInt(AnonymousAffiliateLifespan.Text);
                settings.GiftCertificateDaysToExpire    = AlwaysConvert.ToInt(GiftCertExpireDays.Text);

                // SEACH TERMS HISTORY
                settings.UserSearchHistoryTrackingDays = AlwaysConvert.ToInt(SearchHistoryDays.Text);

                // DATA EXCHANGE
                settings.MaxNumOfExportFiles   = AlwaysConvert.ToInt(MaxNumOfExportFiles.Text);
                settings.MaxAgeOfExportFiles   = AlwaysConvert.ToInt(MaxAgeOfExportFiles.Text);
                settings.MaxSizeOfExportFolder = AlwaysConvert.ToInt(MaxSizeOfExportFolder.Text);
                settings.MaxNumOfImportFiles   = AlwaysConvert.ToInt(MaxNumOfImportFiles.Text);
                settings.MaxAgeOfImportFiles   = AlwaysConvert.ToInt(MaxAgeOfImportFiles.Text);
                settings.MaxSizeOfImportFolder = AlwaysConvert.ToInt(MaxSizeOfImportFolder.Text);

                // Subscriptions
                settings.RORetainExpiredSubscriptionDays = AlwaysConvert.ToInt(RetainExpiredSubscriptionDays.Text);

                settings.Save();
            }
        }
Пример #12
0
        private void SendContactUsEmail()
        {
            Store store = AbleContext.Current.Store;
            StoreSettingsManager settings = store.Settings;

            MailMessage mailMessage = new MailMessage();

            if (string.IsNullOrEmpty(SendTo))
            {
                mailMessage.To.Add(settings.DefaultEmailAddress);
            }
            else
            {
                mailMessage.To.Add(SendTo);
            }

            mailMessage.From    = new System.Net.Mail.MailAddress(Email.Text);
            mailMessage.Subject = this.Subject;
            mailMessage.Body   += "Name: " + FirstName.Text + " " + LastName.Text + Environment.NewLine;
            if (!String.IsNullOrEmpty(Company.Text))
            {
                mailMessage.Body += "Company: " + Company.Text + Environment.NewLine;
            }
            mailMessage.Body += "Email: " + Email.Text + Environment.NewLine;
            mailMessage.Body += "Phone: " + Phone.Text + Environment.NewLine;
            mailMessage.Body += "Comment: " + Environment.NewLine + Comments.Text;

            //Add attachments
            List <string> fileAttachments = (List <string>)Session["UPLOADED"];

            if (fileAttachments != null)
            {
                foreach (var attachment in fileAttachments)
                {
                    mailMessage.Attachments.Add(new Attachment(attachment));
                }
            }

            mailMessage.BodyEncoding = System.Text.Encoding.UTF8;
            mailMessage.IsBodyHtml   = false;
            mailMessage.Priority     = System.Net.Mail.MailPriority.High;
            SmtpSettings smtpSettings = SmtpSettings.DefaultSettings;

            try
            {
                EmailClient.Send(mailMessage);

                FailureMessage.Visible = false;
                SuccessMessage.Visible = true;
            }
            catch (Exception exp)
            {
                Logger.Error("ContactUs Control Exception: Exp" + Environment.NewLine + exp.Message);
                FailureMessage.Visible = true;
                SuccessMessage.Visible = false;
            }

            MessagePanel.Visible = true;
            FAQFormPanel.Visible = false;
        }
Пример #13
0
        protected void IntializeCustomExtensionsPanel()
        {
            double iisVersion = HttpContextHelper.GetIISVersion(Request.ServerVariables["SERVER_SOFTWARE"]);

            if (iisVersion == 0 || iisVersion >= 7.0d)
            {
                if (IsIntegratedPipelineMode())
                {
                    if (IsHandleAllRequestsConfigured())
                    {
                        StoreSettingsManager settings = AbleContext.Current.Store.Settings;
                        phCustomExtensionsConfigured.Visible = true;
                        AllowCustomExtensions.Checked        = settings.SeoAllowCustomExtensions;
                        AllowedExtensions.Text = settings.SeoAllowedExtensions;
                        CustomExtensionsPanel.Style["display"]       = AllowCustomExtensions.Checked ? "block" : "none";
                        AllowUrlWithoutExtensions.Checked            = settings.SeoAllowUrlWithoutExtension;
                        RemoveWebConfigurationPanel.Style["display"] = AllowCustomExtensions.Checked ? "none" : "block";
                    }
                    else
                    {
                        phCustomExtensionsUnconfigured.Visible = true;
                    }
                }
                else
                {
                    DisableCustomExtensions("Custom extensions can only be supported when Integrated Pipeline mode is used. We detected that your application is using Classic ASP.NET mode. You will need to update your IIS application settings in order to take advantage of this feature.");
                }
            }
            else
            {
                DisableCustomExtensions("Custom extensions can only be supported on IIS 7.0 or higher. We detected version IIS " + iisVersion.ToString() + ", so this feature is not available. You may only create redirects with the aspx extension.");
            }
        }
Пример #14
0
        protected void Page_Init(object sender, EventArgs e)
        {
            if (Product != null)
            {
                List <CommerceBuilder.Products.ProductImage> images = (from i in Product.Images select i).ToList <CommerceBuilder.Products.ProductImage>();
                if (images.Count > 0 && !string.IsNullOrEmpty(Product.ImageUrl))
                {
                    images.Insert(0, new CommerceBuilder.Products.ProductImage()
                    {
                        ImageUrl = Product.ImageUrl, ImageAltText = Product.ImageAltText
                    });
                }

                if (images == null || images.Count == 0)
                {
                    phAdditionalImages.Visible = false;
                }
                else
                {
                    //InstructionTextLabel.Visible = images.Count > 0;
                    //if (!string.IsNullOrEmpty(ThumbnailClickInstructionText))
                    //    InstructionTextLabel.Text = ThumbnailClickInstructionText;
                    MoreImagesList.DataSource = images;
                    MoreImagesList.DataBind();
                }
            }

            _settings = AbleContext.Current.Store.Settings;
        }
Пример #15
0
        private void ValidateOrderMinMaxAmounts()
        {
            // IF THE ORDER AMOUNT DOES NOT FALL IN VALID RANGE SPECIFIED BY THE MERCHENT
            OrderItemType[] args = new OrderItemType[] { OrderItemType.Charge,
                                                         OrderItemType.Coupon, OrderItemType.Credit, OrderItemType.Discount,
                                                         OrderItemType.GiftCertificate, OrderItemType.GiftWrap, OrderItemType.Handling,
                                                         OrderItemType.Product, OrderItemType.Shipping, OrderItemType.Tax };
            decimal orderTotal            = AbleContext.Current.User.Basket.Items.TotalPrice(args);
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;
            decimal minOrderAmount        = settings.OrderMinimumAmount;
            decimal maxOrderAmount        = settings.OrderMaximumAmount;

            if ((minOrderAmount > orderTotal) || (maxOrderAmount > 0 && maxOrderAmount < orderTotal))
            {
                CheckoutButton.Enabled = false;
                OrderBelowMinimumAmountMessage.Visible = (minOrderAmount > orderTotal);
                if (OrderBelowMinimumAmountMessage.Visible)
                {
                    OrderBelowMinimumAmountMessage.Text = string.Format(OrderBelowMinimumAmountMessage.Text, minOrderAmount.LSCurrencyFormat("ulc"));
                }
                OrderAboveMaximumAmountMessage.Visible = !OrderBelowMinimumAmountMessage.Visible;
                if (OrderAboveMaximumAmountMessage.Visible)
                {
                    OrderAboveMaximumAmountMessage.Text = string.Format(OrderAboveMaximumAmountMessage.Text, maxOrderAmount.LSCurrencyFormat("ulc"));
                }
            }
            else
            {
                CheckoutButton.Enabled = true;
                OrderAboveMaximumAmountMessage.Visible = false;
                OrderBelowMinimumAmountMessage.Visible = false;
            }
        }
        public void InitializeForm()
        {
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;

            if (settings.ProductReviewEnabled != UserAuthFilter.None)
            {
                if ((settings.ProductReviewEnabled == UserAuthFilter.Registered) && (AbleContext.Current.User.IsAnonymous))
                {
                    RegisterPanel.Visible = true;
                    ReviewPanel.Visible   = false;
                }
                else
                {
                    //THE REVIEW FORM WILL BE ENABLED
                    User user = AbleContext.Current.User;
                    //CHECK TO SEE IF WE CAN PREPOPULATE THE FORM
                    ReviewerProfile profile = user.ReviewerProfile;
                    if (profile != null)
                    {
                        //EMAIL ADDRESS IS ONLY VISIBLE FOR ANONYMOUS USERS
                        trEmailAddress1.Visible = (user.IsAnonymous || String.IsNullOrEmpty(GetUserEmail()));
                        trEmailAddress2.Visible = (user.IsAnonymous || String.IsNullOrEmpty(GetUserEmail()));
                        Email.Text    = profile.Email;
                        Name.Text     = profile.DisplayName;
                        Location.Text = profile.Location;
                        //CHECK FOR EXISTING REVIEW
                        if (_ProductReview == null)
                        {
                            _ProductReview = ProductReviewDataSource.LoadForProductAndReviewerProfile(_ProductId, profile.Id);
                        }
                        if (_ProductReview != null)
                        {
                            //EXISTING REVIEW FOUND, INITIALIZE FORM VALUES
                            //(THESE VALUES MAY BE OVERRIDEN BY FORM POST)
                            ListItem item = Rating.Items.FindByValue(_ProductReview.Rating.ToString("F0"));
                            if (item != null)
                            {
                                Rating.SelectedIndex = (Rating.Items.IndexOf(item));
                            }
                            ReviewTitle.Text = _ProductReview.ReviewTitle;
                            ReviewBody.Text  = _ProductReview.ReviewBody;
                        }
                    }
                    else if (!user.IsAnonymous)
                    {
                        trEmailAddress1.Visible = String.IsNullOrEmpty(GetUserEmail());
                        trEmailAddress2.Visible = String.IsNullOrEmpty(GetUserEmail());
                        Name.Text     = user.PrimaryAddress.FirstName;
                        Location.Text = user.PrimaryAddress.City;
                    }
                }
            }
            else
            {
                this.Controls.Clear();
            }
            this.FormInitialized = true;
        }
        protected void Page_Init(object sender, EventArgs e)
        {
            _IconPath = AbleCommerce.Code.PageHelper.GetAdminThemeIconPath(this.Page);

            int categoryCount             = CategoryDataSource.CountAll();
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;

            _DisplayCategorySearch = settings.CategorySearchDisplayLimit > 0 && categoryCount >= settings.CategorySearchDisplayLimit;
        }
        protected void Page_Init(object sender, EventArgs e)
        {
            //INITIALIZE VARIABLES
            _CategoryId = AbleCommerce.Code.PageHelper.GetCategoryId();
            _Category   = CategoryDataSource.Load(_CategoryId);
            _ProductId  = AlwaysConvert.ToInt(Request.QueryString["ProductId"]);
            _Product    = ProductDataSource.Load(_ProductId);
            if (_Product == null)
            {
                Response.Redirect(AbleCommerce.Code.NavigationHelper.GetAdminUrl("Catalog/Browse.aspx?CategoryId=" + _CategoryId.ToString()));
            }
            _KitComponentId = AlwaysConvert.ToInt(Request.QueryString["KitComponentId"]);
            _KitComponent   = KitComponentDataSource.Load(_KitComponentId);
            if (_KitComponent == null)
            {
                Response.Redirect("EditKit.aspx?CategoryId=" + _CategoryId.ToString() + "&ProductId=" + _ProductId.ToString());
            }
            CancelLink.NavigateUrl += "?CategoryId=" + _CategoryId.ToString() + "&ProductId=" + _ProductId.ToString();
            Caption.Text            = string.Format(Caption.Text, _KitComponent.Name);
            InstructionText.Text    = string.Format(InstructionText.Text, _KitComponent.Name, _Product.Name);

            int categoryCount             = CategoryDataSource.CountAll();
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;

            _DisplayCategorySearch = settings.CategorySearchDisplayLimit > 0 && categoryCount >= settings.CategorySearchDisplayLimit;

            // INITIALIZE DROP DOWN LISTS
            if (!_DisplayCategorySearch)
            {
                InitializeCategoryTree();
            }
            else
            {
                // DISPLAY AUTO COMPLETE FOR CATEGORY SEARCH OPTION
                string js = PageHelper.GetAutoCompleteScript(Page.ResolveClientUrl("~/CategorySuggest.ashx"), CategoryAutoComplete, HiddenSelectedCategoryId, "Key", "Value");

                ScriptManager.RegisterStartupScript(PageAjax, this.GetType(), "CATEGORY_SUGGEST", js, true);
                CategoryAutoComplete.Visible = true;
                CategoryFilter.Visible       = false;
            }
            ManufacturerFilter.DataSource = ManufacturerDataSource.LoadAll("Name");
            ManufacturerFilter.DataBind();
            VendorFilter.DataSource = VendorDataSource.LoadAll("Name");
            VendorFilter.DataBind();

            // LOAD CUSTOM VIEWSTATE VARIABLES
            LoadCustomViewState();
            if (_SelectedProducts.Count > 0)
            {
                // REBIND THE REPEATER
                BindSelectedProducts(_SelectedProducts);
            }

            AbleCommerce.Code.PageHelper.SetDefaultButton(NameFilter, SearchButton.ClientID);
            AbleCommerce.Code.PageHelper.SetDefaultButton(SkuFilter, SearchButton.ClientID);
        }
Пример #19
0
        protected bool IsSmtpServerConfigured()
        {
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;

            if (!String.IsNullOrEmpty(settings.SmtpServer) && !String.IsNullOrEmpty(settings.SmtpPort))
            {
                return(true);
            }
            return(false);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _settings = AbleContext.Current.Store.Settings;
            if (string.IsNullOrEmpty(_settings.CheckoutTermsAndConditions))
            {
                Response.Redirect(NavigationHelper.GetMobileStoreUrl("~/Default.aspx"));
            }

            PHContents.Controls.Add(new LiteralControl(_settings.CheckoutTermsAndConditions));
        }
Пример #21
0
        protected void UpdateAdminThemesButton_Click(object sender, EventArgs e)
        {
            // SAVE SETTINGS AND REDIRECT IF REQUIRED
            Store store = AbleContext.Current.Store;
            StoreSettingsManager settings = store.Settings;

            settings.AdminTheme = AdminTheme.SelectedValue;
            settings.Save();
            Response.Redirect("~/Admin/Website/Themes/Default.aspx");
        }
Пример #22
0
        private string GetFromAddress()
        {
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;
            string fromAddress            = settings.DefaultEmailAddress;

            if (string.IsNullOrEmpty(fromAddress))
            {
                fromAddress = "*****@*****.**";
            }
            return(fromAddress);
        }
        protected void Page_Init(object sender, EventArgs e)
        {
            _settings = AbleContext.Current.Store.Settings;

            if (AbleContext.Current.User.Basket.Items.Count == 0)
            {
                Response.Redirect(AbleCommerce.Code.NavigationHelper.GetBasketUrl());
            }
            Country.DataSource = CountryDataSource.LoadAll();
            Country.DataBind();
        }
Пример #24
0
        protected void Page_Init(object sender, EventArgs e)
        {
            _settings = AbleContext.Current.Store.Settings;
            _Basket   = AbleContext.Current.User.Basket;
            LoadCustomViewState();

            if (_Basket.Items.Count == 0)
            {
                Response.Redirect(NavigationHelper.GetMobileStoreUrl("~/Basket.aspx"));
            }
        }
Пример #25
0
        protected void Page_Init(object sender, EventArgs e)
        {
            User user = AbleContext.Current.User;
            StoreSettingsManager settings = AbleContext.Current.Store.Settings;

            if (settings.ProductReviewEnabled == UserAuthFilter.None ||
                settings.ProductReviewEnabled == UserAuthFilter.Registered && user.IsAnonymous)
            {
                Response.Redirect("~/Members/MyAccount.aspx");
            }
            BindReviews();
        }
Пример #26
0
 protected void ForexProvider_DataBound(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         StoreSettingsManager settings = AbleContext.Current.Store.Settings;
         ListItem             item     = ForexProvider.Items.FindByValue(settings.ForexProviderClassId);
         if (item != null)
         {
             item.Selected = true;
         }
     }
 }
        protected void ProductDs_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            e.InputParameters["keyword"] = StringHelper.StripHtml(Keywords.Text).Trim();

            StoreSettingsManager settings = AbleContext.Current.Store.Settings;
            bool displayCategorySearch    = settings.CategorySearchDisplayLimit > 0 && _CategoryCount >= settings.CategorySearchDisplayLimit;

            if (displayCategorySearch)
            {
                e.InputParameters["categoryId"] = AlwaysConvert.ToInt(HiddenSelectedCategoryId.Value);
            }
        }
Пример #28
0
        protected void EnableROConfirm_Click(object sender, EventArgs e)
        {
            Store store = AbleContext.Current.Store;
            StoreSettingsManager settings = store.Settings;

            settings.ROCreateNewOrdersEnabled = true;
            settings.Save();

            ROEnabledPanel.Visible     = true;
            RONotEnabledPanel.Visible  = false;
            EnableInstructions.Visible = false;
            LblEnabling.Visible        = false;
        }
Пример #29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _WebConfigPath = Server.MapPath("~/web.config");
     if (!Page.IsPostBack)
     {
         Store store = AbleContext.Current.Store;
         StoreSettingsManager settings = store.Settings;
         CacheSize.Text         = settings.SeoCacheSize.ToString();
         EnableTracking.Checked = settings.SeoTrackStatistics;
         IntializeCustomExtensionsPanel();
     }
     AllowCustomExtensions.Attributes.Add("onclick", "if(this.checked){document.getElementById('" + CustomExtensionsPanel.ClientID + "').style.display='block';document.getElementById('" + RemoveWebConfigurationPanel.ClientID + "').style.display='none'}else{document.getElementById('" + CustomExtensionsPanel.ClientID + "').style.display='none';document.getElementById('" + RemoveWebConfigurationPanel.ClientID + "').style.display='block'}");
 }
Пример #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Store store = AbleContext.Current.Store;
            StoreSettingsManager settings = store.Settings;

            if (!Page.IsPostBack)
            {
                PageSize.Text                = settings.MobileStoreCatalogPageSize.ToString();
                DisplayType.SelectedIndex    = settings.MobileStoreCatalogRowDisplay ? 1 : 0;
                ProductUseSummary.Checked    = settings.MobileStoreProductUseSummary;
                EnableMobileBrowsing.Checked = !settings.MobileStoreClosed;
            }
        }