Beispiel #1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (storeInfo == null)
            {
                StoreController storeController = new StoreController();
                storeInfo = storeController.GetStoreInfo(PortalId);
                if (storeInfo.CurrencySymbol != string.Empty)
                {
                    LocalFormat.CurrencySymbol = storeInfo.CurrencySymbol;
                }
            }

            moduleSettings = new ModuleSettings(parentControl.ModuleId, parentControl.TabId);
            cartNav = new CartNavigation(Request.QueryString);

            //try
            //{

                updateCartGrid();
            //}
            //catch(Exception ex)
            //{
            //	Exceptions.ProcessModuleLoadException(this, ex);
            //}
        }
Beispiel #2
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            StoreController storeController = new StoreController();
            storeInfo = storeController.GetStoreInfo(PortalId);

            if (storeInfo == null)
            {
                CssTools.AddCss(this.Page, this.TemplateSourceDirectory, PortalId);
            }
            else
            {
                if (storeInfo.PortalTemplates)
                {
                    CssTools.AddCss(this.Page, PortalSettings.HomeDirectory + "Store", PortalId);
                }
                else
                {
                    CssTools.AddCss(this.Page, this.TemplateSourceDirectory, PortalId);
                }
            }

            adminNav = new AdminNavigation(Request.QueryString);

            lblParentTitle.Text = parentTitle;

            // canadean changed
            if(!PortalSecurity.IsInRole("Administrators"))
            {
                btnStoreInfo.Visible = false;
                lblSpacer1.Visible = false;
                //Response.Write("Not Administrator");
            }
            //else
            //    Response.Write("Administrator");

            if (adminNav.PageID == Null.NullString)
            {
                // Load the default control
                adminNav = new AdminNavigation();
                adminNav.PageID = "StoreAdmin";

                // canadean changed
                adminNav.PageID = "StoreAdmin";
                if (!PortalSecurity.IsInRole("Administrators"))
                    adminNav.PageID = "CustomerAdmin";

                loadAdminControl();
            }
            else
            {
                loadAdminControl();
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                if (storeInfo == null)
                {
                    StoreController storeController = new StoreController();
                    storeInfo = storeController.GetStoreInfo(PortalId);
                    if (storeInfo.CurrencySymbol != string.Empty)
                    {
                        LocalFormat.CurrencySymbol = storeInfo.CurrencySymbol;
                    }

                    if (storeInfo.PortalTemplates)
                    {
                        CssTools.AddCss(this.Page, PortalSettings.HomeDirectory + "Store", PortalId);
                    }
                    else
                    {
                        CssTools.AddCss(this.Page, this.TemplateSourceDirectory, PortalId);
                    }
                }

                moduleSettings = new ModuleSettings(ModuleId, TabId);
                cartNav = new CartNavigation(Request.QueryString);
            }
            catch (Exception ex)
            {
                string ErrorSettings = Localization.GetString("ErrorSettings", this.LocalResourceFile);
                Exceptions.ProcessModuleLoadException(ErrorSettings, this, ex, true);
            }

            try
            {
                updateCartGrid();
            }
            catch(Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            /*
            Response.Write("<br>Page_load2 ");
            if (Page.IsPostBack)
                Response.Write("<br>Postback2 ");
            */

            /*
            if (Page.IsPostBack)
            {
                labelLog.Text = labelLog.Text + "<br>Page load PostBack" + DateTime.Now.ToString();
                int cat1 = -1;
                int.TryParse(DropDownList1.SelectedValue, out cat1);
                int cat2 = -1;
                int.TryParse(DropDownList2.SelectedValue, out cat2);
                labelLog.Text = labelLog.Text + "<br>dd1: " + cat1.ToString() + " dd2: " + cat2.ToString() + DateTime.Now.ToString();
            }
            else
            {
                labelLog.Text = labelLog.Text + "<br>Page load - Not a PostBack" + DateTime.Now.ToString();
            } */
                //Response.Write("Page_PreRender");

                npTitle = Localization.GetString("NPTitle.Text", this.LocalResourceFile);
                fpTitle = Localization.GetString("FPTitle.Text", this.LocalResourceFile);
                ppTitle = Localization.GetString("PPTitle.Text", this.LocalResourceFile);
                cpTitle = Localization.GetString("CPTitle.Text", this.LocalResourceFile);

                try
                {
                    if (storeInfo == null)
                    {
                        StoreController storeController = new StoreController();
                        storeInfo = storeController.GetStoreInfo(PortalId);
                        if (storeInfo.PortalTemplates)
                        {
                            templatesPath = PortalSettings.HomeDirectoryMapPath + "Store\\";
                            CssTools.AddCss(this.Page, PortalSettings.HomeDirectory + "Store", PortalId);
                        }
                        else
                        {
                            templatesPath = MapPath(ModulePath) + "\\";
                            CssTools.AddCss(this.Page, this.TemplateSourceDirectory, PortalId);
                        }
                    }

                    moduleSettings = new ModuleSettings(this.ModuleId, this.TabId);

                    catalogNav = new CatalogNavigation(Request.QueryString);

                    if (catalogNav.CategoryID == Null.NullInteger)
                    {
                        if (bool.Parse(moduleSettings.General.UseDefaultCategory))
                        {
                            catalogNav.CategoryID = int.Parse(moduleSettings.General.DefaultCategoryID);
                        }
                    }

                    if (catalogNav.ProductID != Null.NullInteger)
                    {
                        ProductController productController = new ProductController();
                        productInfo = productController.GetProduct(catalogNav.ProductID);
                        catalogNav.CategoryID = productInfo.CategoryID;
                    }

                    if (catalogNav.CategoryID != Null.NullInteger)
                    {
                        CategoryController categoryController = new CategoryController();
                        categoryInfo = categoryController.GetCategory(catalogNav.CategoryID);
                    }

                    this.Controls.Add(TemplateController.ParseTemplate(templatesPath, moduleSettings.General.Template, new ProcessTokenDelegate(processToken)));

                    // Canadean changed: added current categoryid on a hidden dropdown, to use on the cascade categories
                    /*
                    if (catalogNav.CategoryID != Null.NullInteger)
                    {
                        ddHidden.Items.Add(new ListItem(catalogNav.CategoryID.ToString(), catalogNav.CategoryID.ToString()));
                    }
                    */

                }
                catch (Exception ex)
                {
                    string ErrorSettings = Localization.GetString("ErrorSettings", this.LocalResourceFile);
                    Response.Write("<br>" + ex.Message);
                    Response.Write("<br>" + ex.StackTrace);

                    //Exceptions.ProcessModuleLoadException(ErrorSettings, this, ex, true);
                }
                if (DotNetNuke.Framework.AJAX.IsInstalled())
                {
                    DotNetNuke.Framework.AJAX.RegisterScriptManager();
                }

            //}
        }
        /// <summary>
        ///		Required method for Designer support - do not modify
        ///		the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.grdOrders.ItemDataBound += new DataGridItemEventHandler(this.grdOrders_ItemDataBound);
            this.grdOrderDetails.ItemDataBound += new DataGridItemEventHandler(this.grdOrderDetails_ItemDataBound);
            this.lnkbtnSave.Click += new EventHandler(lnkbtnSave_Click);
            this.btnPayViaPayPal.Click += new EventHandler(btnPayViaPayPal_Click);
            storeInfo = storeController.GetStoreInfo(PortalId);
            if (storeInfo.CurrencySymbol != string.Empty)
            {
                LocalFormat.CurrencySymbol = storeInfo.CurrencySymbol;
            }

            //_OrderDateFormat = Localization.GetString("OrderDateFormat", this.LocalResourceFile);
            _OrderDateFormat = "dd/MM/yyyy HH:mm";
        }
