EchoTex_Payroll/HRM.BO/Bonus/Bonus.cs
2024-10-14 10:01:49 +06:00

205 lines
4.9 KiB
C#

using Ease.Core.Model;
using System;
using System.Collections.Generic;
using System.Data;
namespace HRM.BO
{
#region Bonus
public class Bonus : BasicBaseObject
{
#region Constructor
public Bonus()
{
_code = string.Empty;
_name = string.Empty;
_nameInBangla = string.Empty;
_status = EnumStatus.Active;
//#### _payrollTypeID = SystemInformation.CurrentSysInfo.PayrollTypeID;
}
#endregion
#region Propertiesyee
#region Code : string
private string _code;
public string Code
{
get { return _code; }
set { _code = value; }
}
#endregion
#region Name : string
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
#endregion
#region NameInBangla : string
private string _nameInBangla;
public string NameInBangla
{
get { return _nameInBangla; }
set { _nameInBangla = value; }
}
#endregion
#region PayrollTypeID : ID
private int _payrollTypeID;
public int PayrollTypeID
{
get { return _payrollTypeID; }
set { _payrollTypeID = value; }
}
#endregion
//#region Service Factory IBonusService : IBonusService
//internal static IBonusService Service
//{
// get { return Services.Factory.CreateService<IBonusService>(typeof(IBonusService)); }
//}
//#endregion
#endregion
//#region Functions
//public static Bonus Get(int nID)
//{
// Bonus oBonus = null;
// #region Cache Header
// oBonus = (Bonus)_cache["Get", nID];
// if (oBonus != null)
// return oBonus;
// #endregion
// oBonus = Bonus.Service.Get(nID);
// #region Cache Footer
// _cache.Add(oBonus, "Get", nID);
// #endregion
// return oBonus;
//}
//public static List<Bonus> Get(EnumStatus status)
//{
// #region Cache Header
// List<Bonus> bonus = _cache["Get",status] as List<Bonus>;
// if (bonus != null)
// return bonus;
// #endregion
// try
// {
// bonus = Service.Get(status, SystemInformation.CurrentSysInfo.PayrollTypeID.Integer);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(bonus, "Get",status);
// #endregion
// return bonus;
//}
//public static List<Bonus> GetParameterizedBonus(EnumStatus status)
//{
// #region Cache Header
// List<Bonus> bonus = _cache["Get", status] as List<Bonus>;
// if (bonus != null)
// return bonus;
// #endregion
// try
// {
// bonus = Service.GetParameterizedBonus(status,SystemInformation.CurrentSysInfo.PayrollTypeID.Integer);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(bonus, "Get", status);
// #endregion
// return bonus;
//}
//public static List<Bonus> GetActiveProccessedBonus(DateTime bonusMonth)
//{
// List<Bonus> bonuses = new List<Bonus>();
// try
// {
// bonuses = Service.GetActiveProccessedBonus(SystemInformation.CurrentSysInfo.PayrollTypeID.Integer, bonusMonth);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// return bonuses;
//}
//public int Save()
//{
// this.SetAuditTrailProperties();
// return Bonus.Service.Save(this);
//}
//public void Delete(int id)
//{
// Bonus.Service.Delete(id);
//}
//#endregion
}
#endregion
#region IBonus Service
public interface IBonusService
{
Bonus Get(int id);
List<Bonus> Get(EnumStatus status, int payrollTypeID);
List<Bonus> GetParameterizedBonus(EnumStatus status, int payrollTypeID);
List<Bonus> GetActiveProccessedBonus(int payrollTypeID, DateTime bonusMonth);
int Save(Bonus item);
void Delete(int id);
List<Bonus> GetAllBonus(int payrollTypeID, EnumStatus status, string code, string name);
DataSet GetCCWiseBonusSummary(DateTime bMonthDate, string bonus);
DataSet GetCCWiseBonus(DateTime bMonthDate, string bonus);
}
#endregion
}