CEL_Payroll/Payroll.BO/Recruitement/RecruitementProcess.cs

494 lines
15 KiB
C#
Raw Permalink Normal View History

2024-09-17 14:30:13 +06:00
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Ease.CoreV35.Model;
namespace Payroll.BO
{
[Serializable]
public class RecruitementProcess : BasicBaseObject
{
#region Constructor
public RecruitementProcess()
{
_code = "";
_description = String.Empty;
_startDate = DateTime.MinValue;
_endDate = DateTime.MinValue;
_processStatus = EnumRecruitementProcess.None;
_allCandidates = new ObjectsTemplate<Candidate>();
//_allRecruitementSteps = new ObjectsTemplate<RecruitementStep>();
_allRecruitementSteps = null;
_allRecruitementOrgs = new ObjectsTemplate<RecruitementOrg>();
}
#endregion
#region Delegate
public delegate void dlgtRefresh();
#endregion
#region Service Factory IRecruitementProcessService : IRecruitementProcessService
internal static IRecruitementProcessService Service
{
get { return Services.Factory.CreateService<IRecruitementProcessService>(typeof(IRecruitementProcessService)); }
}
#endregion
#region Properties
private string _code;
private string _description;
private DateTime _startDate;
private DateTime _endDate;
private EnumRecruitementProcess _processStatus;
private ObjectsTemplate<Candidate> _allCandidates;
private ObjectsTemplate<RecruitementStep> _allRecruitementSteps;
private ObjectsTemplate<RecruitementOrg> _allRecruitementOrgs;
private ObjectsTemplate<CreatedRequisition> _SelectedRequisitions;
public string Code
{
get { return _code; }
set { _code = value; }
}
public string Description
{
get { return _description; }
set { _description = value; }
}
public DateTime StartDate
{
get { return _startDate; }
set { _startDate = value; }
}
public DateTime EndDate
{
get { return _endDate; }
set { _endDate = value; }
}
public EnumRecruitementProcess ProcessStatus
{
get { return _processStatus; }
set { _processStatus = value; }
}
public ObjectsTemplate<Candidate> AllCandidates
{
get
{
if (!this.IsNew && _allCandidates.Count == 0)
return RecruitementProcess.GetCanditates(this.ID);
return _allCandidates;
}
set { _allCandidates = value; }
}
public ObjectsTemplate<RecruitementStep> AllRecruitementSteps
{
get
{
if (!this.IsNew && _allRecruitementSteps == null)
{
return RecruitementProcess.Service.Get(this.ID);
}
return _allRecruitementSteps;
}
set { _allRecruitementSteps = value; }
}
public ObjectsTemplate<RecruitementOrg> AllRecruitementOrgs
{
get { return _allRecruitementOrgs; }
set { _allRecruitementOrgs = value; }
}
public ObjectsTemplate<CreatedRequisition> SelectedRequisitions
{
get { return _SelectedRequisitions; }
set { _SelectedRequisitions = value; }
}
#endregion
#region Methods
#region Save
public void Save()
{
RecruitementProcess.Service.Save(this);
}
#endregion
#region Save
public static void Save(RecruitementProcess obRecruProc, ObjectsTemplate<RecruitementStep> stepItemsToDelete)
{
RecruitementProcess.Service.Save(obRecruProc, stepItemsToDelete);
}
#endregion
#region ObjectsTemplate<RecruitementProcess>Get()
public static ObjectsTemplate<RecruitementProcess> Get()
{
return RecruitementProcess.Service.Get();
}
#endregion
#region ObjectsTemplate< RecruitementStep > Get(ID processID)
public static ObjectsTemplate<RecruitementStep> Get(ID processID)
{
return RecruitementProcess.Service.Get(processID);
}
public static RecruitementStep GetRStep(ID stepID)
{
return RecruitementProcess.Service.GetRStep(stepID);
}
#endregion
public static ObjectsTemplate<RecruitementStep> GetByAssesmentStatus(int nAssStatus, int nEmpID)
{
return RecruitementProcess.Service.GetByAssesmentStatus(nAssStatus, nEmpID);
}
#region ObjectsTemplate< BoardMember > GetBoardMembers(ID processID,ID stepID)
public static ObjectsTemplate<BoardMember> GetBoardMembers(ID processID, ID stepID)
{
return RecruitementProcess.Service.GetBoardMembers(processID, stepID);
}
#endregion
#region GetByProcessId(ID procID)
public static RecruitementProcess GetByProcessId(ID procID)
{
return RecruitementProcess.Service.GetByProcessId(procID);
}
#endregion
#region ObjectsTemplate< Candidate > GetCanditates(ID processID)
public static ObjectsTemplate<Candidate> GetCanditates(ID processID)
{
return RecruitementProcess.Service.GetCanditates(processID);
}
#endregion
#region ObjectsTemplate< Candidate > GetCanditates(ID processID,int assessmentStatus,int logInID)
public static ObjectsTemplate<Candidate> GetCanditates(ID processID, int assessmentStatus, int logInID)
{
return RecruitementProcess.Service.GetCanditates(processID, assessmentStatus, logInID);
}
#endregion
#region Candidate GetByCandediateID(ID candidateID)
public static Candidate GetByCandediateID(ID candidateID)
{
return RecruitementProcess.Service.GetByCandediateID(candidateID);
}
#endregion
#region void SaveCandidatesToProcess(ID processID, ObjectsTemplate<Candidate> allCans)
public static void SaveCandidatesToProcess(ID processID, ObjectsTemplate<Candidate> allCans)
{
RecruitementProcess.Service.SaveCandidatesToProcess(processID, allCans);
}
#endregion
#region void Delete(RecruitementProcess obRecruProc)
public void Delete()
{
RecruitementProcess.Service.Delete(this);
}
#endregion
#region ObjectsTemplate < MemberWiseMark > Get(ID stepID,ID ptocessID)
public static ObjectsTemplate<MemberWiseMark> Get(ID stepID, ID processID)
{
return RecruitementProcess.Service.Get(stepID, processID);
}
#endregion
#region aveMemberWiseMark(ObjectsTemplate<MemberWiseMark> allmemMarks, ID processID, ID stepID)
public static void SaveMemberWiseMark(ObjectsTemplate<MemberWiseMark> allmemMarks, ID processID, ID stepID)
{
RecruitementProcess.Service.SaveMemberWiseMark(allmemMarks, processID, stepID);
}
#endregion
#region void SaveRecruitementStep(RecruitementStep step, ID processID, ID stepID)
public static void SaveRecruitementStep(RecruitementStep step, ID processID, ID stepID)
{
RecruitementProcess.Service.SaveRecruitementStep(step, processID, stepID);
}
#endregion
#region ObjectsTemplate< SelectedCandidate > GetSelectedCandidates(ID processID, ID stepID,bool flag)
public static ObjectsTemplate<SelectedCandidate> GetSelectedCandidates(ID processID, ID stepID, bool flag)
{
return RecruitementProcess.Service.GetSelectedCandidates(processID, stepID, flag);
}
#endregion
#region ObjectsTemplate < RecruitmentType > GetRecruitmentType()
public static ObjectsTemplate<RecruitmentType> GetRecruitmentType()
{
return RecruitementProcess.Service.GetRecruitmentType();
}
#endregion
#region RecruitmentType GetType()
public static RecruitmentType GetType(ID id)
{
return RecruitementProcess.Service.GetType(id);
}
#endregion
#region DataSet GetShortListedCandidates(ID processID)
public static DataSet GetShortListedCandidates(ID processID)
{
return RecruitementProcess.Service.GetShortListedCandidates(processID);
}
#endregion
#region RecruitementStep GetRecruitmentStep(ID processID,int serial)
public static RecruitementStep GetRecruitmentStep(ID processID, int serial)
{
return RecruitementProcess.Service.GetRecruitmentStep(processID, serial);
}
#endregion
#region RecruitementStep GetRecruitmentStep(ID processID,ID stepID)
public static RecruitementStep GetRecruitmentStep(ID processID, ID stepID)
{
return RecruitementProcess.Service.GetRecruitmentStep(processID, stepID);
}
#endregion
#region RecruitementStep GetRecruitmentStep(ID processID, int StepStatus,int typeID)
public static RecruitementStep GetRecruitmentStep(ID processID, int StepStatus, int assessmentStatus)
{
return RecruitementProcess.Service.GetRecruitmentStep(processID, StepStatus, assessmentStatus);
}
#endregion
#region GetProcess
public static RecruitementProcess GetProcess(int status)
{
return RecruitementProcess.Service.GetProcess(status);
}
#endregion
#region void UpdateStep(RecruitementStep obStep)
public static void UpdateStep(RecruitementStep obStep)
{
RecruitementProcess.Service.UpdateStep(obStep);
}
#endregion
#region ObjectsTemplate< RecruitementStep > GetAllSteps(ID processID)
public static ObjectsTemplate<RecruitementStep> GetAllSteps(ID processID)
{
return RecruitementProcess.Service.GetAllSteps(processID);
}
#endregion
#region bool IsCompletable(RecruitementProcess obTarget)
public static bool IsCompletable(RecruitementProcess obTarget)
{
bool result = true;
ObjectsTemplate<RecruitementStep> allSteps = RecruitementProcess.GetAllSteps(obTarget.ID);
foreach (var step in allSteps)
{
if (step.StepStatus == EnumRecruitementStep.None)
{
result = false;
break;
}
}
return result;
}
#endregion
#region void UpdateProcess(RecruitementProcess obProcess)
public static void UpdateProcess(RecruitementProcess obProcess)
{
RecruitementProcess.Service.UpdateProcess(obProcess);
}
#endregion
#region RecruitementProcess CheckCode(string code)
public static RecruitementProcess CheckCode(string code)
{
return RecruitementProcess.Service.CheckCode(code);
}
#endregion
#region ObjectsTemplate< RecruitementProcess > GetProcesses(string query)
public static ObjectsTemplate<RecruitementProcess> GetProcesses(string query)
{
return RecruitementProcess.Service.GetProcesses(query);
}
#endregion
#endregion
public static ObjectsTemplate<SelectedCandidate> GetAllSelectedCandidates(ID processID, ID stepID)
{
return RecruitementProcess.Service.GetSelectedCandidates(processID, stepID);
}
public static RecruitementProcess GetProcess(ID processID, ID stepID, int empID)
{
return RecruitementProcess.Service.GetProcess(processID, stepID, empID);
}
public static RecruitementProcess GetProcess(int status, int empID)
{
return RecruitementProcess.Service.GetProcess(status, empID);
}
public static RecruitementProcess GetProcessID(int status, int empID, ID stepID)
{
return RecruitementProcess.Service.GetProcessID(status, empID, stepID);
}
}
#region IRecruitementProcessService
public interface IRecruitementProcessService
{
void Save(RecruitementProcess obRecruProc);
void SaveCandidatesToProcess(ID processID, ObjectsTemplate<Candidate> allCans);
ObjectsTemplate<RecruitementProcess> Get();
RecruitementProcess GetByProcessId(ID procID);
RecruitementProcess GetProcessID(int status, int empID, ID stepID);
RecruitementProcess GetProcess(ID processID, ID stepID, int empID);
RecruitementProcess GetProcess(int status, int empID);
ObjectsTemplate<RecruitementStep> Get(ID processID);
ObjectsTemplate<BoardMember> GetBoardMembers(ID processID, ID stepID);
ObjectsTemplate<Candidate> GetCanditates(ID processID);
ObjectsTemplate<Candidate> GetCanditates(ID processID, int assessmentStatus, int logInID);
Candidate GetByCandediateID(ID candidateID);
void Delete(RecruitementProcess obRecruProc);
ObjectsTemplate<MemberWiseMark> Get(ID stepID, ID processID);
void SaveMemberWiseMark(ObjectsTemplate<MemberWiseMark> allmemMarks, ID processID, ID stepID);
void SaveRecruitementStep(RecruitementStep step, ID processID, ID stepID);
void Save(RecruitementProcess obRecruProc, ObjectsTemplate<RecruitementStep> stepItemsToDelete);
ObjectsTemplate<SelectedCandidate> GetSelectedCandidates(ID processID, ID stepID, bool flag);
ObjectsTemplate<SelectedCandidate> GetSelectedCandidates(ID processID, ID stepID);
ObjectsTemplate<RecruitmentType> GetRecruitmentType();
DataSet GetShortListedCandidates(ID processID);
RecruitementStep GetRecruitmentStep(ID processID, int serial);
void UpdateStep(RecruitementStep obStep);
ObjectsTemplate<RecruitementStep> GetAllSteps(ID processID);
void UpdateProcess(RecruitementProcess obProcess);
RecruitementProcess CheckCode(string code);
ObjectsTemplate<RecruitementProcess> GetProcesses(string query);
ObjectsTemplate<RecruitementStep> GetByAssesmentStatus(int assessmentStatus, int nEmpID);
RecruitementStep GetRStep(ID stepID);
RecruitementProcess GetProcess(int status);
RecruitementStep GetRecruitmentStep(ID processID, int StepStatus, int assessmentStatus);
RecruitmentType GetType(ID id);
RecruitementStep GetRecruitmentStep(ID processID, ID stepID);
}
#endregion
}