예제 #1
0
        protected void lstFeatureList_SelectedIndexChanged(object sender, EventArgs e)
        {
            lstFeatureList.Attributes.Add("onClick", "javascript:alert('" + Localization.GetString("LstDisabled.Text", this.LocalResourceFile) + "');");

            // Determine new Id
            FeatureListId = Convert.ToInt32(lstFeatureList.SelectedValue);
            if (FeatureListId == -1)
            {
                EditState                     = "new";
                lngFeatureLists.Langs         = new List <ILanguageEditorInfo>();
                pnlFeatureListDetails.Visible = true;
                lblFLDetails.Text             = Localization.GetString("NewFeatureList.Text", this.LocalResourceFile);
            }


            // Enabling / Disabling Edit Controls
            pnlFeatureLists.Visible = false;

            bool pnlVisible = (FeatureListId > -1 || EditState == "new");

            pnlFeatureListDetails.Visible = pnlVisible;
            cmdUpdate.Visible             = pnlVisible;
            cmdCancel.Visible             = true;
            cmdDelete.Visible             = (EditState != "new");
            imgEditItems.Visible          = (EditState != "new");

            if (FeatureListId > 0)
            {
                FeatureList = Controller.GetFeatureListById(FeatureListId, CurrentLanguage);
            }

            if (FeatureList != null)
            {
                // Fill in the Language information
                List <ILanguageEditorInfo> dbLangs = new List <ILanguageEditorInfo>();
                foreach (FeatureListLangInfo featureListLang in Controller.GetFeatureListLangs(FeatureList.FeatureListId))
                {
                    dbLangs.Add(featureListLang);
                }
                lngFeatureLists.Langs = dbLangs;
            }

            lblFLDetails.Text           = String.Format("{0} (ID:{1})", lstFeatureList.SelectedItem.Text, FeatureListId);
            lblFLDetails.Visible        = true;
            lblFLDetailsCaption.Visible = true;
            UpdateList(CurrentLanguage);
        }
예제 #2
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            lngFeatureLists.UpdateLangs();
            switch (EditState)
            {
            case "new":
                FeatureListInfo flNew = new FeatureListInfo();
                flNew.FeatureListId = FeatureListId;
                flNew.PortalID      = PortalId;
                int featureListId = Controller.NewFeatureList(flNew);
                foreach (FeatureListLangInfo featureListLang in lngFeatureLists.Langs)
                {
                    featureListLang.FeatureListId = featureListId;
                    Controller.NewFeatureListLang(featureListLang);
                }
                FeatureListId = featureListId;
                EditState     = "update";
                break;

            case "update":
                Controller.DeleteFeatureListLangs(FeatureListId);
                foreach (FeatureListLangInfo featureListLang in lngFeatureLists.Langs)
                {
                    featureListLang.FeatureListId = FeatureListId;
                    Controller.NewFeatureListLang(featureListLang);
                }
                break;

            default:
                break;
            }
            if (Request.QueryString["adminmode"] != null)
            {
                Response.Redirect(Globals.NavigateURL(TabId, "", "adminmode=featurelist"), true);
            }
            else
            {
                Response.Redirect(EditUrl(), true);
            }
        }
예제 #3
0
        public void SaveFeatureList(string PortalId, string strStoreGuid, FeatureListInfo featureList, string Token)
        {
            int portalId = -1;

            Int32.TryParse(PortalId, out portalId);
            if (portalId < 0)
            {
                throw new Exception("PortalId must be zero or greater");
            }

            if (featureList == null)
            {
                throw new Exception("FeatureList must not be null");
            }

            Guid storeGuid = new Guid(strStoreGuid);

            if (storeGuid == Guid.Empty)
            {
                throw new Exception("StoreGuid must be valid!");
            }

            ImportController.SaveFeatureList(portalId, featureList, storeGuid);
        }
예제 #4
0
 public abstract void UpdateFeatureList(FeatureListInfo FeatureList);
예제 #5
0
 public abstract int NewFeatureList(FeatureListInfo FeatureList);
