//------------------------------------------------------------------------------
//
// 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("ORGANIZATIONS")]
public abstract class OrganizationBase : ObservableEntity
{
public event EventHandler NameChanged;
public event EventHandler AddressChanged;
public event EventHandler ContactChanged;
public event EventHandler> CustomersChanged;
public event EventHandler> MachinesChanged;
public event EventHandler> SitesChanged;
public event EventHandler> UsersChanged;
protected String _name;
///
/// Gets or sets the organizationbase name.
///
[Column("NAME")]
public String Name
{
get
{
return _name;
}
set
{
if (_name != value)
{
_name = value;
OnNameChanged(value);
}
}
}
protected String _contactguid;
///
/// Gets or sets the organizationbase contact guid.
///
[Column("CONTACT_GUID")]
[ForeignKey("Contact")]
public String ContactGuid
{
get
{
return _contactguid;
}
set
{
if (_contactguid != value)
{
_contactguid = value;
}
}
}
protected String _addressguid;
///
/// Gets or sets the organizationbase address guid.
///
[Column("ADDRESS_GUID")]
[ForeignKey("Address")]
public String AddressGuid
{
get
{
return _addressguid;
}
set
{
if (_addressguid != value)
{
_addressguid = value;
}
}
}
protected Address _address;
///
/// Gets or sets the organizationbase address.
///
[XmlIgnore]
[JsonIgnore]
public virtual Address Address
{
get
{
return _address;
}
set
{
if (_address != value)
{
_address = value;
if (Address != null)
{
AddressGuid = Address.Guid;
}
OnAddressChanged(value);
}
}
}
protected Contact _contact;
///
/// Gets or sets the organizationbase contact.
///
[XmlIgnore]
[JsonIgnore]
public virtual Contact Contact
{
get
{
return _contact;
}
set
{
if (_contact != value)
{
_contact = value;
if (Contact != null)
{
ContactGuid = Contact.Guid;
}
OnContactChanged(value);
}
}
}
protected SynchronizedObservableCollection _customers;
///
/// Gets or sets the organizationbase customers.
///
public virtual SynchronizedObservableCollection Customers
{
get
{
return _customers;
}
set
{
if (_customers != value)
{
_customers = value;
OnCustomersChanged(value);
}
}
}
protected SynchronizedObservableCollection _machines;
///
/// Gets or sets the organizationbase machines.
///
public virtual SynchronizedObservableCollection Machines
{
get
{
return _machines;
}
set
{
if (_machines != value)
{
_machines = value;
OnMachinesChanged(value);
}
}
}
protected SynchronizedObservableCollection _sites;
///
/// Gets or sets the organizationbase sites.
///
public virtual SynchronizedObservableCollection Sites
{
get
{
return _sites;
}
set
{
if (_sites != value)
{
_sites = value;
OnSitesChanged(value);
}
}
}
protected SynchronizedObservableCollection _users;
///
/// Gets or sets the organizationbase users.
///
public virtual SynchronizedObservableCollection Users
{
get
{
return _users;
}
set
{
if (_users != value)
{
_users = value;
OnUsersChanged(value);
}
}
}
///
/// Called when the Name has changed.
///
protected virtual void OnNameChanged(String name)
{
NameChanged?.Invoke(this, name);
RaisePropertyChanged(nameof(Name));
}
///
/// Called when the Address has changed.
///
protected virtual void OnAddressChanged(Address address)
{
AddressChanged?.Invoke(this, address);
RaisePropertyChanged(nameof(Address));
}
///
/// Called when the Contact has changed.
///
protected virtual void OnContactChanged(Contact contact)
{
ContactChanged?.Invoke(this, contact);
RaisePropertyChanged(nameof(Contact));
}
///
/// Called when the Customers has changed.
///
protected virtual void OnCustomersChanged(SynchronizedObservableCollection customers)
{
CustomersChanged?.Invoke(this, customers);
RaisePropertyChanged(nameof(Customers));
}
///
/// Called when the Machines has changed.
///
protected virtual void OnMachinesChanged(SynchronizedObservableCollection machines)
{
MachinesChanged?.Invoke(this, machines);
RaisePropertyChanged(nameof(Machines));
}
///
/// Called when the Sites has changed.
///
protected virtual void OnSitesChanged(SynchronizedObservableCollection sites)
{
SitesChanged?.Invoke(this, sites);
RaisePropertyChanged(nameof(Sites));
}
///
/// Called when the Users has changed.
///
protected virtual void OnUsersChanged(SynchronizedObservableCollection users)
{
UsersChanged?.Invoke(this, users);
RaisePropertyChanged(nameof(Users));
}
///
/// Initializes a new instance of the class.
///
public OrganizationBase() : base()
{
Customers = new SynchronizedObservableCollection();
Machines = new SynchronizedObservableCollection();
Sites = new SynchronizedObservableCollection();
Users = new SynchronizedObservableCollection();
}
}
}