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(); //_allRecruitementSteps = new ObjectsTemplate(); _allRecruitementSteps = null; _allRecruitementOrgs = new ObjectsTemplate(); } #endregion #region Delegate public delegate void dlgtRefresh(); #endregion #region Service Factory IRecruitementProcessService : IRecruitementProcessService internal static IRecruitementProcessService Service { get { return Services.Factory.CreateService(typeof(IRecruitementProcessService)); } } #endregion #region Properties private string _code; private string _description; private DateTime _startDate; private DateTime _endDate; private EnumRecruitementProcess _processStatus; private ObjectsTemplate _allCandidates; private ObjectsTemplate _allRecruitementSteps; private ObjectsTemplate _allRecruitementOrgs; private ObjectsTemplate _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 AllCandidates { get { if (!this.IsNew && _allCandidates.Count == 0) return RecruitementProcess.GetCanditates(this.ID); return _allCandidates; } set { _allCandidates = value; } } public ObjectsTemplate AllRecruitementSteps { get { if (!this.IsNew && _allRecruitementSteps == null) { return RecruitementProcess.Service.Get(this.ID); } return _allRecruitementSteps; } set { _allRecruitementSteps = value; } } public ObjectsTemplate AllRecruitementOrgs { get { return _allRecruitementOrgs; } set { _allRecruitementOrgs = value; } } public ObjectsTemplate 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 stepItemsToDelete) { RecruitementProcess.Service.Save(obRecruProc, stepItemsToDelete); } #endregion #region ObjectsTemplateGet() public static ObjectsTemplate Get() { return RecruitementProcess.Service.Get(); } #endregion #region ObjectsTemplate< RecruitementStep > Get(ID processID) public static ObjectsTemplate Get(ID processID) { return RecruitementProcess.Service.Get(processID); } public static RecruitementStep GetRStep(ID stepID) { return RecruitementProcess.Service.GetRStep(stepID); } #endregion public static ObjectsTemplate GetByAssesmentStatus(int nAssStatus, int nEmpID) { return RecruitementProcess.Service.GetByAssesmentStatus(nAssStatus, nEmpID); } #region ObjectsTemplate< BoardMember > GetBoardMembers(ID processID,ID stepID) public static ObjectsTemplate 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 GetCanditates(ID processID) { return RecruitementProcess.Service.GetCanditates(processID); } #endregion #region ObjectsTemplate< Candidate > GetCanditates(ID processID,int assessmentStatus,int logInID) public static ObjectsTemplate 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 allCans) public static void SaveCandidatesToProcess(ID processID, ObjectsTemplate 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 Get(ID stepID, ID processID) { return RecruitementProcess.Service.Get(stepID, processID); } #endregion #region aveMemberWiseMark(ObjectsTemplate allmemMarks, ID processID, ID stepID) public static void SaveMemberWiseMark(ObjectsTemplate 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 GetSelectedCandidates(ID processID, ID stepID, bool flag) { return RecruitementProcess.Service.GetSelectedCandidates(processID, stepID, flag); } #endregion #region ObjectsTemplate < RecruitmentType > GetRecruitmentType() public static ObjectsTemplate 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 GetAllSteps(ID processID) { return RecruitementProcess.Service.GetAllSteps(processID); } #endregion #region bool IsCompletable(RecruitementProcess obTarget) public static bool IsCompletable(RecruitementProcess obTarget) { bool result = true; ObjectsTemplate 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 GetProcesses(string query) { return RecruitementProcess.Service.GetProcesses(query); } #endregion #endregion public static ObjectsTemplate 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 allCans); ObjectsTemplate 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 Get(ID processID); ObjectsTemplate GetBoardMembers(ID processID, ID stepID); ObjectsTemplate GetCanditates(ID processID); ObjectsTemplate GetCanditates(ID processID, int assessmentStatus, int logInID); Candidate GetByCandediateID(ID candidateID); void Delete(RecruitementProcess obRecruProc); ObjectsTemplate Get(ID stepID, ID processID); void SaveMemberWiseMark(ObjectsTemplate allmemMarks, ID processID, ID stepID); void SaveRecruitementStep(RecruitementStep step, ID processID, ID stepID); void Save(RecruitementProcess obRecruProc, ObjectsTemplate stepItemsToDelete); ObjectsTemplate GetSelectedCandidates(ID processID, ID stepID, bool flag); ObjectsTemplate GetSelectedCandidates(ID processID, ID stepID); ObjectsTemplate GetRecruitmentType(); DataSet GetShortListedCandidates(ID processID); RecruitementStep GetRecruitmentStep(ID processID, int serial); void UpdateStep(RecruitementStep obStep); ObjectsTemplate GetAllSteps(ID processID); void UpdateProcess(RecruitementProcess obProcess); RecruitementProcess CheckCode(string code); ObjectsTemplate GetProcesses(string query); ObjectsTemplate 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 }