147 lines
3.6 KiB
C#
147 lines
3.6 KiB
C#
|
|
|||
|
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<IRelationService>(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<Relation> Get()
|
|||
|
//{
|
|||
|
// #region cache header
|
|||
|
// List<Relation> relations = _cache["Get"] as List<Relation>;
|
|||
|
// 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<Relation> Get(EnumStatus status)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
|
|||
|
// List<Relation> relations = _cache["Get", status] as List<Relation>;
|
|||
|
// 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<Relation> Get();
|
|||
|
List<Relation> Get(EnumStatus status);
|
|||
|
int Save(Relation item);
|
|||
|
void Delete(int id);
|
|||
|
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|