290 lines
7.8 KiB
C#
290 lines
7.8 KiB
C#
|
|
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<Discipline.DisciplineLevel> DisciplineLevels { get; set; }
|
|
|
|
//#region EducationLevelID: ID
|
|
//private ID _educationLevelID;
|
|
|
|
//public ID EducationLevelID
|
|
//{
|
|
// get { return _educationLevelID; }
|
|
// set { _educationLevelID = value; }
|
|
//}
|
|
//#endregion
|
|
|
|
|
|
//private List<Discipline.DisciplineLevel> _disciplineLevels = null;
|
|
//public List<Discipline.DisciplineLevel> 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<IDisciplineService>(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<Discipline> Get()
|
|
//{
|
|
// #region cache header
|
|
// List<Discipline> disciplines = _cache["Get"] as List<Discipline>;
|
|
// 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<Discipline> Get(EnumStatus status)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<Discipline> disciplines = _cache["Get", status] as List<Discipline>;
|
|
// 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<Discipline.DisciplineLevel> GetDisplineByDID(ID DisID)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<Discipline.DisciplineLevel> disciplines = _cache["GetDisplineByDID", DisID] as List<Discipline.DisciplineLevel>;
|
|
// 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<Discipline> GetByEducationLevel(ID levelID)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<Discipline> disciplines = _cache["GetByEducationLevel", levelID] as List<Discipline>;
|
|
// 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<Discipline.DisciplineLevel> GetDisByEducationLevel(ID levelID)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<Discipline.DisciplineLevel> disciplines = _cache["GetDisByEducationLevel", levelID] as List<Discipline.DisciplineLevel>;
|
|
// 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<Discipline> Get();
|
|
List<Discipline> Get(EnumStatus status);
|
|
List<Discipline> GetByEducationLevel(int levelID);
|
|
int Save(Discipline item);
|
|
void Delete(int id);
|
|
List<Discipline.DisciplineLevel> GetDisplineByDID(int DisID);
|
|
List<Discipline.DisciplineLevel> GetDisByEducationLevel(int levelID);
|
|
List<Discipline> GetByIDs(string ids);
|
|
}
|
|
#endregion
|
|
}
|