Files
ayanova7/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/DataPortalInfo.cs
2018-06-29 19:47:36 +00:00

161 lines
4.4 KiB
C#

///////////////////////////////////////////////////////////
// Bool.cs
// Implementation of Class DataPortalInfo
// CSLA type: Read-only object
// Created on: 06-Dec-2004
// Object design: John
// Coded: John Aug 4 2004
///////////////////////////////////////////////////////////
using System;
using System.Data;
using CSLA.Data;
using GZTW.Data;
using CSLA;
using System.Threading;
using CSLA.Security;
using System.Text;
using System.Diagnostics;
using System.Reflection;
using System.Configuration;
namespace GZTW.AyaNova.BLL
{
/// <summary>
/// Used to quickly fetch a single Bool record from the db
/// </summary>
[Serializable]
public class DataPortalInfo : ReadOnlyBase
{
#region Attributes
private string mInfo;
#endregion
#region Constructor
/// <summary>
/// Private constructor to prevent direct instantiation
/// </summary>
private DataPortalInfo()
{
}
#endregion
#region Business properties
#endregion
#region Static methods
/// <summary>
/// Fetch support info off the remote data portal
/// </summary>
/// <returns></returns>
public static string GetItem()
{
return ((DataPortalInfo)DataPortal.Fetch(new Criteria( ))).mInfo;
}
#endregion
#region DAL DATA ACCESS
///
/// <param Bool="Criteria"></param>
protected override void DataPortal_Fetch(object Criteria)
{
try
{
StringBuilder sb = new StringBuilder();
sb.Append(
"\tPORTAL: Machine name: " + System.Environment.MachineName + "\r\n" +
//"\tAyaNova Connection: " + DiagnosticConnectionInfo + "\r\n" +
//"\tGenerate PM and Notify from this connection: " + IAmAGenerator.ToString()+ "\r\n" +
"\tPORTAL: OS user name: " + System.Environment.UserName + "\r\n" +
//"\tNetworked: " + SystemInformation.Network.ToString() + "\r\n" +
"\tPORTAL: OS user domain name: " + System.Environment.UserDomainName + "\r\n" +
//"\tPORTAL: OS version: " + System.Environment.OSVersion.ToString() + "\r\n" +
OSVersionInfo.FullOperatingSystemInformationForDisplay + "\r\n" +
"\tPORTAL: System folder: " + System.Environment.SystemDirectory + "\r\n" +
"\tPORTAL: CLR version: " + System.Environment.Version.ToString() + "\r\n" +
"\tPORTAL: Current directory: " + System.Environment.CurrentDirectory + "\r\n" +
"\tPORTAL: Logical drives: ");
foreach(string s in System.Environment.GetLogicalDrives())
sb.Append(s+" ");
sb.Append( "\r\n");
sb.Append(
"\tPORTAL: Working set: " + System.Environment.WorkingSet.ToString() + "\r\n" +
//"\tPrimary monitor size: " + SystemInformation.PrimaryMonitorSize.ToString() + "\r\n" +
"\tPORTAL: Locale current culture: " + System.Threading.Thread.CurrentThread.CurrentCulture.EnglishName + "\r\n" +
"\tPORTAL: Locale currency symbol: " + System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol + "\r\n" +
"\tPORTAL: Locale short date pattern: " + System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern + "\r\n" +
"\tPORTAL: Locale short time pattern: " + System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortTimePattern + "\r\n" );
Assembly a=Assembly.GetExecutingAssembly();
AssemblyName an=a.GetName();
sb.Append("\tPORTAL: Primary assembly: "+an.Name + " " + AyaBizUtils.DisplayVersion(an.Version)+"\r\n");
////Sub release version if any
sb.Append(AyaBizUtils.SubVersion);
sb.Append("\tPORTAL: Primary assembly location: "+an.CodeBase +"\r\n");
sb.Append("\t\tPORTAL: References:\r\n");
foreach(AssemblyName arn in a.GetReferencedAssemblies())
{
sb.Append("\t\tPORTAL: " + arn.Name + " " + AyaBizUtils.DisplayVersion(arn.Version)+"\r\n");
}
mInfo=sb.ToString();
}
catch(Exception ex)
{
this.mInfo="PORTAL: Error retrieving diagnostic info:\r\n" + ex.Message;
}
}
#endregion
#region criteria
/// <summary>
/// Criteria for identifying existing object
/// </summary>
[Serializable]
private class Criteria
{
public Criteria()
{
}
}
#endregion
}//end Bool
}//end Boolspace GZTW.AyaNova.BLL