Click here to Skip to main content
15,878,945 members
Articles / Web Development / ASP.NET

Developing Next Generation Smart Clients using .NET 2.0 working with Existing .NET 1.1 SOA-based XML Web Services

Rate me:
Please Sign up or sign in to vote.
4.96/5 (134 votes)
16 Aug 200540 min read 1.2M   3.9K   462  
Comprehensive guide to development of .NET 2.0 Smart Clients working with existing Service Oriented Architecture based XML web services, fully utilizing the Enterprise Library
// =====================================================================================
// 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 Permission.cs instead.
*/
using System;
using System.ComponentModel;
using System.Collections;
using System.Xml.Serialization;

namespace SmartInstitute
{
	#region PermissionEventArgs 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="Permission"/> object.</remarks>
	public class PermissionEventArgs : System.EventArgs
	{
		private PermissionColumns column;
		
		
		///<summary>
		/// Initalizes a new Instance of the PermissionEventArgs class.
		///</summary>
		public PermissionEventArgs(PermissionColumns column)
		{
			this.column = column;
		}
		
		
		///<summary>
		/// The PermissionColumns that was modified, which has raised the event.
		///</summary>
		///<value cref="PermissionColumns" />
		public PermissionColumns Column
		{
			get {return this.column;}
		}
	}
	#endregion
	
	
	///<summary>
	/// Define a delegate for all Permission related events.
	///</summary>
	public delegate void PermissionEventHandler(object sender, PermissionEventArgs e);
		
	
	///<summary>
	/// An object representation of the 'Permission' 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="Permission"/> class.
    /// </remarks>
	[Serializable]
	public class PermissionBase : System.IComparable, System.ICloneable, IEntity
	{
		
		#region "Variable Declarations"
		
		/// <summary>
		/// ID : 
		/// </summary>
		protected System.Int32		  _ID = (int)0;
		//keep a copy of the original so it can be used for editable primary keys.
		
		/// <summary>
		/// keep a copy of the original so it can be used for editable primary keys.
		/// </summary>
		protected System.Int32 _OriginalID;
		
		/// <summary>
		/// Title : 
		/// </summary>
		protected System.String		  _Title = string.Empty;
		
		/// <summary>
		/// Description : 
		/// </summary>
		protected System.String		  _Description = string.Empty;
		
		/// <summary>
		/// ChangeStamp : 
		/// </summary>
		protected System.DateTime		  _ChangeStamp = DateTime.MinValue;
		
		
		/// <summary>
		/// Occurs before the object is changed.
		/// </summary>	
		public event PermissionEventHandler BeforeChanged;
		
		
		/// <summary>
		/// Occurs after the object is changed.
		/// </summary>
		public event PermissionEventHandler AfterChanged;		
		#endregion "Variable Declarations"
		
		
		#region "Constructors"
		///<summary>
		/// Creates a new <see cref="PermissionBase"/> instance.
		///</summary>
		public PermissionBase()
		{
		}		
		
		///<summary>
		/// Creates a new <see cref="PermissionBase"/> instance.
		///</summary>
		///<param name="ID"></param>
		///<param name="Title"></param>
		///<param name="Description"></param>
		///<param name="ChangeStamp"></param>
		public PermissionBase(System.Int32 ID, System.String Title, System.String Description, System.DateTime ChangeStamp)
		{
			_ID = ID;
			_Title = Title;
			_Description = Description;
			_ChangeStamp = ChangeStamp;
		}
				
		#endregion "Constructors"
		
		
		#region Events trigger
		/// <summary>
		/// Raises the <see cref="BeforeChanged" /> event.
		/// </summary>
		/// <param name="column">The <see cref="PermissionColumns"/> which has fired the event.</param>
		public void OnBeforeChanged(PermissionColumns column)
		{
			if(BeforeChanged != null)
			{
				BeforeChanged(this, new PermissionEventArgs(column));
			}
	
		}
		
		
		/// <summary>
		/// Raises the <see cref="AfterChanged" /> event.
		/// </summary>
		/// <param name="column">The <see cref="PermissionColumns"/> which has fired the event.</param>
		public void OnAfterChanged(PermissionColumns column)
		{
			if(AfterChanged != null)
			{
				AfterChanged(this, new PermissionEventArgs(column));
			}
	
		} 
		#endregion
		
		
		#region Properties	
		/// <summary>
		/// 	Gets or Sets the ID property. 
		///		
		/// </summary>
		/// <value>This type is int</value>
		[ReadOnlyAttribute(true), DescriptionAttribute("")]
		public System.Int32 ID
		{
			get { return _ID; }
			set
			{
				if (_ID == value)
					return;
					
				OnBeforeChanged(PermissionColumns.ID);
				_ID = value;
				_isdirty = true;
				OnAfterChanged(PermissionColumns.ID);
			}
		}
		
		
		/// <summary>
		/// 	Get the original value of the ID property.
		///		
		/// </summary>
		/// <remarks>This is the original value of the ID property.</remarks>
		/// <value>This type is int</value>
		[BrowsableAttribute(false)]
		public System.Int32 OriginalID
		{
			get { return _OriginalID; }
			set { _OriginalID = value; }
		} 
	
		/// <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(PermissionColumns.Title);
				_Title = value;
				_isdirty = true;
				OnAfterChanged(PermissionColumns.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(PermissionColumns.Description);
				_Description = value;
				_isdirty = true;
				OnAfterChanged(PermissionColumns.Description);
			}
		}
	
		/// <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(PermissionColumns.ChangeStamp);
				_ChangeStamp = value;
				_isdirty = true;
				OnAfterChanged(PermissionColumns.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 "Permission"; }
		}
		
		#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 PermissionBase Entity 
		///</summary>
		public virtual PermissionBase Copy()
		{
			//shallow copy entity
			Permission copy = new Permission();
			copy.ID = this._ID;
			copy.OriginalID = this._OriginalID;
			copy.Title = this._Title;
			copy.Description = this._Description;
			copy.ChangeStamp = this._ChangeStamp;
					
			copy.AcceptChanges();
			return (Permission)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="PermissionBase"/> and has the same value as this instance; otherwise, false.</returns>
		public bool Equals(PermissionBase toObject)
		{
			return Equals(this, toObject);
		}
		
		
		///<summary>
		/// Determines whether the specified <see cref="PermissionBase"/> instances are considered equal.
		///</summary>
		///<param name="Object1">The first <see cref="PermissionBase"/> to compare.</param>
		///<param name="Object2">The second <see cref="PermissionBase"/> 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(PermissionBase Object1, PermissionBase 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.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(((PermissionBase)obj).ID);
		}
	
		#endregion
		
			
		#region "IsColumnNull"
		#endregion "IsColumnNull"
		
		///<summary>
		/// Returns a String that represents the current object.
		///</summary>
		public override string ToString()
		{
			return string.Format("{5}{4}- ID: {0}{4}- Title: {1}{4}- Description: {2}{4}- ChangeStamp: {3}{4}", ID, Title, Description, ChangeStamp, Environment.NewLine, this.GetType());
		}
	
	}//End Class
	
	
	/// <summary>
	/// Enumerate the Permission columns.
	/// </summary>
	public enum PermissionColumns
	{
		/// <summary>
		/// ID : 
		/// </summary>
		ID,
		/// <summary>
		/// Title : 
		/// </summary>
		Title,
		/// <summary>
		/// Description : 
		/// </summary>
		Description,
		/// <summary>
		/// ChangeStamp : 
		/// </summary>
		ChangeStamp
	}//End enum

} // end namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect BT, UK (ex British Telecom)
United Kingdom United Kingdom

Comments and Discussions