예제 #6
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                bool showReset = false;
                lblCurrency.Text = Currency;

                // Search ProductGroup
                pnlSearchProductGroup.Visible = false;
                List <ProductFilterInfo> pgf = Controller.GetProductFilter(PortalId, FilterSessionId, "ProductGroup");
                if (pgf.Count > 0)
                {
                    showReset = true;
                    string[] values = pgf[0].FilterValue.Split('|');
                    _productGroupId = Convert.ToInt32(values[0]);
                }

                if (Settings["ProductGroupSearchEnabled"] != null && Convert.ToBoolean(Settings["ProductGroupSearchEnabled"]))
                {
                    ProductGroupInfo pg = Controller.GetProductGroup(PortalId, CurrentLanguage, _productGroupId);
                    if (pg != null)
                    {
                        FilterValueProductGroup       = pg.ProductGroupName;
                        pnlSearchProductGroup.Visible = true;
                    }
                }
                // Search FeatureList
                pnlSearchFeatureList.Visible = false;
                List <ProductFilterInfo> pfl = Controller.GetProductFilter(PortalId, FilterSessionId, "FeatureList");
                if (pfl.Count > 0)
                {
                    showReset = true;
                    string[] values = pfl[0].FilterValue.Split('|');

                    int             FeatureListId = Convert.ToInt32(values[0]);
                    FeatureListInfo fli           = Controller.GetFeatureListById(FeatureListId, CurrentLanguage);
                    if (fli != null)
                    {
                        lblSearchFeatureListCap.Text = fli.FeatureList;
                        int FeatureListItemId = Convert.ToInt32(values[1]);
                        FeatureListItemLangInfo featureListItemLang = Controller.GetFeatureListItemLang(FeatureListItemId, CurrentLanguage);
                        if (featureListItemLang != null)
                        {
                            lblSearchFeatureList.Text    = featureListItemLang.FeatureListItem;
                            pnlSearchFeatureList.Visible = true;
                        }
                    }
                }

                // Search for text
                if (Settings["TextSearchEnabled"] != null && Convert.ToBoolean(Settings["TextSearchEnabled"]))
                {
                    List <ProductFilterInfo> fi = Controller.GetProductFilter(PortalId, FilterSessionId, "TextSearch");
                    if (fi.Count == 0 || fi[0].FilterValue == String.Empty)
                    {
                        MultiViewText.ActiveViewIndex = 0;
                        FilterValueText = (fi.Count == 0 ? "" : fi[0].FilterValue);
                    }
                    else
                    {
                        showReset = true;
                        MultiViewText.ActiveViewIndex = 1;
                        FilterValueText = fi[0].FilterValue;
                    }
                }
                else
                {
                    pnlSearchText.Visible = false;
                }

                // Static Search
                pnlSearchStatic.Visible = false;
                if (Settings["StaticSearchEnabled"] != null && Convert.ToBoolean(Settings["StaticSearchEnabled"]))
                {
                    List <StaticFilterInfo> sf = Controller.GetStaticFilters(PortalId);
                    if (sf.Count > 0)
                    {
                        List <ProductFilterInfo> fi = Controller.GetProductFilter(PortalId, FilterSessionId, "StaticSearch");
                        if (fi.Count > 0 && fi[0].FilterValue != String.Empty)
                        {
                            showReset = true;
                            MultiViewStatic.ActiveViewIndex = 1;
                            FilterValueStatic = Convert.ToInt32(fi[0].FilterValue);
                            StaticFilterInfo actFilter = sf.Find(x => x.StaticFilterId == FilterValueStatic);
                            if (actFilter != null)
                            {
                                lblSearchStatic.Text = actFilter.Token;
                            }
                        }
                        else
                        {
                            MultiViewStatic.ActiveViewIndex = 0;
                            cboSearchStatic.DataSource      = sf;
                            cboSearchStatic.DataTextField   = "Token";
                            cboSearchStatic.DataValueField  = "StaticFilterId";
                            cboSearchStatic.Items.Add(new ListItem {
                                Text = Localization.GetString("Select.Text", this.LocalResourceFile), Value = "0"
                            });
                            cboSearchStatic.AppendDataBoundItems = true;
                            cboSearchStatic.DataBind();
                        }
                        pnlSearchStatic.Visible = true;
                    }
                }

                // Search for Price
                if (Settings["PriceSearchEnabled"] != null && Convert.ToBoolean(Settings["PriceSearchEnabled"]))
                {
                    List <ProductFilterInfo> fi = Controller.GetProductFilter(PortalId, FilterSessionId, "PriceSearch");
                    if (fi.Count == 0 || fi[0].FilterValue == String.Empty)
                    {
                        MultiViewPrice.ActiveViewIndex = 0;
                        FilterValuePrice = (fi.Count == 0 ? "" : fi[0].FilterValue);
                    }
                    else
                    {
                        showReset = true;
                        MultiViewPrice.ActiveViewIndex = 1;
                        FilterValuePrice = fi[0].FilterValue;
                    }
                }
                else
                {
                    pnlSearchPrice.Visible = false;
                }

                // Search for Features
                if (Settings["FeatureSearchEnabled"] != null && Convert.ToBoolean(Settings["FeatureSearchEnabled"]))
                {
                    List <ProductFilterInfo> fi = Controller.GetProductFilter(PortalId, FilterSessionId, "FeatureSearch");
                    if (fi.Count > 0 && fi[0].FilterValue != String.Empty)
                    {
                        showReset = true;
                    }
                    pnlFeatures.Visible         = true;
                    FeatureGrid.ProductGroupId  = _productGroupId;
                    FeatureGrid.FilterSessionId = FilterSessionId;
                    FeatureGrid.SearchTabId     = DynamicPage;
                }
                else
                {
                    pnlFeatures.Visible = false;
                }

                pnlSearchReset.Visible = (Settings["ResetSearchEnabled"] != null && Convert.ToBoolean(Settings["ResetSearchEnabled"]) && showReset);
            }
            catch (Exception exc)
            {
                //Module failed to load
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }