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 FestivalBonusProjection [Serializable] public class FestivalBonusProjection : BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(FestivalBonusProjection)); #endregion #region Constructor #region Input validator public string[] InputValidator() { string[] sErrorString = new string[1]; if (this.NoofBasic == 0) { sErrorString[0] = "No of basic can not be zero"; sErrorString[1] = "Noo basic"; return sErrorString; } sErrorString = null; return sErrorString; } #endregion public FestivalBonusProjection() { _basicmonth = EnumMonths.January; _noofbasic = 0.0; } #endregion #region Properties #region basicmonth : date private EnumMonths _basicmonth; public EnumMonths BasicMonth { get { return _basicmonth; } set { _basicmonth = value; } } #endregion #region noofbasic : double private double _noofbasic; public double NoofBasic { get { return _noofbasic; } set { base.OnPropertyChange("noofbasic", _noofbasic, value); _noofbasic = value; } } #endregion #region Service Factory IFestivalBonusProjectionService : IFestivalBonusProjectionService internal static IFestivalBonusProjectionService Service { get { return Services.Factory.CreateService(typeof(IFestivalBonusProjectionService)); } } #endregion #endregion #region Functions public static FestivalBonusProjection Get(ID nID) { FestivalBonusProjection oFestivalBonusProjection = null; #region Cache Header oFestivalBonusProjection = (FestivalBonusProjection)_cache["Get", nID]; if (oFestivalBonusProjection != null) return oFestivalBonusProjection; #endregion oFestivalBonusProjection = FestivalBonusProjection.Service.Get(nID); #region Cache Footer _cache.Add(oFestivalBonusProjection, "Get", nID); #endregion return oFestivalBonusProjection; } public static FestivalBonusProjection Get(EnumMonths dBasicMonth) { FestivalBonusProjection oFestivalBonusProjection = null; #region Cache Header oFestivalBonusProjection = (FestivalBonusProjection)_cache["Get", dBasicMonth]; if (oFestivalBonusProjection != null) return oFestivalBonusProjection; #endregion oFestivalBonusProjection = FestivalBonusProjection.Service.Get(dBasicMonth); #region Cache Footer _cache.Add(oFestivalBonusProjection, "Get", dBasicMonth); #endregion return oFestivalBonusProjection; } public static ObjectsTemplate Get(EnumStatus status) { #region Cache Header ObjectsTemplate FestivalBonusProjections = _cache["Get", status] as ObjectsTemplate; if (FestivalBonusProjections != null) return FestivalBonusProjections; #endregion try { FestivalBonusProjections = Service.Get(status); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(FestivalBonusProjections, "Get", status); #endregion return FestivalBonusProjections; } public ID Save() { this.SetAuditTrailProperties(); return FestivalBonusProjection.Service.Save(this); } public void Delete(ID id) { FestivalBonusProjection.Service.Delete(id); } #endregion } #endregion #region IFestivalBonusProjection Service public interface IFestivalBonusProjectionService { FestivalBonusProjection Get(ID id); ObjectsTemplate Get(EnumStatus status); ID Save(FestivalBonusProjection item); void Delete(ID id); FestivalBonusProjection Get(EnumMonths dBasicMonth); } #endregion }