using System; using System.Collections.Generic; using System.Linq; using Ease.CoreV35.Caching; using System.Text; using Ease.CoreV35.Model; using Ease.CoreV35; namespace Payroll.BO { [Serializable] public class ChildrenEducation : BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(ChildrenEducation)); #endregion #region ctor(s) public ChildrenEducation() { _amount = 0; _noOfChildren = 0; _fromMonth = DateTime.MinValue; //_employeeID = 0; } #endregion #region Propertise #region ChildrenEducationID:ID private ID _childrenEducationID; public ID ChildrenEducationID { get { return _childrenEducationID; } set { base.OnPropertyChange("ChildrenEducationID", _childrenEducationID, value); _childrenEducationID = value; } } #endregion #region From Month: DateTime private DateTime _fromMonth; public DateTime FromMonth { get { return _fromMonth; } set { base.OnPropertyChange("FromMonth", _fromMonth, value); _fromMonth = value; } } #endregion #region NoOfChildren: Int private int _noOfChildren; public int NoOfChildren { get { return _noOfChildren; } set { base.OnPropertyChange("NoOfChildren", _noOfChildren, value); _noOfChildren = value; } } #endregion #region Amount:double private double _amount; public double Amount { get { return _amount; } set { base.OnPropertyChange("Amount", _amount, value); _amount = value; } } #endregion #region EmployeeID: ID private ID _employeeID; public ID EmployeeID { get { return _employeeID; } set { base.OnPropertyChange("EmployeeID", _employeeID, value); _employeeID = value; } } #endregion #endregion #region Functions public ID Save() { this.SetAuditTrailProperties(); return ChildrenEducation.Service.Save(this); } public void Save(ObjectsTemplate oChildrenEducations) { foreach (ChildrenEducation oCEAllow in oChildrenEducations) { oCEAllow.SetAuditTrailProperties(); } ChildrenEducation.Service.Save(oChildrenEducations); } public void Save(ObjectsTemplate oChildrenEducations, ObjectsTemplate adParamEmployees) { foreach (ChildrenEducation oCEAllow in oChildrenEducations) { oCEAllow.SetAuditTrailProperties(); } ChildrenEducation.Service.Save(oChildrenEducations, adParamEmployees); } public void Save(ChildrenEducation oChildrenEducation, ADParameterEmployee adParamEmployee) { oChildrenEducation.SetAuditTrailProperties(); ChildrenEducation.Service.Save(oChildrenEducation, adParamEmployee); } public void Delete(ID id) { ChildrenEducation.Service.Delete(id); } public static ObjectsTemplate Get(DateTime date) { #region Cache Header ObjectsTemplate aChildrenEducation = _cache["Get"] as ObjectsTemplate; #endregion try { aChildrenEducation = Service.Get(date); } catch (Exception ex) { throw new Exception(ex.Message); } #region Cache Footer _cache.Add(aChildrenEducation, "Get"); #endregion return aChildrenEducation; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate childrenEducations = _cache["Get"] as ObjectsTemplate; if (childrenEducations != null) return childrenEducations; #endregion try { childrenEducations = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(childrenEducations, "Get"); #endregion return childrenEducations; } public static ChildrenEducation Get(ID nID) { ChildrenEducation oChildrenEducation = null; #region Cache Header oChildrenEducation = (ChildrenEducation)_cache["Get", nID]; if (oChildrenEducation != null) return oChildrenEducation; #endregion oChildrenEducation = ChildrenEducation.Service.Get(nID); #region Cache Footer _cache.Add(oChildrenEducation, "Get", nID); #endregion return oChildrenEducation; } public bool IsExist(ChildrenEducation childrenEducation) { try { return Service.IsExist(childrenEducation); } catch (ServiceException e) { throw new Exception(e.Message, e); } } #region Service Factory IChildrenEducationService: IChildrenEducationService internal static IChildrenEducationService Service { get { return Services.Factory.CreateService(typeof(IChildrenEducationService)); } } #endregion #endregion } #region IChildrenEducation Service public interface IChildrenEducationService { void Save(ChildrenEducation oChildrenEducation, ADParameterEmployee adParamEmployee); void Save(ObjectsTemplate oChildrenEducations, ObjectsTemplate adParamEmployees); void Save(ObjectsTemplate oChildrenEducations); ID Save(ChildrenEducation item); void Delete(ID id); ChildrenEducation Get(ID id); ObjectsTemplate Get(); ObjectsTemplate Get(DateTime date); bool IsExist(ChildrenEducation ChildrenEducation); } #endregion }