Beispiel #6
0
 public void UpdateStoreInfo(StoreInfo storeInfo)
 {
     DataProvider.Instance().UpdateStoreInfo(storeInfo.PortalID, storeInfo.Name, storeInfo.Description, storeInfo.Keywords, storeInfo.GatewayName, storeInfo.GatewaySettings, storeInfo.DefaultEmailAddress, storeInfo.ShoppingCartPageID, storeInfo.StorePageID, storeInfo.CurrencySymbol, storeInfo.PortalTemplates, storeInfo.AuthorizeCancel);
 }
Beispiel #7
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            StoreController storeController = new StoreController();
            bool newStore = false;

            if (storeInfo == null)
            {
                storeInfo = new StoreInfo();
                newStore = true;
            }

            storeInfo.PortalID = PortalId;
            storeInfo.Name = txtStoreName.Text;
            storeInfo.Description = txtDescription.Text;
            storeInfo.Keywords = txtKeywords.Text;
            storeInfo.DefaultEmailAddress = txtEmail.Text;
            storeInfo.CurrencySymbol = txtCurrencySymbol.Text;
            storeInfo.PortalTemplates = chkUsePortalTemplates.Checked;
            storeInfo.GatewayName = lstGateway.SelectedItem.Text;
            storeInfo.ShoppingCartPageID = int.Parse(lstShoppingCartPageID.SelectedValue);
            storeInfo.StorePageID = int.Parse(lstStorePageID.SelectedValue);
            storeInfo.AuthorizeCancel = chkAuthorizeCancel.Checked;

            if ((gatewayControl != null) && (gatewayControl.DataSource != null))
            {
                storeInfo.GatewaySettings = gatewayControl.DataSource.ToString();
            }

            if (chkUsePortalTemplates.Checked)
            {
                string hostFolder = MapPath(ModulePath);
                string portalFolder = PortalSettings.HomeDirectoryMapPath + "Store\\";
                string[] fileList = null;

                // Templates
                if (!Directory.Exists(portalFolder + "Templates"))
                {
                    Directory.CreateDirectory(portalFolder + "Templates");

                    fileList = Directory.GetFiles(hostFolder + "Templates", "*.*");

                    foreach (string file in fileList)
                    {
                        FileInfo fileInfo = new FileInfo(file);
                        fileInfo.CopyTo(portalFolder + "Templates\\" + fileInfo.Name, false);
                    }
                }

                // Images
                if (!Directory.Exists(portalFolder + "Templates\\Images"))
                {
                    Directory.CreateDirectory(portalFolder + "Templates\\Images");

                    fileList = Directory.GetFiles(hostFolder + "Templates\\Images", "*.*");

                    foreach (string file in fileList)
                    {
                        FileInfo fileInfo = new FileInfo(file);
                        fileInfo.CopyTo(portalFolder + "Templates\\Images\\" + fileInfo.Name, false);
                    }
                }

                // StyleSheet
                if (!Directory.Exists(portalFolder + "Templates\\StyleSheet"))
                {
                    Directory.CreateDirectory(portalFolder + "Templates\\StyleSheet");

                    fileList = Directory.GetFiles(hostFolder + "Templates\\StyleSheet", "*.*");

                    foreach (string file in fileList)
                    {
                        FileInfo fileInfo = new FileInfo(file);
                        fileInfo.CopyTo(portalFolder + "Templates\\StyleSheet\\" + fileInfo.Name, false);
                    }
                }

            }

            if (newStore)
            {
                storeInfo.CreatedByUser = UserInfo.Username;
                storeController.AddStoreInfo(storeInfo);
            }
            else
            {
                storeController.UpdateStoreInfo(storeInfo);
            }
        }
