CEL_Payroll/Payroll.BO/Common/ErrorSuccessLog.cs

492 lines
12 KiB
C#
Raw Normal View History

2024-09-17 14:30:13 +06:00
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<ErrorLogDetail> _ErrorLogdetails;
public ObjectsTemplate<ErrorLogDetail> ErrorLogDetails
{
get
{
//if (this.ID.IsUnassigned == false && this.ID.Integer > 0)
//{
// _ErrorLogdetails = new ObjectsTemplate<ErrorLogDetail>();
// _ErrorLogdetails = GetErrorLogDetails(this.ID);
//}
return _ErrorLogdetails;
}
set
{
_ErrorLogdetails = value;
}
}
#endregion
#region ErrorLogDetails : ErrorLogDetails
private ObjectsTemplate<SuccessLogDetail> _SuccessLogDetails;
public ObjectsTemplate<SuccessLogDetail> SuccessLogDetails
{
get
{
//if (this.ID != null)
//{
// _SuccessLogDetails = new ObjectsTemplate<SuccessLogDetail>();
// _SuccessLogDetails = GetSuccessLogDetails(this.ID);
//}
return _SuccessLogDetails;
}
set
{
_SuccessLogDetails = value;
}
}
#endregion
#region Service Factory IErrorSuccessLogService : IErrorSuccessLogService
internal static IErrorSuccessLogService Service
{
get { return Services.Factory.CreateService<IErrorSuccessLogService>(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<ErrorSuccessLog> Get()
{
#region cache header
ObjectsTemplate<ErrorSuccessLog> ErrorSuccessLogs = _cache["Get"] as ObjectsTemplate<ErrorSuccessLog>;
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<ErrorSuccessLog> GetByStatus(bool sts)
{
#region cache header
ObjectsTemplate<ErrorSuccessLog> ErrorSuccessLogs = _cache["Get"] as ObjectsTemplate<ErrorSuccessLog>;
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<ErrorSuccessLog> GetByStatus(bool sts, DateTime frmDate, DateTime toDate)
{
#region cache header
ObjectsTemplate<ErrorSuccessLog> ErrorSuccessLogs = _cache["Get"] as ObjectsTemplate<ErrorSuccessLog>;
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<ErrorLogDetail> GetErrorLogDetails(ID nID)
{
#region cache header
ObjectsTemplate<ErrorLogDetail> ErrorSuccessLogs = _cache["GetErrorLogDetails"] as ObjectsTemplate<ErrorLogDetail>;
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<SuccessLogDetail> GetSuccessLogDetails(ID nID)
{
#region cache header
ObjectsTemplate<SuccessLogDetail> ErrorSuccessLogs = _cache["GetSuccessLogDetails"] as ObjectsTemplate<SuccessLogDetail>;
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<ErrorSuccessLog> Get();
ObjectsTemplate<ErrorLogDetail> GetErrorLogDetails(ID id);
ObjectsTemplate<SuccessLogDetail> GetSuccessLogDetails(ID id);
ObjectsTemplate<ErrorSuccessLog> GetByStatus(bool sts);
ObjectsTemplate<ErrorSuccessLog> 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