using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35.Caching; using Ease.CoreV35.Model; namespace Payroll.BO { [Serializable] public class EmpFieldTrack : AuditTrailBase { #region Cache Store private static Cache _cache = new Cache(typeof(EmpFieldTrack)); #endregion #region Constructor public EmpFieldTrack() { _IMENumber = string.Empty; _longitude = 0; _latitude = 0; _employeeID = null; _nearLocation = string.Empty; _client = string.Empty; _remarks = string.Empty; _tranDateTime = DateTime.Now; _zipcode = string.Empty; } #endregion #region Properties #region IMENumber : string private string _IMENumber ; public string IMENumber { get { return _IMENumber; } set { _IMENumber = value; } } #endregion #region Latitude : decimal private decimal _latitude; public decimal Latitude { get { return _latitude; } set { _latitude = value; } } #endregion #region Longitude : decimal private decimal _longitude; public decimal Longitude { get { return _longitude; } set { _longitude = value; } } #endregion #region EmployeeID : ID private ID _employeeID; public ID EmployeeID { get { return _employeeID; } set { _employeeID = value; } } #endregion #region NearLocation : string private string _nearLocation; public string NearLocation { get { return _nearLocation; } set { _nearLocation = value; } } #endregion #region Client : string private string _client; public string Client { get { return _client; } set { _client = value; } } #endregion #region Remarks : string private string _remarks; public string Remarks { get { return _IMENumber; } set { _IMENumber = value; } } #endregion #region TranDateTime : DateTime private DateTime _tranDateTime; public DateTime TranDateTime { get { return _tranDateTime; } set { _tranDateTime = value; } } #endregion #region Zipcode : string private string _zipcode; public string Zipcode { get { return _zipcode; } set { _zipcode = value; } } #endregion #region ServiceFactory Service : IEmpFieldTrackService internal static IEmpFieldTrackService Service { get { return Services.Factory.CreateService(typeof(IEmpFieldTrackService)); } } #endregion #endregion #region Functions public static EmpFieldTrack Get(ID nID) { EmpFieldTrack oEmpFieldTrack = null; #region Cache Header oEmpFieldTrack = (EmpFieldTrack) _cache["Get" , nID]; if (oEmpFieldTrack != null) return oEmpFieldTrack; #endregion oEmpFieldTrack = Service.Get(nID); #region Cache Footer _cache.Add(oEmpFieldTrack, "Get", nID); #endregion return oEmpFieldTrack; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate oEmpFieldTracks = _cache["Get"] as ObjectsTemplate; if (oEmpFieldTracks != null) return oEmpFieldTracks; #endregion try { oEmpFieldTracks = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(oEmpFieldTracks, "Get"); #endregion return oEmpFieldTracks; } public ID Save() { return Service.Save(this); } public void Delete() { Service.Delete(ID); } #endregion } public interface IEmpFieldTrackService { EmpFieldTrack Get(ID nID); ObjectsTemplate Get(); ID Save(EmpFieldTrack empFieldTrack); void Delete(ID ID); } }