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("TelephoneNo", _telephoneNo, value); _telephoneNo = value; } } #endregion #region EntryDate : DateTime private DateTime _entryDate; public DateTime EntryDate { get { return _entryDate; } set { //base.OnPropertyChange("EntryDate", _entryDate, value); _entryDate = value; } } #endregion #region TotalHour : double private double _totalHour; public double TotalHour { get { return _totalHour; } set { //base.OnPropertyChange("TotalHour", _totalHour, value); _totalHour = value; } } #endregion #region DepartureTime : DateTime private DateTime _departureTime; public DateTime DepartureTime { get { return _departureTime; } set { //base.OnPropertyChange("DepartureTime", _departureTime, value); _departureTime = value; } } #endregion #region ReturnTime : DateTime private DateTime _returnTime; public DateTime ReturnTime { get { return _returnTime; } set { //base.OnPropertyChange("ReturnTime", _returnTime, value); _returnTime = value; } } #endregion #region ClaimWFStatus : EnumClaimWFStatus private EnumClaimWFStatus _claimWFStatus; public EnumClaimWFStatus ClaimWFStatus { get { return _claimWFStatus; } set { //base.OnPropertyChange("ClaimWFStatus", (short)_claimWFStatus, (short)value); _claimWFStatus = value; } } #endregion #region SystemMode : EnumSystemMode private EnumSystemMode _systemMode; public EnumSystemMode SystemMode { get { return _systemMode; } set { //base.OnPropertyChange("SystemMode", (short)_systemMode, (short)value); _systemMode = value; } } #endregion #region LineManagerID : ID private int _lineManagerID; public int LineManagerID { get { return _lineManagerID; } set { //base.OnPropertyChange("LineManagerID", _lineManagerID, value); _lineManagerID = value; } } #endregion #region ApprovedBy : ID private int _approvedBy; public int ApprovedBy { get { return _approvedBy; } set { //base.OnPropertyChange("ApprovedBy", _approvedBy, value); _approvedBy = value; } } #endregion #region ApprovedDate : DateTime private DateTime _approvedDate; public DateTime ApprovedDate { get { return _approvedDate; } set { //base.OnPropertyChange("ApprovedDate", _approvedDate, value); _approvedDate = value; } } #endregion #region EmployeeID : ID private int _employeeID; public int EmployeeID { get { return _employeeID; } set { //base.OnPropertyChange("EmployeeID", _employeeID, value); _employeeID = value; } } #endregion #region Remarks : string private string _remarks; public string Remarks { get { return _remarks; } set { //base.OnPropertyChange("Remarks", _remarks, value); _remarks = value; } } #endregion //#region Service Factory IGatePassService : IGatePassService //internal static IGatePassService Service //{ // get { return Services.Factory.CreateService(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 GetByShiftManagerID(ID shiftManagerID, EnumClaimWFStatus wfStatus) //{ // #region Cache Header // ObjectsTemplate AdhocClaims = _cache["GetByEmployeeID"] as ObjectsTemplate; // 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 GetByApproverID(ID approverID, DateTime fromDate, DateTime toDate) //{ // #region Cache Header // ObjectsTemplate oGatePasss = _cache["GetByEmployeeID"] as ObjectsTemplate; // 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 GetByEmployeeID(string employeeIDs, EnumClaimWFStatus wfStatus) //{ // #region Cache Header // ObjectsTemplate AdhocClaims = _cache["GetByEmployeeID"] as ObjectsTemplate; // 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 Get() //{ // #region Cache Header // ObjectsTemplate GatePasss = _cache["Get"] as ObjectsTemplate; // 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 GetByEmployeeID(ID employeeID, DateTime fromDate, DateTime toDate) //{ // #region Cache Header // ObjectsTemplate GatePasss = _cache["Get"] as ObjectsTemplate; // 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 _GatePasss) //{ // foreach (GatePass cardOp in _GatePasss) // { // cardOp.SetAuditTrailProperties(); // } // GatePass.Service.Save(_GatePasss); //} //public static void Save(ObjectsTemplate _GatePasss, ObjectsTemplate benefits, ObjectsTemplate 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 _GatePasss, ObjectsTemplate benefits, ObjectsTemplate aTrails); // ObjectsTemplate GetByApproverID(ID approverID, DateTime fromDate, DateTime toDate); // ObjectsTemplate GetByShiftManagerID(ID shiftManagerID, EnumClaimWFStatus wfStatus); // ObjectsTemplate GetByEmployeeID(string employeeIDs, EnumClaimWFStatus wfStatus); // ObjectsTemplate GetByEmployeeID(ID employeeID, DateTime fromDate, DateTime toDate); // GatePass Get(ID id); // ObjectsTemplate Get(); // ID Save(GatePass item); // void Save(ObjectsTemplate _GatePasss); // void Delete(ID id); //} //#endregion }