CEL_Payroll/Payroll.BO/OPI/PremiumProcess.cs

147 lines
3.6 KiB
C#
Raw Permalink 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;
using System.Data;
namespace Payroll.BO
{
#region Base Object
public class PremiumProcess : BasicBaseObject
{
public PremiumProcess()
{
}
#region Properties
#region Month
private DateTime _month;
public DateTime Month
{
get { return _month; }
set { _month = value; }
}
#endregion
#region Factor
private double _factor;
public double Factor
{
get { return _factor; }
set { _factor = value; }
}
#endregion
#region PremierRate
private double _premierRate;
public double PremierRate
{
get { return _premierRate; }
set { _premierRate = value; }
}
#endregion
#region PremiumProcessDetail
private ObjectsTemplate<PremiumProcessDetail> _PremiumProcessDetails;
public ObjectsTemplate<PremiumProcessDetail> PremiumProcessDetails
{
get
{
if (_PremiumProcessDetails == null)
{
_PremiumProcessDetails = new ObjectsTemplate<PremiumProcessDetail>();
if (!this.ID.IsUnassigned)
_PremiumProcessDetails = PremiumProcessDetail.GetDetails(this.ID);
}
return _PremiumProcessDetails;
}
set { _PremiumProcessDetails = value; }
}
#endregion
#endregion
#region Service Factory IPremiumProcessService : IPremiumProcessService
internal static IPremiumProcessService Service
{
get
{
return Services.Factory.CreateService<IPremiumProcessService>(typeof(IPremiumProcessService));
}
}
#endregion
#region Functions
public static PremiumProcess Get(ID nPremiumProcessID)
{
return PremiumProcess.Service.Get(nPremiumProcessID);
}
public static ObjectsTemplate<PremiumProcess> Get()
{
return PremiumProcess.Service.Get();
}
public static PremiumProcess GetByMonth(DateTime month)
{
return PremiumProcess.Service.GetByMonth(month);
}
public ID Save()
{
this.SetAuditTrailProperties();
return PremiumProcess.Service.Save(this);
}
public void Delete()
{
PremiumProcess.Service.Delete(this.ID);
}
public static DataTable GetGroupInsurance(DateTime dtCur)
{
DataTable dataTableOfEmployee = new DataTable("Employee");
try
{
dataTableOfEmployee = Service.GetGroupInsurance(dtCur);
}
catch (ServiceException e)
{
throw new Exception(e.Message, e);
}
return dataTableOfEmployee;
}
#endregion
}
#endregion
#region IPremiumProcess Service
public interface IPremiumProcessService
{
#region Base's Functions Definations
PremiumProcess Get(ID id);
ObjectsTemplate<PremiumProcess> Get();
PremiumProcess GetByMonth(DateTime month);
ID Save(PremiumProcess item);
void Delete(ID id);
DataTable GetGroupInsurance(DateTime dtCur);
#endregion
}
#endregion
}