//------------------------------------------------------------------------------
//
// This code was generated by a tool.
// Tango Observables Generator
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. Do not modify!
//
//------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Xml.Serialization;
using Newtonsoft.Json;
using System.Linq;
using Tango.DAL.Remote.DB;
using Tango.Core;
using System.ComponentModel;
using Tango.Core.CustomAttributes;
namespace Tango.BL.Entities
{
[Table("SITES_CATALOGS")]
public abstract class SitesCatalogBase : ObservableEntity
{
public event EventHandler ColorCatalogChanged;
public event EventHandler SiteChanged;
protected String _siteguid;
///
/// Gets or sets the sitescatalogbase site guid.
///
[Column("SITE_GUID")]
[ForeignKey("Site")]
public String SiteGuid
{
get
{
return _siteguid;
}
set
{
if (_siteguid != value)
{
_siteguid = value;
}
}
}
protected String _colorcatalogguid;
///
/// Gets or sets the sitescatalogbase color catalog guid.
///
[Column("COLOR_CATALOG_GUID")]
[ForeignKey("ColorCatalog")]
public String ColorCatalogGuid
{
get
{
return _colorcatalogguid;
}
set
{
if (_colorcatalogguid != value)
{
_colorcatalogguid = value;
}
}
}
protected ColorCatalog _colorcatalog;
///
/// Gets or sets the sitescatalogbase color catalogs.
///
[XmlIgnore]
[JsonIgnore]
public virtual ColorCatalog ColorCatalog
{
get
{
return _colorcatalog;
}
set
{
if (_colorcatalog != value)
{
_colorcatalog = value;
if (ColorCatalog != null)
{
ColorCatalogGuid = ColorCatalog.Guid;
}
OnColorCatalogChanged(value);
}
}
}
protected Site _site;
///
/// Gets or sets the sitescatalogbase site.
///
[XmlIgnore]
[JsonIgnore]
public virtual Site Site
{
get
{
return _site;
}
set
{
if (_site != value)
{
_site = value;
if (Site != null)
{
SiteGuid = Site.Guid;
}
OnSiteChanged(value);
}
}
}
///
/// Called when the ColorCatalog has changed.
///
protected virtual void OnColorCatalogChanged(ColorCatalog colorcatalog)
{
ColorCatalogChanged?.Invoke(this, colorcatalog);
RaisePropertyChanged(nameof(ColorCatalog));
}
///
/// Called when the Site has changed.
///
protected virtual void OnSiteChanged(Site site)
{
SiteChanged?.Invoke(this, site);
RaisePropertyChanged(nameof(Site));
}
///
/// Initializes a new instance of the class.
///
public SitesCatalogBase() : base()
{
}
}
}