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 EmployeeTaxInvestment [Serializable] public class EmployeeTaxInvestment : BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(EmployeeTaxInvestment)); #endregion #region Constructor public EmployeeTaxInvestment() { _employeeID = null; _amount = 0; _taxparameterId = null; _typeID = null; } #endregion #region Properties #region EmployeeID : ID private ID _employeeID; public ID EmployeeID { get { return _employeeID; } set { base.OnPropertyChange("EmployeeID", _employeeID, value); _employeeID = value; } } #endregion #region amount : double private double _amount; public double Amount { get { return _amount; } set { base.OnPropertyChange("amount", _amount, value); _amount = value; } } #endregion #region TaxparameterId : ID private ID _taxparameterId; public ID TaxparameterId { get { return _taxparameterId; } set { base.OnPropertyChange("TaxparameterId", _taxparameterId, value); _taxparameterId = value; } } #endregion #region TypeID : ID private ID _typeID; public ID TypeID { get { return _typeID; } set { base.OnPropertyChange("TypeID", _typeID, value); _typeID = value; } } #endregion #region Service Factory IEmployeeTaxInvestmentService : IEmployeeTaxInvestmentService internal static IEmployeeTaxInvestmentService Service { get { return Services.Factory.CreateService(typeof(IEmployeeTaxInvestmentService)); } } #endregion #endregion #region Functions public static EmployeeTaxInvestment Get(ID nID) { EmployeeTaxInvestment oEmployeeTaxInvestment = null; #region Cache Header oEmployeeTaxInvestment = (EmployeeTaxInvestment)_cache["Get", nID]; if (oEmployeeTaxInvestment != null) return oEmployeeTaxInvestment; #endregion oEmployeeTaxInvestment = EmployeeTaxInvestment.Service.Get(nID); #region Cache Footer _cache.Add(oEmployeeTaxInvestment, "Get", nID); #endregion return oEmployeeTaxInvestment; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate employeeTaxInvestments = _cache["Get"] as ObjectsTemplate; if (employeeTaxInvestments != null) return employeeTaxInvestments; #endregion try { employeeTaxInvestments = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(employeeTaxInvestments, "Get"); #endregion return employeeTaxInvestments; } public static ObjectsTemplate GetAllUsersInfo() { ObjectsTemplate employeeTaxInvestments = null; try { employeeTaxInvestments = Service.GetAllUsersInfo(Payroll.BO.SystemInformation.CurrentSysInfo.TaxParamID.Integer); } catch (ServiceException e) { throw new Exception(e.Message, e); } return employeeTaxInvestments; } public static ObjectsTemplate GetSingleEmpsInfo(ID id) { ObjectsTemplate employeeTaxInvestments = null; try { employeeTaxInvestments = Service.GetSingleEmpsInfo(id); } catch (ServiceException e) { throw new Exception(e.Message, e); } return employeeTaxInvestments; } public double GetAmount(ID TaxParamID, ID emloyeeID) { double InvestAmount = 0.0; try { InvestAmount = Service.GetAmount(TaxParamID, emloyeeID); } catch (ServiceException e) { throw new Exception(e.Message, e); } return InvestAmount; } public ID Save() { this.SetAuditTrailProperties(); return EmployeeTaxInvestment.Service.Save(this); } public void Save(ObjectsTemplate empTaxInvests) { this.SetAuditTrailProperties(); EmployeeTaxInvestment.Service.Save(empTaxInvests); } public void Delete() { EmployeeTaxInvestment.Service.Delete(ID); } #endregion } #endregion #region IEmployeeTaxInvestment Service public interface IEmployeeTaxInvestmentService { EmployeeTaxInvestment Get(ID id); ObjectsTemplate Get(); ObjectsTemplate GetAllUsersInfo(int taxParamID); double GetAmount(ID TaxParamID, ID emloyeeID); ID Save(EmployeeTaxInvestment item); void Save(ObjectsTemplate empTaxInvests); void Delete(ID id); ObjectsTemplate GetSingleEmpsInfo(ID id); } #endregion }