|
| 1 | +using System.Collections.Generic; |
| 2 | +using Grand.Core.Domain.Catalog; |
| 3 | +using Grand.Core.Domain.Localization; |
| 4 | +using Grand.Core.Domain.Stores; |
| 5 | +using Grand.Core.Domain.Security; |
| 6 | + |
| 7 | +namespace Grand.Core.Domain.Messages |
| 8 | +{ |
| 9 | + /// <summary> |
| 10 | + /// Represents a contact attribute |
| 11 | + /// </summary> |
| 12 | + public partial class ContactAttribute : BaseEntity, ILocalizedEntity, IStoreMappingSupported, IAclSupported |
| 13 | + { |
| 14 | + private ICollection<ContactAttributeValue> _contactAttributeValues; |
| 15 | + |
| 16 | + public ContactAttribute() |
| 17 | + { |
| 18 | + Stores = new List<string>(); |
| 19 | + Locales = new List<LocalizedProperty>(); |
| 20 | + CustomerRoles = new List<string>(); |
| 21 | + } |
| 22 | + /// <summary> |
| 23 | + /// Gets or sets the name |
| 24 | + /// </summary> |
| 25 | + public string Name { get; set; } |
| 26 | + |
| 27 | + /// <summary> |
| 28 | + /// Gets or sets the text prompt |
| 29 | + /// </summary> |
| 30 | + public string TextPrompt { get; set; } |
| 31 | + |
| 32 | + /// <summary> |
| 33 | + /// Gets or sets a value indicating whether the entity is required |
| 34 | + /// </summary> |
| 35 | + public bool IsRequired { get; set; } |
| 36 | + |
| 37 | + |
| 38 | + /// <summary> |
| 39 | + /// Gets or sets the attribute control type identifier |
| 40 | + /// </summary> |
| 41 | + public int AttributeControlTypeId { get; set; } |
| 42 | + |
| 43 | + /// <summary> |
| 44 | + /// Gets or sets the display order |
| 45 | + /// </summary> |
| 46 | + public int DisplayOrder { get; set; } |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores |
| 50 | + /// </summary> |
| 51 | + public bool LimitedToStores { get; set; } |
| 52 | + public IList<string> Stores { get; set; } |
| 53 | + |
| 54 | + |
| 55 | + /// <summary> |
| 56 | + /// Gets or sets the collection of locales |
| 57 | + /// </summary> |
| 58 | + public IList<LocalizedProperty> Locales { get; set; } |
| 59 | + |
| 60 | + //validation fields |
| 61 | + |
| 62 | + /// <summary> |
| 63 | + /// Gets or sets the validation rule for minimum length (for textbox and multiline textbox) |
| 64 | + /// </summary> |
| 65 | + public int? ValidationMinLength { get; set; } |
| 66 | + |
| 67 | + /// <summary> |
| 68 | + /// Gets or sets the validation rule for maximum length (for textbox and multiline textbox) |
| 69 | + /// </summary> |
| 70 | + public int? ValidationMaxLength { get; set; } |
| 71 | + |
| 72 | + /// <summary> |
| 73 | + /// Gets or sets the validation rule for file allowed extensions (for file upload) |
| 74 | + /// </summary> |
| 75 | + public string ValidationFileAllowedExtensions { get; set; } |
| 76 | + |
| 77 | + /// <summary> |
| 78 | + /// Gets or sets the validation rule for file maximum size in kilobytes (for file upload) |
| 79 | + /// </summary> |
| 80 | + public int? ValidationFileMaximumSize { get; set; } |
| 81 | + |
| 82 | + /// <summary> |
| 83 | + /// Gets or sets the default value (for textbox and multiline textbox) |
| 84 | + /// </summary> |
| 85 | + public string DefaultValue { get; set; } |
| 86 | + |
| 87 | + /// <summary> |
| 88 | + /// Gets or sets a condition (depending on other attribute) when this attribute should be enabled (visible). |
| 89 | + /// </summary> |
| 90 | + public string ConditionAttributeXml { get; set; } |
| 91 | + |
| 92 | + /// <summary> |
| 93 | + /// Gets or sets a value indicating whether the entity is subject to ACL |
| 94 | + /// </summary> |
| 95 | + public bool SubjectToAcl { get; set; } |
| 96 | + public IList<string> CustomerRoles { get; set; } |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + /// <summary> |
| 101 | + /// Gets the attribute control type |
| 102 | + /// </summary> |
| 103 | + public AttributeControlType AttributeControlType |
| 104 | + { |
| 105 | + get |
| 106 | + { |
| 107 | + return (AttributeControlType)this.AttributeControlTypeId; |
| 108 | + } |
| 109 | + set |
| 110 | + { |
| 111 | + this.AttributeControlTypeId = (int)value; |
| 112 | + } |
| 113 | + } |
| 114 | + /// <summary> |
| 115 | + /// Gets the checkout attribute values |
| 116 | + /// </summary> |
| 117 | + public virtual ICollection<ContactAttributeValue> ContactAttributeValues |
| 118 | + { |
| 119 | + get { return _contactAttributeValues ?? (_contactAttributeValues = new List<ContactAttributeValue>()); } |
| 120 | + protected set { _contactAttributeValues = value; } |
| 121 | + } |
| 122 | + } |
| 123 | + |
| 124 | +} |
0 commit comments