EchoTex_Payroll/HRM.BO/OverTime/TermEntityGrade.cs

199 lines
4.5 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 Ease.CoreV35;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
using System.Data.Linq.Mapping;
namespace HRM.BO
{
#region TermEntityGrade
public class TermEntityGrade : AuditTrailBase
{
#region Cache Store
private static Cache _cache = new Cache(typeof(TermEntityGrade));
#endregion
#region Constructor
public TermEntityGrade()
{
_termEntityID = null;
_gradeID = null;
_grade = null;
}
#endregion
#region Properties
#region termEntityID : ID
private ID _termEntityID;
public ID TermEntityID
{
get { return _termEntityID; }
set
{
base.OnPropertyChange<ID>("termEntityID", _termEntityID, value);
_termEntityID = value;
}
}
#endregion
#region gradeID : ID
private ID _gradeID;
public ID GradeID
{
get { return _gradeID; }
set
{
base.OnPropertyChange<ID>("gradeID", _gradeID, value);
_gradeID = value;
}
}
#endregion
#region Grade: Grade
private Grade _grade;
public Grade Grade
{
get
{
if (_gradeID.Integer > 0 && _grade == null)
{
_grade = new Grade();
_grade = Grade.Get(_gradeID);
}
return this._grade;
}
set
{
_grade = value;
}
}
#endregion
#region Service Factory ITermEntityGradeService : ITermEntityGradeService
internal static ITermEntityGradeService Service
{
get { return Services.Factory.CreateService<ITermEntityGradeService>(typeof(ITermEntityGradeService)); }
}
#endregion
#endregion
#region Functions
public static TermEntityGrade Get(ID nID)
{
TermEntityGrade oTermEntityGrade = null;
#region Cache Header
oTermEntityGrade = (TermEntityGrade)_cache["Get", nID];
if (oTermEntityGrade != null)
return oTermEntityGrade;
#endregion
oTermEntityGrade = TermEntityGrade.Service.Get(nID);
#region Cache Footer
_cache.Add(oTermEntityGrade, "Get", nID);
#endregion
return oTermEntityGrade;
}
public static List<TermEntityGrade> Get()
{
#region Cache Header
List<TermEntityGrade> termEntityGrades = _cache["Get"] as List<TermEntityGrade>;
if (termEntityGrades != null)
return termEntityGrades;
#endregion
try
{
termEntityGrades = Service.Get();
}
catch (ServiceException e)
{
throw new Exception(e.Message, e);
}
#region Cache Footer
_cache.Add(termEntityGrades, "Get");
#endregion
return termEntityGrades;
}
public static List<TermEntityGrade> GetByTermEntityID(ID termEntityID)
{
#region Cache Header
List<TermEntityGrade> termEntityGrades = _cache["Get", termEntityID] as List<TermEntityGrade>;
if (termEntityGrades != null)
return termEntityGrades;
#endregion
try
{
termEntityGrades = Service.GetByTermEntityID(termEntityID);
}
catch (ServiceException e)
{
throw new Exception(e.Message, e);
}
#region Cache Footer
_cache.Add(termEntityGrades, "Get", termEntityID);
#endregion
return termEntityGrades;
}
public ID Save()
{
return TermEntityGrade.Service.Save(this);
}
public void Delete()
{
TermEntityGrade.Service.Delete(ID);
}
#endregion
}
#endregion
#region ITermEntityGrade Service
public interface ITermEntityGradeService
{
TermEntityGrade Get(ID id);
List<TermEntityGrade> Get();
List<TermEntityGrade> GetByTermEntityID(ID TermEntityID);
ID Save(TermEntityGrade item);
void Delete(ID id);
}
#endregion
}
*/