using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HRM.BO { public class SkillLevel : BasicBaseObject { #region Constructor public SkillLevel() { Value = string.Empty; Code = string.Empty; Name = string.Empty; this.Status = EnumStatus.Active; //_skillPoint = 0; } #endregion #region Properties public string Value { get; set; } public string Code { get; set; } public string Name { get; set; } //#region Service Factory ISkillLevelService : ISkillLevelService //internal static ISkillLevelService Service //{ // get { return Services.Factory.CreateService(typeof(ISkillLevelService)); } //} //#endregion #endregion //#region Functions //public ID Save() //{ // try // { // if (this.IsNew) // { // if (IsExists(this.Code)) // { // throw new ServiceException("Code already exists"); // } // } // base.SetAuditTrailProperties(); // return SkillLevel.Service.Save(this); // } // catch (ServiceException e) // { // throw new ServiceException(e.Message, e); // } //} //public void Delete(ID id) //{ // SkillLevel.Service.Delete(id); //} //public static SkillLevel Get(ID nID) //{ // SkillLevel oSkilLevel = null; // #region Cache Header // oSkilLevel = (SkillLevel)_cache["Get", nID]; // if (oSkilLevel != null) // return oSkilLevel; // #endregion // oSkilLevel = SkillLevel.Service.Get(nID); // #region Cache Footer // _cache.Add(oSkilLevel, "Get", nID); // #endregion // return oSkilLevel; //} //public static List Get() //{ // #region Cache Header // List oSkilLevel = _cache["Get"] as List; // if (oSkilLevel != null) // return oSkilLevel; // #endregion // try // { // oSkilLevel = Service.Get(); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(oSkilLevel, "Get"); // #endregion // return oSkilLevel; //} //public static List Get(EnumStatus status) //{ // #region Cache Header // List skills = _cache["Get", status] as List; // if (skills != null) // return skills; // #endregion // try // { // skills = Service.Get(status); // } // catch (ServiceException e) // { // throw new Exception(e.Message, e); // } // #region Cache Footer // _cache.Add(skills, "Get", status); // #endregion // return skills; //} //private bool IsExists(string Code) //{ // try // { // bool isExists = false; // if (this.Code != null && this.Value.ToUpper() != Code.ToUpper()) // { // isExists = SkillLevel.Service.IsExists(Code); // } // return isExists; // } // catch (ServiceException e) // { // throw new ServiceException(e.Message, e); // } //} ////public static List GetChilds(ID parentID) ////{ //// #region Cache Header //// List skills = _cache["GetChilds"] as List; //// if (skills != null) //// return skills; //// #endregion //// try //// { //// skills = Service.GetChilds(parentID); //// } //// catch (ServiceException e) //// { //// throw new Exception(e.Message, e); //// } //// #region Cache Footer //// _cache.Add(skills, "GetChilds"); //// #endregion //// return skills; ////} //#endregion } #region ISkilLevel Service public interface ISkillLevelService { int Save(SkillLevel item); void Delete(int id); SkillLevel Get(int id); List Get(); List Get(EnumStatus status); //List GetChilds(ID parentID); bool IsExists(string Code); } #endregion }