// =====================================================================================
// Copyright © 2005 by . All rights are reserved.
//
// If you like this code then feel free to go ahead and use it.
// The only thing I ask is that you don't remove or alter my copyright notice.
//
// Your use of this software is entirely at your own risk. I make no claims or
// warrantees about the reliability or fitness of this code for any particular purpose.
// If you make changes or additions to this code please mark your code as being yours.
//
// website , email OmarALZabir@gmail.com, msn oazabir@hotmail.com
// =====================================================================================
/*
Code Generated by a tool.
Wednesday, July 27, 2005
Do not modify, edit the file CourseSection.cs instead.
*/
using System;
using System.ComponentModel;
using System.Collections;
using System.Xml.Serialization;
namespace SmartInstitute
{
#region CourseSectionEventArgs class
///<summary>
/// Provides data for the BeforeChanged and AfterChanged events.
///</summary>
///<remarks>The BeforeChanged and AfterChanged events occur when a change is made to the value of a property of a <see cref="CourseSection"/> object.</remarks>
public class CourseSectionEventArgs : System.EventArgs
{
private CourseSectionColumns column;
///<summary>
/// Initalizes a new Instance of the CourseSectionEventArgs class.
///</summary>
public CourseSectionEventArgs(CourseSectionColumns column)
{
this.column = column;
}
///<summary>
/// The CourseSectionColumns that was modified, which has raised the event.
///</summary>
///<value cref="CourseSectionColumns" />
public CourseSectionColumns Column
{
get {return this.column;}
}
}
#endregion
///<summary>
/// Define a delegate for all CourseSection related events.
///</summary>
public delegate void CourseSectionEventHandler(object sender, CourseSectionEventArgs e);
///<summary>
/// An object representation of the 'CourseSection' table.
///</summary>
/// <remarks>
/// This class is generated by a tool and should never be modified.
/// All custom implementations should be done in the <see cref="CourseSection"/> class.
/// </remarks>
[Serializable]
public class CourseSectionBase : System.IComparable, System.ICloneable, IEntity
{
#region "Variable Declarations"
/// <summary>
/// ID :
/// </summary>
protected System.Int32 _ID = (int)0;
/// <summary>
/// Title :
/// </summary>
protected System.String _Title = string.Empty;
/// <summary>
/// Description :
/// </summary>
protected System.String _Description = string.Empty;
/// <summary>
/// Capacity :
/// </summary>
protected System.Int32 _Capacity = (int)0;
/// <summary>
/// CourseID :
/// </summary>
protected System.Int32 _CourseID = (int)0;
/// <summary>
/// ClassID :
/// </summary>
protected System.String _ClassID = string.Empty;
/// <summary>
/// Status :
/// </summary>
protected System.Int32 _Status = (int)0;
/// <summary>
/// Type :
/// </summary>
protected System.Int32 _Type = (int)0;
/// <summary>
/// ChangeStamp :
/// </summary>
protected System.DateTime _ChangeStamp = DateTime.MinValue;
/// <summary>
/// Occurs before the object is changed.
/// </summary>
public event CourseSectionEventHandler BeforeChanged;
/// <summary>
/// Occurs after the object is changed.
/// </summary>
public event CourseSectionEventHandler AfterChanged;
#endregion "Variable Declarations"
#region "Constructors"
///<summary>
/// Creates a new <see cref="CourseSectionBase"/> instance.
///</summary>
public CourseSectionBase()
{
}
///<summary>
/// Creates a new <see cref="CourseSectionBase"/> instance.
///</summary>
///<param name="ID"></param>
///<param name="Title"></param>
///<param name="Description"></param>
///<param name="Capacity"></param>
///<param name="CourseID"></param>
///<param name="ClassID"></param>
///<param name="Status"></param>
///<param name="Type"></param>
///<param name="ChangeStamp"></param>
public CourseSectionBase(System.Int32 ID, System.String Title, System.String Description, System.Int32 Capacity, System.Int32 CourseID, System.String ClassID, System.Int32 Status, System.Int32 Type, System.DateTime ChangeStamp)
{
_ID = ID;
_Title = Title;
_Description = Description;
_Capacity = Capacity;
_CourseID = CourseID;
_ClassID = ClassID;
_Status = Status;
_Type = Type;
_ChangeStamp = ChangeStamp;
}
#endregion "Constructors"
#region Events trigger
/// <summary>
/// Raises the <see cref="BeforeChanged" /> event.
/// </summary>
/// <param name="column">The <see cref="CourseSectionColumns"/> which has fired the event.</param>
public void OnBeforeChanged(CourseSectionColumns column)
{
if(BeforeChanged != null)
{
BeforeChanged(this, new CourseSectionEventArgs(column));
}
}
/// <summary>
/// Raises the <see cref="AfterChanged" /> event.
/// </summary>
/// <param name="column">The <see cref="CourseSectionColumns"/> which has fired the event.</param>
public void OnAfterChanged(CourseSectionColumns column)
{
if(AfterChanged != null)
{
AfterChanged(this, new CourseSectionEventArgs(column));
}
}
#endregion
#region Properties
/// <summary>
/// Gets or Sets the ID property.
///
/// </summary>
/// <value>This type is int</value>
[DescriptionAttribute("")]
public System.Int32 ID
{
get { return _ID; }
set
{
if (_ID == value)
return;
OnBeforeChanged(CourseSectionColumns.ID);
_ID = value;
_isdirty = true;
OnAfterChanged(CourseSectionColumns.ID);
}
}
/// <summary>
/// Gets or Sets the Title property.
///
/// </summary>
/// <value>This type is varchar</value>
[DescriptionAttribute("")]
public System.String Title
{
get { return _Title; }
set
{
if (_Title == value)
return;
OnBeforeChanged(CourseSectionColumns.Title);
_Title = value;
_isdirty = true;
OnAfterChanged(CourseSectionColumns.Title);
}
}
/// <summary>
/// Gets or Sets the Description property.
///
/// </summary>
/// <value>This type is varchar</value>
[DescriptionAttribute("")]
public System.String Description
{
get { return _Description; }
set
{
if (_Description == value)
return;
OnBeforeChanged(CourseSectionColumns.Description);
_Description = value;
_isdirty = true;
OnAfterChanged(CourseSectionColumns.Description);
}
}
/// <summary>
/// Gets or Sets the Capacity property.
///
/// </summary>
/// <value>This type is int</value>
[DescriptionAttribute("")]
public System.Int32 Capacity
{
get { return _Capacity; }
set
{
if (_Capacity == value)
return;
OnBeforeChanged(CourseSectionColumns.Capacity);
_Capacity = value;
_isdirty = true;
OnAfterChanged(CourseSectionColumns.Capacity);
}
}
/// <summary>
/// Gets or Sets the CourseID property.
///
/// </summary>
/// <value>This type is int</value>
[DescriptionAttribute("")]
public System.Int32 CourseID
{
get { return _CourseID; }
set
{
if (_CourseID == value)
return;
OnBeforeChanged(CourseSectionColumns.CourseID);
_CourseID = value;
_isdirty = true;
OnAfterChanged(CourseSectionColumns.CourseID);
}
}
/// <summary>
/// Gets or Sets the ClassID property.
///
/// </summary>
/// <value>This type is varchar</value>
[DescriptionAttribute("")]
public System.String ClassID
{
get { return _ClassID; }
set
{
if (_ClassID == value)
return;
OnBeforeChanged(CourseSectionColumns.ClassID);
_ClassID = value;
_isdirty = true;
OnAfterChanged(CourseSectionColumns.ClassID);
}
}
/// <summary>
/// Gets or Sets the Status property.
///
/// </summary>
/// <value>This type is int</value>
[DescriptionAttribute("")]
public System.Int32 Status
{
get { return _Status; }
set
{
if (_Status == value)
return;
OnBeforeChanged(CourseSectionColumns.Status);
_Status = value;
_isdirty = true;
OnAfterChanged(CourseSectionColumns.Status);
}
}
/// <summary>
/// Gets or Sets the Type property.
///
/// </summary>
/// <value>This type is int</value>
[DescriptionAttribute("")]
public System.Int32 Type
{
get { return _Type; }
set
{
if (_Type == value)
return;
OnBeforeChanged(CourseSectionColumns.Type);
_Type = value;
_isdirty = true;
OnAfterChanged(CourseSectionColumns.Type);
}
}
/// <summary>
/// Gets or Sets the ChangeStamp property.
///
/// </summary>
/// <value>This type is smalldatetime</value>
[DescriptionAttribute("")]
public System.DateTime ChangeStamp
{
get { return _ChangeStamp; }
set
{
if (_ChangeStamp == value)
return;
OnBeforeChanged(CourseSectionColumns.ChangeStamp);
_ChangeStamp = value;
_isdirty = true;
OnAfterChanged(CourseSectionColumns.ChangeStamp);
}
}
private bool _isdeleted = false;
/// <summary>
/// True if object has been <see cref="MarkToDelete"/>. ReadOnly.
/// </summary>
[BrowsableAttribute(false)]
public bool IsDeleted
{
get { return _isdeleted; }
set { _isdeleted = value; }
}
private bool _isdirty = false;
/// <summary>
/// Indicates if the object has been modified from its original state.
/// </summary>
///<value>True if object has been modified from its original state; otherwise False;</value>
[BrowsableAttribute(false)]
public bool IsDirty
{
get { return _isdirty; }
set { _isdirty = value; }
}
private bool _isnew = false;
/// <summary>
/// Indicates if the object is new.
/// </summary>
///<value>True if objectis new; otherwise False;</value>
[BrowsableAttribute(false)]
public bool IsNew
{
get { return _isnew; }
set { _isnew = value; }
}
/// <summary>
/// The name of the underlying database table.
/// </summary>
[BrowsableAttribute(false)]
public string TableName
{
get { return "CourseSection"; }
}
private CourseTakenByStudentCollection _CourseTakenByStudentCollection = new CourseTakenByStudentCollection();
/// <summary>
/// Holds a collection of CourseTakenByStudent objects
/// which are related to this object through the relation FK_CourseTakenByStudent_Section
/// </summary>
public CourseTakenByStudentCollection CourseTakenByStudentCollection
{
get { return _CourseTakenByStudentCollection; }
set { _CourseTakenByStudentCollection = value; }
}
private SectionRoutineCollection _SectionRoutineCollection = new SectionRoutineCollection();
/// <summary>
/// Holds a collection of SectionRoutine objects
/// which are related to this object through the relation FK_SectionRoutine_Section
/// </summary>
public SectionRoutineCollection SectionRoutineCollection
{
get { return _SectionRoutineCollection; }
set { _SectionRoutineCollection = value; }
}
#endregion
#region Methods
/// <summary>
/// Accepts the changes made to this object by setting each flags to false.
/// </summary>
public void AcceptChanges()
{
_isdeleted = false;
_isdirty = false;
_isnew = false;
}
///<summary>
/// TODO: Revert all changes and restore original values.
/// Currently not supported.
///</summary>
public virtual void CancelChanges(){
throw new NotSupportedException("Method currently not Supported.");
}
///<summary>
/// Marks entity to be deleted.
///</summary>
public void MarkToDelete()
{
_isdeleted = true;
}
#region ICloneable Members
///<summary>
/// Returns a Typed CourseSectionBase Entity
///</summary>
public virtual CourseSectionBase Copy()
{
//shallow copy entity
CourseSection copy = new CourseSection();
copy.ID = this._ID;
copy.Title = this._Title;
copy.Description = this._Description;
copy.Capacity = this._Capacity;
copy.CourseID = this._CourseID;
copy.ClassID = this._ClassID;
copy.Status = this._Status;
copy.Type = this._Type;
copy.ChangeStamp = this._ChangeStamp;
copy.AcceptChanges();
return (CourseSection)copy;
}
///<summary>
/// ICloneable.Clone() Member, returns the Deep Copy of this entity.
///</summary>
public object Clone(){
return this.Copy();
}
///<summary>
/// Returns a deep copy of the child collection object passed in.
///</summary>
public static object MakeCopyOf(object x)
{
if (x is ICloneable)
{
// Return a deep copy of the object
return ((ICloneable)x).Clone();
}
else
throw new System.NotSupportedException("Object Does Not Implement the ICloneable Interface.");
}
#endregion
///<summary>
/// Returns a value indicating whether this instance is equal to a specified object.
///</summary>
///<param name="toObject">An object to compare to this instance.</param>
///<returns>true if toObject is a <see cref="CourseSectionBase"/> and has the same value as this instance; otherwise, false.</returns>
public bool Equals(CourseSectionBase toObject)
{
return Equals(this, toObject);
}
///<summary>
/// Determines whether the specified <see cref="CourseSectionBase"/> instances are considered equal.
///</summary>
///<param name="Object1">The first <see cref="CourseSectionBase"/> to compare.</param>
///<param name="Object2">The second <see cref="CourseSectionBase"/> to compare. </param>
///<returns>true if Object1 is the same instance as Object2 or if both are null references or if objA.Equals(objB) returns true; otherwise, false.</returns>
public static bool Equals(CourseSectionBase Object1, CourseSectionBase Object2)
{
bool equal = true;
if (Object1.ID != Object2.ID)
equal = false;
if (Object1.Title != Object2.Title)
equal = false;
if (Object1.Description != Object2.Description)
equal = false;
if (Object1.Capacity != Object2.Capacity)
equal = false;
if (Object1.CourseID != Object2.CourseID)
equal = false;
if (Object1.ClassID != Object2.ClassID)
equal = false;
if (Object1.Status != Object2.Status)
equal = false;
if (Object1.Type != Object2.Type)
equal = false;
if (Object1.ChangeStamp != Object2.ChangeStamp)
equal = false;
return equal;
}
#endregion
#region IComparable Members
///<summary>
/// Compares this instance to a specified object and returns an indication of their relative values.
///<param name="obj">An object to compare to this instance, or a null reference (Nothing in Visual Basic).</param>
///</summary>
///<returns>A signed integer that indicates the relative order of this instance and obj.</returns>
public int CompareTo(object obj)
{
return this.ID.CompareTo(((CourseSectionBase)obj).ID);
}
#endregion
#region "IsColumnNull"
#endregion "IsColumnNull"
///<summary>
/// Returns a String that represents the current object.
///</summary>
public override string ToString()
{
return string.Format("{10}{9}- ID: {0}{9}- Title: {1}{9}- Description: {2}{9}- Capacity: {3}{9}- CourseID: {4}{9}- ClassID: {5}{9}- Status: {6}{9}- Type: {7}{9}- ChangeStamp: {8}{9}", ID, Title, Description, Capacity, CourseID, ClassID, Status, Type, ChangeStamp, Environment.NewLine, this.GetType());
}
}//End Class
/// <summary>
/// Enumerate the CourseSection columns.
/// </summary>
public enum CourseSectionColumns
{
/// <summary>
/// ID :
/// </summary>
ID,
/// <summary>
/// Title :
/// </summary>
Title,
/// <summary>
/// Description :
/// </summary>
Description,
/// <summary>
/// Capacity :
/// </summary>
Capacity,
/// <summary>
/// CourseID :
/// </summary>
CourseID,
/// <summary>
/// ClassID :
/// </summary>
ClassID,
/// <summary>
/// Status :
/// </summary>
Status,
/// <summary>
/// Type :
/// </summary>
Type,
/// <summary>
/// ChangeStamp :
/// </summary>
ChangeStamp
}//End enum
} // end namespace