Beispiel #8
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            StoreNavigation nav = new StoreNavigation(Request.QueryString);
            string cartPageID = string.Empty;
            string storePageID = string.Empty;

            // Load store details
            StoreController storeController = new StoreController();
            storeInfo = storeController.GetStoreInfo(PortalId);

            if (storeInfo != null)// && !Page.IsPostBack)
            {
                txtStoreName.Text = storeInfo.Name;
                txtDescription.Text = storeInfo.Description;
                txtKeywords.Text = storeInfo.Keywords;
                txtEmail.Text = storeInfo.DefaultEmailAddress;
                txtCurrencySymbol.Text = storeInfo.CurrencySymbol;
                chkUsePortalTemplates.Checked = storeInfo.PortalTemplates;
                cartPageID = storeInfo.ShoppingCartPageID.ToString();
                storePageID = storeInfo.StorePageID.ToString();
                chkAuthorizeCancel.Checked = storeInfo.AuthorizeCancel;
                if (nav.GatewayName == Null.NullString)
                {
                    nav.GatewayName = storeInfo.GatewayName;
                }
            }

            if (!Page.IsPostBack || lstShoppingCartPageID.Items.Count == 0)
            {
                // Load pages available to host the shopping cart
                loadTabs(cartPageID);

                //Load tabs available to host the store
                loadStoreTabs(storePageID);

                // Load available gateways
                loadGateways(nav.GatewayName);
            }

            // Load tax provider
            loadTaxProvider();

            // Load shipping provider
            loadShippingProvider();

            // Load the current gateway control
            if (lstGateway.Items.Count > 0)
            {
                if (nav.GatewayName == Null.NullString)
                {
                    nav.GatewayName = lstGateway.SelectedItem.Text;
                }

                loadGatewayAdmin(nav.GatewayName);
            }
        }
