//------------------------------------------------------------------------------
// <auto-generated>
// 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!
// </auto-generated>
//------------------------------------------------------------------------------
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;
namespace Tango.BL.Entities
{
[Table("ROLES")]
public abstract class RoleBase : ObservableEntity<Role>
{
public event EventHandler<Int32> CodeChanged;
public event EventHandler<String> NameChanged;
public event EventHandler<String> DescriptionChanged;
public event EventHandler<SynchronizedObservableCollection<RolesPermission>> RolesPermissionsChanged;
public event EventHandler<SynchronizedObservableCollection<UsersRole>> UsersRolesChanged;
protected Int32 _code;
/// <summary>
/// Gets or sets the rolebase code.
/// </summary>
[Column("CODE")]
public Int32 Code
{
get
{
return _code;
}
set
{
if (_code != value)
{
_code = value;
OnCodeChanged(value);
}
}
}
protected String _name;
/// <summary>
/// Gets or sets the rolebase name.
/// </summary>
[Column("NAME")]
public String Name
{
get
{
return _name;
}
set
{
if (_name != value)
{
_name = value;
OnNameChanged(value);
}
}
}
protected String _description;
/// <summary>
/// Gets or sets the rolebase description.
/// </summary>
[Column("DESCRIPTION")]
public String Description
{
get
{
return _description;
}
set
{
if (_description != value)
{
_description = value;
OnDescriptionChanged(value);
}
}
}
protected SynchronizedObservableCollection<RolesPermission> _rolespermissions;
/// <summary>
/// Gets or sets the rolebase roles permissions.
/// </summary>
public virtual SynchronizedObservableCollection<RolesPermission> RolesPermissions
{
get
{
return _rolespermissions;
}
set
{
if (_rolespermissions != value)
{
_rolespermissions = value;
OnRolesPermissionsChanged(value);
}
}
}
protected SynchronizedObservableCollection<UsersRole> _usersroles;
/// <summary>
/// Gets or sets the rolebase users roles.
/// </summary>
public virtual SynchronizedObservableCollection<UsersRole> UsersRoles
{
get
{
return _usersroles;
}
set
{
if (_usersroles != value)
{
_usersroles = value;
OnUsersRolesChanged(value);
}
}
}
/// <summary>
/// Called when the Code has changed.
/// </summary>
protected virtual void OnCodeChanged(Int32 code)
{
CodeChanged?.Invoke(this, code);
RaisePropertyChanged(nameof(Code));
}
/// <summary>
/// Called when the Name has changed.
/// </summary>
protected virtual void OnNameChanged(String name)
{
NameChanged?.Invoke(this, name);
RaisePropertyChanged(nameof(Name));
}
/// <summary>
/// Called when the Description has changed.
/// </summary>
protected virtual void OnDescriptionChanged(String description)
{
DescriptionChanged?.Invoke(this, description);
RaisePropertyChanged(nameof(Description));
}
/// <summary>
/// Called when the RolesPermissions has changed.
/// </summary>
protected virtual void OnRolesPermissionsChanged(SynchronizedObservableCollection<RolesPermission> rolespermissions)
{
RolesPermissionsChanged?.Invoke(this, rolespermissions);
RaisePropertyChanged(nameof(RolesPermissions));
}
/// <summary>
/// Called when the UsersRoles has changed.
/// </summary>
protected virtual void OnUsersRolesChanged(SynchronizedObservableCollection<UsersRole> usersroles)
{
UsersRolesChanged?.Invoke(this, usersroles);
RaisePropertyChanged(nameof(UsersRoles));
}
/// <summary>
/// Initializes a new instance of the <see cref="RoleBase" /> class.
/// </summary>
public RoleBase() : base()
{
RolesPermissions = new SynchronizedObservableCollection<RolesPermission>();
UsersRoles = new SynchronizedObservableCollection<UsersRole>();
}
}
}