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 AutoObject [Serializable] public class AutoObject : BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(AutoObject)); #endregion #region Constructor public AutoObject() { _menuKey = string.Empty; _name = string.Empty; } #endregion #region Properties #region name : string private string _name; public string Name { get { return _name; } set { base.OnPropertyChange("name", _name, value); _name = value; } } #endregion #region MenuKey : string private string _menuKey; public string MenuKey { get { return _menuKey; } set { base.OnPropertyChange("MenuKey", _menuKey, value); _menuKey = value; } } #endregion #region Service Factory IDesignationService : IDesignationService internal static IAutoObjectService Service { get { return Services.Factory.CreateService(typeof(IAutoObjectService)); } } #endregion #endregion #region Functions public static AutoObject Get(string sFormName) { AutoObject oItem = null; #region Cache Header oItem = (AutoObject)_cache["Get", sFormName]; if (oItem != null) return oItem; #endregion oItem = AutoObject.Service.Get(sFormName); #region Cache Footer _cache.Add(oItem, "Get", sFormName); #endregion return oItem; } public ID Save() { this.SetAuditTrailProperties(); return AutoObject.Service.Save(this); } public void Delete(ID id) { AutoObject.Service.Delete(id); } #endregion } #endregion #region IAutoObjectService Service public interface IAutoObjectService { AutoObject Get(string sFormName); ID Save(AutoObject item); void Delete(ID id); } #endregion }