Beispiel #9
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                // Load utility objects
                _nav = new CatalogNavigation(Request.QueryString);
                _nav.ProductID = Null.NullInteger;	//Product should not be displayed!
                if (_nav.CategoryID == 0)
                {
                    _nav.CategoryID = Null.NullInteger;
                }

                //Get category and parent category data
                CategoryController categoryController = new CategoryController();
                selectedCategoryID = _nav.CategoryID;
                if (selectedCategoryID != Null.NullInteger)
                {
                    CategoryInfo category = categoryController.GetCategory(selectedCategoryID);
                    parentCategories.Add(category);
                    if (category.CategoryID != category.ParentCategoryID)
                    {
                        while (category.ParentCategoryID != Null.NullInteger)
                        {
                            category = categoryController.GetCategory(category.ParentCategoryID);
                            parentCategories.Add(category);
                            foreach (CategoryInfo cat in parentCategories)
                            {
                                if (cat.CategoryID == category.CategoryID)
                                {
                                    //Cyclical categories found
                                    break;
                                }
                            }
                        }
                    }
                }
                if (parentCategories.Count > 0)
                {
                    parentCategories.Reverse();
                }

                if (storeInfo == null)
                {
                    StoreController storeController = new StoreController();
                    storeInfo = storeController.GetStoreInfo(PortalId);
                    if (storeInfo.PortalTemplates)
                    {
                        CssTools.AddCss(this.Page, PortalSettings.HomeDirectory + "Store", PortalId);
                    }
                    else
                    {
                        CssTools.AddCss(this.Page, this.TemplateSourceDirectory, PortalId);
                    }
                }

                _settings = new ModuleSettings(this.ModuleId, this.TabId);
                // Databind to list of categories
                CategoryController controller = new CategoryController();
                ArrayList categoryList = controller.GetCategories(this.PortalId, false, -2);
                MyList.RepeatColumns = int.Parse(_settings.CategoryMenu.ColumnCount);
                MyList.DataSource = categoryList;
                MyList.DataBind();

                //MyList.SelectedIndex = GetSelectedIndex();
            }
            catch(Exception ex)
            {
                if (ex.InnerException != null)
                {
                    Exceptions.ProcessModuleLoadException(this, ex.InnerException);
                }
                else
                {
                    string ErrorSettings = Localization.GetString("ErrorSettings", this.LocalResourceFile);
                    Exceptions.ProcessModuleLoadException(ErrorSettings, this, ex, true);
                }
            }
        }
Beispiel #10
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (storeInfo == null)
            {
                StoreController storeController = new StoreController();
                storeInfo = storeController.GetStoreInfo(PortalId);
            }

            if (storeInfo.CurrencySymbol != string.Empty)
            {
                LocalFormat.CurrencySymbol = storeInfo.CurrencySymbol;
            }

            _nav = new AdminNavigation(Request.QueryString);
            // Do we show list or edit view?
            if (_nav.ProductID != Null.NullInteger)
            {
                ShowEditControl();
            }
            /*
            // canadean changed: Now we do it only on the PreRender, to allow filtering by the text entered
            else
            {
                ShowProductList();
            }*/

            //Response.Write("<br>Page_load: " + this.tbProductFilter.Text + " - " + _nav.ProductID);
        }
