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 PhotoPath [Serializable] public class PhotoPath : BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(PhotoPath)); #endregion #region Constructor public PhotoPath() { _employeePhoto = string.Empty; _employeeSignature = string.Empty; _nomineePhoto = string.Empty; _nomineeSignature = string.Empty; _hospitalizationPhoto = string.Empty; _letterTempPath = string.Empty; _trainingOutlinePathPath = string.Empty; _ERRSFilePath = string.Empty; } #endregion #region Properties #region EmployeePhoto : string private string _employeePhoto; public string EmployeePhoto { get { return _employeePhoto; } set { base.OnPropertyChange("EmployeePhoto", _employeePhoto, value); _employeePhoto = value; } } #endregion #region EmployeeSignature : string private string _employeeSignature; public string EmployeeSignature { get { return _employeeSignature; } set { base.OnPropertyChange("EmployeeSignature", _employeeSignature, value); _employeeSignature = value; } } #endregion #region NomineePhoto : string private string _nomineePhoto; public string NomineePhoto { get { return _nomineePhoto; } set { base.OnPropertyChange("NomineePhoto", _nomineePhoto, value); _nomineePhoto = value; } } #endregion #region NomineeSignature : string private string _nomineeSignature; public string NomineeSignature { get { return _nomineeSignature; } set { base.OnPropertyChange("NomineeSignature", _nomineeSignature, value); _nomineeSignature = value; } } #endregion #region HospitalizationPhoto : string private string _hospitalizationPhoto; public string HospitalizationPhoto { get { return _hospitalizationPhoto; } set { base.OnPropertyChange("HospitalizationPhoto", _hospitalizationPhoto, value); _hospitalizationPhoto = value; } } #endregion #region LetterTempPath : string private string _letterTempPath; public string LetterTempPath { get { return _letterTempPath; } set { base.OnPropertyChange("LetterTempPath", _letterTempPath, value); _letterTempPath = value; } } #endregion #region TrainingOutlinePath : string private string _trainingOutlinePathPath; public string TrainingOutlinePath { get { return _trainingOutlinePathPath; } set { base.OnPropertyChange("TrainingOutlinePath", _trainingOutlinePathPath, value); _trainingOutlinePathPath = value; } } #endregion #region ERRSFilePath : string private string _ERRSFilePath; public string ERRSFilePath { get { return _ERRSFilePath; } set { base.OnPropertyChange("ERRSFilePath", _ERRSFilePath, value); _ERRSFilePath = value; } } #endregion #region Service Factory IPhotoPathService : IPhotoPathService internal static IPhotoPathService Service { get { return Services.Factory.CreateService(typeof(IPhotoPathService)); } } #endregion #endregion #region Functions public static PhotoPath Get(ID nID) { PhotoPath oPhotoPath = null; #region Cache Header oPhotoPath = (PhotoPath)_cache["Get", nID]; if (oPhotoPath != null) return oPhotoPath; #endregion oPhotoPath = PhotoPath.Service.Get(nID); #region Cache Footer _cache.Add(oPhotoPath, "Get", nID); #endregion return oPhotoPath; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate PhotoPaths = _cache["Get"] as ObjectsTemplate; if (PhotoPaths != null) return PhotoPaths; #endregion try { PhotoPaths = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(PhotoPaths, "Get"); #endregion return PhotoPaths; } public ID Save() { base.SetAuditTrailProperties(); return PhotoPath.Service.Save(this); } public void Delete(ID id) { PhotoPath.Service.Delete(id); } #endregion } #endregion #region IPhotoPath Service public interface IPhotoPathService { PhotoPath Get(ID id); ObjectsTemplate Get(); ID Save(PhotoPath item); void Delete(ID id); } #endregion }