public BrandMetadataSelectableSetting RetrieveSetting() { //var result = BrandMetadataSelectableSetting.New(); //set the id if we are editing an existing setting as opposed to adding a new one - this will trigger an update at the mapper instance //if (BrandMetadataSelectableSettingId > 0) result.BrandMetadataSelectableSettingId = BrandMetadataSelectableSettingId; var result = BrandMetadataSelectableSettingId > 0 ? BrandMetadataSelectableSetting.Get(BrandMetadataSelectableSettingId) : BrandMetadataSelectableSetting.New(); result.SelectableType = GetIntOrDefault(TypeDropDownList.SelectedValue); result.Depth = GetIntOrDefault(DepthDropDownList.SelectedValue); result.SortType = GetIntOrDefault(SortTypeRadioButtonList.SelectedValue); result.OrderType = GetIntOrDefault(OrderTypeRadioButtonList.SelectedValue); result.ColumnCount = GetIntOrDefault(ColumnsDropDownList.SelectedValue); result.IsLinear = LinearCheckBox.Checked; result.AllowMultiple = AllowMultipleCheckbox.Checked; //leave as they are if existing and set the default values if not result.FilterGroup = result.IsNew ? 0 : result.FilterGroup; result.FilterSelectableType = result.IsNew ? (int)SelectableMetadataType.DropDown : result.FilterSelectableType; result.FilterDepth = result.IsNew ? 3 : result.FilterDepth; return(result); }
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."); }