yavsc/yavscModel/FrontOffice/Catalog/Brand.cs

70 lines
1.7 KiB
C#

10 years ago
using System;
using System.ComponentModel.DataAnnotations;
Refactoring: moving the Catalog manager and model into the Yavsc.Model.FrontOffice namespace * Web.config: * Catalog.xml: * MyClass.cs: * Note.cs: * Euro.cs: * Unit.cs: * Text.cs: * Link.cs: * Price.cs: * Label.cs: * Brand.cs: * Scalar.cs: * Option.cs: * Period.cs: * YavscModel.csproj: * Catalog.cs: * Service.cs: * Product.cs: * YavscClient.csproj: * CatalogManager.cs: * Currency.cs: * CheckBox.cs: * SaleForm.cs: * FormInput.cs: * CatalogProvider.cs: * TextInput.cs: * SelectItem.cs: * SalesCatalog.csproj: * FilesInput.cs: * FormElement.cs: * SelectInput.cs: * IValueProvider.cs: * StockStatus.cs: * RadioButton.cs: * Commande.cs: * ProductImage.cs: * WebCatalogExtensions.cs: * TemplateException.cs: * ProductCategory.cs: * PhysicalProduct.cs: * Note.cs: * Link.cs: * Text.cs: * Euro.cs: * Unit.cs: * WorkFlowManager.cs: * Brand.cs: * Label.cs: * Price.cs: * Scalar.cs: * FrontOfficeController.cs: * Period.cs: * Option.cs: * Product.cs: * Service.cs: * Catalog.cs: * SaleForm.cs: * Currency.cs: * CheckBox.cs: * TextInput.cs: * FrontOfficeApiController.cs: * FormInput.cs: * SelectItem.cs: * FilesInput.cs: * XmlCatalog.cs: * FormElement.cs: * SelectInput.cs: * RadioButton.cs: * StockStatus.cs: * ProductImage.cs: * CatalogHelper.cs: * CatalogManager.cs: * CatalogProvider.cs: * ProductCategory.cs: * PhysicalProduct.cs: * XmlCatalogProvider.cs: * CatalogProviderConfigurationElement.cs: * CatalogProvidersConfigurationSection.cs: * CatalogProvidersConfigurationCollection.cs: * CatalogProviderConfigurationElement.cs: * CatalogProvidersConfigurationSection.cs: * CatalogProvidersConfigurationCollection.cs: * CatalogHelper.cs:
10 years ago
namespace Yavsc.Model.FrontOffice
10 years ago
{
/// <summary>
/// Brand.
/// </summary>
10 years ago
public class Brand
{
/// <summary>
/// Initializes a new instance of the <see cref="Yavsc.Model.FrontOffice.Brand"/> class.
/// </summary>
10 years ago
public Brand ()
{
}
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
10 years ago
[Required]
public string Name { get; set; }
/// <summary>
/// Gets or sets the slogan.
/// </summary>
/// <value>The slogan.</value>
10 years ago
public string Slogan { get; set; }
/// <summary>
/// Gets or sets the logo.
/// </summary>
/// <value>The logo.</value>
10 years ago
public ProductImage Logo { get; set; }
/// <summary>
/// Gets or sets the categories.
/// </summary>
/// <value>The categories.</value>
10 years ago
public ProductCategory[] Categories { get; set; }
/// <summary>
/// Gets or sets the default form.
/// </summary>
/// <value>The default form.</value>
public SaleForm DefaultForm { get; set; }
/// <summary>
/// Gets the product category.
/// </summary>
/// <returns>The product category.</returns>
/// <param name="reference">Reference.</param>
10 years ago
public ProductCategory GetProductCategory(string reference)
{
return Array.Find<ProductCategory>(Categories, c => c.Reference == reference);
}
/// <summary>
/// Gets the name of the product category by.
/// </summary>
/// <returns>The product category by name.</returns>
/// <param name="catName">Cat name.</param>
10 years ago
public ProductCategory GetProductCategoryByName(string catName)
{
return Array.Find<ProductCategory>(Categories, c => c.Name == catName);
}
}
}