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; using System.Data; namespace Payroll.BO { [Serializable] public class ComponentUploadSetup: BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(ComponentUploadSetup)); #endregion #region Constructor public ComponentUploadSetup() { } #endregion #region Properties #region EmployeeID private int _employeeID; public int EmployeeID { get { return _employeeID; } set { _employeeID = value; } } #endregion #region ApproverID private int _approverID; public int ApproverID { get { return _approverID; } set { _approverID = value; } } #endregion #region ComponentType private EnumComponentType _componentType; public EnumComponentType ComponentType { get { return _componentType; } set { _componentType = value; } } #endregion #region ItemID private ID _itemID; public ID ItemID { get { return _itemID; } set { _itemID = value; } } #endregion #region Description private string _description; public string Description { get { return _description; } set { _description = value; } } #endregion #endregion #region Functions public static ObjectsTemplate Get() { ObjectsTemplate componentSetups = null; #region Cache Header componentSetups = (ObjectsTemplate)_cache["Get"]; if (componentSetups != null) return componentSetups; #endregion componentSetups = ComponentUploadSetup.Service.Get(); #region Cache Footer _cache.Add(componentSetups, "Get"); #endregion return componentSetups; } public static ObjectsTemplate Get(ID empid) { ObjectsTemplate componentSetups = null; #region Cache Header componentSetups = (ObjectsTemplate)_cache["Get", empid]; if (componentSetups != null) return componentSetups; #endregion componentSetups = ComponentUploadSetup.Service.Get(empid); #region Cache Footer _cache.Add(componentSetups, "Get", empid); #endregion return componentSetups; } public static ObjectsTemplate GetByApproverID(ID apprvrID) { ObjectsTemplate componentSetups = null; componentSetups = ComponentUploadSetup.Service.GetByApproverID(apprvrID); return componentSetups; } public static DataTable GetUploadedComponentReportData(DateTime fromDate, DateTime toDate) { return Service.GetUploadedComponentReportData(fromDate, toDate); } public void Save(ObjectsTemplate componentSetups) { this.SetAuditTrailProperties(); ComponentUploadSetup.Service.Save(componentSetups); } public void Delete(ID id) { ComponentUploadSetup.Service.Delete(id); } public static void DeleteSingleComponent(ComponentUploadSetup oComponentUploadSetup) { ComponentUploadSetup.Service.DeleteSingleComponent(oComponentUploadSetup); } #endregion #region Service Factory internal static IComponentUploadSetupService Service { get { return Services.Factory.CreateService(typeof(IComponentUploadSetupService)); } } #endregion } public interface IComponentUploadSetupService { ObjectsTemplate Get(); ObjectsTemplate Get(ID empId); ObjectsTemplate GetByApproverID(ID apprvrID); DataTable GetUploadedComponentReportData(DateTime fromDate, DateTime toDate); void Save(ObjectsTemplate componentSetups); void Delete(ID id); void DeleteSingleComponent(ComponentUploadSetup oComponentUploadSetup); } }