using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35.Caching; using Ease.CoreV35.Model; namespace Payroll.BO { #region Class TrainingSchEmpCost [Serializable] public class TrainingSchEmpCost : AuditTrailBase { #region Cache Store private static Cache _cache = new Cache(typeof(TrainingSchEmpCost)); #endregion #region Constructor public TrainingSchEmpCost() { _costHdID = 0; _amount = 0; _trunDate = DateTime.MinValue; _remarks = string.Empty; _employeeID = 0; // _trainSchEmpID = 0; } #endregion #region Properties #region Property CostHdID : int private int _costHdID; public int CostHdID { get { return _costHdID; } set { _costHdID = value; } } #endregion #region Property Amount : double private double _amount; public double Amount { get { return _amount; } set { _amount = value; } } #endregion #region Property TrunDate : DateTime private DateTime _trunDate; public DateTime TrunDate { get { return _trunDate; } set { _trunDate = value; } } #endregion #region Property Remarks : string private string _remarks; public string Remarks { get { return _remarks; } set { _remarks = value; base.SetObjectStateModified(); } } #endregion #region Property EmployeeID : int private int _employeeID; public int EmployeeID { get { return _employeeID; } set { _employeeID = value; } } #endregion #region Property TrainSchEmpID : int private int _trainSchEmpID; public int TrainSchEmpID { get { return _trainSchEmpID; } set { _trainSchEmpID = value; } } #endregion #endregion #region Functions public static TrainingSchEmpCost Get(int nID) { TrainingSchEmpCost oTrainingSchEmpCost = null; #region Cache Header oTrainingSchEmpCost = (TrainingSchEmpCost)_cache["Get", nID]; if (oTrainingSchEmpCost != null) return oTrainingSchEmpCost; #endregion oTrainingSchEmpCost = TrainingSchEmpCost.Service.Get(ID.FromInteger(nID)); #region Cache Footer _cache.Add(oTrainingSchEmpCost, "Get", nID); #endregion return oTrainingSchEmpCost; } public static ObjectsTemplate GetByTrainingScheduleEmpID(ID empID, ID trainSchEmpID) { ObjectsTemplate oTrainingSchEmpCosts = null; oTrainingSchEmpCosts = TrainingSchEmpCost.Service.GetByTrainingScheduleEmpID(empID, trainSchEmpID); return oTrainingSchEmpCosts; } public ID Save() { this.SetAuditTrailProperties(); return TrainingSchEmpCost.Service.Save(this); } public static void SaveTrainingSheduleCost(ObjectsTemplate tsec) { Service.SaveTrainingSheduleCost(tsec); } public static void Delete(ID id) { TrainingSchEmpCost.Service.Delete(id); } #endregion #region Collection Functions public static ObjectsTemplate Get() { ObjectsTemplate oTrainingSchEmpCosts = null; #region Cache Header oTrainingSchEmpCosts = (ObjectsTemplate)_cache["Get"]; if (oTrainingSchEmpCosts != null) return oTrainingSchEmpCosts; #endregion oTrainingSchEmpCosts = TrainingSchEmpCost.Service.Get(); #region Cache Footer _cache.Add(oTrainingSchEmpCosts, "Get"); #endregion return oTrainingSchEmpCosts; } #endregion #region Service Factory internal static ITrainingSchEmpCostService Service { get { return Services.Factory.CreateService(typeof(ITrainingSchEmpCostService)); } } #endregion public static ObjectsTemplate GetCostWithoutParent() { return Service.GetCostWithoutParent(); } } #endregion #region ITrainingSchEmpCostService Service public interface ITrainingSchEmpCostService { TrainingSchEmpCost Get(ID id); ObjectsTemplate Get(); ID Save(TrainingSchEmpCost oTrainingSchEmpCost); void Delete(ID id); ObjectsTemplate GetByTrainingScheduleEmpID(ID iD, ID trainSchEmpID); void SaveTrainingSheduleCost(ObjectsTemplate tsec); ObjectsTemplate GetCostWithoutParent(); } #endregion }