using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35.Model; namespace Payroll.BO { // public enum EnumappStatus // { // Not_completed_by_manager=1, // Already_completed_by_manager=2, // Not_yet_completed_by_HR=3, // Alredy_completed_by_HR=4 //Manualy select // } [Serializable] public class EmployeeAppraisal : AuditTrailBase { #region constructor public EmployeeAppraisal() { _employeeID = null; _appraisalYear = DateTime.MinValue; _MKTSurveyID = null; _currentBasic = 0; _surveyON = EnumSurveyOn.Basic; _budgetAmount = 0; _MKTAmount = 0; _LMID = null; _LMChangePercent = 0; _LMChangeAmount = 0; _LMRemarks = string.Empty; _HRApproveID = null; _HRChangePercent = 0; _HRChangeAmount = 0; _HRRemarks = string.Empty; _ISLMDone = false; _ISHRDone = false; _AppraisalPointID = null; _AppraisalPointRate =0; } #endregion #region Properties #region EmployeeID private ID _employeeID; public ID EmployeeID { get { return _employeeID; } set { _employeeID = value; } } #endregion #region AppraisalYear private DateTime _appraisalYear; public DateTime AppraisalYear { get { return _appraisalYear; } set { _appraisalYear = value; } } #endregion #region MKTSurveyID private ID _MKTSurveyID; public ID MKTSurveyID { get { return _MKTSurveyID; } set { _MKTSurveyID = value; } } #endregion #region CurrentBasic private double _currentBasic; public double CurrentBasic { get { return _currentBasic; } set { _currentBasic = value; } } #endregion #region SurveyON private EnumSurveyOn _surveyON; public EnumSurveyOn SurveyON { get { return _surveyON; } set { _surveyON = value; } } #endregion #region BudgetAmount private double _budgetAmount; public double BudgetAmount { get { return _budgetAmount; } set { _budgetAmount = value; } } #endregion #region MKTAmount private double _MKTAmount; public double MKTAmount { get { return _MKTAmount; } set { _MKTAmount = value; } } #endregion #region LMID private ID _LMID; public ID LMID { get { return _LMID; } set { _LMID = value; } } #endregion #region LMChangePercent private double _LMChangePercent; public double LMChangePercent { get { return _LMChangePercent; } set { _LMChangePercent = value; } } #endregion #region LMChangeAmount private double _LMChangeAmount; public double LMChangeAmount { get { return _LMChangeAmount; } set { _LMChangeAmount = value; } } #endregion #region LMRemarks private string _LMRemarks; public string LMRemarks { get { return _LMRemarks; } set { _LMRemarks = value; } } #endregion #region HRApproveID private ID _HRApproveID; public ID HRApproveID { get { return _HRApproveID; } set { _HRApproveID = value; } } #endregion #region HRChangePercent private double _HRChangePercent; public double HRChangePercent { get { return _HRChangePercent; } set { _HRChangePercent = value; } } #endregion #region HRChangeAmount private double _HRChangeAmount; public double HRChangeAmount { get { return _HRChangeAmount; } set { _HRChangeAmount = value; } } #endregion #region HRRemarks private string _HRRemarks; public string HRRemarks { get { return _HRRemarks; } set { _HRRemarks = value; } } #endregion #region ISLMDone private bool _ISLMDone; public bool ISLMDone { get { return _ISLMDone; } set { _ISLMDone = value; } } #endregion #region ISHRDone private bool _ISHRDone; public bool ISHRDone { get { return _ISHRDone; } set { _ISHRDone = value; } } #endregion #region AppraisalPointID private ID _AppraisalPointID; public ID AppraisalPointID { get { return _AppraisalPointID; } set { _AppraisalPointID = value; } } #endregion #region AppraisalPointRate private double _AppraisalPointRate; public double AppraisalPointRate { get { return _AppraisalPointRate; } set { _AppraisalPointRate = value; } } #endregion #endregion #region Service Factory IEmployeeAppraisalService : IEmployeeAppraisalService internal static IEmployeeAppraisalService Service { get { return Services.Factory.CreateService(typeof(IEmployeeAppraisalService)); } } #endregion private AppraisalPoint _appraisalPoint; public AppraisalPoint AppraisalPoint { get { if (_appraisalPoint == null && !this.AppraisalPointID.IsUnassigned && this.AppraisalPointID.Integer > 0) { // _appraisalPoint = AppraisalPoint.Get(this.ID); } return _appraisalPoint; } set { _appraisalPoint = value; } } private Employee _employee; public Employee Employee { get { if (this.EmployeeID!=null && !this.EmployeeID.IsUnassigned) { _employee = Employee.Get(this.EmployeeID); // # get by budget master id } return this._employee; } set { _employee = value; } } #region Functions #region Get public static ObjectsTemplate Get(EnumStatus status) { return EmployeeAppraisal.Service.Get(status); } public static ObjectsTemplate Get(DateTime AppYear) { return EmployeeAppraisal.Service.Get(AppYear); } #endregion #region Save public ID Save() { this.SetAuditTrailProperties(); return EmployeeAppraisal.Service.Save(this); } public static void Save(ObjectsTemplate empappraisals) { foreach (EmployeeAppraisal item in empappraisals) { item.SetAuditTrailProperties(); } EmployeeAppraisal.Service.Save(empappraisals); } #endregion #region Delete public static void Delete(ID id) { EmployeeAppraisal.Service.Delete(id); } #endregion #endregion } #region IEmployeeAppraisalService public interface IEmployeeAppraisalService { ObjectsTemplate Get(EnumStatus status); ObjectsTemplate Get(DateTime AppraisalYear); ID Save(EmployeeAppraisal item); void Save(ObjectsTemplate items); void Delete(ID id); } #endregion }