EchoTex_Payroll/HRM.BO/Leave/LeaveProcessDetail.cs

220 lines
7.6 KiB
C#
Raw Normal View History

2024-10-14 10:01:49 +06:00
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 LeaveProcessDetail
public class LeaveProcessDetail : UpdateAuditTrail
{
#region Constructor
public LeaveProcessDetail()
{
//_nProcessId = 0;
//_nEmpId = 0;
//_leaveYearID = 0;
//_nLeaveId = 0;
//_carryFromPrvYear = 0;
//_nCFDays = 0;
//_nEncashDays = 0;
//_nEncashAmount = 0;
//_nNormalLeaveDays = 0;
//_nYearEndBalance = 0;
//_nleaveavailed = 0;
//_nOpeningBalance = 0;
//_nForFitedDays = 0;
}
#endregion
#region Properties
public int ProcessId { get; set; }
public int EmpId { get; set; }
public int LeaveYearID { get; set; }
public int LeaveId { get; set; }
public double CarryFromPrvYear { get; set; }
public double CFDays { get; set; }
public double EncashDays { get; set; }
public double EncashAmount { get; set; }
#region NormalLeaveDays
public double NormalLeaveDays { get; set; }
public double ClosingBalance
{
get
{
return YearEndBalance;
}
}
#endregion
public double YearEndBalance { get; set; }
public double LeaveAvailed { get; set; }
public double OpeningBalance { get; set; }
public double ForfitedDays { get; set; }
public Leave Leave { get; set; }
//private Leave _oLeave;
//public Leave Leave
//{
// get
// {
// if ( _nLeaveId != 0)
// {
// _oLeave = new Leave().Get(ID.FromInteger(_nLeaveId));
// }
// return _oLeave;
// }
//}
#endregion
//public static LeaveProcessDetail GetYearStatus(int nYear, int nLeaveId, int nEmpId)
//{
// return LeaveProcessDetail.Service.GetByYear(nYear, nLeaveId, nEmpId);
//}
//public static LeaveProcessDetail GetPrvYearStatus(int leaveYearID, int nLeaveId, int nEmpId)
//{
// LeaveYear oCurrYear = LeaveYear.Service.Get(ID.FromInteger(leaveYearID));
// LeaveYear oPrvYear=null;
// List<LeaveYear> olYears = LeaveYear.Service.Get();
// foreach (LeaveYear oItem in olYears)
// {
// if (oItem.EndDate.AddDays(1) == oCurrYear.StartDate)
// {
// oPrvYear= oItem;
// break;
// }
// }
// if (oPrvYear == null) return null;
// return LeaveProcessDetail.Service.GetStatus(nEmpId, nLeaveId, oPrvYear.ID.Integer);
//}
//#region Functions
//public LeaveProcessDetail Get(ID nTranId)
//{
// LeaveProcessDetail oLeaveProcessDetail = null;
// #region Cache Header
// oLeaveProcessDetail = (LeaveProcessDetail)_cache["Get", nTranId];
// if (oLeaveProcessDetail != null)
// return oLeaveProcessDetail;
// #endregion
// oLeaveProcessDetail = LeaveProcessDetail.Service.Get(nTranId);
// #region Cache Footer
// _cache.Add(oLeaveProcessDetail, "Get", nTranId);
// #endregion
// return oLeaveProcessDetail;
//}
//public LeaveProcessDetail GetStatus(int empid, int leaveID, int leaveYearID)
//{
// LeaveProcessDetail oLeaveProcessDetail = null;
// #region Cache Header
// oLeaveProcessDetail = (LeaveProcessDetail)_cache["Get", empid, leaveID, leaveYearID];
// if (oLeaveProcessDetail != null)
// return oLeaveProcessDetail;
// #endregion
// oLeaveProcessDetail = LeaveProcessDetail.Service.GetStatus(empid,leaveID,leaveYearID);
// #region Cache Footer
// _cache.Add(oLeaveProcessDetail, "Get", empid, leaveID, leaveYearID);
// #endregion
// return oLeaveProcessDetail;
//}
//public static List<LeaveProcessDetail> GetByYear(int leaveYearID)
//{
// List<LeaveProcessDetail> oLeaveProcessDetails = new List<LeaveProcessDetail>();
// oLeaveProcessDetails = LeaveProcessDetail.Service.GetByYear(leaveYearID);
// return oLeaveProcessDetails;
//}
//public ID Save()
//{
// return LeaveProcessDetail.Service.Save(this);
//}
//public void SaveStatus(LeaveProcessDetail oLeaveProcessDetail)
//{
// LeaveProcessDetail.Service.SaveStatus(oLeaveProcessDetail);
//}
//public void Delete()
//{
// LeaveProcessDetail.Service.Delete(ID);
//}
//public void Delete(int nProcessId)
//{
// LeaveProcessDetail.Service.Delete(nProcessId);
//}
//#endregion
//#region Functions
//public static List<LeaveProcessDetail> Get(int nProcessId)
//{
// #region Cache Header
// List<LeaveProcessDetail> oLeaveProcessDetails = _cache["Get"] as List<LeaveProcessDetail>;
// if (oLeaveProcessDetails != null)
// return oLeaveProcessDetails;
// #endregion
// oLeaveProcessDetails = LeaveProcessDetail.Service.Get(nProcessId);
// #region Cache Footer
// _cache.Add(oLeaveProcessDetails, "Get", nProcessId);
// #endregion
// return oLeaveProcessDetails;
//}
//public static List<LeaveProcessDetail> GetAllStatus(int empId)
//{
// #region Cache Header
// List<LeaveProcessDetail> oLeaveProcessDetails = _cache["Get"] as List<LeaveProcessDetail>;
// if (oLeaveProcessDetails != null)
// return oLeaveProcessDetails;
// #endregion
// oLeaveProcessDetails = LeaveProcessDetail.Service.GetAllStatus(empId);
// #region Cache Footer
// _cache.Add(oLeaveProcessDetails, "Get", empId);
// #endregion
// return oLeaveProcessDetails;
//}
//public static void Save(List<LeaveProcessDetail> oLeaveProcessDetails)
//{
// foreach (LeaveProcessDetail oItem in oLeaveProcessDetails)
// oItem.Save();
//}
//#endregion
//#region Service Factory
//internal static ILeaveProcessDetailService Service
//{
// get { return Services.Factory.CreateService<ILeaveProcessDetailService>(typeof(ILeaveProcessDetailService)); }
//}
//#endregion
}
#endregion
//#region ILeaveProcessDetail Service
//public interface ILeaveProcessDetailService
//{
// LeaveProcessDetail Get(ID id);
// LeaveProcessDetail GetStatus(int empid, int leaveID, int leaveYearID);
// LeaveProcessDetail GetByYear(int ProcessYear, int LeaveId, int EmpId);
// List<LeaveProcessDetail> GetByYear(int leaveYearID);
// List<LeaveProcessDetail> Get(int ProcessId);
// List<LeaveProcessDetail> GetAllStatus(int empId);
// ID Save(LeaveProcessDetail oLeaveProcessDetail);
// LeaveProcessDetail GetStatusFromColl(int employeeid, int leaveyearID, int leaveid);
// void SaveStatus(LeaveProcessDetail oLeaveProcessDetail);
// void Delete(ID id);
// void Delete(int nProcessId);
//}
//#endregion
}