This commit is contained in:
2006-11-14 14:33:33 +00:00
commit a0cad33b0f
180 changed files with 40199 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// ========================================================================
// 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;
namespace Volian.CSLA.Library
{
public partial class DocVersion
{
public VersionTypeEnum eVersionType
{
get { return (VersionTypeEnum)_VersionType; }
set { _VersionType = (int)value; }
}
}
public enum VersionTypeEnum : int
{
WorkingDraft = 0, Temporary = 1, Revision = 128, Approved = 129
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Csla;
using Csla.Data;
namespace Volian.CSLA.Library
{
public partial class DocVersionInfo : ReadOnlyBase<DocVersionInfo>, IVEReadOnlyItem
{
#region IVEReadOnlyItem
ProcedureInfoList _pil = null;
public System.Collections.IList GetChildren()
{
if (_pil == null)
_pil = ProcedureInfoList.Get(StructureID);
return _pil;
}
public bool GetChildrenLoaded()
{
return _pil == null;
}
public bool HasChildren()
{
return StructureID > 0;
}
public override string ToString()
{
return string.Format("{0} - {1}", Name, Title);
}
#endregion
}
}

View File

@@ -0,0 +1,44 @@
// ========================================================================
// 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
{
public partial class Folder : BusinessBase<Folder>
{
#region Folder Config
[NonSerialized]
private FolderConfig _FolderConfig;
public FolderConfig FolderConfig
{
get
{
if (_FolderConfig == null)
{
_FolderConfig = new FolderConfig(this.Config);
_FolderConfig.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_FolderConfig_PropertyChanged);
}
return _FolderConfig;
}
}
private void _FolderConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
Config = _FolderConfig.ToString();
}
#endregion
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Csla;
using Csla.Data;
namespace Volian.CSLA.Library
{
public partial class FolderInfo : ReadOnlyBase<FolderInfo>, IVEReadOnlyItem
{
#region IVEReadOnlyItem
public System.Collections.IList GetChildren()
{
return DocVersions;
}
public bool GetChildrenLoaded()
{
return _DocVersions == null;
}
public bool HasChildren()
{
return DocVersionCount > 0;
}
public override string ToString()
{
return string.Format("{0} - {1}", Name, Title);
}
#endregion
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Csla;
using Csla.Data;
namespace Volian.CSLA.Library
{
public partial class ProcedureInfo : ReadOnlyBase<ProcedureInfo>, IVEReadOnlyItem
{
#region IVEReadOnlyItem
SectionInfoList _sil = null;
public System.Collections.IList GetChildren()
{
if (_sil == null)
_sil = SectionInfoList.Get(StructureID);
return _sil;
}
public bool GetChildrenLoaded()
{
return _sil == null;
}
public bool HasChildren()
{
return StructureID > 0;
}
public override string ToString()
{
return string.Format("{0} - {1}", this.Number,this.Title);
}
#endregion
}
}

View File

@@ -0,0 +1,72 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Csla;
using Csla.Data;
namespace Volian.CSLA.Library
{
public partial class ProcedureInfoList : ReadOnlyListBase<ProcedureInfoList, ProcedureInfo>
{
#region Factory Methods
public static ProcedureInfoList Get(int StructureID)
{
return DataPortal.Fetch<ProcedureInfoList>(new StructureIDCriteria(StructureID));
}
#endregion
#region Data Access
[Serializable()]
protected class StructureIDCriteria
{
private int _id;
public int Id
{
get { return _id; }
}
public StructureIDCriteria(int id)
{
_id = id;
}
}
protected void DataPortal_Fetch(StructureIDCriteria criteria)
{
this.RaiseListChangedEvents = false;
// if (log.IsDebugEnabled) log.Debug(this.GetType().ToString());
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "vesp_ListProcsCSLA";
cm.Parameters.AddWithValue("@StructID", criteria.Id);
SqlDataReader drRaw = cm.ExecuteReader();
using (SafeDataReader dr = new SafeDataReader(drRaw))
{
IsReadOnly = false;
while (dr.Read())
{
ProcedureInfo info = new ProcedureInfo(dr);
this.Add(info);
}
IsReadOnly = true;
}
}
}
}
catch (Exception ex)
{
//System.Diagnostics.StackFrame[] sf = new System.Diagnostics.StackTrace().GetFrames();
//string sMsg = string.Format("{0}.{1} Exception: {2} \r\n Message: {3}\r\n Inner Exception:{4}",
// this.GetType().ToString(), sf[0].GetMethod().Name,
// ex.GetType().ToString(), ex.Message, ex.InnerException);
//System.Diagnostics.EventLog.WriteEntry("VEReadOnlyListBase", sMsg);
//Console.WriteLine(sMsg);
if (Database.Log.IsErrorEnabled) Database.Log.Error("Fetch Error", ex);
}
this.RaiseListChangedEvents = true;
}
#endregion
}
}

View File

@@ -0,0 +1,86 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Csla;
using Csla.Data;
namespace Volian.CSLA.Library
{
public partial class SectionInfo : ReadOnlyBase<SectionInfo>, IVEReadOnlyItem
{
#region Business Methods
private string _PPath = string.Empty;
/// <summary>
/// Required to build tree PPath is the Parent Path calculated with a recursive query
/// </summary>
public string PPath
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _PPath;
}
}
private string _Path = string.Empty;
/// <summary>
/// Required to build tree Path is the Current Path calculated with a recursive query
/// </summary>
public string Path
{
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
get
{
CanReadProperty(true);
return _Path;
}
}
#endregion
#region IVEReadOnlyItem
HLStepInfoList _hlsil = null;
public System.Collections.IList GetChildren()
{
if (_hlsil == null)
{
if(ContentType==1)
_hlsil = HLStepInfoList.Get(ContentID);
}
return _hlsil;
}
public bool GetChildrenLoaded()
{
return _hlsil == null;
}
public bool HasChildren()
{
return ContentType==1 && ContentID != 0;
}
public override string ToString()
{
return string.Format("{0} - {1}", this.Number, this.Title);
}
#endregion
#region Data Access Portal
/// <summary>
/// This loads the SectionInfo Record and adds the Path and PPath fields
/// </summary>
/// <param name="dr"></param>
/// <returns></returns>
internal static SectionInfo ExtendedGet(SafeDataReader dr)
{
try
{
SectionInfo si = new SectionInfo(dr);
si._Path = dr.GetString("Path");
si._PPath = dr.GetString("PPath");
return si;
}
catch (Exception ex)
{
Database.LogException("SectionInfo.Constructor", ex);
throw new DbCslaException("SectionInfo.Constructor", ex);
}
}
#endregion
}
}

