// =====================================================================================
// 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 CourseTakenByStudent.cs instead.
*/
using System;
using System.ComponentModel;
using System.Collections;
using System.Xml.Serialization;
namespace SmartInstitute
{
#region CourseTakenByStudentEventArgs 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="CourseTakenByStudent"/> object.</remarks>
public class CourseTakenByStudentEventArgs : System.EventArgs
{
private CourseTakenByStudentColumns column;
///<summary>
/// Initalizes a new Instance of the CourseTakenByStudentEventArgs class.
///</summary>
public CourseTakenByStudentEventArgs(CourseTakenByStudentColumns column)
{
this.column = column;
}
///<summary>
/// The CourseTakenByStudentColumns that was modified, which has raised the event.
///</summary>
///<value cref="CourseTakenByStudentColumns" />
public CourseTakenByStudentColumns Column
{
get {return this.column;}
}
}
#endregion
///<summary>
/// Define a delegate for all CourseTakenByStudent related events.
///</summary>
public delegate void CourseTakenByStudentEventHandler(object sender, CourseTakenByStudentEventArgs e);
///<summary>
/// An object representation of the 'CourseTakenByStudent' 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="CourseTakenByStudent"/> class.
/// </remarks>
[Serializable]
public class CourseTakenByStudentBase : System.IComparable, System.ICloneable, IEntity
{
#region "Variable Declarations"
/// <summary>
/// ID :
/// </summary>
protected System.Int32 _ID = (int)0;
/// <summary>
/// StudentID :
/// </summary>
protected System.Int32 _StudentID = (int)0;
/// <summary>
/// CourseID :
/// </summary>
protected System.Int32 _CourseID = (int)0;
/// <summary>
/// SectionID :
/// </summary>
protected System.Int32 _SectionID = (int)0;
/// <summary>
/// Status :
/// </summary>
protected System.Int32 _Status = (int)0;
/// <summary>
/// NonCredit :
/// </summary>
protected System.Boolean _NonCredit = false;
/// <summary>
/// ChangeStamp :
/// </summary>
protected System.DateTime _ChangeStamp = DateTime.MinValue;
/// <summary>
/// Occurs before the object is changed.
/// </summary>
public event CourseTakenByStudentEventHandler BeforeChanged;
/// <summary>
/// Occurs after the object is changed.
/// </summary>
public event CourseTakenByStudentEventHandler AfterChanged;
#endregion "Variable Declarations"
#region "Constructors"
///<summary>
/// Creates a new <see cref="CourseTakenByStudentBase"/> instance.
///</summary>
public CourseTakenByStudentBase()
{
}
///<summary>
/// Creates a new <see cref="CourseTakenByStudentBase"/> instance.
///</summary>
///<param name="ID"></param>
///<param name="StudentID"></param>
///<param name="CourseID"></param>
///<param name="SectionID"></param>
///<param name="Status"></param>
///<param name="NonCredit"></param>
///<param name="ChangeStamp"></param>
public CourseTakenByStudentBase(System.Int32 ID, System.Int32 StudentID, System.Int32 CourseID, System.Int32 SectionID, System.Int32 Status, System.Boolean NonCredit, System.DateTime ChangeStamp)
{
_ID = ID;
_StudentID = StudentID;
_CourseID = CourseID;
_SectionID = SectionID;
_Status = Status;
_NonCredit = NonCredit;
_ChangeStamp = ChangeStamp;
}
#endregion "Constructors"
#region Events trigger
/// <summary>
/// Raises the <see cref="BeforeChanged" /> event.
/// </summary>
/// <param name="column">The <see cref="CourseTakenByStudentColumns"/> which has fired the event.</param>
public void OnBeforeChanged(CourseTakenByStudentColumns column)
{
if(BeforeChanged != null)
{
BeforeChanged(this, new CourseTakenByStudentEventArgs(column));
}
}
/// <summary>
/// Raises the <see cref="AfterChanged" /> event.
/// </summary>
/// <param name="column">The <see cref="CourseTakenByStudentColumns"/> which has fired the event.</param>
public void OnAfterChanged(CourseTakenByStudentColumns column)
{
if(AfterChanged != null)
{
AfterChanged(this, new CourseTakenByStudentEventArgs(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(CourseTakenByStudentColumns.ID);
_ID = value;
_isdirty = true;
OnAfterChanged(CourseTakenByStudentColumns.ID);
}
}
/// <summary>
/// Gets or Sets the StudentID property.
///
/// </summary>
/// <value>This type is int</value>
[DescriptionAttribute("")]
public System.Int32 StudentID
{
get { return _StudentID; }
set
{
if (_StudentID == value)
return;
OnBeforeChanged(CourseTakenByStudentColumns.StudentID);
_StudentID = value;
_isdirty = true;
OnAfterChanged(CourseTakenByStudentColumns.StudentID);
}
}
/// <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(CourseTakenByStudentColumns.CourseID);
_CourseID = value;
_isdirty = true;
OnAfterChanged(CourseTakenByStudentColumns.CourseID);
}
}
/// <summary>
/// Gets or Sets the SectionID property.
///
/// </summary>
/// <value>This type is int</value>
[DescriptionAttribute("")]
public System.Int32 SectionID
{
get { return _SectionID; }
set
{
if (_SectionID == value)
return;
OnBeforeChanged(CourseTakenByStudentColumns.SectionID);
_SectionID = value;
_isdirty = true;
OnAfterChanged(CourseTakenByStudentColumns.SectionID);
}
}
/// <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(CourseTakenByStudentColumns.Status);
_Status = value;
_isdirty = true;
OnAfterChanged(CourseTakenByStudentColumns.Status);
}
}
/// <summary>
/// Gets or Sets the NonCredit property.
///
/// </summary>
/// <value>This type is bit</value>
[DescriptionAttribute("")]
public System.Boolean NonCredit
{
get { return _NonCredit; }
set
{
if (_NonCredit == value)
return;
OnBeforeChanged(CourseTakenByStudentColumns.NonCredit);
_NonCredit = value;
_isdirty = true;
OnAfterChanged(CourseTakenByStudentColumns.NonCredit);
}
}
/// <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(CourseTakenByStudentColumns.ChangeStamp);
_ChangeStamp = value;
_isdirty = true;
OnAfterChanged(CourseTakenByStudentColumns.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 "CourseTakenByStudent"; }
}
#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 CourseTakenByStudentBase Entity
///</summary>
public virtual CourseTakenByStudentBase Copy()
{
//shallow copy entity
CourseTakenByStudent copy = new CourseTakenByStudent();
copy.ID = this._ID;
copy.StudentID = this._StudentID;
copy.CourseID = this._CourseID;
copy.SectionID = this._SectionID;
copy.Status = this._Status;
copy.NonCredit = this._NonCredit;
copy.ChangeStamp = this._ChangeStamp;
copy.AcceptChanges();
return (CourseTakenByStudent)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="CourseTakenByStudentBase"/> and has the same value as this instance; otherwise, false.</returns>
public bool Equals(CourseTakenByStudentBase toObject)
{
return Equals(this, toObject);
}
///<summary>
/// Determines whether the specified <see cref="CourseTakenByStudentBase"/> instances are considered equal.
///</summary>
///<param name="Object1">The first <see cref="CourseTakenByStudentBase"/> to compare.</param>
///<param name="Object2">The second <see cref="CourseTakenByStudentBase"/> 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(CourseTakenByStudentBase Object1, CourseTakenByStudentBase Object2)
{
bool equal = true;
if (Object1.ID != Object2.ID)
equal = false;
if (Object1.StudentID != Object2.StudentID)
equal = false;
if (Object1.CourseID != Object2.CourseID)
equal = false;
if (Object1.SectionID != Object2.SectionID)
equal = false;
if (Object1.Status != Object2.Status)
equal = false;
if (Object1.NonCredit != Object2.NonCredit)
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(((CourseTakenByStudentBase)obj).ID);
}
#endregion
#region "IsColumnNull"
#endregion "IsColumnNull"
///<summary>
/// Returns a String that represents the current object.
///</summary>
public override string ToString()
{
return string.Format("{8}{7}- ID: {0}{7}- StudentID: {1}{7}- CourseID: {2}{7}- SectionID: {3}{7}- Status: {4}{7}- NonCredit: {5}{7}- ChangeStamp: {6}{7}", ID, StudentID, CourseID, SectionID, Status, NonCredit, ChangeStamp, Environment.NewLine, this.GetType());
}
}//End Class
/// <summary>
/// Enumerate the CourseTakenByStudent columns.
/// </summary>
public enum CourseTakenByStudentColumns
{
/// <summary>
/// ID :
/// </summary>
ID,
/// <summary>
/// StudentID :
/// </summary>
StudentID,
/// <summary>
/// CourseID :
/// </summary>
CourseID,
/// <summary>
/// SectionID :
/// </summary>
SectionID,
/// <summary>
/// Status :
/// </summary>
Status,
/// <summary>
/// NonCredit :
/// </summary>
NonCredit,
/// <summary>
/// ChangeStamp :
/// </summary>
ChangeStamp
}//End enum
} // end namespace