151 lines
3.8 KiB
C#
151 lines
3.8 KiB
C#
|
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace HRM.BO
|
|||
|
{
|
|||
|
#region class Achievements
|
|||
|
|
|||
|
public class Achievement : BasicBaseObject
|
|||
|
{
|
|||
|
#region constructor
|
|||
|
public Achievement()
|
|||
|
{
|
|||
|
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 IAchievementService : IAchievementService
|
|||
|
|
|||
|
//internal static IAchievementService Service
|
|||
|
//{
|
|||
|
// get { return Services.Factory.CreateService<IAchievementService>(typeof(IAchievementService)); }
|
|||
|
//}
|
|||
|
|
|||
|
//#endregion
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
//#region Function
|
|||
|
|
|||
|
//public static Achievements Get(ID nID)
|
|||
|
//{
|
|||
|
// Achievements oAchievement = null;
|
|||
|
// #region Cache Header
|
|||
|
// oAchievement = (Achievements)_cache["Get", nID];
|
|||
|
// if (oAchievement != null)
|
|||
|
// return oAchievement;
|
|||
|
// #endregion
|
|||
|
// oAchievement = Achievements.Service.Get(nID);
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(oAchievement, "Get", nID);
|
|||
|
// #endregion
|
|||
|
// return oAchievement;
|
|||
|
//}
|
|||
|
|
|||
|
//public static Achievements Get(string sCode)
|
|||
|
//{
|
|||
|
// Achievements oAchievement = null;
|
|||
|
// #region Cache Header
|
|||
|
// oAchievement = (Achievements)_cache["Get", sCode];
|
|||
|
// if (oAchievement != null)
|
|||
|
// return oAchievement;
|
|||
|
// #endregion
|
|||
|
// oAchievement = Achievements.Service.Get(sCode);
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(oAchievement, "Get", sCode);
|
|||
|
// #endregion
|
|||
|
// return oAchievement;
|
|||
|
//}
|
|||
|
|
|||
|
//public static List<Achievements> Get()
|
|||
|
//{
|
|||
|
// #region cache header
|
|||
|
// List<Achievements> relations = _cache["Get"] as List<Achievements>;
|
|||
|
// 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<Achievements> Get(EnumStatus status)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
|
|||
|
// List<Achievements> oAchievement = _cache["Get", status] as List<Achievements>;
|
|||
|
// if (oAchievement != null)
|
|||
|
// return oAchievement;
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// try
|
|||
|
// {
|
|||
|
// oAchievement = Service.Get(status);
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
|
|||
|
// #region Cache Footer
|
|||
|
|
|||
|
// _cache.Add(oAchievement, "Get", status);
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// return oAchievement;
|
|||
|
//}
|
|||
|
|
|||
|
//public ID Save()
|
|||
|
//{
|
|||
|
// this.SetAuditTrailProperties();
|
|||
|
// return Achievements.Service.Save(this);
|
|||
|
//}
|
|||
|
|
|||
|
//public void Delete(ID id)
|
|||
|
//{
|
|||
|
// Achievements.Service.Delete(id);
|
|||
|
//}
|
|||
|
|
|||
|
//#endregion
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
|
|||
|
#region IAchievementService
|
|||
|
public interface IAchievementService
|
|||
|
{
|
|||
|
Achievement Get(int id);
|
|||
|
Achievement Get(string sCode);
|
|||
|
List<Achievement> Get();
|
|||
|
List<Achievement> Get(EnumStatus status);
|
|||
|
int Save(Achievement item);
|
|||
|
void Delete(int id);
|
|||
|
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|