using System; using System.Collections.Generic; using System.Linq; using System.Text; using Ease.CoreV35; using Ease.CoreV35.Model; using Ease.CoreV35.Caching; using System.Data.Linq.Mapping; namespace Payroll.BO { #region ErrorSuccessLog [Serializable] public class ErrorSuccessLog : BasicBaseObject { #region Cache Store private static Cache _cache = new Cache(typeof(ErrorSuccessLog)); #endregion #region Constructor public ErrorSuccessLog() { _OperationDate = DateTime.Today; _ReceiveStatus = EnumReceiveStatus.Success; _IsLogRead = false; _ViewName = ""; } #endregion #region Properties #region OperationDate : Datetime private DateTime _OperationDate; public DateTime OperationDate { get { return _OperationDate; } set { _OperationDate = value; } } #endregion #region ReceiveStatus : EnumReceiveStatus private EnumReceiveStatus _ReceiveStatus; public EnumReceiveStatus ReceiveStatus { get { return _ReceiveStatus; } set { _ReceiveStatus = value; } } #endregion #region IsLogRead : bool private bool _IsLogRead; public bool IsLogRead { get { return _IsLogRead; } set { _IsLogRead = value; } } #endregion #region ViewName : string private string _ViewName; public string ViewName { get { return _ViewName; } set { _ViewName = value; } } #endregion #region ErrorLogDetails : ErrorLogDetails private ObjectsTemplate _ErrorLogdetails; public ObjectsTemplate ErrorLogDetails { get { //if (this.ID.IsUnassigned == false && this.ID.Integer > 0) //{ // _ErrorLogdetails = new ObjectsTemplate(); // _ErrorLogdetails = GetErrorLogDetails(this.ID); //} return _ErrorLogdetails; } set { _ErrorLogdetails = value; } } #endregion #region ErrorLogDetails : ErrorLogDetails private ObjectsTemplate _SuccessLogDetails; public ObjectsTemplate SuccessLogDetails { get { //if (this.ID != null) //{ // _SuccessLogDetails = new ObjectsTemplate(); // _SuccessLogDetails = GetSuccessLogDetails(this.ID); //} return _SuccessLogDetails; } set { _SuccessLogDetails = value; } } #endregion #region Service Factory IErrorSuccessLogService : IErrorSuccessLogService internal static IErrorSuccessLogService Service { get { return Services.Factory.CreateService(typeof(IErrorSuccessLogService)); } } #endregion #endregion #region Functions public ErrorSuccessLog Get(ID nID) { ErrorSuccessLog oErrorSuccessLog = null; #region Cache Header oErrorSuccessLog = (ErrorSuccessLog)_cache["Get", ID]; if (oErrorSuccessLog != null) return oErrorSuccessLog; #endregion oErrorSuccessLog = ErrorSuccessLog.Service.Get(nID); #region Cache Footer _cache.Add(oErrorSuccessLog, "Get", ID); #endregion return oErrorSuccessLog; } public static ObjectsTemplate Get() { #region cache header ObjectsTemplate ErrorSuccessLogs = _cache["Get"] as ObjectsTemplate; if (ErrorSuccessLogs != null) return ErrorSuccessLogs; #endregion try { ErrorSuccessLogs = Service.Get(); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region cache footer _cache.Add(ErrorSuccessLogs, "Get"); #endregion return ErrorSuccessLogs; } public static ObjectsTemplate GetByStatus(bool sts) { #region cache header ObjectsTemplate ErrorSuccessLogs = _cache["Get"] as ObjectsTemplate; if (ErrorSuccessLogs != null) return ErrorSuccessLogs; #endregion try { ErrorSuccessLogs = Service.GetByStatus(sts); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region cache footer _cache.Add(ErrorSuccessLogs, "Get"); #endregion return ErrorSuccessLogs; } public static ObjectsTemplate GetByStatus(bool sts, DateTime frmDate, DateTime toDate) { #region cache header ObjectsTemplate ErrorSuccessLogs = _cache["Get"] as ObjectsTemplate; if (ErrorSuccessLogs != null) return ErrorSuccessLogs; #endregion try { ErrorSuccessLogs = Service.GetByStatus(sts, frmDate, toDate); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region cache footer _cache.Add(ErrorSuccessLogs, "Get"); #endregion return ErrorSuccessLogs; } public static ObjectsTemplate GetErrorLogDetails(ID nID) { #region cache header ObjectsTemplate ErrorSuccessLogs = _cache["GetErrorLogDetails"] as ObjectsTemplate; if (ErrorSuccessLogs != null) return ErrorSuccessLogs; #endregion try { ErrorSuccessLogs = Service.GetErrorLogDetails(nID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region cache footer _cache.Add(ErrorSuccessLogs, "GetErrorLogDetails"); #endregion return ErrorSuccessLogs; } public static ObjectsTemplate GetSuccessLogDetails(ID nID) { #region cache header ObjectsTemplate ErrorSuccessLogs = _cache["GetSuccessLogDetails"] as ObjectsTemplate; if (ErrorSuccessLogs != null) return ErrorSuccessLogs; #endregion try { ErrorSuccessLogs = Service.GetSuccessLogDetails(nID); } catch (ServiceException e) { throw new Exception(e.Message, e); } #region cache footer _cache.Add(ErrorSuccessLogs, "GetSuccessLogDetails"); #endregion return ErrorSuccessLogs; } public ID Save() { //base.SetAuditTrailProperties(); return ErrorSuccessLog.Service.Save(this); } public void Update() { ErrorSuccessLog.Service.Update(this); } #endregion } #endregion #region IErrorSuccessLog Service public interface IErrorSuccessLogService { ErrorSuccessLog Get(ID id); ObjectsTemplate Get(); ObjectsTemplate GetErrorLogDetails(ID id); ObjectsTemplate GetSuccessLogDetails(ID id); ObjectsTemplate GetByStatus(bool sts); ObjectsTemplate GetByStatus(bool sts, DateTime fromDate, DateTime toDate); ID Save(ErrorSuccessLog item); void Update(ErrorSuccessLog item); } #endregion #region ErrorLogDetail [Serializable] public class ErrorLogDetail : BasicBaseObject { public ErrorLogDetail() { _ErrorSuccessLogID = null; _EmployeeID = null; _EmployeePIN = ""; _EmployeeName = ""; _ErrorType = EnumErrorType.BasicData; _ErrorDescription = ""; } #region ErrorSuccessLogID : ID private ID _ErrorSuccessLogID; public ID ErrorSuccessLogID { get { return _ErrorSuccessLogID; } set { _ErrorSuccessLogID = value; } } #endregion #region EmployeeID : ID private ID _EmployeeID; public ID EmployeeID { get { return _EmployeeID; } set { _EmployeeID = value; } } #endregion #region ErrorType : EnumErrorType private EnumErrorType _ErrorType; public EnumErrorType ErrorType { get { return _ErrorType; } set { _ErrorType = value; } } #endregion #region EmployeeName : string private string _EmployeeName; public string EmployeeName { get { return _EmployeeName; } set { _EmployeeName = value; } } #endregion #region EmployeePIN : string private string _EmployeePIN; public string EmployeePIN { get { return _EmployeePIN; } set { _EmployeePIN = value; } } #endregion #region ErrorDescription : string private string _ErrorDescription; public string ErrorDescription { get { return _ErrorDescription; } set { _ErrorDescription = value; } } #endregion } #endregion #region SuccessLogDetail [Serializable] public class SuccessLogDetail : BasicBaseObject { public SuccessLogDetail() { _ErrorSuccessLogID = null; _EmployeeID = null; _EmployeePIN = ""; _EmployeeName = ""; _SuccessDescription = ""; } #region ErrorSuccessLogID : ID private ID _ErrorSuccessLogID; public ID ErrorSuccessLogID { get { return _ErrorSuccessLogID; } set { _ErrorSuccessLogID = value; } } #endregion #region EmployeeID : ID private ID _EmployeeID; public ID EmployeeID { get { return _EmployeeID; } set { _EmployeeID = value; } } #endregion #region EmployeeName : string private string _EmployeeName; public string EmployeeName { get { return _EmployeeName; } set { _EmployeeName = value; } } #endregion #region EmployeePIN : string private string _EmployeePIN; public string EmployeePIN { get { return _EmployeePIN; } set { _EmployeePIN = value; } } #endregion #region SuccessDescription : string private string _SuccessDescription; public string SuccessDescription { get { return _SuccessDescription; } set { _SuccessDescription = value; } } #endregion } #endregion #region SuccessorErrorList [Serializable] public class SuccessorErrorList { public SuccessorErrorList() { } public ID RowNo { get; set; } public string EmployeeNo { get; set; } public string Message { get; set; } public EnumSAPProcessStatus Status { get; set; } public DateTime UploadDate { get; set; } } } #endregion