498 lines
12 KiB
C#
498 lines
12 KiB
C#
|
|
using Ease.Core.Model;
|
|
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region SalaryProcess
|
|
public class SalaryProcess : AuditTrailBase, IworkflowInterface
|
|
{
|
|
#region Constructor
|
|
|
|
public SalaryProcess()
|
|
{
|
|
_salaryMonth = DateTime.MinValue;
|
|
_processDate = DateTime.MinValue;
|
|
_paymentDate = DateTime.MinValue;
|
|
_monthEndDate = DateTime.MinValue;
|
|
_workDays = 0;
|
|
_isFinalized = false;
|
|
_processCode = "";
|
|
_remarks = "";
|
|
_payrollTypeID = 0;
|
|
_showInDesktop = false;
|
|
_showInDesktopDate = DateTime.MinValue;
|
|
_wfStatus = enumwfStatus.Not_yet_Initiated;
|
|
_notifyEmail = "";
|
|
_isBankTransfer = false;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
#region Salary Month : DateTime
|
|
|
|
private DateTime _salaryMonth;
|
|
public DateTime SalaryMonth
|
|
{
|
|
get { return _salaryMonth; }
|
|
set
|
|
{
|
|
|
|
_salaryMonth = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region processDate : DateTime
|
|
|
|
private DateTime _processDate;
|
|
public DateTime ProcessDate
|
|
{
|
|
get { return _processDate; }
|
|
set
|
|
{
|
|
|
|
_processDate = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region paymentDate : System.DateTime
|
|
|
|
private System.DateTime? _paymentDate;
|
|
public System.DateTime? PaymentDate
|
|
{
|
|
get { return _paymentDate; }
|
|
set
|
|
{
|
|
|
|
_paymentDate = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region workDays : int
|
|
|
|
private int _workDays;
|
|
public int WorkDays
|
|
{
|
|
get { return _workDays; }
|
|
set
|
|
{
|
|
|
|
_workDays = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region isFinalized : bool
|
|
|
|
private bool _isFinalized;
|
|
public bool IsFinalized
|
|
{
|
|
get { return _isFinalized; }
|
|
set
|
|
{
|
|
|
|
_isFinalized = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region payrollTypeID : int
|
|
|
|
private int _payrollTypeID;
|
|
public int PayrollTypeID
|
|
{
|
|
get { return _payrollTypeID; }
|
|
set
|
|
{
|
|
|
|
_payrollTypeID = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ProcessCode : string
|
|
|
|
private string _processCode;
|
|
public string ProcessCode
|
|
{
|
|
get { return _processCode; }
|
|
set
|
|
{
|
|
|
|
_processCode = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Remarks : string
|
|
|
|
private string _remarks;
|
|
public string Remarks
|
|
{
|
|
get { return _remarks; }
|
|
set
|
|
{
|
|
|
|
_remarks = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ShowInDesktop : int
|
|
|
|
private bool _showInDesktop;
|
|
public bool ShowInDesktops
|
|
{
|
|
get { return _showInDesktop; }
|
|
set
|
|
{
|
|
|
|
_showInDesktop = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ShowInDesktopDate : DateTime
|
|
|
|
private DateTime _showInDesktopDate;
|
|
public DateTime ShowInDesktopDate
|
|
{
|
|
get { return _showInDesktopDate; }
|
|
set
|
|
{
|
|
|
|
_showInDesktopDate = value;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region MonthEndDate : System.DateTime
|
|
|
|
private System.DateTime? _monthEndDate;
|
|
public System.DateTime? MonthEndDate
|
|
{
|
|
get { return _monthEndDate; }
|
|
set
|
|
{
|
|
|
|
_monthEndDate = value;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region WFStatus : enumWFStatus
|
|
private enumwfStatus? _wfStatus;
|
|
public enumwfStatus? WFStatus
|
|
{
|
|
get { return _wfStatus; }
|
|
set { _wfStatus = value; }
|
|
}
|
|
#endregion
|
|
|
|
#region NotifyEmail : string
|
|
private string _notifyEmail;
|
|
public string NotifyEmail
|
|
{
|
|
get { return _notifyEmail; }
|
|
set { _notifyEmail = value; }
|
|
}
|
|
#endregion
|
|
|
|
#region IsBankTransfer : bool
|
|
private bool _isBankTransfer;
|
|
public bool IsBankTransfer
|
|
{
|
|
get { return _isBankTransfer; }
|
|
set { _isBankTransfer = value; }
|
|
}
|
|
#endregion
|
|
|
|
public double EuroRate { get; set; }
|
|
|
|
#region Service Factory ISalaryProcessService : ISalaryProcessService
|
|
|
|
internal static ISalaryProcessService Service
|
|
{
|
|
get { return Services.Factory.CreateService<ISalaryProcessService>(typeof(ISalaryProcessService)); }
|
|
}
|
|
|
|
#endregion
|
|
|
|
public int headCount { get; set; }
|
|
#endregion
|
|
|
|
//#region Functions
|
|
|
|
//public static SalaryProcess Get(int nID)
|
|
//{
|
|
// SalaryProcess oSalaryProcess = null;
|
|
// #region Cache Header
|
|
// oSalaryProcess = (SalaryProcess)_cache["Get", nID];
|
|
// if (oSalaryProcess != null)
|
|
// return oSalaryProcess;
|
|
// #endregion
|
|
// oSalaryProcess = SalaryProcess.Service.Get(nID);
|
|
// #region Cache Footer
|
|
// _cache.Add(oSalaryProcess, "Get", nID);
|
|
// #endregion
|
|
// return oSalaryProcess;
|
|
//}
|
|
|
|
//public static List<SalaryProcess> Get(DateTime dMonthDate)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<SalaryProcess> salaryProcesss = _cache["Get", dMonthDate] as List<SalaryProcess>;
|
|
// if (salaryProcesss != null)
|
|
// return salaryProcesss;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// salaryProcesss = Service.Get(dMonthDate,SystemInformation.CurrentSysInfo.PayrollTypeID.Integer);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(salaryProcesss, "Get", dMonthDate);
|
|
|
|
// #endregion
|
|
|
|
// return salaryProcesss;
|
|
//}
|
|
|
|
//public static List<SalaryProcess> Get()
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<SalaryProcess> salaryProcesss = _cache["Get"] as List<SalaryProcess>;
|
|
// if (salaryProcesss != null)
|
|
// return salaryProcesss;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// salaryProcesss = Service.Get(SystemInformation.CurrentSysInfo.PayrollTypeID.Integer);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(salaryProcesss, "Get");
|
|
|
|
// #endregion
|
|
|
|
// return salaryProcesss;
|
|
//}
|
|
|
|
//public static List<SalaryProcess> GetSP()
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<SalaryProcess> salaryProcesss = _cache["Get"] as List<SalaryProcess>;
|
|
// if (salaryProcesss != null)
|
|
// return salaryProcesss;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// salaryProcesss = Service.GetSP();
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(salaryProcesss, "GetSP");
|
|
|
|
// #endregion
|
|
|
|
// return salaryProcesss;
|
|
//}
|
|
|
|
//public bool GetBySMonth(DateTime dSMonth)
|
|
//{
|
|
// bool bShowInDesktop;
|
|
// bShowInDesktop = SalaryProcess.Service.GetBySMonth(dSMonth,SystemInformation.CurrentSysInfo.PayrollTypeID.Integer);
|
|
// return bShowInDesktop;
|
|
//}
|
|
|
|
//public int Save()
|
|
//{
|
|
// return SalaryProcess.Service.Save(this);
|
|
//}
|
|
|
|
//public void SetAuditTraiProperty()
|
|
//{
|
|
// base.SetAuditTrailProperties();
|
|
//}
|
|
|
|
//public void Delete()
|
|
//{
|
|
// SalaryProcess.Service.Delete(this.ID);
|
|
//}
|
|
|
|
//public void UndoSalary()
|
|
//{
|
|
// SalaryProcess.Service.UndoSalary(this.ID);
|
|
//}
|
|
|
|
//public static void UndoMonthlySalaryByIDs(string ids)
|
|
//{
|
|
// SalaryProcess.Service.UndoMonthlySalaryByIDs(ids);
|
|
//}
|
|
|
|
//public static void UndoMonthlySalaryByEmpIDs(string ids,DateTime salaryMonth)
|
|
//{
|
|
// SalaryProcess.Service.UndoMonthlySalaryByEmpIDs(ids, salaryMonth);
|
|
//}
|
|
|
|
//public void Update(SalaryProcess oSProcess)
|
|
//{
|
|
// this.SetAuditTraiProperty();
|
|
// SalaryProcess.Service.Update(oSProcess);
|
|
//}
|
|
|
|
//public void SPApprove(SalaryProcess oSProcess)
|
|
//{
|
|
// SalaryProcess.Service.SPApprove(oSProcess);
|
|
//}
|
|
|
|
//public static List<SalaryProcess> GetAllProcess()
|
|
//{
|
|
// List<SalaryProcess> salaryProcesss = new List<SalaryProcess> ();
|
|
// salaryProcesss = SalaryProcess.Service.GetAllProcess(SystemInformation.CurrentSysInfo.PayrollTypeID.Integer, SystemInformation.CurrentSysInfo.NextPayProcessDate);
|
|
// return salaryProcesss;
|
|
//}
|
|
|
|
//#endregion
|
|
|
|
#region IworkflowInterface Members
|
|
public string ObjectDescription
|
|
{
|
|
get
|
|
{
|
|
string str = "";
|
|
return str;
|
|
}
|
|
}
|
|
public int SetupID
|
|
{
|
|
get { return 30; }
|
|
}
|
|
public int ObjectID
|
|
{
|
|
get { return this.ID; }
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
#endregion
|
|
|
|
#region Salary Approval Attachment
|
|
public class SalaryApprovalAttachment
|
|
{
|
|
#region Properties
|
|
public int ApprovalAttachmentID { get; set; }
|
|
public int PayrolltypeID { get; set; }
|
|
public DateTime SalaryMonth { get; set; }
|
|
public string FileName { get; set; }
|
|
public string FileData { get; set; }
|
|
public string Remarks { get; set; }
|
|
public EnumFileType FileType { get; set; }
|
|
public byte[] FileAsByteArray { get; set; }
|
|
public string PrevFileName { get; set; }
|
|
public string FileTobase64
|
|
{
|
|
get
|
|
{
|
|
return FileAsByteArray == null ? null : Convert.ToBase64String(FileAsByteArray);
|
|
}
|
|
}
|
|
public string PreviousFileTobase64
|
|
{
|
|
get; set;
|
|
}
|
|
public string ConnectionString { get; set; }
|
|
|
|
public int? ReferenceID { get; set; }
|
|
#endregion
|
|
}
|
|
#endregion
|
|
|
|
#region ISalaryProcess Service
|
|
|
|
public interface ISalaryProcessService
|
|
{
|
|
|
|
bool GetBySMonth(DateTime sMonth, int payrollTypeID);
|
|
|
|
List<SalaryProcessStatus> SalaryProcess(SalaryProcess item, List<Employee> employees);
|
|
int Save(SalaryProcess item);
|
|
void Delete(int id);
|
|
|
|
void UndoSalary(int id);
|
|
void UndoSalaryForInitiator(int id);
|
|
void UndoMonthlySalaryByIDs(string ids);
|
|
void UndoMonthlySalaryByEmpIDs(string ids, DateTime salaryMonth);
|
|
void ApproveSalary(DateTime salaryMonth, int payrollTypeID);
|
|
void ApproveSalaryNew(SalaryProcess oSalaryProcess,int currentEmpID);
|
|
void SalryBankTransfer(SalaryProcess oSalaryProcess);
|
|
enumwfStatus ApproveSalaryNew(WFMovementTran oWFMovementTran);
|
|
void SalaryProcessRevertRevert(WFMovementTran oWFMovementTran, string remarks);
|
|
void Update(SalaryProcess oSProcess);
|
|
void SPApprove(SalaryProcess oSProcess);
|
|
List<SalaryProcess> Get(DateTime dMonthDate, int payrollTypeID);
|
|
DataSet GetProcessSummary(DateTime salaryMonth, int payrollTypeID, int taxParamID);
|
|
List<SalaryProcess> GetUnApprovedSalaries(DateTime dMonthDate, int payrollTypeID);
|
|
|
|
void MonthEnd(int userid, DateTime salaryMonth, int payrollTypeID, DateTime paymentDate);
|
|
SalaryProcess GetSalaryProcess(DateTime salaryMonth, int payrollTypeID);
|
|
SalaryProcess GetSalaryProcessForRunningWorkflow(DateTime salaryMonth, int payrollTypeID);
|
|
SalaryProcess GetSalaryProcessByUniqueID(int uniqueID);
|
|
List<SalaryProcess> GetAllProcess(int payrollTypeID, DateTime nextPayProcessDate);
|
|
|
|
void DeleteSalaryApprovalAttachment(int id);
|
|
|
|
void UpdateMessValue(DateTime salaryMonth, int payrollTypeID, string documentNoSAP, int jvtypeID);
|
|
string GetDocumentNoSAPValue(DateTime dSMonth, int payrollTypeID);
|
|
void deleteDocmentNo(DateTime dSMonth, int payrollTypeID, int jvTypeId);
|
|
}
|
|
|
|
#endregion
|
|
}
|