EchoTex_Payroll/HRM.BO/PMP/PMPEmployeeRating.cs
2024-10-14 10:01:49 +06:00

450 lines
12 KiB
C#

using Ease.Core.Model;
using System;
using System.Collections.Generic;
using System.Data;
namespace HRM.BO
{
public class PMPEmployeeRating : BasicBaseObject, IworkflowInterface
{
#region Constructor
public PMPEmployeeRating()
{
_employeeID = 0;
_selfObjectRatingID = 0;
_approvarObjectRatingID = 0;
_approvarID = 0;
_selfValueBehaviorRatingID = 0;
_appValueBehaviorRatingID = 0;
_isTargetSettingDone = false;
_isMedianDone = false;
_isValueBehaviorDone = false;
OPMPTargetSettings = null;
OPMPValueBehaviorRatings = null;
_pmpStatus = EnumPMPStatus.Objective_Setting;
_pmpWFStatus = PMPWFStatus.Draft;
_incrementedPercentByHR = Double.MinValue;
_remarksByHR = String.Empty;
_isFinalized = false;
}
#endregion
#region Properties
#region IsFinalized
private bool _isFinalized;
public bool IsFinalized
{
get { return _isFinalized; }
set { _isFinalized = value; }
}
#endregion
#region PmpStatus
private EnumPMPStatus _pmpStatus;
public EnumPMPStatus PmpStatus
{
get { return _pmpStatus; }
set { _pmpStatus = value; }
}
#endregion
#region HrValueBehaValueBehaviorRatingID
private int _hrValueBehaValueBehaviorRatingID;
public int HrValueBehaValueBehaviorRatingID
{
get { return _hrValueBehaValueBehaviorRatingID; }
set { _hrValueBehaValueBehaviorRatingID = value; }
}
#endregion
#region HrTargetSettingRatingID
private int _hrTargetSettingRatingID;
public int HrTargetSettingRatingID
{
get { return _hrTargetSettingRatingID; }
set { _hrTargetSettingRatingID = value; }
}
#endregion
#region RemarksByHR
private string _remarksByHR;
public string RemarksByHR
{
get { return _remarksByHR; }
set { _remarksByHR = value; }
}
#endregion
#region IncrementedPercentByHR
private double _incrementedPercentByHR;
public double IncrementedPercentByHR
{
get { return _incrementedPercentByHR; }
set { _incrementedPercentByHR = value; }
}
#endregion
#region PmpWFStatus
private PMPWFStatus _pmpWFStatus;
public PMPWFStatus PmpWFStatus
{
get { return _pmpWFStatus; }
set { _pmpWFStatus = value; }
}
#endregion
#region PMPProcessID : ID
private int _pmpProcessID;
public int PmpProcessID
{
get { return _pmpProcessID; }
set { _pmpProcessID = value; }
}
#endregion
#region EmployeeID : ID
private int _employeeID;
public int EmployeeID
{
get { return _employeeID; }
set { _employeeID = value; }
}
#endregion
#region SelfObjectRatingID : ID
private int _selfObjectRatingID;
public int SelfObjectRatingID
{
get { return _selfObjectRatingID; }
set { _selfObjectRatingID = value; }
}
#endregion
#region ApprovarObjectRatingID : ID
private int _approvarObjectRatingID;
public int ApprovarObjectRatingID
{
get { return _approvarObjectRatingID; }
set { _approvarObjectRatingID = value; }
}
#endregion
#region ApprovarID : ID
private int _approvarID;
public int ApprovarID
{
get { return _approvarID; }
set { _approvarID = value; }
}
#endregion
#region SelfValueBehaviorRatingID : ID
private int _selfValueBehaviorRatingID;
public int SelfValueBehaviorRatingID
{
get { return _selfValueBehaviorRatingID; }
set { _selfValueBehaviorRatingID = value; }
}
#endregion
#region AppValueBehaviorRatingID : ID
private int _appValueBehaviorRatingID;
public int AppValueBehaviorRatingID
{
get { return _appValueBehaviorRatingID; }
set { _appValueBehaviorRatingID = value; }
}
#endregion
#region IsTargetSettingDone : bool
private bool _isTargetSettingDone;
public bool IsTargetSettingDone
{
get { return _isTargetSettingDone; }
set { _isTargetSettingDone = value; }
}
#endregion
#region IsMedianDone : bool
private bool _isMedianDone;
public bool IsMedianDone
{
get { return _isMedianDone; }
set { _isMedianDone = value; }
}
#endregion
#region IsValueBehaviorDone : bool
private bool _isValueBehaviorDone;
public bool IsValueBehaviorDone
{
get { return _isValueBehaviorDone; }
set { _isValueBehaviorDone = value; }
}
#endregion
public List<PMPTargetSetting> OPMPTargetSettings { get; set; }
public List<PMPValueBehaviorRating> OPMPValueBehaviorRatings { get; set; }
public Employee Employee { get; set; }
//#region List < PMPTargetSetting > : PMPTargetSetting
//private List<PMPTargetSetting> _oPMPTargetSettings;
//public List < PMPTargetSetting > OPMPTargetSettings
//{
// get
// {
// if (this.PmpProcessID != null && this.PmpProcessID.IsUnassigned == false && this.PmpProcessID.Integer > 0 && _oPMPTargetSettings == null)
// _oPMPTargetSettings = PMPProcess.GetPMPTargetSettingsByEmployeeIdAndPMPProcessID(EmployeeID, PmpProcessID);
// return _oPMPTargetSettings;
// }
// set { _oPMPTargetSettings = value; }
//}
//#endregion
//#region List < PMPValueBehaviorRating > : OPMPValueBehaviorRatings
//private List < PMPValueBehaviorRating > _oPMPValueBehaviorRatings;
//public List< PMPValueBehaviorRating > OPMPValueBehaviorRatings
//{
// get
// {
// if (this.PmpProcessID != null && this.PmpProcessID.IsUnassigned == false && this.PmpProcessID.Integer > 0 && _oPMPValueBehaviorRatings == null)
// _oPMPValueBehaviorRatings = PMPProcess.GetValueBehaviorRatingsByEmployeeIdAndPmpProcessId(this.EmployeeID, this.PmpProcessID);
// return _oPMPValueBehaviorRatings;
// }
// set { _oPMPValueBehaviorRatings = value; }
//}
//public List<PMPValueBehaviorRating> ValueBehaviorRatings
//{
// get
// {
// List<PMPValueBehaviorRating> _valueBehaviorRatings=PMPProcess.GetValueBehaviorRatingsByEmployeeIdAndPmpProcessId(EmployeeID, PmpProcessID);
// if(_valueBehaviorRatings ==null )
// _valueBehaviorRatings = new List<PMPValueBehaviorRating>();
// List<PMPValueBehaviorRating> valueBehaviorRatings = new List<PMPValueBehaviorRating>();
// foreach (PMPValueBehaviorRating rat in _valueBehaviorRatings)
// {
// valueBehaviorRatings.Add(rat);
// }
// List<PMPValueBehavior> _valueBehaviors = PMPValueBehavior.Get(EnumStatus.Active ) ;
// foreach (PMPValueBehavior vb in _valueBehaviors)
// {
// bool toadd = true;
// PMPValueBehaviorRating item = new PMPValueBehaviorRating();
// foreach (PMPValueBehaviorRating rat in _valueBehaviorRatings)
// {
// if (rat.PMPValueBehaviorID.Integer == vb.ID.Integer)
// {
// toadd = false;
// break;
// }
// }
// if (toadd)
// {
// item.PMPValueBehaviorID = vb.ID;
// item.EmployeeID = EmployeeID;
// item.PmpEmployeeRatingID = ID;
// item.PmpProcessId = PmpProcessID;
// valueBehaviorRatings.Add(item);
// }
// }
// _oPMPValueBehaviorRatings = valueBehaviorRatings;
// return valueBehaviorRatings;
// }
//}
//#endregion
//#region Employee
//private Employee _employee;
//public Employee Employee
//{
// get
// {
// if (_employee == null && _employeeID != null)
// {
// _employee = Employee.Get(_employeeID);
// }
// return _employee;
// }
// set
// {
// _employee = value;
// }
//}
//#endregion
#endregion
public string WFDesciption()
{
string sDescription;
sDescription = this.Employee.Name + " (" + this.Employee.EmployeeNo + ")"
+ " Submitted target for this year PMP";
return sDescription;
}
#region Iworkflow Implementation
public string ObjectDescription
{
get
{
string str = "";
str = this.Employee.Name + " (" + this.Employee.EmployeeNo + ")"
+ " Submitted target for this year PMP" ;
return str;
}
}
public int GetStatusbyWf(EnumwfStatus wfstatus)
{
PMPWFStatus tatus;
switch (wfstatus)
{
case EnumwfStatus.Received:
tatus = PMPWFStatus.InProcess;
break;
case EnumwfStatus.Revert:
tatus = PMPWFStatus.Revert;
break;
case EnumwfStatus.Reject:
tatus = PMPWFStatus.Decline;
break;
case EnumwfStatus.Approve:
tatus = PMPWFStatus.Complete;
break;
case EnumwfStatus.End:
tatus = PMPWFStatus.Complete;
break;
default:
tatus = PMPWFStatus.InProcess;
break;
}
return (int)tatus;
}
public int SetupID
{
get
{
return (2);
}
}
public int ObjectID
{
get { return this.ID; }
}
public List<PendingJobDetail> GetDetails()
{
List<PendingJobDetail> opJobsDetail = new List<PendingJobDetail>();
opJobsDetail.Add(new PendingJobDetail() { Type = "Applier:", Value = this.Employee.Name });
opJobsDetail.Add(new PendingJobDetail() { Type = "PMP Status:", Value = this.PmpStatus.ToString().Replace('_', ' ') });
// add more items as per need
return opJobsDetail;
}
//public static PMPEmployeeRating Get(int pmpempid)
//{
// return PMPProcess.Service.GetPMPEmployeeRatingByPMPProcessID(pmpempid);
//}
#endregion
}
}