using System; using System.Collections.Generic; namespace HRM.BO { #region Class Discipline public class Discipline : BasicBaseObject { #region constructor public Discipline() { Code = string.Empty; Description = string.Empty; Status = EnumStatus.Active; } #endregion #region Internal Class public class DisciplineLevel : AuditTrailBase { #region Constructor public DisciplineLevel() { DiscilineID = 0; LevelID = 0; } #endregion #region Properties public int DiscilineID { get; set; } public int LevelID { get; set; } #endregion } #endregion #region properties public string Code { get; set; } public string Description { get; set; } public int EducationTypeId { get; set; } public int EducationLevelID { get; set; } public List DisciplineLevels { get; set; } //#region EducationLevelID: ID //private ID _educationLevelID; //public ID EducationLevelID //{ // get { return _educationLevelID; } // set { _educationLevelID = value; } //} //#endregion //private List _disciplineLevels = null; //public List DisciplineLevels //{ // get // { // if (_disciplineLevels == null && !this.ID.IsUnassigned && this.ID.Integer > 0) // { // _disciplineLevels = Discipline.GetDisplineByDID(this.ID); // } // return this._disciplineLevels; // } // set // { // _disciplineLevels = value; // } //} //#endregion //#region Service Factory IDisciplineService : IDisciplineService //internal static IDisciplineService Service //{ // get { return Services.Factory.CreateService(typeof(IDisciplineService)); } //} //#endregion #endregion //#region functions //public static Discipline Get(ID nID) //{ // Discipline oDiscipline = null; // #region Cache Header // oDiscipline = (Discipline)_cache["Get", nID]; // if (oDiscipline != null) // return oDiscipline; // #endregion // oDiscipline = Discipline.Service.Get(nID); // #region Cache Footer // _cache.Add(oDiscipline, "Get", nID); // #endregion // return oDiscipline; //} //public static Discipline Get(string sCode) //{ // Discipline oDiscipline = null; // #region cache header // oDiscipline = (Discipline)_cache["Get", sCode]; // if (oDiscipline != null) // return oDiscipline; // #endregion // oDiscipline = Discipline.Service.Get(sCode); // #region cache footer // _cache.Add(oDiscipline, "Get", sCode); // #endregion // return oDiscipline; //} //public static List Get() //{ // #region cache header // List disciplines = _cache["Get"] as List; // if (disciplines != null) // return disciplines; // #endregion // try // { // disciplines = Service.Get(); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region cache footer // _cache.Add(disciplines, "Get"); // #endregion // return disciplines; //} //public static List Get(EnumStatus status) //{ // #region Cache Header // List disciplines = _cache["Get", status] as List; // if (disciplines != null) // return disciplines; // #endregion // try // { // disciplines = Service.Get(status); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(disciplines, "Get", status); // #endregion // return disciplines; //} //public static List GetDisplineByDID(ID DisID) //{ // #region Cache Header // List disciplines = _cache["GetDisplineByDID", DisID] as List; // if (disciplines != null) // return disciplines; // #endregion // try // { // disciplines = Service.GetDisplineByDID(DisID); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(disciplines, "GetDisplineByDID", DisID); // #endregion // return disciplines; //} //public static List GetByEducationLevel(ID levelID) //{ // #region Cache Header // List disciplines = _cache["GetByEducationLevel", levelID] as List; // if (disciplines != null) // return disciplines; // #endregion // try // { // disciplines = Service.GetByEducationLevel(levelID); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(disciplines, "GetByEducationLevel", levelID); // #endregion // return disciplines; //} //public static List GetDisByEducationLevel(ID levelID) //{ // #region Cache Header // List disciplines = _cache["GetDisByEducationLevel", levelID] as List; // if (disciplines != null) // return disciplines; // #endregion // try // { // disciplines = Service.GetDisByEducationLevel(levelID); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(disciplines, "GetDisByEducationLevel", levelID); // #endregion // return disciplines; //} //public ID Save() //{ // this.SetAuditTrailProperties(); // return Discipline.Service.Save(this); //} //public void Delete(ID id) //{ // Discipline.Service.Delete(id); //} //#endregion } #endregion #region IDiscipline Service public interface IDisciplineService { Discipline Get(int id); Discipline Get(string sCode); List Get(); List Get(EnumStatus status); List GetByEducationLevel(int levelID); int Save(Discipline item); void Delete(int id); List GetDisplineByDID(int DisID); List GetDisByEducationLevel(int levelID); List GetByIDs(string ids); } #endregion }