422 lines
12 KiB
C#
422 lines
12 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using Ease.Core;
|
|||
|
|
|||
|
namespace HRM.BO
|
|||
|
{
|
|||
|
#region GatePass
|
|||
|
|
|||
|
[Serializable]
|
|||
|
public class GatePass : AuditTrailBase
|
|||
|
{
|
|||
|
#region Constructor
|
|||
|
|
|||
|
public GatePass()
|
|||
|
{
|
|||
|
_telephoneNo = string.Empty;
|
|||
|
_lineManagerID = 0;
|
|||
|
_employeeID = 0;
|
|||
|
_remarks = string.Empty;
|
|||
|
_entryDate = DateTime.MinValue;
|
|||
|
_departureTime = DateTime.MinValue;
|
|||
|
_returnTime = DateTime.MinValue;
|
|||
|
_totalHour = 0;
|
|||
|
_approvedBy = 0;
|
|||
|
_approvedDate = DateTime.MinValue;
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Properties
|
|||
|
|
|||
|
#region TelephoneNo : string
|
|||
|
|
|||
|
private string _telephoneNo;
|
|||
|
|
|||
|
public string TelephoneNo
|
|||
|
{
|
|||
|
get { return _telephoneNo; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<string>("TelephoneNo", _telephoneNo, value);
|
|||
|
_telephoneNo = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region EntryDate : DateTime
|
|||
|
|
|||
|
private DateTime _entryDate;
|
|||
|
|
|||
|
public DateTime EntryDate
|
|||
|
{
|
|||
|
get { return _entryDate; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<DateTime>("EntryDate", _entryDate, value);
|
|||
|
_entryDate = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region TotalHour : double
|
|||
|
|
|||
|
private double _totalHour;
|
|||
|
|
|||
|
public double TotalHour
|
|||
|
{
|
|||
|
get { return _totalHour; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<double>("TotalHour", _totalHour, value);
|
|||
|
_totalHour = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region DepartureTime : DateTime
|
|||
|
|
|||
|
private DateTime _departureTime;
|
|||
|
|
|||
|
public DateTime DepartureTime
|
|||
|
{
|
|||
|
get { return _departureTime; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<DateTime>("DepartureTime", _departureTime, value);
|
|||
|
_departureTime = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region ReturnTime : DateTime
|
|||
|
|
|||
|
private DateTime _returnTime;
|
|||
|
|
|||
|
public DateTime ReturnTime
|
|||
|
{
|
|||
|
get { return _returnTime; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<DateTime>("ReturnTime", _returnTime, value);
|
|||
|
_returnTime = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region ClaimWFStatus : EnumClaimWFStatus
|
|||
|
|
|||
|
private EnumClaimWFStatus _claimWFStatus;
|
|||
|
|
|||
|
public EnumClaimWFStatus ClaimWFStatus
|
|||
|
{
|
|||
|
get { return _claimWFStatus; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<short>("ClaimWFStatus", (short)_claimWFStatus, (short)value);
|
|||
|
_claimWFStatus = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region SystemMode : EnumSystemMode
|
|||
|
|
|||
|
private EnumSystemMode _systemMode;
|
|||
|
|
|||
|
public EnumSystemMode SystemMode
|
|||
|
{
|
|||
|
get { return _systemMode; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<short>("SystemMode", (short)_systemMode, (short)value);
|
|||
|
_systemMode = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region LineManagerID : ID
|
|||
|
|
|||
|
private int _lineManagerID;
|
|||
|
|
|||
|
public int LineManagerID
|
|||
|
{
|
|||
|
get { return _lineManagerID; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<ID>("LineManagerID", _lineManagerID, value);
|
|||
|
_lineManagerID = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region ApprovedBy : ID
|
|||
|
|
|||
|
private int _approvedBy;
|
|||
|
|
|||
|
public int ApprovedBy
|
|||
|
{
|
|||
|
get { return _approvedBy; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<ID>("ApprovedBy", _approvedBy, value);
|
|||
|
_approvedBy = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region ApprovedDate : DateTime
|
|||
|
|
|||
|
private DateTime _approvedDate;
|
|||
|
|
|||
|
public DateTime ApprovedDate
|
|||
|
{
|
|||
|
get { return _approvedDate; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<DateTime>("ApprovedDate", _approvedDate, value);
|
|||
|
_approvedDate = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region EmployeeID : ID
|
|||
|
|
|||
|
private int _employeeID;
|
|||
|
|
|||
|
public int EmployeeID
|
|||
|
{
|
|||
|
get { return _employeeID; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<ID>("EmployeeID", _employeeID, value);
|
|||
|
_employeeID = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
#region Remarks : string
|
|||
|
|
|||
|
private string _remarks;
|
|||
|
|
|||
|
public string Remarks
|
|||
|
{
|
|||
|
get { return _remarks; }
|
|||
|
set
|
|||
|
{
|
|||
|
//base.OnPropertyChange<string>("Remarks", _remarks, value);
|
|||
|
_remarks = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
//#region Service Factory IGatePassService : IGatePassService
|
|||
|
|
|||
|
//internal static IGatePassService Service
|
|||
|
//{
|
|||
|
// get { return Services.Factory.CreateService<IGatePassService>(typeof(IGatePassService)); }
|
|||
|
//}
|
|||
|
|
|||
|
//#endregion
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
//#region Functions
|
|||
|
|
|||
|
//public static GatePass Get(ID nID)
|
|||
|
//{
|
|||
|
// GatePass oGatePass = null;
|
|||
|
// #region Cache Header
|
|||
|
// oGatePass = (GatePass)_cache["Get", nID];
|
|||
|
// if (oGatePass != null)
|
|||
|
// return oGatePass;
|
|||
|
// #endregion
|
|||
|
// oGatePass = GatePass.Service.Get(nID);
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(oGatePass, "Get", nID);
|
|||
|
// #endregion
|
|||
|
// return oGatePass;
|
|||
|
//}
|
|||
|
|
|||
|
//public static ObjectsTemplate<GatePass> GetByShiftManagerID(ID shiftManagerID, EnumClaimWFStatus wfStatus)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
// ObjectsTemplate<GatePass> AdhocClaims = _cache["GetByEmployeeID"] as ObjectsTemplate<GatePass>;
|
|||
|
// if (AdhocClaims != null)
|
|||
|
// return AdhocClaims;
|
|||
|
// #endregion
|
|||
|
// try
|
|||
|
// {
|
|||
|
// AdhocClaims = Service.GetByShiftManagerID(shiftManagerID, wfStatus);
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(AdhocClaims, "GetByEmployeeID");
|
|||
|
// #endregion
|
|||
|
// return AdhocClaims;
|
|||
|
//}
|
|||
|
|
|||
|
//public static ObjectsTemplate<GatePass> GetByApproverID(ID approverID, DateTime fromDate, DateTime toDate)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
// ObjectsTemplate<GatePass> oGatePasss = _cache["GetByEmployeeID"] as ObjectsTemplate<GatePass>;
|
|||
|
// if (oGatePasss != null)
|
|||
|
// return oGatePasss;
|
|||
|
// #endregion
|
|||
|
// try
|
|||
|
// {
|
|||
|
// oGatePasss = Service.GetByApproverID(approverID, fromDate, toDate);
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(oGatePasss, "GetByEmployeeID");
|
|||
|
// #endregion
|
|||
|
// return oGatePasss;
|
|||
|
//}
|
|||
|
|
|||
|
//public static ObjectsTemplate<GatePass> GetByEmployeeID(string employeeIDs, EnumClaimWFStatus wfStatus)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
// ObjectsTemplate<GatePass> AdhocClaims = _cache["GetByEmployeeID"] as ObjectsTemplate<GatePass>;
|
|||
|
// if (AdhocClaims != null)
|
|||
|
// return AdhocClaims;
|
|||
|
// #endregion
|
|||
|
// try
|
|||
|
// {
|
|||
|
// AdhocClaims = Service.GetByEmployeeID(employeeIDs, wfStatus);
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(AdhocClaims, "GetByEmployeeID");
|
|||
|
// #endregion
|
|||
|
// return AdhocClaims;
|
|||
|
//}
|
|||
|
|
|||
|
//public static ObjectsTemplate<GatePass> Get()
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
// ObjectsTemplate<GatePass> GatePasss = _cache["Get"] as ObjectsTemplate<GatePass>;
|
|||
|
// if (GatePasss != null)
|
|||
|
// return GatePasss;
|
|||
|
// #endregion
|
|||
|
// try
|
|||
|
// {
|
|||
|
// GatePasss = Service.Get();
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(GatePasss, "Get");
|
|||
|
// #endregion
|
|||
|
// return GatePasss;
|
|||
|
//}
|
|||
|
|
|||
|
//public static ObjectsTemplate<GatePass> GetByEmployeeID(ID employeeID, DateTime fromDate, DateTime toDate)
|
|||
|
//{
|
|||
|
// #region Cache Header
|
|||
|
// ObjectsTemplate<GatePass> GatePasss = _cache["Get"] as ObjectsTemplate<GatePass>;
|
|||
|
// if (GatePasss != null)
|
|||
|
// return GatePasss;
|
|||
|
// #endregion
|
|||
|
// try
|
|||
|
// {
|
|||
|
// GatePasss = Service.GetByEmployeeID(employeeID, fromDate, toDate);
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
// #region Cache Footer
|
|||
|
// _cache.Add(GatePasss, "Get");
|
|||
|
// #endregion
|
|||
|
// return GatePasss;
|
|||
|
//}
|
|||
|
|
|||
|
//public ID Save()
|
|||
|
//{
|
|||
|
// this.SetAuditTrailProperties();
|
|||
|
// return GatePass.Service.Save(this);
|
|||
|
//}
|
|||
|
//public static void Save(ObjectsTemplate<GatePass> _GatePasss)
|
|||
|
//{
|
|||
|
// foreach (GatePass cardOp in _GatePasss)
|
|||
|
// {
|
|||
|
// cardOp.SetAuditTrailProperties();
|
|||
|
// }
|
|||
|
// GatePass.Service.Save(_GatePasss);
|
|||
|
//}
|
|||
|
|
|||
|
//public static void Save(ObjectsTemplate<GatePass> _GatePasss, ObjectsTemplate<AttnMonthlyBenefit> benefits, ObjectsTemplate<AttnBenefitAuditTrail> oAttnBenefitAuditTrails)
|
|||
|
//{
|
|||
|
// foreach (GatePass cardOp in _GatePasss)
|
|||
|
// {
|
|||
|
// cardOp.SetAuditTrailProperties();
|
|||
|
// }
|
|||
|
// GatePass.Service.Save(_GatePasss, benefits, oAttnBenefitAuditTrails);
|
|||
|
//}
|
|||
|
//public void Delete()
|
|||
|
//{
|
|||
|
// GatePass.Service.Delete(ID);
|
|||
|
//}
|
|||
|
|
|||
|
//public static int GetGatePassDataByWFStatusCount(DateTime fromdate, DateTime toDate, EnumWFAttnStatus status)
|
|||
|
//{
|
|||
|
// try
|
|||
|
// {
|
|||
|
// return Service.GetGatePassDataByWFStatusCount(fromdate, toDate, status);
|
|||
|
// }
|
|||
|
// catch (ServiceException e)
|
|||
|
// {
|
|||
|
// throw new Exception(e.Message, e);
|
|||
|
// }
|
|||
|
//}
|
|||
|
|
|||
|
|
|||
|
//#endregion
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
//#region IGatePass Service
|
|||
|
|
|||
|
//public interface IGatePassService
|
|||
|
//{
|
|||
|
// int GetGatePassDataByWFStatusCount(DateTime fromdate, DateTime toDate, EnumWFAttnStatus status);
|
|||
|
// void Save(ObjectsTemplate<GatePass> _GatePasss, ObjectsTemplate<AttnMonthlyBenefit> benefits, ObjectsTemplate<AttnBenefitAuditTrail> aTrails);
|
|||
|
// ObjectsTemplate<GatePass> GetByApproverID(ID approverID, DateTime fromDate, DateTime toDate);
|
|||
|
// ObjectsTemplate<GatePass> GetByShiftManagerID(ID shiftManagerID, EnumClaimWFStatus wfStatus);
|
|||
|
// ObjectsTemplate<GatePass> GetByEmployeeID(string employeeIDs, EnumClaimWFStatus wfStatus);
|
|||
|
// ObjectsTemplate<GatePass> GetByEmployeeID(ID employeeID, DateTime fromDate, DateTime toDate);
|
|||
|
// GatePass Get(ID id);
|
|||
|
// ObjectsTemplate<GatePass> Get();
|
|||
|
// ID Save(GatePass item);
|
|||
|
// void Save(ObjectsTemplate<GatePass> _GatePasss);
|
|||
|
// void Delete(ID id);
|
|||
|
//}
|
|||
|
|
|||
|
//#endregion
|
|||
|
}
|