CEL_Payroll/Payroll.BO/Common/PhotoPath.cs

240 lines
5.8 KiB
C#
Raw Normal View History

2024-09-17 14:30:13 +06:00
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<string>("EmployeePhoto", _employeePhoto, value);
_employeePhoto = value;
}
}
#endregion
#region EmployeeSignature : string
private string _employeeSignature;
public string EmployeeSignature
{
get { return _employeeSignature; }
set
{
base.OnPropertyChange<string>("EmployeeSignature", _employeeSignature, value);
_employeeSignature = value;
}
}
#endregion
#region NomineePhoto : string
private string _nomineePhoto;
public string NomineePhoto
{
get { return _nomineePhoto; }
set
{
base.OnPropertyChange<string>("NomineePhoto", _nomineePhoto, value);
_nomineePhoto = value;
}
}
#endregion
#region NomineeSignature : string
private string _nomineeSignature;
public string NomineeSignature
{
get { return _nomineeSignature; }
set
{
base.OnPropertyChange<string>("NomineeSignature", _nomineeSignature, value);
_nomineeSignature = value;
}
}
#endregion
#region HospitalizationPhoto : string
private string _hospitalizationPhoto;
public string HospitalizationPhoto
{
get { return _hospitalizationPhoto; }
set
{
base.OnPropertyChange<string>("HospitalizationPhoto", _hospitalizationPhoto, value);
_hospitalizationPhoto = value;
}
}
#endregion
#region LetterTempPath : string
private string _letterTempPath;
public string LetterTempPath
{
get { return _letterTempPath; }
set
{
base.OnPropertyChange<string>("LetterTempPath", _letterTempPath, value);
_letterTempPath = value;
}
}
#endregion
#region TrainingOutlinePath : string
private string _trainingOutlinePathPath;
public string TrainingOutlinePath
{
get { return _trainingOutlinePathPath; }
set
{
base.OnPropertyChange<string>("TrainingOutlinePath", _trainingOutlinePathPath, value);
_trainingOutlinePathPath = value;
}
}
#endregion
#region ERRSFilePath : string
private string _ERRSFilePath;
public string ERRSFilePath
{
get { return _ERRSFilePath; }
set
{
base.OnPropertyChange<string>("ERRSFilePath", _ERRSFilePath, value);
_ERRSFilePath = value;
}
}
#endregion
#region Service Factory IPhotoPathService : IPhotoPathService
internal static IPhotoPathService Service
{
get { return Services.Factory.CreateService<IPhotoPathService>(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<PhotoPath> Get()
{
#region Cache Header
ObjectsTemplate<PhotoPath> PhotoPaths = _cache["Get"] as ObjectsTemplate<PhotoPath>;
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<PhotoPath> Get();
ID Save(PhotoPath item);
void Delete(ID id);
}
#endregion
}