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

134 lines
3.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ease.Core;
using Ease.Core.Model;
using System.Data;
namespace HRM.BO
{
#region Leave Year
public class LeaveYear : BasicBaseObject
{
#region Constructor
public LeaveYear()
{
this.Name = "";
//_startDate = DateTime.Now.Date;
//_endDate = DateTime.Now.Date;
//_benYearStartDate = DateTime.Now.Date;
//_benYearEndDate = DateTime.Now.Date;
//_IsEnded = false;
//_IsCurrent = false;
//_status = EnumStatus.Inactive;
this.Status = EnumStatus.Active;
}
#endregion
#region Properties
public string Name { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public DateTime? EncashmentStartDate { get; set; }
public DateTime? EncashmentEndDate { get; set; }
public string StartDateWithFormat
{
get
{
return StartDate.ToString("dd MMM yyyy");
}
}
public string EndDateWithFormat
{
get
{
return EndDate.ToString("dd MMM yyyy");
}
}
public string EncashmentStartDateWithFormat
{
get
{
return EncashmentStartDate?.ToString("dd MMM yyyy");
}
}
public string EncashmentEndDateWithFormat
{
get
{
return EncashmentEndDate?.ToString("dd MMM yyyy");
}
}
//public DateTime BenYearStartDate { get; set; }
//public DateTime BenYearEndDate { get; set; }
public bool IsEnded { get; set; }
public string IsEndedWithFormat
{
get
{
return IsEnded ? "Yes" : "No";
}
}
public bool IsCurrent { get; set; }
public bool? IsEncashmentActive { get; set; }
public string IsCurrentWithFormat
{
get
{
return IsCurrent ? "Yes" : "No";
}
}
public string IsEncashmentActiveWithFormat
{
get
{
return IsEncashmentActive?.ToString()=="1"?"Yes":"No";
}
}
public string StatusWithFormat
{
get
{
return Status.ToString();
}
}
public int PayrollTypeId { get; set; }
#endregion
}
#endregion
#region ILeaveYear Service
public interface ILeaveYearService
{
LeaveYear Get(int id);
LeaveYear GetCurrentYear(string year);
List<LeaveYear> Get();
List<LeaveYear> Get(EnumStatus status);
List<LeaveYear> Get(EnumStatus status, int payrollTypeId);
int Save(LeaveYear oLeaveYear);
void Delete(int id);
int CountCurrentYear();
LeaveYear GetCurrentYear(int payrolltypeid);
LeaveYear GetLastYear(int payrolltypeid);
LeaveYear GetIDByName(string sLeaveYear);
LeaveYear LastLeaveYear(LeaveYear oCurrYear);
LeaveYear GetLastLeaveYear(LeaveYear oCurrYear, int payrollTypeId);
List<LeaveYear> GetByPayrollTypeId(int id);
}
#endregion
}