Exemple #1
0
        protected void SaveSettingsButton_Click(object sender, EventArgs e)
        {
            var brand      = BrandCache.Instance.GetById(BrandId);
            var setting    = brand.GetCustomMetadataSetting(GroupNumber);
            var selectable = ucEditDetails.RetrieveSetting();
            var updateVals = false;

            if (!setting.IsNew && !setting.IsNull && setting.UiControlType == (int)BrandMetadataUiControlType.Select)
            {//check if the type is not changing which would require updating all metadata vals entries of all assets in the database
                //as that will no longer be reflecting the right values
                updateVals = setting.SelectableSetting.SelectableType != selectable.SelectableType;
            }

            selectable.BrandMetadataSettingId = setting.BrandMetadataSettingId.GetValueOrDefault();

            BrandMetadataSelectableSetting.Update(selectable);

            ucEditDetails.BrandMetadataSelectableSettingId = selectable.BrandMetadataSelectableSettingId.GetValueOrDefault();

            if (updateVals)
            {
                var assets = Asset.FindMany(new AssetFinder()
                {
                    IsDeleted = false
                });
                foreach (var asset in assets)
                {
                    asset.MetadataList.ToString();
                    asset.MetadataTextFieldsList.ToString();
                    asset.MetadataTextAreasList.ToString();

                    Asset.SaveAssetMetadata(asset);
                }
            }

            var msg = "Metadata selection options updated successfully" + (updateVals? ".<br />Asset search metadata updated successfully." : "");

            MessageLabel1.SetSuccessMessage(msg);

            CacheManager.InvalidateCache("BrandMetadata", CacheType.All);
        }
Exemple #2
0
        protected void ApplyButton_Click(object sender, EventArgs e)
        {
            var selId = GetSelectedSelectableSettingId();

            if (selId <= 0)
            {
                GeneralFeedbackLabel.SetSuccessMessage("no group was selected from the list.");
                return;
            }

            var f = BrandMetadataSelectableSetting.Get(selId);

            f.FilterDepth          = int.Parse(RowsDropDownList.SelectedValue);
            f.FilterSelectableType = Option2RadioButton.Checked
                                             ? (int)SelectableMetadataType.ComboBox
                                             : (int)SelectableMetadataType.DropDown;

            BrandMetadataSelectableSetting.Update(f);

            GeneralFeedbackLabel.SetSuccessMessage("display settings of the selected metadata were updated.");
        }
Exemple #3
0
        protected void MakeLiveButton_Click(object sender, EventArgs e)
        {
            var saveCandidates = GetInputSettings();

            foreach (var setting in saveCandidates)
            {
                BrandMetadataSelectableSetting.Update(setting.SelectableSetting);
            }

            var b = Brand.Get(BrandId);

            b.FilterMarkup = MarkupTextBox.Text;
            Brand.Update(b);

            MainMultiView.ActiveViewIndex = 0;
            GeneralFeedbackLabel.SetSuccessMessage("changes were saved.");

            GroupSelectableTypeChanges.Clear();
            GroupSelectableRowsCountChanges.Clear();

            LoadPreviewState();
        }