188 lines
5.1 KiB
C#
188 lines
5.1 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>
|
|
/// ConnectionInfo Generated by MyGeneration using the CSLA Object Mapping template
|
|
/// </summary>
|
|
[Serializable()]
|
|
public partial class ConnectionInfo : ReadOnlyBase<ConnectionInfo>
|
|
{
|
|
#region Business Methods
|
|
private int _DBID;
|
|
[System.ComponentModel.DataObjectField(true, true)]
|
|
public int DBID
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _DBID;
|
|
}
|
|
}
|
|
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 string _ConnectionString = string.Empty;
|
|
public string ConnectionString
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _ConnectionString;
|
|
}
|
|
}
|
|
private int _ServerType;
|
|
/// <summary>
|
|
/// 0 SQL Server
|
|
/// </summary>
|
|
public int ServerType
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _ServerType;
|
|
}
|
|
}
|
|
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 _Foldercount = 0;
|
|
/// <summary>
|
|
/// Count of Folder for this Connection
|
|
/// </summary>
|
|
public int FolderCount
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
return _Foldercount;
|
|
}
|
|
}
|
|
private FolderInfoList _Folders = null;
|
|
public FolderInfoList Folders
|
|
{
|
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
|
|
get
|
|
{
|
|
CanReadProperty(true);
|
|
if (_Folders == null)
|
|
_Folders = FolderInfoList.GetByConnection(_DBID);
|
|
return _Folders;
|
|
}
|
|
}
|
|
// TODO: Replace base ConnectionInfo.ToString function as necessary
|
|
/// <summary>
|
|
/// Overrides Base ToString
|
|
/// </summary>
|
|
/// <returns>A string representation of current ConnectionInfo</returns>
|
|
//public override string ToString()
|
|
//{
|
|
// return base.ToString();
|
|
//}
|
|
// TODO: Check ConnectionInfo.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 ConnectionInfo</returns>
|
|
protected override object GetIdValue()
|
|
{
|
|
return _DBID;
|
|
}
|
|
#endregion
|
|
#region Factory Methods
|
|
private ConnectionInfo()
|
|
{ /* require use of factory methods */ }
|
|
public Connection Get()
|
|
{
|
|
return Connection.Get(_DBID);
|
|
}
|
|
#endregion
|
|
#region Data Access Portal
|
|
internal ConnectionInfo(SafeDataReader dr)
|
|
{
|
|
try
|
|
{
|
|
_DBID = dr.GetInt32("DBID");
|
|
_Name = dr.GetString("Name");
|
|
_Title = dr.GetString("Title");
|
|
_ConnectionString = dr.GetString("ConnectionString");
|
|
_ServerType = dr.GetInt32("ServerType");
|
|
_Config = dr.GetString("Config");
|
|
_DTS = dr.GetDateTime("DTS");
|
|
_UsrID = dr.GetString("UsrID");
|
|
_Foldercount = dr.GetInt32("FolderCount");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Database.LogException("ConnectionInfo.Constructor", ex);
|
|
throw new DbCslaException("ConnectionInfo.Constructor", ex);
|
|
}
|
|
}
|
|
#endregion
|
|
} // Class
|
|
} // Namespace
|