CEL_Payroll/Payroll.BO/Requisition/CreatedRequisition.cs

143 lines
3.4 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 CreatedRequisition
[Serializable]
public class CreatedRequisition : BasicBaseObject
{
#region Cache Store
private static Cache _cache = new Cache(typeof(CreatedRequisition));
#endregion
#region Constructor
public CreatedRequisition()
{
_RequisitionID =null;
_name = "";
_RecruitementProcessID = null;
}
#endregion
#region Properties
#region _RequisitionID : ID
private ID _RequisitionID;
public ID EmpRequisitionID
{
get { return _RequisitionID; }
set
{
base.OnPropertyChange<ID>("EmpRequisitionID", _RequisitionID, value);
_RequisitionID = value;
}
}
#endregion
#region _RecruitementProcessID : ID
private ID _RecruitementProcessID;
public ID RecruitementProcessID
{
get { return _RecruitementProcessID; }
set
{
base.OnPropertyChange<ID>("RecruitementProcessID", _RecruitementProcessID, value);
_RecruitementProcessID = value;
}
}
#endregion
#region _name : string
private string _name;
public string Name
{
get { return _name; }
set
{
base.OnPropertyChange<string>("Name", _name, value);
_name = value;
}
}
#endregion
#region Service Factory ICreatedRequisitionService : ICreatedRequisitionService
internal static ICreatedRequisitionService Service
{
get { return Services.Factory.CreateService<ICreatedRequisitionService>(typeof(ICreatedRequisitionService)); }
}
#endregion
#endregion
#region Functions
public static ObjectsTemplate<CreatedRequisition> Get()
{
#region cache header
ObjectsTemplate<CreatedRequisition> CreatedRequisitions = _cache["Get"] as ObjectsTemplate<CreatedRequisition>;
if (CreatedRequisitions != null)
return CreatedRequisitions;
#endregion
try
{
CreatedRequisitions = Service.Get();
}
catch (ServiceException e)
{
throw new Exception(e.Message, e);
}
#region cache footer
_cache.Add(CreatedRequisitions, "Get");
#endregion
return CreatedRequisitions;
}
public ID Save()
{
base.SetAuditTrailProperties();
return CreatedRequisition.Service.Save(this);
}
public void Delete(ID id)
{
CreatedRequisition.Service.Delete(id);
}
#endregion
}
#endregion
#region ICreatedRequisition Service
public interface ICreatedRequisitionService
{
ObjectsTemplate<CreatedRequisition> Get();
ID Save(CreatedRequisition item);
void Delete(ID id);
}
#endregion
}