using System; using System.Collections.Generic; namespace HRM.BO { #region class Relation public class Relation : BasicBaseObject { #region constructor public Relation() { Code = string.Empty; Description = string.Empty; Status = EnumStatus.Active; } #endregion #region Properties public string Code { get; set; } public string Description { get; set; } //#region Service Factory IRelationService : IRelationService //internal static IRelationService Service //{ // get { return Services.Factory.CreateService(typeof(IRelationService)); } //} //#endregion #endregion //#region Function //public static Relation Get(ID nID) //{ // Relation oRelation = null; // #region Cache Header // oRelation = (Relation)_cache["Get", nID]; // if (oRelation != null) // return oRelation; // #endregion // oRelation = Relation.Service.Get(nID); // #region Cache Footer // _cache.Add(oRelation, "Get", nID); // #endregion // return oRelation; //} //public static Relation Get(string sCode) //{ // Relation oRelation = null; // #region Cache Header // oRelation = (Relation)_cache["Get", sCode]; // if (oRelation != null) // return oRelation; // #endregion // oRelation = Relation.Service.Get(sCode); // #region Cache Footer // _cache.Add(oRelation, "Get", sCode); // #endregion // return oRelation; //} //public static List Get() //{ // #region cache header // List relations = _cache["Get"] as List; // if (relations != null) // return relations; // #endregion // try // { // relations = Service.Get(); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region cache footer // _cache.Add(relations, "Get"); // #endregion // return relations; //} //public static List Get(EnumStatus status) //{ // #region Cache Header // List relations = _cache["Get", status] as List; // if (relations != null) // return relations; // #endregion // try // { // relations = Service.Get(status); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(relations, "Get", status); // #endregion // return relations; //} //public ID Save() //{ // this.SetAuditTrailProperties(); // return Relation.Service.Save(this); //} //public void Delete(ID id) //{ // Relation.Service.Delete(id); //} //#endregion } #endregion #region IRelation Service public interface IRelationService { Relation Get(int id); Relation Get(string sCode); List Get(); List Get(EnumStatus status); int Save(Relation item); void Delete(int id); } #endregion }