178 lines
4.9 KiB
C#
178 lines
4.9 KiB
C#
// ========================================================================
|
|
// Copyright 2006 - Volian Enterprises, Inc. All rights reserved.
|
|
// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
|
// ------------------------------------------------------------------------
|
|
// $Workfile: $ $Revision: $
|
|
// $Author: $ $Date: $
|
|
//
|
|
// $History: $
|
|
// ========================================================================
|
|
|
|
using System;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using Csla;
|
|
using Csla.Data;
|
|
using System.Configuration;
|
|
using System.IO;
|
|
|
|
namespace Volian.CSLA.Library
|
|
{
|
|
/// <summary>
|
|
/// RoleInfo Generated by MyGeneration using the CSLA Object Mapping template
|
|
/// </summary>
|
|
[Serializable()]
|
|
public partial class RoleInfo : ReadOnlyBase<RoleInfo>
|
|
{
|
|
#region Business Methods
|
|
private int _RID;
|
|
[System.ComponentModel.DataObjectField(true, true)]
|
|
public int RID
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _RID;
|
|
}
|
|
}
|
|
private string _Name = string.Empty;
|
|
public string Name
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _Name;
|
|
}
|
|
}
|
|
private string _Title = string.Empty;
|
|
public string Title
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _Title;
|
|
}
|
|
}
|
|
private DateTime _DTS = new DateTime();
|
|
public DateTime DTS
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _DTS;
|
|
}
|
|
}
|
|
private string _UsrID = string.Empty;
|
|
public string UsrID
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _UsrID;
|
|
}
|
|
}
|
|
private int _Assignmentcount = 0;
|
|
/// <summary>
|
|
/// Count of Assignment for this Role
|
|
/// </summary>
|
|
public int AssignmentCount
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _Assignmentcount;
|
|
}
|
|
}
|
|
private AssignmentInfoList _Assignments = null;
|
|
public AssignmentInfoList Assignments
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
if (_Assignments == null)
|
|
_Assignments = AssignmentInfoList.GetByRole(_RID);
|
|
return _Assignments;
|
|
}
|
|
}
|
|
private int _Permissioncount = 0;
|
|
/// <summary>
|
|
/// Count of Permission for this Role
|
|
/// </summary>
|
|
public int PermissionCount
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _Permissioncount;
|
|
}
|
|
}
|
|
private PermissionInfoList _Permissions = null;
|
|
public PermissionInfoList Permissions
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
if (_Permissions == null)
|
|
_Permissions = PermissionInfoList.GetByRole(_RID);
|
|
return _Permissions;
|
|
}
|
|
}
|
|
// TODO: Replace base RoleInfo.ToString function as necessary
|
|
/// <summary>
|
|
/// Overrides Base ToString
|
|
/// </summary>
|
|
/// <returns>A string representation of current RoleInfo</returns>
|
|
//public override string ToString()
|
|
//{
|
|
// return base.ToString();
|
|
//}
|
|
// TODO: Check RoleInfo.GetIdValue to assure that the ID returned is unique
|
|
/// <summary>
|
|
/// Overrides Base GetIdValue - Used internally by CSLA to determine equality
|
|
/// </summary>
|
|
/// <returns>A Unique ID for the current RoleInfo</returns>
|
|
protected override object GetIdValue()
|
|
{
|
|
return _RID;
|
|
}
|
|
#endregion
|
|
#region Factory Methods
|
|
private RoleInfo()
|
|
{ /* require use of factory methods */ }
|
|
public Role Get()
|
|
{
|
|
return Role.Get(_RID);
|
|
}
|
|
#endregion
|
|
#region Data Access Portal
|
|
internal RoleInfo(SafeDataReader dr)
|
|
{
|
|
try
|
|
{
|
|
_RID = dr.GetInt32("RID");
|
|
_Name = dr.GetString("Name");
|
|
_Title = dr.GetString("Title");
|
|
_DTS = dr.GetDateTime("DTS");
|
|
_UsrID = dr.GetString("UsrID");
|
|
_Assignmentcount = dr.GetInt32("AssignmentCount");
|
|
_Permissioncount = dr.GetInt32("PermissionCount");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Database.LogException("RoleInfo.Constructor", ex);
|
|
throw new DbCslaException("RoleInfo.Constructor", ex);
|
|
}
|
|
}
|
|
#endregion
|
|
} // Class
|
|
} // Namespace
|