Пример #1
0
        protected void lstFeatures_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
        {
            int TabId             = Convert.ToInt32(Settings["ProductListModulePage"]);
            int featureListItemId = (int)lstFeatures.DataKeys[e.NewSelectedIndex].Value;

            Controller.DeleteProductFilter(PortalId, FilterSessionId, "FeatureList");

            ProductFilterInfo pf = new ProductFilterInfo();

            pf.FilterSessionId = FilterSessionId;
            pf.FilterSource    = "FeatureList";
            pf.FilterValue     = FeatureListId.ToString() + "|" + featureListItemId.ToString();
            pf.PortalId        = PortalId;
            Controller.NewProductFilter(pf);

            Response.Redirect(Globals.NavigateURL(TabId));
        }
Пример #2
0
        public void rotFeatures_ItemClick(object sender, RadRotatorEventArgs e)
        {
            FeatureListItemInfo feature = Features[e.Item.Index];

            int TabId             = Convert.ToInt32(Settings["ProductListModulePage"]);
            int featureListItemId = feature.FeatureListItemId;

            Controller.DeleteProductFilter(PortalId, FilterSessionId, "FeatureList");

            ProductFilterInfo pf = new ProductFilterInfo();

            pf.FilterSessionId = FilterSessionId;
            pf.FilterSource    = "FeatureList";
            pf.FilterValue     = FeatureListId.ToString() + "|" + featureListItemId.ToString();
            pf.PortalId        = PortalId;
            Controller.NewProductFilter(pf);

            Response.Redirect(Globals.NavigateURL(TabId));
        }
Пример #3
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                Controller = new BBStoreController();

                if (Request["adminmode"] != null)
                {
                    pnlBack.Visible = false;
                }

                if (!IsPostBack)
                {
                    List <FeatureListInfo> featureLists = Controller.GetFeatureLists(PortalId, CurrentLanguage);
                    featureLists.Insert(0, new FeatureListInfo()
                    {
                        FeatureList = "<Add new>", FeatureListId = -1
                    });
                    lstFeatureList.DataSource     = featureLists;
                    lstFeatureList.DataTextField  = "FeatureList";
                    lstFeatureList.DataValueField = "FeatureListId";
                    lstFeatureList.DataBind();

                    if (Request["featurelist"] != null)
                    {
                        FeatureListId = Convert.ToInt32(Request["featurelist"]);
                        lstFeatureList.SelectedValue = FeatureListId.ToString();
                        lstFeatureList_SelectedIndexChanged(lstFeatureList, new EventArgs());
                    }


                    cmdDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteConfirm.Text", this.LocalResourceFile) + "');");
                    lblFLDetailsCaption.Text  = Localization.GetString("lblFLDetailsCaption.Text", this.LocalResourceFile);
                    lblFLIDetailsCaption.Text = Localization.GetString("lblFLIDetailsCaption.Text", this.LocalResourceFile);
                }
            }
            catch (Exception exc)
            {
                //Module failed to load
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Пример #4
0
 protected void cmdDelete_Click(object sender, EventArgs e)
 {
     Controller.DeleteFeatureListItem(FeatureListItemId);
     if (Request.QueryString["adminmode"] != null)
     {
         Response.Redirect(Globals.NavigateURL(TabId, "", "adminmode=featurelistitem", "featurelist=" + FeatureListId.ToString()), true);
     }
     else
     {
         Response.Redirect(EditUrl(), true);
     }
 }
Пример #5
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            lngFeatureListItems.UpdateLangs();
            switch (EditState)
            {
            case "new":
                FeatureListItemInfo fliNew = new FeatureListItemInfo();
                fliNew.FeatureListId = FeatureListId;
                fliNew.Image         = BBStoreHelper.GetRelativeFilePath(ImageSelector.Url);
                fliNew.ViewOrder     = Convert.ToInt32(txtViewOrder.Text);
                int featureListItemId = Controller.NewFeatureListItem(fliNew);
                foreach (FeatureListItemLangInfo featureListItemLang in lngFeatureListItems.Langs)
                {
                    featureListItemLang.FeatureListItemId = featureListItemId;
                    Controller.NewFeatureListItemLang(featureListItemLang);
                }
                FeatureListItemId = featureListItemId;
                EditState         = "update";
                break;

            case "update":
                FeatureListItemInfo fliUpdate = Controller.GetFeatureListItemById(FeatureListItemId);
                fliUpdate.Image     = BBStoreHelper.GetRelativeFilePath(ImageSelector.Url);
                fliUpdate.ViewOrder = Convert.ToInt32(txtViewOrder.Text);
                Controller.UpdateFeatureListItem(fliUpdate);

                Controller.DeleteFeatureListItemLangs(FeatureListItemId);
                foreach (FeatureListItemLangInfo featureListItemLang in lngFeatureListItems.Langs)
                {
                    featureListItemLang.FeatureListItemId = FeatureListItemId;
                    Controller.NewFeatureListItemLang(featureListItemLang);
                }
                break;

            default:
                break;
            }
            if (Request.QueryString["adminmode"] != null)
            {
                Response.Redirect(Globals.NavigateURL(TabId, "", "adminmode=featurelistitem", "featurelist=" + FeatureListId.ToString()), true);
            }
            else
            {
                Response.Redirect(EditUrl(), true);
            }
        }