Beispiel #11
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            //Response.Write("Page_Load");
            // return;

            if (_storeInfo == null)
            {
                StoreController storeController = new StoreController();
                _storeInfo = storeController.GetStoreInfo(PortalId);

                if (_storeInfo.CurrencySymbol != string.Empty)
                {
                    LocalFormat.CurrencySymbol = _storeInfo.CurrencySymbol;
                }

                if (_storeInfo.PortalTemplates)
                {
                    CssTools.AddCss(this.Page, PortalSettings.HomeDirectory + "Store", PortalId);
                }
                else
                {
                    CssTools.AddCss(this.Page, this.TemplateSourceDirectory, PortalId);
                }
            }

            lblGatewayTitle.Visible = false;

            if (forceSSL())
            {
                SSLHelper.RequestSecurePage();
            }

            //Mail.SendMail(PortalSettings.Email, "*****@*****.**", "", "Canadean Checkout ", " ", "", "", "", "", "", "");
            if (Request.QueryString["WorldPayExit"] != null)
            {
                //Mail.SendMail(PortalSettings.Email, "*****@*****.**", "", "Canadean Payment Checkout - " + Request.QueryString["WorldPayExit"], " ", "", "", "", "", "", "");
                loadPaymentControl();

                return;
            }

            loadCartControl();
            loadAddressControl();
            loadPaymentControl();
            loadTaxCheckoutControl();
            loadShippingCheckoutControl();

            _orderInfo = GetExistingOrder();

            updateCheckoutAddress();

            if (Request.QueryString["PayPalExit"] == null)
            {
                if (!this.Page.IsPostBack)
                {
                    if (_orderInfo == null)
                    {
                        _orderInfo = CreateOrder();
                    }

                    //Update the order details with the most recent cart items.
                    OrderController orderController = new OrderController();

                    CartInfo cartInfo = CurrentCart.GetInfo(PortalId);
                    if (cartInfo != null & _orderInfo != null)
                    {
                        _orderInfo = orderController.UpdateOrderDetails(_orderInfo.OrderID, cartInfo.CartID);
                    }
                }

                CalculateTaxandShipping(_orderInfo);
                updateCheckoutOrder(_orderInfo);
                updateStoreInfo();
            }
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (storeInfo == null)
            {
                StoreController storeController = new StoreController();
                storeInfo = storeController.GetStoreInfo(PortalId);
                if (storeInfo.CurrencySymbol != string.Empty)
                {
                    LocalFormat.CurrencySymbol = storeInfo.CurrencySymbol;
                }
            }

            UpdateShippingTotal(this.OrderInfo);
        }
