????Emlpoyee.cs??

 

publicclassEmployee:IDisposable
{
???IDisposable???#region???IDisposable???
/**////
///??????IDisposable?????????
///
publicvoidDispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
/**////
///?????????
///
///
protectedvirtualvoidDispose(booldisposing)
{
if(!m_disposed)
{
if(disposing)
{
//Releasemanagedresources
if(db!=null)
this.db.Dispose();
if(dt!=null)
this.dt.Dispose();
this._CurrentPosition=null;
this._Department=null;
this._EmployeeCode=null;
}
//Releaseunmanagedresources
m_disposed=true;
}
}
/**////
///????????
///
~Employee()
{
Dispose(false);
}
privateboolm_disposed;
#endregion
}