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 WebAPPFormParam [Serializable] public class WebAPPFormParam : BasicBaseObject { public delegate void ItemChanged(); #region Cache Store private static Cache _cache = new Cache(typeof(WebAPPFormParam)); #endregion #region Constructor public WebAPPFormParam() { _nformObjectID = 0; _assessmentBy = ID.FromInteger(0); _nobjectID = 0; _dAssessmentDate = DateTime.MinValue; } #endregion #region Properties #region DataType : EnumAssessmentFormType private EnumAssessmentFormType _assessmentFormType; public EnumAssessmentFormType AssessmentFormType { get { return _assessmentFormType; } set { base.OnPropertyChange("dataType", (short)_assessmentFormType, (short)value); _assessmentFormType = value; } } #endregion #region FormID : int private int _nformObjectID; public int FormID { get { return _nformObjectID; } set { base.OnPropertyChange("formID", _nformObjectID, value); _nformObjectID = value; } } #endregion #region AssessmentBy : ID private ID _assessmentBy; public ID AssessmentBy { get { return _assessmentBy; } set { base.OnPropertyChange("assessmentBy", _assessmentBy, value); _assessmentBy = value; } } #endregion #region AssessmentDate : DateTime private DateTime _dAssessmentDate; public DateTime AssessmentDate { get { return _dAssessmentDate; } set { base.OnPropertyChange("assessmentDate", _dAssessmentDate, value); _dAssessmentDate = value; } } #endregion #region ObjectID : int private int _nobjectID; public int ObjectID { get { return _nobjectID; } set { base.OnPropertyChange("objectID", _nobjectID, value); _nobjectID = value; } } #endregion #region AssessmentFor : EnumAssessmentFor private EnumAssessmentFor _assessmentFor; public EnumAssessmentFor AssessmentFor { get { return _assessmentFor; } set { base.OnPropertyChange("assessmentFor", (short)_assessmentFor, (short)value); _assessmentFor = value; } } #endregion #region WebAppFormParamDetails : ObjectsTemplate private ObjectsTemplate _paramDetailes; public ObjectsTemplate ParamDetails { get { if (_paramDetailes == null && !this.ID.IsUnassigned) { _paramDetailes = WebAPPFormParamDetails.Service.GetParamDetails(this.ID.Integer); //_salaryEmpCostCenters = new ObjectsTemplate(); } return _paramDetailes; } set { _paramDetailes = value; } } #endregion #endregion #region Service Factory IWebAPPFormParamService : IWebAPPFormParamService internal static IWebAPPFormParamService Service { get { return Services.Factory.CreateService(typeof(IWebAPPFormParamService)); } } #endregion #region Functions public static WebAPPFormParam Get(ID id) { WebAPPFormParam webAPPFormParam = null; #region Cache Header webAPPFormParam = (WebAPPFormParam)_cache["Get",id]; if (webAPPFormParam != null) return webAPPFormParam; #endregion webAPPFormParam = WebAPPFormParam.Service.Get(id); #region Cache Footer _cache.Add(webAPPFormParam, "Get", id); #endregion return webAPPFormParam; } public static WebAPPFormParam Get(int formId, int objectID) { WebAPPFormParam webAPPFormParam = null; #region Cache Header webAPPFormParam = (WebAPPFormParam)_cache["Get", formId, objectID]; if (webAPPFormParam != null) return webAPPFormParam; #endregion webAPPFormParam = WebAPPFormParam.Service.Get(formId, objectID); #region Cache Footer _cache.Add(webAPPFormParam, "Get", formId, objectID); #endregion return webAPPFormParam; } public static ObjectsTemplate Get() { #region Cache Header ObjectsTemplate webAPPFormParams = _cache["Get"] as ObjectsTemplate; if (webAPPFormParams != null) return webAPPFormParams; #endregion try { webAPPFormParams = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(webAPPFormParams, "Get"); #endregion return webAPPFormParams; } public static ObjectsTemplate GetParams(int formId, int objectID) { #region Cache Header ObjectsTemplate webAPPFormParams = _cache["Get"] as ObjectsTemplate; if (webAPPFormParams != null) return webAPPFormParams; #endregion try { webAPPFormParams = Service.GetParams(formId, objectID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region Cache Footer _cache.Add(webAPPFormParams, "Get"); #endregion return webAPPFormParams; } public ID Save() { base.SetAuditTrailProperties(); return WebAPPFormParam.Service.Save(this); } public void Delete(int formId, int objectID) { WebAPPFormParam.Service.Delete(formId, objectID); } public void Delete() { WebAPPFormParam.Service.Delete(this.ID); } //public void DeleteOb(int id) //{ // WebAPPFormParam.Service.Delete(ID); //} public void Save(ObjectsTemplate webAPPFormParams) { base.SetAuditTrailProperties(); foreach (var item in webAPPFormParams) { item.SetAuditTrailProperties(); } WebAPPFormParam.Service.Save(webAPPFormParams); } public static ObjectsTemplate GetParamDetails(int ParamId) { ObjectsTemplate oWebAPPFormParamDetails = null; oWebAPPFormParamDetails = Service.GetParamDetails(ParamId); return oWebAPPFormParamDetails; } #endregion } #endregion #region IWebAPPFormParamService public interface IWebAPPFormParamService { WebAPPFormParam Get(ID id); WebAPPFormParam Get(int formId,int objectID); ObjectsTemplate GetParams(int formId, int objectID); ObjectsTemplate Get(); ID Save(WebAPPFormParam item); void Save(ObjectsTemplate letters); void Delete(int formId, int objectID); void Delete(ID id); //void DeleteOb(int id); ObjectsTemplate GetParamDetails(int ParamId); } #endregion }