2007-11-20 20:12:45 +00:00

156 lines
4.0 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.Collections.Generic;
namespace VEPROMS.CSLA.Library
{
public partial class DocVersion: IVEDrillDown
{
#region VersionType
public VersionTypeEnum eVersionType
{
get { return (VersionTypeEnum)_VersionType; }
set { _VersionType = (int)value; }
}
#endregion
#region DocVersion Config
[NonSerialized]
private DocVersionConfig _DocVersionConfig;
public DocVersionConfig DocVersionConfig
{
get
{
if (_DocVersionConfig == null)
{
_DocVersionConfig = new DocVersionConfig(this);
_DocVersionConfig.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_DocVersionConfig_PropertyChanged);
}
return _DocVersionConfig;
}
}
private void _DocVersionConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
Config = _DocVersionConfig.ToString();
}
#endregion
public override string ToString()
{
return string.Format("{0} - {1}", Name, Title);
}
#region IVEDrillDown
public System.Collections.IList GetChildren()
{
return null;
}
public bool HasChildren
{
get { return _ItemID > 0; }
}
public IVEDrillDown ActiveParent
{
get
{
return MyFolder;
}
}
public Format ActiveFormat
{
get { return LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat; }
}
public Format LocalFormat
{
get { return MyFormat; }
}
public DynamicTypeDescriptor MyConfig
{
get { return DocVersionConfig; }
}
#endregion
}
public partial class DocVersionInfo:IVEDrillDownReadOnly
{
#region DocVersion Config
[NonSerialized]
private DocVersionConfig _DocVersionConfig;
public DocVersionConfig DocVersionConfig
{ get { return (_DocVersionConfig != null ? _DocVersionConfig : _DocVersionConfig = new DocVersionConfig(this));} }
private void DocVersionConfigRefresh()
{
_DocVersionConfig = null;
}
#endregion
ItemInfoList _iil = null;
public ItemInfoList Procedures
{ get { return (_iil != null ? _iil: _iil = ItemInfoList.GetList(_ItemID,(int)E_FromType.Procedure)); } }
#region IVEReadOnlyItem
public System.Collections.IList GetChildren()
{
return Procedures;
}
//public bool ChildrenAreLoaded
//{
// get { return _iil == null; }
//}
public bool HasChildren
{
get { return _ItemID > 0; }
}
public IVEDrillDownReadOnly ActiveParent
{
get
{
return MyFolder;
}
}
public FormatInfo ActiveFormat
{
get { return LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat; }
}
public FormatInfo LocalFormat
{
get { return MyFormat; }
}
public DynamicTypeDescriptor MyConfig
{
get { return Get().DocVersionConfig; }
}
//public bool HasStandardSteps()
//{ return false; }
public override string ToString()
{
return string.Format("{0} - {1}", Name, Title);
}
//public string ToString(string str,System.IFormatProvider ifp)
//{
// return ToString();
//}
#endregion
#region Extension
partial class DocVersionInfoExtension : extensionBase
{
public override void Refresh(DocVersionInfo tmp)
{
tmp.DocVersionConfigRefresh();
}
}
#endregion
}
public enum VersionTypeEnum : int
{
WorkingDraft = 0, Temporary = 1, Revision = 128, Approved = 129
}
}