Beispiel #13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            //Localize the linkbuttons
            btnCart.Text = Localization.GetString("btnCart");
            btnProfile.Text = Localization.GetString("btnProfile");
            btnOrders.Text = Localization.GetString("btnOrders");

            try
            {
                if (storeInfo == null)
                {
                    StoreController storeController = new StoreController();
                    storeInfo = storeController.GetStoreInfo(PortalId);

                    if (storeInfo.PortalTemplates)
                    {
                        CssTools.AddCss(this.Page, PortalSettings.HomeDirectory + "Store", PortalId);
                    }
                    else
                    {
                        CssTools.AddCss(this.Page, this.TemplateSourceDirectory, PortalId);
                    }
                }

                _nav = new CustomerNavigation(Request.QueryString);

                lblParentTitle.Text = parentTitle;

                if (_nav.PageID == Null.NullString)
                {
                    // Load the default control
                    _nav.PageID = "CustomerCart";
                    loadAccountControl();
                }
                else
                {
                    loadAccountControl();
                }
            }
            catch (Exception ex)
            {
                string ErrorSettings = Localization.GetString("ErrorSettings", this.LocalResourceFile);
                Exceptions.ProcessModuleLoadException(ErrorSettings, this, ex, true);
            }
        }
        public override void LoadSettings()
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    if (storeInfo == null)
                    {
                        StoreController storeController = new StoreController();
                        storeInfo = storeController.GetStoreInfo(PortalId);
                        if (storeInfo.PortalTemplates)
                        {
                            templatesPath = PortalSettings.HomeDirectoryMapPath + "Store\\";
                        }
                        else
                        {
                            templatesPath = MapPath(ModulePath) + "\\";
                        }
                    }

                    TabController tabController = new TabController();
                    ArrayList tabs = tabController.GetTabs(PortalId);

                    lstNPLDetailPage.Items.Add(new ListItem(Localization.GetString("NPLSamePage", this.LocalResourceFile), "0"));
                    lstFPLDetailPage.Items.Add(new ListItem(Localization.GetString("FPLSamePage", this.LocalResourceFile), "0"));
                    lstPPLDetailPage.Items.Add(new ListItem(Localization.GetString("PPLSamePage", this.LocalResourceFile), "0"));
                    lstCPLDetailPage.Items.Add(new ListItem(Localization.GetString("CPLSamePage", this.LocalResourceFile), "0"));
                    lstPDSReturnPage.Items.Add(new ListItem(Localization.GetString("PDSSamePage", this.LocalResourceFile), "0"));

                    foreach (TabInfo tabInfo in tabs)
                    {
                        if (!tabInfo.IsDeleted && !tabInfo.IsAdminTab && !tabInfo.IsSuperTab)
                        {
                            lstNPLDetailPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString()));
                            lstFPLDetailPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString()));
                            lstPPLDetailPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString()));
                            lstCPLDetailPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString()));
                            lstPDSReturnPage.Items.Add(new ListItem(tabInfo.TabName, tabInfo.TabID.ToString()));
                        }
                    }

                    loadTemplates();

                    String repeatDirection = Localization.GetString("RepeatDirectionHoriz", this.LocalResourceFile);
                    lstNPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "H"));
                    lstFPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "H"));
                    lstPPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "H"));
                    lstCPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "H"));

                    repeatDirection = Localization.GetString("RepeatDirectionVert", this.LocalResourceFile);
                    lstNPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "V"));
                    lstFPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "V"));
                    lstPPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "V"));
                    lstCPLRepeatDirection.Items.Add(new ListItem(repeatDirection, "V"));

                    // General Player Settings
                    chkUseDefaultCategory.Checked = bool.Parse(moduleSettings.General.UseDefaultCategory);
                    chkShowMessage.Checked = bool.Parse(moduleSettings.General.ShowMessage);
                    chkShowNew.Checked = bool.Parse(moduleSettings.General.ShowNewProducts);
                    chkShowFeatured.Checked = bool.Parse(moduleSettings.General.ShowFeaturedProducts);
                    chkShowPopular.Checked = bool.Parse(moduleSettings.General.ShowPopularProducts);
                    chkShowCategory.Checked = bool.Parse(moduleSettings.General.ShowCategoryProducts);
                    chkShowDetail.Checked = bool.Parse(moduleSettings.General.ShowProductDetail);
                    lstDefaultCategory.SelectedValue = moduleSettings.General.DefaultCategoryID;
                    ListItem itemTemplate = lstTemplate.Items.FindByText(moduleSettings.General.Template);
                    if (itemTemplate != null)
                    {
                        itemTemplate.Selected = true;
                    }

                    // New list settings
                    ListItem itemNPLContainerTemplate = lstNPLContainerTemplate.Items.FindByText(moduleSettings.NewProducts.ContainerTemplate);
                    if (itemNPLContainerTemplate != null)
                    {
                        itemNPLContainerTemplate.Selected = true;
                    }
                    ListItem itemNPLTemplate = lstNPLTemplate.Items.FindByText(moduleSettings.NewProducts.Template);
                    if (itemNPLTemplate != null)
                    {
                        itemNPLTemplate.Selected = true;
                    }
                    txtNPLRowCount.Text = moduleSettings.NewProducts.RowCount;
                    txtNPLColumnCount.Text = moduleSettings.NewProducts.ColumnCount;
                    txtNPLColumnWidth.Text = moduleSettings.NewProducts.ColumnWidth;
                    ListItem itemNPLDirection = lstNPLRepeatDirection.Items.FindByValue(moduleSettings.NewProducts.RepeatDirection);
                    if (itemNPLDirection != null)
                    {
                        itemNPLDirection.Selected = true;
                    }
                    txtNPLThumbnailWidth.Text = moduleSettings.NewProducts.ThumbnailWidth;
                    chkNPLShowThumbnail.Checked = bool.Parse(moduleSettings.NewProducts.ShowThumbnail);
                    lstNPLDetailPage.SelectedValue = moduleSettings.NewProducts.DetailPage;

                    // Featured list settings
                    ListItem itemFPLContainerTemplate = lstFPLContainerTemplate.Items.FindByText(moduleSettings.FeaturedProducts.ContainerTemplate);
                    if (itemFPLContainerTemplate != null)
                    {
                        itemFPLContainerTemplate.Selected = true;
                    }
                    ListItem itemFPLTemplate = lstFPLTemplate.Items.FindByText(moduleSettings.FeaturedProducts.Template);
                    if (itemFPLTemplate != null)
                    {
                        itemFPLTemplate.Selected = true;
                    }
                    txtFPLRowCount.Text = moduleSettings.FeaturedProducts.RowCount;
                    txtFPLColumnCount.Text = moduleSettings.FeaturedProducts.ColumnCount;
                    txtFPLColumnWidth.Text = moduleSettings.FeaturedProducts.ColumnWidth;
                    ListItem itemFPLDirection = lstFPLRepeatDirection.Items.FindByValue(moduleSettings.FeaturedProducts.RepeatDirection);
                    if (itemFPLDirection != null)
                    {
                        itemFPLDirection.Selected = true;
                    }
                    txtFPLThumbnailWidth.Text = moduleSettings.FeaturedProducts.ThumbnailWidth;
                    chkFPLShowThumbnail.Checked = bool.Parse(moduleSettings.FeaturedProducts.ShowThumbnail);
                    lstFPLDetailPage.SelectedValue = moduleSettings.FeaturedProducts.DetailPage;

                    // Popular list settings
                    ListItem itemPPLContainerTemplate = lstPPLContainerTemplate.Items.FindByText(moduleSettings.PopularProducts.ContainerTemplate);
                    if (itemPPLContainerTemplate != null)
                    {
                        itemPPLContainerTemplate.Selected = true;
                    }
                    ListItem itemPPLTemplate = lstPPLTemplate.Items.FindByText(moduleSettings.PopularProducts.Template);
                    if (itemPPLTemplate != null)
                    {
                        itemPPLTemplate.Selected = true;
                    }
                    txtPPLRowCount.Text = moduleSettings.PopularProducts.RowCount;
                    txtPPLColumnCount.Text = moduleSettings.PopularProducts.ColumnCount;
                    txtPPLColumnWidth.Text = moduleSettings.PopularProducts.ColumnWidth;
                    ListItem itemPPLDirection = lstPPLRepeatDirection.Items.FindByValue(moduleSettings.PopularProducts.RepeatDirection);
                    if (itemPPLDirection != null)
                    {
                        itemPPLDirection.Selected = true;
                    }
                    txtPPLThumbnailWidth.Text = moduleSettings.PopularProducts.ThumbnailWidth;
                    chkPPLShowThumbnail.Checked = bool.Parse(moduleSettings.PopularProducts.ShowThumbnail);
                    lstPPLDetailPage.SelectedValue = moduleSettings.PopularProducts.DetailPage;

                    // Category list settings
                    ListItem itemCPLContainerTemplate = lstCPLContainerTemplate.Items.FindByText(moduleSettings.CategoryProducts.ContainerTemplate);
                    if (itemCPLContainerTemplate != null)
                    {
                        itemCPLContainerTemplate.Selected = true;
                    }
                    ListItem itemCPLTemplate = lstCPLTemplate.Items.FindByText(moduleSettings.CategoryProducts.Template);
                    if (itemCPLTemplate != null)
                    {
                        itemCPLTemplate.Selected = true;
                    }
                    txtCPLRowCount.Text = moduleSettings.CategoryProducts.RowCount;
                    txtCPLColumnCount.Text = moduleSettings.CategoryProducts.ColumnCount;
                    txtCPLColumnWidth.Text = moduleSettings.CategoryProducts.ColumnWidth;
                    ListItem itemCPLDirection = lstCPLRepeatDirection.Items.FindByValue(moduleSettings.CategoryProducts.RepeatDirection);
                    if (itemCPLDirection != null)
                    {
                        itemCPLDirection.Selected = true;
                    }
                    txtCPLThumbnailWidth.Text = moduleSettings.CategoryProducts.ThumbnailWidth;
                    chkCPLShowThumbnail.Checked = bool.Parse(moduleSettings.CategoryProducts.ShowThumbnail);
                    lstCPLDetailPage.SelectedValue = moduleSettings.CategoryProducts.DetailPage;

                    // Detail settings
                    ListItem itemDetailTemplate = lstDetailTemplate.Items.FindByText(moduleSettings.ProductDetail.Template);
                    if (itemDetailTemplate != null)
                    {
                        itemDetailTemplate.Selected = true;
                    }
                    chkDetailShowThumbnail.Checked = bool.Parse(moduleSettings.ProductDetail.ShowThumbnail);
                    txtDetailThumbnailWidth.Text = moduleSettings.ProductDetail.ThumbnailWidth;
                    chkDetailShowReviews.Checked = bool.Parse(moduleSettings.ProductDetail.ShowReviews);
                    lstPDSReturnPage.SelectedValue = moduleSettings.ProductDetail.ReturnPage;
                }
            }
            catch(Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Beispiel #15
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            lblStoreMicroCartItemsTitle.CssClass = _itemsTitleCssClass;
            lblStoreMicroCartTotalTitle.CssClass = _totalTitleCssClass;
            lblStoreMicroCartItems.CssClass = _itemsCssClass;
            lblStoreMicroCartTotal.CssClass = _totalCssClass;

            _resource = this.TemplateSourceDirectory + "/App_LocalResources/MicroCart.ascx.resx";
            lblStoreMicroCartItemsTitle.Text = Localization.GetString("CartItemsTitle.Text", _resource);
            lblStoreMicroCartTotalTitle.Text = Localization.GetString("CartTotalTitle.Text", _resource);

            try
            {
                if (storeInfo == null)
                {
                    portalId = this.PortalSettings.PortalId;
                    cartInfo = CurrentCart.GetInfo(portalId);

                    StoreController storeController = new StoreController();
                    storeInfo = storeController.GetStoreInfo(portalId);
                    if (storeInfo.CurrencySymbol != string.Empty)
                    {
                        LocalFormat.CurrencySymbol = storeInfo.CurrencySymbol;
                    }
                }

                _text = Localization.GetString("CartItems.Text", _resource);
                int _items = cartInfo.Items;

                if (_items > 0)
                {
                    lblStoreMicroCartItems.Text = string.Format(_text, _items);
                    lblStoreMicroCartTotal.Text = cartInfo.Total.ToString("C", LocalFormat);
                }
                else
                {
                    lblStoreMicroCartItems.Text = string.Format(_text, 0);
                    lblStoreMicroCartTotal.Text = (0D).ToString("C", LocalFormat);
                }
            }
            catch
            {
                _text = Localization.GetString("Error.Text", _resource);
                lblStoreMicroCartItems.Text = _text;
                lblStoreMicroCartTotalTitle.Text = _text;
            }
        }
