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; using System.Data; namespace Payroll.BO { #region ProdBonusSupervisor [Serializable] public class ProdBonusSupervisor: BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(ProdBonusSupervisor)); #endregion #region Constructor #region Input validator #endregion public ProdBonusSupervisor() { } #endregion #region Properties #region ProdBonusSetupID : ID private ID _prodBonusSetupID; public ID ProdBonusSetupID { get { return _prodBonusSetupID; } set { base.OnPropertyChange("ProdBonusSetupID", _prodBonusSetupID, value); _prodBonusSetupID = value; } } #endregion #region ProdBonusLineID : ID private ID _prodBonusLineID; public ID ProdBonusLineID { get { return _prodBonusLineID; } set { base.OnPropertyChange("ProdBonusLineID", _prodBonusLineID, value); _prodBonusLineID = value; } } #endregion #region EmployeeID : ID private ID _employeeID; public ID EmployeeID { get { return _employeeID; } set { base.OnPropertyChange("EmployeeID", _employeeID, value); _employeeID = value; } } #endregion #region BonusPercent : double private double _bonusPercent; public double BonusPercent { get { return _bonusPercent; } set { base.OnPropertyChange("BonusPercent", _bonusPercent, value); _bonusPercent = value; } } #endregion #region Amount : double private double _amount; public double Amount { get { return _amount; } set { base.OnPropertyChange("Amount", _amount, value); _amount = value; } } #endregion #region Service Factory IProdBonusSupervisorService : IProdBonusSupervisorService internal static IProdBonusSupervisorService Service { get { return Services.Factory.CreateService(typeof(IProdBonusSupervisorService)); } } #endregion #endregion #region Functions public static ProdBonusSupervisor Get(ID nID) { ProdBonusSupervisor oProdBonusSupervisor = null; #region Cache Header oProdBonusSupervisor = (ProdBonusSupervisor)_cache["Get", nID]; if (oProdBonusSupervisor != null) return oProdBonusSupervisor; #endregion oProdBonusSupervisor = ProdBonusSupervisor.Service.Get(nID); #region Cache Footer _cache.Add(oProdBonusSupervisor, "Get", nID); #endregion return oProdBonusSupervisor; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate ProdBonusSupervisors = _cache["Get"] as ObjectsTemplate; if (ProdBonusSupervisors != null) return ProdBonusSupervisors; #endregion try { ProdBonusSupervisors = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(ProdBonusSupervisors, "Get"); #endregion return ProdBonusSupervisors; } public ID Save() { this.SetAuditTrailProperties(); return ProdBonusSupervisor.Service.Save(this); } public void Delete(ID id) { ProdBonusSupervisor.Service.Delete(id); } #endregion } #endregion #region IProdBonusSupervisor Service public interface IProdBonusSupervisorService { ProdBonusSupervisor Get(ID id); ObjectsTemplate Get(); ID Save(ProdBonusSupervisor item); void Delete(ID id); } #endregion }