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 Payroll.BO { #region PayScaleDetail [Serializable] public class PayScaleDetail:AuditTrailBase { #region Cache Store private static Cache _cache = new Cache(typeof(PayScaleDetail)); #endregion #region Constructor public PayScaleDetail() { _payscaleID = null; _stepNo = 0; _amount = 0; _stepAmount = 0; _stepIncrement = 0; } #endregion #region Properties #region payscaleID : ID private ID _payscaleID; public ID PayscaleID { get { return _payscaleID; } set { base.OnPropertyChange("payscaleID", _payscaleID, value); _payscaleID = value; } } #endregion #region StepNo : int private int _stepNo; public int StepNo { get { return _stepNo; } set { base.OnPropertyChange("StepNo", _stepNo, value); _stepNo = value; } } #endregion #region Amount : double private double _amount; public double Amount { get { return _amount; } set { base.OnPropertyChange("Amount", _amount, value); _amount = value; } } #endregion #region stepAmount : double private double _stepAmount; public double StepAmount { get { return _stepAmount; } set { base.OnPropertyChange("stepAmount", _stepAmount, value); _stepAmount = value; } } #endregion #region stepIncrement : double private double _stepIncrement; public double StepIncrement { get { return _stepIncrement; } set { base.OnPropertyChange("stepIncrement", _stepIncrement, value); _stepIncrement = value; } } #endregion #region GradeID : ID private ID _gradeID; public ID GradeID { get { return _gradeID; } set { base.OnPropertyChange("gradeID", _gradeID, value); _gradeID = value; } } #endregion #region GradeID : ID private ID _AllowanceID; public ID AllowanceID { get { return _AllowanceID; } set { base.OnPropertyChange("allowanceID", _AllowanceID, value); _AllowanceID = value; } } #endregion #region Service Factory IPayScaleDetailService : IPayScaleDetailService internal static IPayScaleDetailService Service { get { return Services.Factory.CreateService(typeof(IPayScaleDetailService)); } } #endregion #endregion #region Functions public static PayScaleDetail Get(ID nID) { PayScaleDetail oPayScaleDetail = null; #region Cache Header oPayScaleDetail = (PayScaleDetail)_cache["Get", nID]; if (oPayScaleDetail != null) return oPayScaleDetail; #endregion oPayScaleDetail = PayScaleDetail.Service.Get(nID); #region Cache Footer _cache.Add(oPayScaleDetail, "Get", nID); #endregion return oPayScaleDetail; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate payScaleDetails = _cache["Get"] as ObjectsTemplate; if (payScaleDetails != null) return payScaleDetails; #endregion try { payScaleDetails = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(payScaleDetails, "Get"); #endregion return payScaleDetails; } public static ObjectsTemplate GetByPayScale(ID payscaleID) { #region Cache Header ObjectsTemplate payScaleDetails = _cache["GetByPayScale", payscaleID] as ObjectsTemplate; if (payScaleDetails != null) return payScaleDetails; #endregion try { payScaleDetails = Service.GetByPayScale(payscaleID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(payScaleDetails, "GetByPayScale", payscaleID); #endregion return payScaleDetails; } public static ObjectsTemplate Get(ID nGradeID,ID nAllowID) { #region Cache Header ObjectsTemplate payScaleDetails = _cache["Get", nGradeID, nAllowID] as ObjectsTemplate; if (payScaleDetails != null) return payScaleDetails; #endregion try { payScaleDetails = Service.Get(nGradeID, nAllowID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(payScaleDetails, "Get", nGradeID, nAllowID); #endregion return payScaleDetails; } public static ObjectsTemplate GetByGradeID(ID nGradeID) { #region Cache Header ObjectsTemplate payScaleDetails = _cache["GetByGradeID", nGradeID] as ObjectsTemplate; if (payScaleDetails != null) return payScaleDetails; #endregion try { payScaleDetails = Service.GetByGradeID(nGradeID, SystemInformation.CurrentSysInfo.PayrollTypeID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(payScaleDetails, "GetByGradeID", nGradeID); #endregion return payScaleDetails; } public ID Save() { return PayScaleDetail.Service.Save(this); } public void Delete() { PayScaleDetail.Service.Delete(ID); } #endregion } #endregion #region IPayScaleDetail Service public interface IPayScaleDetailService { PayScaleDetail Get(ID id); ObjectsTemplate Get(); ID Save(PayScaleDetail item); void Delete(ID id); ObjectsTemplate GetByGradeID(ID nGradeID, ID PayrollTypeID); ObjectsTemplate Get(ID nGradeID, ID nAllowID); ObjectsTemplate GetByPayScale(ID payscaleID); } #endregion }