EchoTex_Payroll/HRM.BO/Organogram/SkillLevel.cs

196 lines
5.0 KiB
C#
Raw Normal View History

2024-10-14 10:01:49 +06:00

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<ISkillLevelService>(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<SkillLevel> Get()
//{
// #region Cache Header
// List<SkillLevel> oSkilLevel = _cache["Get"] as List<SkillLevel>;
// 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<SkillLevel> Get(EnumStatus status)
//{
// #region Cache Header
// List<SkillLevel> skills = _cache["Get", status] as List<SkillLevel>;
// 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<SkillLevel> GetChilds(ID parentID)
////{
//// #region Cache Header
//// List<SkillLevel> skills = _cache["GetChilds"] as List<SkillLevel>;
//// 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<SkillLevel> Get();
List<SkillLevel> Get(EnumStatus status);
//List<SkillLevel> GetChilds(ID parentID);
bool IsExists(string Code);
}
#endregion
}