2010-08-10 10:51:21 +00:00

105 lines
3.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;
using System.Xml;
using System.Drawing;
using System.ComponentModel;
namespace VEPROMS.CSLA.Library
{
public partial interface IFormatOrFormatInfo
{
PlantFormat PlantFormat { get;}
IFormatOrFormatInfo MyIParent { get;}
string Data { get; }
string ToString();
string FullName { get; }
}
public partial class Format:IFormatOrFormatInfo
{
#region PlantFormat
[NonSerialized]
private PlantFormat _PlantFormat;
public PlantFormat PlantFormat
{ get { return (_PlantFormat != null ? _PlantFormat : _PlantFormat = new PlantFormat(this)); } }
#endregion
public IFormatOrFormatInfo MyIParent { get { return MyParent; } }
public override string ToString()
{
//return Name;
//return PlantFormat.FormatData.Name;
return FullName;
}
public string FullName
{
get
{
if (ParentID == 1) return Description + " (" + Name + ")";
return MyParent.Description + " - " + Description + " (" + Name + ")";
}
}
}
public partial class FormatInfo : IFormatOrFormatInfo
{
#region PlantFormat
[NonSerialized]
private PlantFormat _PlantFormat;
public PlantFormat PlantFormat
{ get { return (_PlantFormat != null ? _PlantFormat : _PlantFormat = new PlantFormat(this)); } }
#endregion
public IFormatOrFormatInfo MyIParent { get { return MyParent; } }
public override string ToString()
{
//return Name;
//return PlantFormat.FormatData.Name;
return FullName;
}
public string FullName
{
get
{
if (ParentID == 1) return Description + " (" + Name + ")";
return MyParent.Description + " - " + Description + " (" + Name + ")";
}
}
public StepSectionLayoutData MyStepSectionLayoutData
{
get { return PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData; }
}
public StepSectionPrintData MyStepSectionPrintData
{
get { return PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData; }
}
}
public partial class FormatInfoList
{
private static Csla.SortedBindingList<FormatInfo> _SortedFormatInfoList;
public static Csla.SortedBindingList<FormatInfo> SortedFormatInfoList
{
get
{
if (_SortedFormatInfoList == null)
{
_SortedFormatInfoList = new SortedBindingList<FormatInfo>(FormatInfoList.Get());
_SortedFormatInfoList.ApplySort("FullName", ListSortDirection.Ascending);
}
return _SortedFormatInfoList;
}
}
}
}