// ========================================================================
// Copyright 2007 - 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.ComponentModel;
using System.Collections.Generic;
using Csla.Validation;
namespace VEPROMS.CSLA.Library
{
///
/// ChildFormats Generated by MyGeneration using the CSLA Object Mapping template
///
[Serializable()]
[TypeConverter(typeof(ChildFormatsConverter))]
public partial class ChildFormats : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules
{
#region Log4Net
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
#endregion
#region Business Methods
private string _ErrorMessage = string.Empty;
public string ErrorMessage
{
get { return _ErrorMessage; }
}
// One To Many
public new Format this[int formatID]
{
get
{
foreach (Format format in this)
if (format.FormatID == formatID)
return format;
return null;
}
}
public new System.Collections.Generic.IList Items
{
get { return base.Items; }
}
public Format GetItem(int formatID)
{
foreach (Format format in this)
if (format.FormatID == formatID)
return format;
return null;
}
public Format Add(Format myParent, string name, string data) // One to Many with unique fields
{
if (!Contains(name))
{
Format format = Format.New(myParent, name, data);
this.Add(format);
return format;
}
else
throw new InvalidOperationException("format already exists");
}
public void Remove(int formatID)
{
foreach (Format format in this)
{
if (format.FormatID == formatID)
{
Remove(format);
break;
}
}
}
public bool Contains(int formatID)
{
foreach (Format format in this)
if (format.FormatID == formatID)
return true;
return false;
}
public bool ContainsDeleted(int formatID)
{
foreach (Format format in DeletedList)
if (format.FormatID == formatID)
return true;
return false;
}
public bool IsDirtyList(List