View File

@@ -0,0 +1,77 @@
using System;
using System.Data;
using System.Data.SqlClient;
using Csla;
using Csla.Data;
namespace Volian.CSLA.Library
{
public partial class SectionInfoList : ReadOnlyListBase<SectionInfoList, SectionInfo>
{
#region Factory Methods
/// <summary>
/// Get SectionInfoList based upon starting Structure ID
/// </summary>
/// <param name="StructureID">Starting structureID</param>
/// <returns></returns>
public static SectionInfoList Get(int StructureID)
{
return DataPortal.Fetch<SectionInfoList>(new StructureIDCriteria(StructureID));
}
#endregion
#region Generic Data Access
[Serializable()]
protected class StructureIDCriteria
{
private int _id;
public int Id
{
get { return _id; }
}
public StructureIDCriteria(int id)
{
_id = id;
}
}
protected void DataPortal_Fetch(StructureIDCriteria criteria)
{
this.RaiseListChangedEvents = false;
// if (log.IsDebugEnabled) log.Debug(this.GetType().ToString());
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "vesp_ListSectsCSLA";
cm.Parameters.AddWithValue("@StructID", criteria.Id);
SqlDataReader drRaw = cm.ExecuteReader();
using (SafeDataReader dr = new SafeDataReader(drRaw))
{
IsReadOnly = false;
while (dr.Read())
{
SectionInfo info = SectionInfo.ExtendedGet(dr);
this.Add(info);
}
IsReadOnly = true;
}
}
}
}
catch (Exception ex)
{
//System.Diagnostics.StackFrame[] sf = new System.Diagnostics.StackTrace().GetFrames();
//string sMsg = string.Format("{0}.{1} Exception: {2} \r\n Message: {3}\r\n Inner Exception:{4}",
// this.GetType().ToString(), sf[0].GetMethod().Name,
// ex.GetType().ToString(), ex.Message, ex.InnerException);
//System.Diagnostics.EventLog.WriteEntry("VEReadOnlyListBase", sMsg);
//Console.WriteLine(sMsg);
if (Database.Log.IsErrorEnabled) Database.Log.Error("Fetch Error", ex);
}
this.RaiseListChangedEvents = true;
}
#endregion
}
}