177 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			177 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
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<ID>("GroupID", _groupID, value);
 | 
						|
                _groupID = value;
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        #endregion
 | 
						|
 | 
						|
        #region groupCode : string
 | 
						|
 | 
						|
        private string _groupCode;
 | 
						|
        public string GroupCode
 | 
						|
        {
 | 
						|
            get { return _groupCode; }
 | 
						|
            set
 | 
						|
            {
 | 
						|
                base.OnPropertyChange<string>("groupCode", _groupCode, value);
 | 
						|
                _groupCode = value;
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        #endregion
 | 
						|
 | 
						|
        #region description : string
 | 
						|
 | 
						|
        private string _description;
 | 
						|
        public string Description
 | 
						|
        {
 | 
						|
            get { return _description; }
 | 
						|
            set
 | 
						|
            {
 | 
						|
                base.OnPropertyChange<string>("description", _description, value);
 | 
						|
                _description = value;
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        #endregion
 | 
						|
 | 
						|
        #region groupBy : EnumSearchEmployeeGroup
 | 
						|
 | 
						|
        private EnumSearchEmployeeGroup _groupBy;
 | 
						|
        public EnumSearchEmployeeGroup GroupBy
 | 
						|
        {
 | 
						|
            get { return _groupBy; }
 | 
						|
            set
 | 
						|
            {
 | 
						|
                base.OnPropertyChange<short>("groupBy",(short) _groupBy, (short)value);
 | 
						|
                _groupBy = value;
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        #endregion
 | 
						|
 | 
						|
        #region Service Factory ISearchEmployeeGroupService : ISearchEmployeeGroupService
 | 
						|
 | 
						|
        internal static ISearchEmployeeGroupService Service
 | 
						|
        {
 | 
						|
            get { return Services.Factory.CreateService<ISearchEmployeeGroupService>(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<SearchEmployeeGroup> Get()
 | 
						|
        {
 | 
						|
            #region Cache Header
 | 
						|
 | 
						|
            ObjectsTemplate<SearchEmployeeGroup> searchEmployeeGroups = _cache["Get"] as ObjectsTemplate<SearchEmployeeGroup>;
 | 
						|
            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<SearchEmployeeGroup> Get();
 | 
						|
        ID Save(SearchEmployeeGroup item);
 | 
						|
        void Delete(ID id);
 | 
						|
    }
 | 
						|
 | 
						|
    #endregion
 | 
						|
}
 |