Beispiel #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (storeInfo == null)
            {
                StoreController storeController = new StoreController();
                storeInfo = storeController.GetStoreInfo(PortalId);
                if (storeInfo.PortalTemplates)
                {
                    templatesPath = PortalSettings.HomeDirectoryMapPath + "Store\\";
                    imagesPath = PortalSettings.HomeDirectory + "Store/Templates/Images/";
                }
                else
                {
                    //templatesPath = MapPath(ModulePath) + "\\";
                    templatesPath = MapPath(ModulePath);
                    imagesPath = parentControl.ModulePath + "Templates/Images/";
                }
            }

            if (storeInfo.CurrencySymbol != string.Empty)
            {
                LocalFormat.CurrencySymbol = storeInfo.CurrencySymbol;
            }

            moduleNav = new CatalogNavigation(Request.QueryString);

            //0 indicates that no detail page is being used, so use current tabid
            if (this.DetailPage == 0)
            {
                this.DetailPage = this.TabId;
            }
            moduleNav.TabId = this.DetailPage;

            if (moduleNav.PageIndex == Null.NullInteger)
            {
                moduleNav.PageIndex = 1;
            }

            if (containerTemplate == string.Empty)
            {
                this.Controls.Add(TemplateController.ParseTemplate(templatesPath, "ListContainer.htm", new ProcessTokenDelegate(processToken)));
            }
            else
            {
                this.Controls.Add(TemplateController.ParseTemplate(templatesPath, containerTemplate, new ProcessTokenDelegate(processToken)));
            }
            if (lstProducts != null) BindData();
        }