178 lines
6.2 KiB
C#
178 lines
6.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region ADParameterEmployee
|
|
|
|
public class ADParameterEmployee : AuditTrailBase
|
|
{
|
|
#region Constructor
|
|
|
|
public ADParameterEmployee()
|
|
{
|
|
ADParameterID = 0;
|
|
AllowDeductID = 0;
|
|
Periodicity = EnumPeriodicity.RegardLess;
|
|
EmployeeID = 0;
|
|
FormDate = DateTime.MinValue;
|
|
TillDate = DateTime.MinValue;
|
|
MonthlyAmount = 0;
|
|
TotalAmount = 0;
|
|
Arreartype = EnumArrearType.Regardless;
|
|
Employee = null;
|
|
DisburseAmount = 0;
|
|
TracNo = string.Empty;
|
|
ADEmpType = EnumADEmpType.AppliedToIndividual;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
public int ADParameterID { get; set; }
|
|
public int AllowDeductID { get; set; }
|
|
public AllowanceDeduction AllowDeduct { get; set; }
|
|
public EnumPeriodicity Periodicity { get; set; }
|
|
public int EmployeeID { get; set; }
|
|
public DateTime FormDate { get; set; }
|
|
public DateTime? TillDate { get; set; }
|
|
public double DisburseAmount { get; set; }
|
|
public double MonthlyAmount { get; set; }
|
|
public double TotalAmount { get; set; }
|
|
public EnumArrearType Arreartype { get; set; }
|
|
public EnumADEmpType ADEmpType { get; set; }
|
|
public EnumValueType ValueType { get; set; }
|
|
public string TracNo { get; set; }
|
|
public Employee Employee { get; set; }
|
|
public string EmployeeNo { get; set; }
|
|
public double Days { get; set; }
|
|
|
|
public string EmployeeName { get; set; }
|
|
|
|
public double GetAmount(double basicSalary, double grossSalary)
|
|
{
|
|
if (this.ValueType == EnumValueType.Amount) return this.MonthlyAmount;
|
|
else
|
|
{
|
|
return ((basicSalary + grossSalary) * this.MonthlyAmount) / 100;
|
|
}
|
|
|
|
}
|
|
//#region AllowDeductID : ID
|
|
|
|
//private AllowanceDeduction _allowanceDeduct = null;
|
|
//public AllowanceDeduction AllowDeduct
|
|
//{
|
|
// get
|
|
// {
|
|
// if (_allowanceDeduct == null && !_allowDeductID.IsUnassigned && _allowDeductID.Integer > 0)
|
|
// {
|
|
// _allowanceDeduct = AllowanceDeduction.Get(_allowDeductID);
|
|
// }
|
|
// return _allowanceDeduct;
|
|
// }
|
|
//}
|
|
|
|
//#endregion
|
|
|
|
//#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
|
|
|
|
|
|
//#region Service Factory IADParameterEmployeeService : IADParameterEmployeeService
|
|
|
|
//internal static IADParameterEmployeeService Service
|
|
//{
|
|
// get { return Services.Factory.CreateService<IADParameterEmployeeService>(typeof(IADParameterEmployeeService)); }
|
|
//}
|
|
|
|
//#endregion
|
|
|
|
#endregion
|
|
|
|
#region Functions
|
|
|
|
public ADParameterEmployee GetClone()
|
|
{
|
|
ADParameterEmployee adEmp = new ADParameterEmployee();
|
|
adEmp.ADEmpType = this.ADEmpType;
|
|
adEmp.ADParameterID = this.ADParameterID;
|
|
adEmp.AllowDeductID = this.AllowDeductID;
|
|
adEmp.Arreartype = this.Arreartype;
|
|
adEmp.DisburseAmount = this.DisburseAmount;
|
|
adEmp.EmployeeID = this.EmployeeID;
|
|
adEmp.FormDate = this.FormDate;
|
|
adEmp.MonthlyAmount = this.MonthlyAmount;
|
|
adEmp.Periodicity = this.Periodicity;
|
|
adEmp.SortOrder = this.SortOrder;
|
|
adEmp.TillDate = this.TillDate;
|
|
adEmp.TotalAmount = this.TotalAmount;
|
|
adEmp.ValueType = this.ValueType;
|
|
return adEmp;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region IADParameterEmployee Service
|
|
|
|
public interface IADParameterEmployeeService
|
|
{
|
|
ADParameterEmployee Get(int id);
|
|
List<ADParameterEmployee> Get(EnumADEmpType status);
|
|
List<ADParameterEmployee> GetbyParameter(int ADParamID, DateTime nextPayProcessDate);
|
|
List<ADParameterEmployee> GetbyParameter(int nADPAramID, EnumADEmpType type);
|
|
List<ADParameterEmployee> GetByAllow(int AllDeductID);
|
|
List<ADParameterEmployee> GetByAllowForApproval(int AllDeductID, int payrollTypeID);
|
|
|
|
int Save(ADParameterEmployee item, DateTime lastPayProcessDate);
|
|
void UpdateAmountAndDate(ADParameterEmployee item);
|
|
void Save(List<ADParameterEmployee> items, DateTime lastPayProcessDate);
|
|
void Delete(int id);
|
|
void Delete(ADParameterEmployee adParamEmp);
|
|
|
|
void DeleteByAllowDeductMonth(int EmpID, int AllowDeductID, DateTime dAllowDeductMonht);
|
|
//void DeleteByAllo(ID allowDeductID);
|
|
//void DeleteByEmpID(ID nEmpID,ID nADParameterID);
|
|
|
|
//bool IsMonthlyAllowDeduct(ID employeeID, ID allowDeductID,DateTime AllowDeductMonth);
|
|
|
|
ADParameterEmployee Get(int EmpID, int AllowDeductID, int ADParamID);
|
|
ADParameterEmployee Get(int EmpID, int nAllowDeductID, int ADParamID, EnumArrearType nArrearType);
|
|
|
|
List<ADParameterEmployee> GetByEmployee(int EmpID, EnumAllowOrDeduct adType, EnumADEmpType adEmpType,
|
|
int parollTypeID, DateTime nextPayProcessDate);
|
|
|
|
List<ADParameterEmployee> GetByEmployee(int EmpID, int AllowDeductID, int parollTypeID);
|
|
List<ADParameterEmployee> Get(DateTime fromdate, DateTime todate, int parollTypeID);
|
|
List<ADParameterEmployee> Get(int AllowDeductID, DateTime fromdate, DateTime todate, int payrollTypeID);
|
|
|
|
List<ADParameterEmployee> GetForApproval(int AllowDeductID, DateTime fromdate, DateTime todate,
|
|
int payrollTypeID);
|
|
|
|
List<ADParameterEmployee> Get(int EmpID, int AllowDeductID, DateTime fromdate, DateTime todate);
|
|
}
|
|
|
|
#endregion
|
|
} |