using HRM.BO; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace HRM.UI.DTOs.Leave { public class LeaveEntryDto { #region Properties public EnumSystemType SystemType { get; set; } public EnumCompensatoryLeaveFor CompensatoryLeaveFor { get; set; } public bool DoctorCertificate { get; set; } public int EmpID { get; set; } public Employee Employee { get; set; } public int EmpGradeId { get; set; } public int ItemId { get; set; } public double OtValue { get; set; } public int LeaveYear { get; set; } public int AppliedParamId { get; set; } public LeaveParameter LeaveParameter { get; set; } public DateTime LeaveAgainstDate { get; set; } public DateTime AppliedLeaveDate { get; set; } public DateTime AppliedFromDate { get; set; } public DateTime AppliedToDate { get; set; } public double AppliedTotalDays { get; set; } public double LFAAmount { get; set; } public double DayPeriod { get; set; } public double LFASmokingAmount { get; set; } public DateTime SalaryMonth { get; set; } public int ApprovedParamId { get; set; } public DateTime ApprovedLeaveDate { get; set; } public DateTime? ApprovedDate { get; set; } private DateTime _aprFromDate; public DateTime ApprovedFromDate { get { if (AvailFromDate == DateTime.MinValue) return _aprFromDate; return AvailFromDate; } set { _aprFromDate = value; } } private DateTime _aprToDate; public DateTime ApprovedToDate { get { if (AvailToDate == DateTime.MinValue) return _aprToDate; return AvailToDate; } set { _aprToDate = value; } } private double _aprTotalDays; public double ApprovedTotalDays { get { if (AvailTotalDays == 0.0) return _aprTotalDays; else return AvailTotalDays; } set { _aprTotalDays = value; } } public int ApprovedBy { get; set; } public int ResponsiblePersonID { get; set; } public string Remarks { get; set; } public DateTime EntryDate { get; set; } public int IsDrafted { get; set; } public int IsAvailed { get; set; } public int LeaveEntryType { get; set; } public DateTime? WorkingDate { get; set; } private EnumLeaveStatus _leaveStatus; public EnumLeaveStatus LeaveStatus { get { return _leaveStatus; } set { _leaveStatus = value; switch (_leaveStatus) { case EnumLeaveStatus.Drafted: LeaveStatusDescription = "Drafted"; break; case EnumLeaveStatus.Approved: LeaveStatusDescription = "Approved"; break; case EnumLeaveStatus.Declined: LeaveStatusDescription = "Declined"; break; //case EnumLeaveStatus.Availed: // _leaveStatusDescription = "Availed"; // break; case EnumLeaveStatus.OnApproval: LeaveStatusDescription = "Waiting for Approval"; break; } } } public string LeaveDayPeriod { get; set; } public int GetStatusbyWf(EnumwfStatus wfstatus) { EnumLeaveStatus lvstatus; switch (wfstatus) { case EnumwfStatus.Received: case EnumwfStatus.Revert: lvstatus = EnumLeaveStatus.OnApproval; break; case EnumwfStatus.Reject: lvstatus = EnumLeaveStatus.Declined; break; case EnumwfStatus.Approve: lvstatus = EnumLeaveStatus.Approved; break; case EnumwfStatus.End: lvstatus = EnumLeaveStatus.Approved; break; default: lvstatus = EnumLeaveStatus.OnApproval; break; } return (int) lvstatus; } public string LeaveStatusDescription { get; set; } public string ErnLeaveRemarks { get; set; } public int LeaveID { get; set; } public int AppliedLeaveID { get; set; } public int SbuID { get; set; } public int DepartmentID { get; set; } public int FunctionID { get; set; } public int LocationID { get; set; } public int DesignationID { get; set; } #region Leave Properties for Avail public DateTime AvailFromDate { get; set; } public DateTime AvailToDate { get; set; } public string AvailRemarks { get; set; } public int AvailedBy { get; set; } public double AvailTotalDays { get; set; } #endregion public List Attachments { get; set; } #endregion } }