251 lines
6.8 KiB
C#
251 lines
6.8 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>
|
|
/// UserInfo Generated by MyGeneration using the CSLA Object Mapping template
|
|
/// </summary>
|
|
[Serializable()]
|
|
public partial class UserInfo : ReadOnlyBase<UserInfo>
|
|
{
|
|
#region Business Methods
|
|
private int _UID;
|
|
[System.ComponentModel.DataObjectField(true, true)]
|
|
public int UID
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _UID;
|
|
}
|
|
}
|
|
private string _UserID = string.Empty;
|
|
public string UserID
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _UserID;
|
|
}
|
|
}
|
|
private string _FirstName = string.Empty;
|
|
public string FirstName
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _FirstName;
|
|
}
|
|
}
|
|
private string _MiddleName = string.Empty;
|
|
public string MiddleName
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _MiddleName;
|
|
}
|
|
}
|
|
private string _LastName = string.Empty;
|
|
public string LastName
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _LastName;
|
|
}
|
|
}
|
|
private string _Suffix = string.Empty;
|
|
public string Suffix
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _Suffix;
|
|
}
|
|
}
|
|
private string _CourtesyTitle = string.Empty;
|
|
public string CourtesyTitle
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _CourtesyTitle;
|
|
}
|
|
}
|
|
private string _PhoneNumber = string.Empty;
|
|
public string PhoneNumber
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _PhoneNumber;
|
|
}
|
|
}
|
|
private string _CFGName = string.Empty;
|
|
public string CFGName
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _CFGName;
|
|
}
|
|
}
|
|
private string _UserLogin = string.Empty;
|
|
public string UserLogin
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _UserLogin;
|
|
}
|
|
}
|
|
private string _UserName = string.Empty;
|
|
public string UserName
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _UserName;
|
|
}
|
|
}
|
|
private string _Config = string.Empty;
|
|
public string Config
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _Config;
|
|
}
|
|
}
|
|
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 _Membershipcount = 0;
|
|
/// <summary>
|
|
/// Count of Membership for this User
|
|
/// </summary>
|
|
public int MembershipCount
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _Membershipcount;
|
|
}
|
|
}
|
|
private MembershipInfoList _Memberships = null;
|
|
public MembershipInfoList Memberships
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
if (_Memberships == null)
|
|
_Memberships = MembershipInfoList.GetByUser(_UID);
|
|
return _Memberships;
|
|
}
|
|
}
|
|
// TODO: Replace base UserInfo.ToString function as necessary
|
|
/// <summary>
|
|
/// Overrides Base ToString
|
|
/// </summary>
|
|
/// <returns>A string representation of current UserInfo</returns>
|
|
//public override string ToString()
|
|
//{
|
|
// return base.ToString();
|
|
//}
|
|
// TODO: Check UserInfo.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 UserInfo</returns>
|
|
protected override object GetIdValue()
|
|
{
|
|
return _UID;
|
|
}
|
|
#endregion
|
|
#region Factory Methods
|
|
private UserInfo()
|
|
{ /* require use of factory methods */ }
|
|
public User Get()
|
|
{
|
|
return User.Get(_UID);
|
|
}
|
|
#endregion
|
|
#region Data Access Portal
|
|
internal UserInfo(SafeDataReader dr)
|
|
{
|
|
try
|
|
{
|
|
_UID = dr.GetInt32("UID");
|
|
_UserID = dr.GetString("UserID");
|
|
_FirstName = dr.GetString("FirstName");
|
|
_MiddleName = dr.GetString("MiddleName");
|
|
_LastName = dr.GetString("LastName");
|
|
_Suffix = dr.GetString("Suffix");
|
|
_CourtesyTitle = dr.GetString("CourtesyTitle");
|
|
_PhoneNumber = dr.GetString("PhoneNumber");
|
|
_CFGName = dr.GetString("CFGName");
|
|
_UserLogin = dr.GetString("UserLogin");
|
|
_UserName = dr.GetString("UserName");
|
|
_Config = dr.GetString("Config");
|
|
_DTS = dr.GetDateTime("DTS");
|
|
_UsrID = dr.GetString("UsrID");
|
|
_Membershipcount = dr.GetInt32("MembershipCount");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Database.LogException("UserInfo.Constructor", ex);
|
|
throw new DbCslaException("UserInfo.Constructor", ex);
|
|
}
|
|
}
|
|
#endregion
|
|
} // Class
|
|
} // Namespace
|