CEL_Payroll/Payroll.BO/Bonus/ProdBonusProcess.cs
2024-09-17 14:30:13 +06:00

405 lines
9.7 KiB
C#

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
{
[Serializable]
public class ProdBonusProcess : BasicBaseObject
{
#region Constructor
public ProdBonusProcess()
{
}
#endregion
#region Properties
#region SalaryMonth : DateTime
private DateTime _SalaryMonth;
public DateTime SalaryMonth
{
get { return _SalaryMonth; }
set { _SalaryMonth = value; }
}
#endregion
#region ProcessDate : DateTime
private DateTime _ProcessDate;
public DateTime ProcessDate
{
get { return _ProcessDate; }
set { _ProcessDate = value; }
}
#endregion
#region Property ProdBonusProcessEmps : ProdBonusProcessEmp
private ObjectsTemplate<ProdBonusProcessEmp> _ProdBonusProcessEmps;
public ObjectsTemplate<ProdBonusProcessEmp> ProdBonusProcessEmps
{
get
{
if (_ProdBonusProcessEmps == null && !this.ID.IsUnassigned && this.ID.Integer > 0)
{
_ProdBonusProcessEmps = Service.GetProdBonusProcessEmps(this.ID);
}
return _ProdBonusProcessEmps;
}
set
{
_ProdBonusProcessEmps = value;
}
}
#endregion
#region Property ProdBonusProcessItems : ProdBonusProcessItem
private ObjectsTemplate<ProdBonusProcessItem> _ProdBonusProcessItems;
public ObjectsTemplate<ProdBonusProcessItem> ProdBonusProcessItems
{
get
{
if (_ProdBonusProcessItems == null && !this.ID.IsUnassigned && this.ID.Integer > 0)
{
_ProdBonusProcessItems = Service.GetProdBonusProcessItems(this.ID);
}
return _ProdBonusProcessItems;
}
set
{
_ProdBonusProcessItems = value;
}
}
#endregion
#endregion
#region Functions
#region Get All
public static ObjectsTemplate<ProdBonusProcess> Get()
{
return ProdBonusProcess.Service.Get();
}
public static ProdBonusProcessEmp GetProdBonusEmp(ID Id, DateTime salaryMonth)
{
return ProdBonusProcess.Service.GetProdBonusEmp(Id,salaryMonth);
}
#endregion
#region Get By ID
public static ProdBonusProcess Get(ID id)
{
return ProdBonusProcess.Service.Get(id);
}
#endregion
#region Get By Status
public static ObjectsTemplate<ProdBonusProcess> Get(DateTime dtSalaryMonth)
{
return ProdBonusProcess.Service.Get(dtSalaryMonth);
}
public static DataSet GetDetailItems(DateTime dtSalaryMonth)
{
return ProdBonusProcess.Service.GetDetailItems(dtSalaryMonth);
}
#endregion
#region Get DataSet For Report
public static DataSet GetMontlyProdBonus(DateTime dBonusMonth)
{
DataSet ds = null;
try
{
ds = Service.GetMontlyProdBonus(dBonusMonth);
}
catch (Exception e)
{
throw new Exception(e.Message, e);
}
return ds;
}
public static DataSet GetProdBonusDetail(int designID)
{
DataSet ds = null;
try
{
ds = Service.GetProdBonusDetail(designID);
}
catch (Exception e)
{
throw new Exception(e.Message, e);
}
return ds;
}
public static DataSet EmpDesignWiseProdBonus(DateTime dBonusMonth)
{
DataSet ds = null;
try
{
ds = Service.EmpDesignWiseProdBonus(dBonusMonth);
}
catch (Exception e)
{
throw new Exception(e.Message, e);
}
return ds;
}
#endregion
#region Save
public static void Save(ObjectsTemplate<ProdBonusProcess> items)
{
foreach(ProdBonusProcess item in items)
item.SetAuditTrailProperties();
ProdBonusProcess.Service.Save(items);
}
#endregion
#region Delete
public static void Delete(ID id)
{
ProdBonusProcess.Service.Delete(id);
}
#endregion
#region Undo
public static void UndoProcess(ObjectsTemplate<ProdBonusProcess> oProdBonusProsses, ADParameter _ADParam, DateTime dtSalaryMonth)
{
ProdBonusProcess.Service.UndoProcess(oProdBonusProsses, _ADParam,dtSalaryMonth);
}
#endregion
#endregion
#region Service Factory IProdBonusProcess : IProdBonusProcess
internal static IProdBonusProcessService Service
{
get { return Services.Factory.CreateService<IProdBonusProcessService>(typeof(IProdBonusProcessService)); }
}
#endregion
}
[Serializable]
public class ProdBonusProcessEmp : BasicBaseObject
{
#region Constructor
public ProdBonusProcessEmp()
{
_description = string.Empty;
}
#endregion
#region Properties
#region ProdBonusProcessID : ID
private ID _ProdBonusProcessID;
public ID ProdBonusProcessID
{
get { return _ProdBonusProcessID; }
set { _ProdBonusProcessID = value; }
}
#endregion
#region EmployeeID : ID
private ID _EmployeeID;
public ID EmployeeID
{
get { return _EmployeeID; }
set { _EmployeeID = value; }
}
#endregion
#region Amount : Double
private double _Amount;
public double Amount
{
get { return _Amount; }
set { _Amount = value; }
}
#endregion
#region Description : string
private string _description;
public string Description
{
get { return _description; }
set { _description = value; }
}
#endregion
#endregion
}
[Serializable]
public class ProdBonusProcessItem : BasicBaseObject
{
#region Constructor
public ProdBonusProcessItem()
{
}
#endregion
#region Properties
#region ProdBonusProcessID : ID
private ID _ProdBonusProcessID;
public ID ProdBonusProcessID
{
get { return _ProdBonusProcessID; }
set { _ProdBonusProcessID = value; }
}
#endregion
#region ProdBonusSetupID : ID
private ID _ProdBonusSetupID;
public ID ProdBonusSetupID
{
get { return _ProdBonusSetupID; }
set { _ProdBonusSetupID = value; }
}
#endregion
#region ProdBonusLineID : ID
private ID _prodBonusLineID;
public ID ProdBonusLineID
{
get { return _prodBonusLineID; }
set { _prodBonusLineID = value; }
}
#endregion
#region EmployeeID : ID
private ID _EmployeeID;
public ID EmployeeID
{
get { return _EmployeeID; }
set { _EmployeeID = value; }
}
#endregion
#region Amount : double
private double _Amount;
public double Amount
{
get { return _Amount; }
set { _Amount = value; }
}
#endregion
#region OTHour : double
private double _oTHour;
public double OTHour
{
get { return _oTHour; }
set { _oTHour = value; }
}
#endregion
#region AchievePercent : double
private double _achievePercent;
public double AchievePercent
{
get { return _achievePercent; }
set { _achievePercent = value; }
}
#endregion
#region WorkingHour : double
private double _workingHour;
public double WorkingHour
{
get { return _workingHour; }
set { _workingHour = value; }
}
#endregion
#region WorkingHour : double
private string _description;
public string Description
{
get { return _description; }
set { _description = value; }
}
#endregion
#endregion
}
#region IProdBonusProcess Service
public interface IProdBonusProcessService
{
ObjectsTemplate<ProdBonusProcess> Get();
ObjectsTemplate<ProdBonusProcess> Get(DateTime dtSalaryMonth);
DataSet GetDetailItems(DateTime dtSalaryMonth);
ProdBonusProcess Get(ID id);
void Save(ObjectsTemplate<ProdBonusProcess> items);
void Delete(ID id);
ObjectsTemplate<ProdBonusProcessEmp> GetProdBonusProcessEmps(ID nProcessID);
ObjectsTemplate<ProdBonusProcessItem> GetProdBonusProcessItems(ID nProcessID);
DataSet GetMontlyProdBonus(DateTime dBonusMonth);
DataSet GetProdBonusDetail(int designID);
DataSet EmpDesignWiseProdBonus(DateTime dBonusMonth);
void UndoProcess(ObjectsTemplate<ProdBonusProcess> oProdBonusProsses, ADParameter _ADParam, DateTime dtSalaryMonth);
ProdBonusProcessEmp GetProdBonusEmp(ID Id, DateTime salaryMonth);
}
#endregion
}