EchoTex_Payroll/HRM.BO/Recruitement/InternalRecruitment.cs

1083 lines
29 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00

using Ease.Core.Model;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
namespace HRM.BO
{
#region InternalRecruitment
public class InternalRecruitment : AuditTrailBase, IworkflowInterface
{
#region Constructor
public InternalRecruitment()
{
//_sPositionName=string.Empty;
//_sJobDescription = string.Empty;
//_sEducation = string.Empty;
//_sExperience=string.Empty;
//_sResponsibility = string.Empty;
//_sOtherResponsibility = string.Empty;
//_sSalaryRange = string.Empty;
//_sBenefits = string.Empty;
//_sApplicationLastDate = string.Empty;
//_dPublishedDate = DateTime.MinValue;
//_bWorkflowRequired = false;
//_bIsClosed = false;
this.offerLetterApproveStatus = EnumOfferLetterStatus.not_Initiated;
IREmployees = new List<IREmployee>();
}
#endregion
#region Properties
#region PositionName : string
private string _sPositionName;
public string PositionName
{
get { return _sPositionName; }
set
{
_sPositionName = value;
}
}
#endregion
#region PositionNo : string
private string _sPositionNo;
public string PositionNo
{
get { return _sPositionNo; }
set
{
_sPositionNo = value;
}
}
#endregion
#region JobDescription : string
private string _sJobDescription;
public string JobDescription
{
get { return _sJobDescription; }
set
{
_sJobDescription = value;
}
}
#endregion
#region Education : string
private EducationEnum? _sEducation;
public EducationEnum? Education
{
get { return _sEducation; }
set
{
_sEducation = value;
}
}
#endregion
#region Experience : string
private int _sExperience;
public int Experience
{
get { return _sExperience; }
set
{
_sExperience = value;
}
}
#endregion
public enum EducationEnum
{
None = 0,
Any = 1,
Diploma = 2,
Bachelors_Honors = 3,
Masters = 4,
Doctorial = 5,
Others = 6
}
#region PositionCode : string
private string _sPositionCode;
public string PositionCode
{
get { return _sPositionCode; }
set
{
_sPositionCode = value;
}
}
#endregion
#region Responsibility : string
private string _sResponsibility;
public string Responsibility
{
get { return _sResponsibility; }
set
{
_sResponsibility = value;
}
}
#endregion
#region OtherResponsibility : string
private string _sOtherResponsibility;
public string OtherResponsibility
{
get { return _sOtherResponsibility; }
set
{
_sOtherResponsibility = value;
}
}
#endregion
#region SalaryRange : string
private string _sSalaryRange;
public string SalaryRange
{
get { return _sSalaryRange; }
set
{
_sSalaryRange = value;
}
}
#endregion
#region Benefits : string
private string _sBenefits;
public string Benefits
{
get { return _sBenefits; }
set
{
_sBenefits = value;
}
}
#endregion
#region ApplicationLastDate : string
private string _sApplicationLastDate;
public string ApplicationLastDate
{
get { return _sApplicationLastDate; }
set
{
_sApplicationLastDate = value;
}
}
#endregion
#region PublishedDate : DateTime
private DateTime? _dPublishedDate;
public DateTime? PublishedDate
{
get { return _dPublishedDate; }
set
{
_dPublishedDate = value;
}
}
#endregion
#region WorkflowRequired : bool
private bool? _bWorkflowRequired;
public bool? WorkflowRequired
{
get { return _bWorkflowRequired; }
set
{
_bWorkflowRequired = value;
}
}
#endregion
#region IsClosed : bool
private bool? _bIsClosed;
public bool? IsClosed
{
get { return _bIsClosed; }
set
{
_bIsClosed = value;
}
}
#endregion
#region _departmentId : int
private int _departmentId;
public int DepartmentId
{
get { return _departmentId; }
set
{
_departmentId = value;
}
}
#endregion
#region _gradeId : int
private int _gradeId;
public int GradeId
{
get { return _gradeId; }
set
{
_gradeId = value;
}
}
#endregion
#region _designationId : int
private int _designationId;
public int DesignationId
{
get { return _designationId; }
set
{
_designationId = value;
}
}
#endregion
#region _jdId : int
private int _jdId;
public int JdId
{
get { return _jdId; }
set
{
_jdId = value;
}
}
#endregion
#region _budgetedHeadCount : int
private int _budgetedHeadCount;
public int BudgetedHeadCount
{
get { return _budgetedHeadCount; }
set
{
_budgetedHeadCount = value;
}
}
#endregion
#region _currentHeadCount : int
private int _currentHeadCount;
public int CurrentHeadCount
{
get { return _currentHeadCount; }
set
{
_currentHeadCount = value;
}
}
#endregion
#region _totalHeadCount : int
private int _totalHeadCount;
public int TotalHeadCount
{
get { return _totalHeadCount; }
set
{
_totalHeadCount = value;
}
}
#endregion
#region _type : EnumInternalRecruitmentType
private EnumInternalRecruitmentType _type;
public EnumInternalRecruitmentType Type
{
get { return _type; }
set
{
_type = value;
}
}
#endregion
#region _institution : string
private string _institution;
public string Institution
{
get { return _institution; }
set
{
_institution = value;
}
}
#endregion
#region _keywords : string
private string _keywords;
public string Keywords
{
get { return _keywords; }
set
{
_keywords = value;
}
}
#endregion
#region _kPI : string
private string _kPI;
public string KPI
{
get { return _kPI; }
set
{
_kPI = value;
}
}
#endregion
#region _expectedJoiningDate : Datetime
private DateTime? _expectedJoiningDate;
public DateTime? ExpectedJoiningDate
{
get { return _expectedJoiningDate; }
set
{
_expectedJoiningDate = value;
}
}
#endregion
#region _positionDate : Datetime
private DateTime _positionDate;
public DateTime PositionDate
{
get { return _positionDate; }
set
{
_positionDate = value;
}
}
#endregion
#region _expectedNewJoiningDate : Datetime
private DateTime? _expectedNewJoiningDate;
public DateTime? ExpectedNewJoiningDate
{
get { return _expectedNewJoiningDate; }
set
{
_expectedNewJoiningDate = value;
}
}
#endregion
#region _separationDate : Datetime
private DateTime? _separationDate;
public DateTime? SeparationDate
{
get { return _separationDate; }
set
{
_separationDate = value;
}
}
#endregion
#region _replacementDueTo : string
private string _replacementDueTo;
public string ReplacementDueTo
{
get { return _replacementDueTo; }
set
{
_replacementDueTo = value;
}
}
#region _specialization : string
private string _specialization;
public string Specialization
{
get { return _specialization; }
set
{
_specialization = value;
}
}
#endregion
#region GradeCode : string
private string _gradeCode;
public string GradeCode
{
get { return _gradeCode; }
set
{
_gradeCode = value;
}
}
#endregion
#region DesignationName : string
private string _designationName;
public string DesignationName
{
get { return _designationName; }
set
{
_designationName = value;
}
}
#endregion
#region DepartmentCode : string
private string _departmentCode;
public string DepartmentCode
{
get { return _departmentCode; }
set
{
_departmentCode = value;
}
}
#endregion
#region WfStatus : enumwfStatus
private EnumwfStatus _eWfStatus;
public EnumwfStatus WfStatus
{
get { return _eWfStatus; }
set { _eWfStatus = value; }
}
#endregion
#region NumberOfStuff : int
private int _numberOfStuff;
public int NumberOfStuff
{
get { return _numberOfStuff; }
set
{
_numberOfStuff = value;
}
}
#region OnBoardStatus : enumOnBoardStatus
private EnumOnBoradStatus _onBoardStatus;
public EnumOnBoradStatus OnBoradStatus
{
get { return _onBoardStatus; }
set { _onBoardStatus = value; }
}
#endregion
#region BasicSalary : enumOnBoardStatus
private string _basicSalary;
public string BasicSalary
{
get { return _basicSalary; }
set { _basicSalary = value; }
}
#endregion
#region RaisedBy : int
private int _raisedBy;
public int RaisedBy
{
get { return _raisedBy; }
set
{
_raisedBy = value;
}
}
#endregion
#endregion
#endregion
public EnumOfferLetterStatus offerLetterApproveStatus { get; set; }
public EnumRequisitionApprovalStatus RequisitionApprovalStatus { get; set; }
public string DepartmentName { get; set; }
public string RequisitionApprovalStatusString { get; set; }
public List<IRNotification> Notifications { get; set; }
public List<IREmployee> IREmployees { get; set; }
public List<FileAttachment> IRFileAttacments { get; set; }
public string Remarks { get; set; }
public ComputerRequisitionEnum? ComputerRequisition { get; set; }
public int LocationId { get; set; }
public string LocationName { get; set; }
public string JobLocation { get; set; }
public DateTime? LastWorkingDate { get; set; }
/// <summary>
/// this property is used for work flow, it's a constant value
/// </summary>
//public int SetupID
//{
// get { return 1; }
//}
public int SetupID
{
get { return 25; }
}
/// <summary>
/// this property is used for work flow, which return leave entry id
/// </summary>
public int ObjectID
{
get { return this.ID; }
}
public string ObjectDescription { get; set; }
public int offLttrAppRaiseEmpID { get; set; }
public int HeadCountApprovalID { get; set; }
public string KeyResponsibilies { get; set; }
//#region IRNotifications
//private List<IRNotification> _oNotifications;
//public List<IRNotification> Notifications
//{
// get
// {
// if (_oNotifications == null)
// {
// _oNotifications = new List<IRNotification>();
// if (!this.IsNew)
// _oNotifications = InternalRecruitment.Service.GetNotifications(this.ID);
// }
// return _oNotifications;
// }
// set
// {
// _oNotifications = value;
// }
//}
//#endregion
//#region IREmployeess
//private List<IREmployee> _oIREmployees;
//public List<IREmployee> IREmployees
//{
// get
// {
// if (_oIREmployees == null )
// {
// _oIREmployees = new List<IREmployee>();
// if (!this.IsNew)
// _oIREmployees = InternalRecruitment.Service.GetIREmployeess(this.ID);
// }
// return _oIREmployees;
// }
// set
// {
// _oIREmployees = value;
// }
//}
//#endregion
#endregion
//#region Service Factory IInternalRecruitmentService : IInternalRecruitmentService
//internal static IInternalRecruitmentService Service
//{
// get { return Services.Factory.CreateService<IInternalRecruitmentService>(typeof(IInternalRecruitmentService)); }
//}
//#endregion
//#region Functions
//public static InternalRecruitment Get(int InternalRecruitmentId)
//{
// InternalRecruitment oInternalRecruitment = null;
// #region Cache Header
// oInternalRecruitment = (InternalRecruitment)_cache["Get", InternalRecruitmentId];
// if (oInternalRecruitment != null)
// return oInternalRecruitment;
// #endregion
// oInternalRecruitment = InternalRecruitment.Service.Get(InternalRecruitmentId);
// #region Cache Footer
// _cache.Add(oInternalRecruitment, "Get", InternalRecruitmentId);
// #endregion
// return oInternalRecruitment;
//}
//public static List<InternalRecruitment> Get()
//{
// #region Cache Header
// List<InternalRecruitment> internalRecruitments = _cache["Get"] as List<InternalRecruitment>;
// if (internalRecruitments != null)
// return internalRecruitments;
// #endregion
// try
// {
// internalRecruitments = Service.Get();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(internalRecruitments, "Get");
// #endregion
// return internalRecruitments;
//}
//public static List<InternalRecruitment> Get(bool isClosed)
//{
// #region Cache Header
// List<InternalRecruitment> internalRecruitments = _cache["Get", isClosed] as List<InternalRecruitment>;
// if (internalRecruitments != null)
// return internalRecruitments;
// #endregion
// try
// {
// internalRecruitments = Service.Get(isClosed);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(internalRecruitments, "Get", isClosed);
// #endregion
// return internalRecruitments;
//}
//public int Save()
//{
// this.SetAuditTrailProperties();
// return InternalRecruitment.Service.Save(this);
//}
//public int SaveIrEmployee(IREmployee iREmployee)
//{
// this.SetAuditTrailProperties();
// return InternalRecruitment.Service.SaveIrEmployee(iREmployee);
//}
//public void Delete(int id)
//{
// InternalRecruitment.Service.Delete(id);
//}
//public IRNotification Get(int positionID)
//{
// IRNotification oIRNotification = null;
// #region Cache Header
// oIRNotification = (IRNotification)_cache["Get", positionID];
// if (oIRNotification != null)
// return oIRNotification;
// #endregion
// oIRNotification = InternalRecruitment.Service.Get(positionID);
// #region Cache Footer
// _cache.Add(oIRNotification, "Get", positionID);
// #endregion
// return oIRNotification;
//}
////public IRNotification Get(int positionID, int empid)
////{
//// IRNotification oIRNotification = null;
//// #region Cache Header
//// oIRNotification = (IRNotification)_cache["Get", positionID, empid];
//// if (oIRNotification != null)
//// return oIRNotification;
//// #endregion
//// oIRNotification = InternalRecruitment.Service.Get(positionID, empid);
//// #region Cache Footer
//// _cache.Add(oIRNotification, "Get", positionID, empid);
//// #endregion
//// return oIRNotification;
////}
//public IREmployee GetIRempID(int irEmpID)
//{
// IREmployee oIRNotification = null;
// #region Cache Header
// oIRNotification = (IREmployee)_cache["Get", irEmpID];
// if (oIRNotification != null)
// return oIRNotification;
// #endregion
// oIRNotification = IREmployee.Service.GetIrempID(irEmpID);
// #region Cache Footer
// _cache.Add(oIRNotification, "Get", irEmpID);
// #endregion
// return oIRNotification;
//}
//#endregion
//public void ReplaceWords(string destFileName, Hashtable tagValueHashTable)
//{
// Word.Find findObject = Application.Selection.Find;
// object SaveChanges = true;
// // if (_wordapp == null) OpenWordApplication();
// object Missing = System.Reflection.Missing.Value;
// Microsoft.Office.Interop.Word.Document oDoc = null;
// try
// {
// object FileName = _PreparedFile;
// object ReadOnly = false;
// object TrueBool = true;
// object FalseBool = false;
// object IsVisible = true;
// object FindText = "";
// object ReplaceText = "";
// oDoc = _wordapp.Documents.Open(ref FileName, ref Missing, ref ReadOnly, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref Missing, ref IsVisible, ref Missing, ref Missing, ref Missing, ref Missing);
// oDoc.Activate();
// object FindContinue = Microsoft.Office.Interop.Word.WdFindWrap.wdFindContinue;
// object ReplaceAll = Microsoft.Office.Interop.Word.WdReplace.wdReplaceAll;
// object MatchCase = true;
// _Pair = (tagValueHashTable != null) ? tagValueHashTable : new Hashtable();
// foreach (string sKey in _Pair.Keys)
// {
// FindText = sKey;
// ReplaceText = tagValueHashTable[sKey];
// _wordapp.Selection.Find.Execute(ref FindText, ref MatchCase, ref TrueBool, ref Missing, ref Missing, ref Missing, ref TrueBool, ref FindContinue, ref Missing,
// ref ReplaceText, ref ReplaceAll, ref Missing, ref Missing, ref Missing, ref Missing);
// }
// }
// catch (Exception ex)
// {
// throw new Exception("Error: Could not read file from disk. Original error: " + ex.Message);
// }
// finally
// {
// if (oDoc != null) _wordapp.Documents.Close(ref SaveChanges, ref Missing, ref Missing);
// }
//}
}
#endregion
public class RequsitionCountChart : BasicBaseObject
{
public RequsitionCountChart()
{
}
public int DepartmentId { get; set; }
public string DeptName { get; set; }
public int RequisitionCount { get; set; }
}
public class RequsitionTypeCountChart : BasicBaseObject
{
public RequsitionTypeCountChart()
{
}
public int DepartmentId { get; set; }
public string DeptName { get; set; }
public int NewCount { get; set; }
public int RepalcementCount { get; set; }
public int TotalCount { get; set; }
public string NewCountDecimal { get; set; }
public string ReplacementCountDecimal { get; set; }
}
public class RecruitmentTrackerReport : BasicBaseObject
{
public RecruitmentTrackerReport()
{
}
public EnumInternalRecruitmentType Type { get; set; }
public string TypeString { get; set; }
public string OnBoardStatusString { get; set; }
public string RequirementTypeString { get; set; }
public string RequisitionApprovalStatusString { get; set; }
public string EmployeeNo { get; set; }
public string Designation { get; set; }
public string Department { get; set; }
public string Sbu { get; set; }
public DateTime? PositionDate { get; set; }
public string UserName { get; set; }
public EnumRequisitionApprovalStatus RequisitionApprovalStatus { get; set; }
public EnumOnBoradStatus OnBoardStatus { get; set; }
public DateTime? ExpectedJoiningDate { get; set; }
public string SelecetedCandidates { get; set; }
public string PositionName { get; set; }
public string Grade { get; set; }
public string Location { get; set; }
public string OfferLetterIssued { get; set; }
public int NoOfDays { get; set; }
public string RepDesignation { get; set; }
public DateTime? Lastworkingdate { get; set; }
public string Remarks { get; set; }
public string ComputerRequisition { get; set; }
public string CadidateName { get; set; }
public EnumGender? CandidateGender { get; set; }
public string Email { get; set; }
public string SeparatonStatus { get; set; }
public string GenderString { get; set; }
}
public class RecruitmentCountReport : BasicBaseObject
{
public RecruitmentCountReport()
{
}
public int JobPosting { get; set; }
public int CvCollection { get; set; }
public int InterviewStarted { get; set; }
public int InterviewCommplited { get; set; }
public int OfferLetter { get; set; }
public int Approved { get; set; }
public int Joining { get; set; }
}
public class RequsitionByLocationCountChart : BasicBaseObject
{
public RequsitionByLocationCountChart()
{
}
public int LocationId { get; set; }
public string Name { get; set; }
public int Count { get; set; }
public int TotalCount { get; set; }
public string NewCountDecimal { get; set; }
public string Code { get; set; }
public string Color { get; set; }
}
public class IssuedOfferLetterbyTypeChart : BasicBaseObject
{
public IssuedOfferLetterbyTypeChart()
{
}
public int New { get; set; }
public int Replacement { get; set; }
public int TotalCount { get; set; }
}
public class IssuedOfferLetterbyChartList : BasicBaseObject
{
public IssuedOfferLetterbyChartList()
{
}
public string Name { get; set; }
public int Count { get; set; }
public int TotalCount { get; set; }
public string NewCountDecimal { get; set; }
public string Code { get; set; }
public string Color { get; set; }
}
public class DesignationIssueLetterRequisitionCount : BasicBaseObject
{
public DesignationIssueLetterRequisitionCount()
{
}
public int DesignationId { get; set; }
public string DesignationName { get; set; }
public int Count { get; set; }
public int TotalCount { get; set; }
public string NewCountDecimal { get; set; }
}
#region IInternalRecruitment Service
public interface IInternalRecruitmentService
{
InternalRecruitment Get(int InternalRecruitmentId);
List<InternalRecruitment> Get(DateTime? fromDate, DateTime? toDate, EnumInternalRecruitmentType type);
List<InternalRecruitment> Get(bool isClosed);
int Save(InternalRecruitment oInternalRecruitment, string connectionString);
void Delete(int InternalRecruitmentId);
void InitiateOfferLetterWorkFlow(InternalRecruitment item, int initiateEmpID);
void InitiateRecruitmentRequisitionWorkFlow(InternalRecruitment item, int initiateEmpID, int userID);
void ApproveOfferLetter(WFMovementTran approver);
void ApproveRecruitmentRequisition(WFMovementTran approver);
List<IRNotification> GetNotifications(int iD);
IRNotification GetWithPositionID(int positionID);
List<IREmployee> GetIREmployeess(int iD);
List<FileAttachment> GetIRFileAttachments(int PositioniD);
List<FileAttachment> GetIRFileAttachmentbyID(int PositioniD, int id);
int SaveIrEmployee(IREmployee iREmployee);
IREmployee Get(int positionID, int empid);
IREmployee GetIrempID(int irempid);
List<FileAttachment> GetIRFileAttachmentbyIDCV(int PositioniD, int id, EnumFileType cV);
void UpdateCompleteStatus(int positionID);
void RecruitmentRequisitionReject(WFMovementTran rejectTran);
List<InternalRecruitment> GetApprovedUserRequisitions(int userId);
List<InternalRecruitment> GetApprovedRequisitionsPicker(EnumRequisitionApprovalStatus? approvalStatus,
string onBoradStatus);
void UpdateRequisitionApproveStatusAdmin(InternalRecruitment item, int userID);
DataSet GetRequsitionCountChart(DateTime fromDate, DateTime toDate);
DataSet GetWeeklyMonthlyRequisitionTypeChart(DateTime fromDate, DateTime toDate);
DataSet GetRecruitmentTrackerReport(DateTime? fromDate, DateTime? toDate, int departmentId, int sbuId, EnumInternalRecruitmentType type);
DataSet GetMonthlyRequisitionByLocationChart(DateTime fromDate, DateTime toDate);
DataSet GetIssuedOfferLetterbyTypeChart(DateTime fromDate, DateTime toDate);
DataSet GetDesignationIssueLetterRequisitionCount(DateTime fromDate, DateTime toDate, int designationId);
DataSet GetRecruitment(DateTime? startDate, DateTime? endDate, EnumOnBoradStatus? onBoardStatus, int recruitmentId, int recruiterId, int currentuserId);
DataSet GetRequisitionChart(DateTime fromDate, DateTime toDate);
DataSet GetRequisitionReports(DateTime fromDate, DateTime toDate);
DataSet GetRequisitionAllCountReport(DateTime fromDate, DateTime toDate);
}
#endregion
}