CEL_Payroll/Payroll.BO/Recruitement/WebAPPFormParam.cs

299 lines
8.3 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 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<short>("dataType", (short)_assessmentFormType, (short)value);
_assessmentFormType = value;
}
}
#endregion
#region FormID : int
private int _nformObjectID;
public int FormID
{
get { return _nformObjectID; }
set
{
base.OnPropertyChange<int>("formID", _nformObjectID, value);
_nformObjectID = value;
}
}
#endregion
#region AssessmentBy : ID
private ID _assessmentBy;
public ID AssessmentBy
{
get { return _assessmentBy; }
set
{
base.OnPropertyChange<ID>("assessmentBy", _assessmentBy, value);
_assessmentBy = value;
}
}
#endregion
#region AssessmentDate : DateTime
private DateTime _dAssessmentDate;
public DateTime AssessmentDate
{
get { return _dAssessmentDate; }
set
{
base.OnPropertyChange<DateTime>("assessmentDate", _dAssessmentDate, value);
_dAssessmentDate = value;
}
}
#endregion
#region ObjectID : int
private int _nobjectID;
public int ObjectID
{
get { return _nobjectID; }
set
{
base.OnPropertyChange<int>("objectID", _nobjectID, value);
_nobjectID = value;
}
}
#endregion
#region AssessmentFor : EnumAssessmentFor
private EnumAssessmentFor _assessmentFor;
public EnumAssessmentFor AssessmentFor
{
get { return _assessmentFor; }
set
{
base.OnPropertyChange<short>("assessmentFor", (short)_assessmentFor, (short)value);
_assessmentFor = value;
}
}
#endregion
#region WebAppFormParamDetails : ObjectsTemplate<WebAppFormParamDetails>
private ObjectsTemplate<WebAPPFormParamDetails> _paramDetailes;
public ObjectsTemplate<WebAPPFormParamDetails> ParamDetails
{
get
{
if (_paramDetailes == null && !this.ID.IsUnassigned)
{
_paramDetailes = WebAPPFormParamDetails.Service.GetParamDetails(this.ID.Integer);
//_salaryEmpCostCenters = new ObjectsTemplate<SalaryEmpCostCenter>();
}
return _paramDetailes;
}
set
{
_paramDetailes = value;
}
}
#endregion
#endregion
#region Service Factory IWebAPPFormParamService : IWebAPPFormParamService
internal static IWebAPPFormParamService Service
{
get { return Services.Factory.CreateService<IWebAPPFormParamService>(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<WebAPPFormParam> Get()
{
#region Cache Header
ObjectsTemplate<WebAPPFormParam> webAPPFormParams = _cache["Get"] as ObjectsTemplate<WebAPPFormParam>;
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<WebAPPFormParam> GetParams(int formId, int objectID)
{
#region Cache Header
ObjectsTemplate<WebAPPFormParam> webAPPFormParams = _cache["Get"] as ObjectsTemplate<WebAPPFormParam>;
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<WebAPPFormParam> webAPPFormParams)
{
base.SetAuditTrailProperties();
foreach (var item in webAPPFormParams)
{
item.SetAuditTrailProperties();
}
WebAPPFormParam.Service.Save(webAPPFormParams);
}
public static ObjectsTemplate<WebAPPFormParamDetails> GetParamDetails(int ParamId)
{
ObjectsTemplate<WebAPPFormParamDetails> 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<WebAPPFormParam> GetParams(int formId, int objectID);
ObjectsTemplate<WebAPPFormParam> Get();
ID Save(WebAPPFormParam item);
void Save(ObjectsTemplate<WebAPPFormParam> letters);
void Delete(int formId, int objectID);
void Delete(ID id);
//void DeleteOb(int id);
ObjectsTemplate<WebAPPFormParamDetails> GetParamDetails(int ParamId);
}
#endregion
}