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 SearchEmployeeGroup [Serializable] public class SearchEmployeeGroup:AuditTrailBase { #region Cache Store private static Cache _cache = new Cache(typeof(SearchEmployeeGroup)); #endregion #region Constructor public SearchEmployeeGroup() { _groupID = null; _groupCode = string.Empty; _description = string.Empty; _groupBy = 0; } #endregion #region Properties #region GroupID : ID private ID _groupID; public ID GroupID { get { return _groupID; } set { base.OnPropertyChange("GroupID", _groupID, value); _groupID = value; } } #endregion #region groupCode : string private string _groupCode; public string GroupCode { get { return _groupCode; } set { base.OnPropertyChange("groupCode", _groupCode, value); _groupCode = value; } } #endregion #region description : string private string _description; public string Description { get { return _description; } set { base.OnPropertyChange("description", _description, value); _description = value; } } #endregion #region groupBy : EnumSearchEmployeeGroup private EnumSearchEmployeeGroup _groupBy; public EnumSearchEmployeeGroup GroupBy { get { return _groupBy; } set { base.OnPropertyChange("groupBy",(short) _groupBy, (short)value); _groupBy = value; } } #endregion #region Service Factory ISearchEmployeeGroupService : ISearchEmployeeGroupService internal static ISearchEmployeeGroupService Service { get { return Services.Factory.CreateService(typeof(ISearchEmployeeGroupService)); } } #endregion #endregion #region Functions public static SearchEmployeeGroup Get(ID nID) { SearchEmployeeGroup oSearchEmployeeGroup = null; #region Cache Header oSearchEmployeeGroup = (SearchEmployeeGroup)_cache["Get", nID]; if (oSearchEmployeeGroup != null) return oSearchEmployeeGroup; #endregion oSearchEmployeeGroup = SearchEmployeeGroup.Service.Get(nID); #region Cache Footer _cache.Add(oSearchEmployeeGroup, "Get", nID); #endregion return oSearchEmployeeGroup; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate searchEmployeeGroups = _cache["Get"] as ObjectsTemplate; if (searchEmployeeGroups != null) return searchEmployeeGroups; #endregion try { searchEmployeeGroups = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(searchEmployeeGroups, "Get"); #endregion return searchEmployeeGroups; } public ID Save() { return SearchEmployeeGroup.Service.Save(this); } public void Delete() { SearchEmployeeGroup.Service.Delete(ID); } #endregion } #endregion #region ISearchEmployeeGroup Service public interface ISearchEmployeeGroupService { SearchEmployeeGroup Get(ID id); ObjectsTemplate Get(); ID Save(SearchEmployeeGroup item); void Delete(ID id); } #endregion }