CSLA - Extension

This commit is contained in:
2026-09-01 08:21:41 -04:00
parent dcd2fbc294
commit dab65dbfb6
30 changed files with 2703 additions and 5680 deletions
+28 -103
View File
@@ -1,42 +1,27 @@
using System;
using System.Collections.Generic;
using System.Text;
using Csla;
using Csla.Data;
namespace VEPROMS.CSLA.Library
{
public partial class ContentPart
{
public override string ToString()
{
return string.Format("{0} {1}", MyItem.MyContent.Number, MyItem.MyContent.Text);
}
}
public override string ToString() => string.Format("{0} {1}", MyItem.MyContent.Number, MyItem.MyContent.Text);
}
public partial class ItemPart
{
public override string ToString()
{
return string.Format("{0} {1}", _MyContent.Number, MyContent.Text);
}
}
public override string ToString() => string.Format("{0} {1}", _MyContent.Number, MyContent.Text);
}
public partial class Part
{
public override string ToString()
{
return string.Format("{0} {1}", MyItem.MyContent.Number, MyItem.MyContent.Text);
}
}
public override string ToString() => string.Format("{0} {1}", MyItem.MyContent.Number, MyItem.MyContent.Text);
}
public partial class PartInfoList
{
internal PartInfoList(SafeDataReader dr, ItemInfo itemInfo)
{
AddPartInfo(dr,itemInfo);
}
internal void AddPartInfo(SafeDataReader dr, ItemInfo itemInfo)
internal PartInfoList(SafeDataReader dr, ItemInfo itemInfo) => AddPartInfo(dr, itemInfo);
internal void AddPartInfo(SafeDataReader dr, ItemInfo itemInfo)
{
IsReadOnly = false;
this.Add(new PartInfo(dr, itemInfo));
Add(new PartInfo(dr, itemInfo));
IsReadOnly = true;
}
public PartInfo Find(E_FromType fromType)
@@ -124,9 +109,8 @@ namespace VEPROMS.CSLA.Library
{
if (_SearchDefaultSort == null)
{
string partText = String.Empty;
switch ((E_FromType)FromType)
string partText;
switch ((E_FromType)FromType)
{
case E_FromType.Caution:
partText = ".Caution";
@@ -189,11 +173,9 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("PartInfo.ReadData", ex);
}
}
public E_FromType PartType
{ get { return (E_FromType)_FromType; } }
public E_FromTypes PartTypes
{ get { return (E_FromTypes)_FromType; } }
public override string ToString()
public E_FromType PartType => (E_FromType)_FromType;
public E_FromTypes PartTypes => (E_FromTypes)_FromType;
public override string ToString()
{
// if the parttype is table or figure, add the correct label:
if (PartTypes == E_FromTypes.Tables)
@@ -204,28 +186,12 @@ namespace VEPROMS.CSLA.Library
}
return string.Format("{0}", PartTypes);
}
//public string ToString(string str, System.IFormatProvider ifp)
//{
// return ToString();
//}
#region IVEDrillDownReadOnly
public ItemInfoList _MyItems;
public ItemInfoList MyItems
{ get { return (_MyItems != null ? _MyItems : _MyItems = ItemInfoList.GetList(_ItemID, _FromType)); } }
public System.Collections.IList GetChildren()
{
//return (_MyItems != null ? _MyItems : _MyItems = ItemInfoList.GetList(_ItemID, _FromType));
return MyItems;
}
//public bool ChildrenAreLoaded
//{
// get { return _MyItems == null; }
//}
public bool HasChildren
{
get { return this.MyContent.ContentPartCount > 0; }
}
public IVEDrillDownReadOnly ActiveParent
public ItemInfoList MyItems => _MyItems ?? (_MyItems = ItemInfoList.GetList(_ItemID, _FromType));
public System.Collections.IList GetChildren() => MyItems;
public bool HasChildren => MyContent.ContentPartCount > 0;
public IVEDrillDownReadOnly ActiveParent
{
get
{
@@ -234,57 +200,16 @@ namespace VEPROMS.CSLA.Library
return parentContent.ContentItems[0];
}
}
public FormatInfo ActiveFormat
{
get { return ActiveParent.ActiveFormat; }
}
public FormatInfo LocalFormat
{
get { return null; }
}
public ConfigDynamicTypeDescriptor MyConfig
{
get { return null; }
}
public bool IsFolder
{
get
{
return false;
}
}
public bool IsDocVersion
{
get
{
return false;
}
}
public bool IsProcedure
{
get
{
return false;
}
}
public bool IsSection
{
get
{
return false;
}
}
public bool IsStep
{
get
{
return false;
}
}
//public bool HasStandardSteps()
//{ return false; }
#endregion
}
public FormatInfo ActiveFormat => ActiveParent.ActiveFormat;
public FormatInfo LocalFormat => null;
public ConfigDynamicTypeDescriptor MyConfig => null;
public bool IsFolder => false;
public bool IsDocVersion => false;
public bool IsProcedure => false;
public bool IsSection => false;
public bool IsStep => false;
#endregion
}
// B2017-146 added the "Part" and "Parts" types of zero so that we have a valid node name when creating an export of a procedure with this FromType value
public enum E_FromType : int