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

278 lines
7.2 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 EmployeeOverTime
public class EmployeeOverTime : AuditTrailBase
{
#region Constructor
public EmployeeOverTime()
{
}
#endregion
#region Properties
public int TermID { get; set; }
public int TermParameterID { get; set; }
public TermParameter TermParam { get; set; }
//#region TermParameter : Object
//private TermParameter _termParameter = null;
//public TermParameter TermParam
//{
// get
// {
// if (!_termParameterID.IsUnassigned && _termParameterID.Integer > 0)
// {
// _termParameter = TermParameter.Get(_termParameterID);
// }
// return _termParameter;
// }
//}
//#endregion
public int EmployeeID { get; set; }
public DateTime MonthDate { get; set; }
public double OTHours { get; set; }
public double Value { get; set; }
public DateTime OTMonth { get; set; }
public Term Term { get; set; }
//#region term : Term
//private Term _term;
//public Term Term
//{
// get
// {
// if (_termID.Integer > 0 && _term == null)
// {
// _term = new Term();
// _term = Term.Get(_termID);
// }
// return this._term;
// }
// set
// {
// _term = value;
// }
//}
//#endregion
public Employee Employee { get; set; }
//#region employee : Employee
//private Employee _employee;
//public Employee Employee
//{
// get
// {
// if (_employeeID.Integer > 0 && _employee == null)
// {
// _employee = new Employee();
// _employee = Employee.Get(_employeeID);
// }
// return this._employee;
// }
// set
// {
// _employee = value;
// }
//}
//#endregion
public int PayrollTypeID { get; set; }
//#region Service Factory IEmployeeOverTimeService : IEmployeeOverTimeService
//internal static IEmployeeOverTimeService Service
//{
// get { return Services.Factory.CreateService<IEmployeeOverTimeService>(typeof(IEmployeeOverTimeService)); }
//}
//#endregion
#endregion
//#region Functions
//public static EmployeeOverTime Get(ID nID)
//{
// EmployeeOverTime oEmployeeOverTime = null;
// #region Cache Header
// oEmployeeOverTime = (EmployeeOverTime)_cache["Get", nID];
// if (oEmployeeOverTime != null)
// return oEmployeeOverTime;
// #endregion
// oEmployeeOverTime = EmployeeOverTime.Service.Get(nID);
// #region Cache Footer
// _cache.Add(oEmployeeOverTime, "Get", nID);
// #endregion
// return oEmployeeOverTime;
//}
//public static List<EmployeeOverTime> Get()
//{
// #region Cache Header
// List<EmployeeOverTime> empOverTimes = _cache["Get"] as List<EmployeeOverTime>;
// if (empOverTimes != null)
// return empOverTimes;
// #endregion
// try
// {
// empOverTimes = Service.Get();
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(empOverTimes, "Get");
// #endregion
// return empOverTimes;
//}
//public static List<EmployeeOverTime> Get(DateTime dOTMonth,ID nPayrollTypeID)
//{
// #region Cache Header
// List<EmployeeOverTime> empOverTimes = _cache["Get"] as List<EmployeeOverTime>;
// if (empOverTimes != null)
// return empOverTimes;
// #endregion
// try
// {
// empOverTimes = Service.Get(dOTMonth,nPayrollTypeID);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(empOverTimes, "Get");
// #endregion
// return empOverTimes;
//}
//public static List<EmployeeOverTime> GetByEmpID(ID nEmpID,DateTime dMonthDate)
//{
// #region Cache Header
// List<EmployeeOverTime> empOverTimes = _cache["Get",nEmpID,dMonthDate] as List<EmployeeOverTime>;
// if (empOverTimes != null)
// return empOverTimes;
// #endregion
// try
// {
// empOverTimes = Service.GetByEmpID(nEmpID,dMonthDate);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(empOverTimes, "Get",nEmpID,dMonthDate);
// #endregion
// return empOverTimes;
//}
//public static void Save(List<EmployeeOverTime> _EmpOverTimes)
//{
// foreach (EmployeeOverTime oEmpOverTime in _EmpOverTimes)
// {
// oEmpOverTime.SetAuditTrailProperties();
// }
// EmployeeOverTime.Service.Save(_EmpOverTimes);
//}
//public static void DeleteByMonth(DateTime dOTMonth)
//{
// EmployeeOverTime.Service.DeleteByMonth(dOTMonth);
//}
//public static void Delete(EmployeeOverTime empOvertime)
//{
// EmployeeOverTime.Service.Delete(empOvertime);
//}
//public ID Save()
//{
// return EmployeeOverTime.Service.Save(this);
//}
////public void Delete()
////{
//// EmployeeOverTime.Service.Delete(ID);
////}
//public static void SaveByExcel(List<EmployeeOverTime> _EmpOverTimes)
//{
// foreach (EmployeeOverTime oEmpOverTime in _EmpOverTimes)
// {
// oEmpOverTime.SetAuditTrailProperties();
// }
// EmployeeOverTime.Service.SaveByExcel(_EmpOverTimes);
//}
//#endregion
}
#endregion
#region IEmployeeOverTime Service
public interface IEmployeeOverTimeService
{
EmployeeOverTime Get(int id);
List<EmployeeOverTime> Get();
List<EmployeeOverTime> GetByEmpID(int nEmpID,DateTime dMonthDaet);
int Save(EmployeeOverTime item);
void Save(List<EmployeeOverTime> _EmpOverTimes);
void SaveByExcel(List<EmployeeOverTime> _EmpOverTimes);
void DeleteByMonth(DateTime dOTMonth);
void Delete(EmployeeOverTime empOvertime);
List<EmployeeOverTime> Get(DateTime dOTMonth, int nPayrollTypeID);
}
#endregion
}