Table of Contents

Class FieldOption

Namespace
Dynamicweb.Ecommerce.Products
Assembly
Dynamicweb.Ecommerce.dll

Represents a single field option.

[Serializable]
public class FieldOption
Inheritance
FieldOption
Inherited Members

Examples

using Dynamicweb.Ecommerce.Products;

namespace Dynamicweb.Ecommerce.Examples.Products
{
    public class ProductFieldOptionHandlerSample
    {
        public string AddOption(string fieldId, string name, string value)
        {
            FieldOption option = new FieldOption
            {
                FieldId = fieldId,
                Sort = Services.FieldOptions.MaximumSort(fieldId) + 1,
                Value = value,
                IsDefault = false
            };

            var languageId = Services.Languages.GetDefaultLanguageId();
            option.SetName(languageId, name);

            Services.FieldOptions.Save(option);        

            return option.Id;
        }
} 
}

Constructors

FieldOption()

Initializes a new instance of FieldOption.

public FieldOption()

FieldOption(FieldOption)

Initializes a new instance of FieldOption.

public FieldOption(FieldOption option)

Parameters

option FieldOption

Option to copy property values from.

Properties

FieldId

Gets or sets and ID of the related field.

public string FieldId { get; set; }

Property Value

string

Id

Gets or sets option ID.

public string Id { get; set; }

Property Value

string

IsDefault

Gets or sets value indicating whether this option is selected by default.

public bool IsDefault { get; set; }

Property Value

bool

Sort

Gets or sets the sort number.

public int Sort { get; set; }

Property Value

int

Translations

Gets the translations for the current entity

public TranslationCollection<FieldOptionTranslation> Translations { get; }

Property Value

TranslationCollection<FieldOptionTranslation>

Value

Gets or sets the value associated with this option.

public string Value { get; set; }

Property Value

string

Methods

GetName(string)

public string GetName(string languageId)

Parameters

languageId string

Returns

string

SetName(string, string)

public void SetName(string languageId, string name)

Parameters

languageId string
name string
To top