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

175 lines
4.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ease.Core;
using Ease.Core.Model;
using System.Data;
namespace HRM.BO
{
#region Term
public class Term : BasicBaseObject
{
#region Constructor
#region Input validator
public string[] InputValidator()
{
string[] sErrorString = new string[2];
if (this.Code == "")
{
sErrorString[0] = "Code can not be empty";
sErrorString[1] = "Code";
return sErrorString;
}
if (this.Name == "")
{
sErrorString[0] = "Description can not be empty";
sErrorString[1] = "Description";
return sErrorString;
}
sErrorString = null;
return sErrorString;
}
#endregion
public Term()
{
//_code = string.Empty;
//_name = string.Empty;
//_termType = EnumTermType.Normal;
_status = EnumStatus.Active;
}
#endregion
#region Properties
public string Code { get; set; }
public string Name { get; set; }
public string NameInBangla { get; set; }
public EnumTermType TermType { get; set; }
public int payrolltypeid { get; set; }
//#region Service Factory ITermService : ITermService
//internal static ITermService Service
//{
// get { return Services.Factory.CreateService<ITermService>(typeof(ITermService)); }
//}
//#endregion
#endregion
//#region Functions
//public static Term Get(ID nID)
//{
// Term oTerm = null;
// #region Cache Header
// oTerm = (Term)_cache["Get", nID];
// if (oTerm != null)
// return oTerm;
// #endregion
// oTerm = Term.Service.Get(nID);
// #region Cache Footer
// _cache.Add(oTerm, "Get", nID);
// #endregion
// return oTerm;
//}
//public static List<Term> Get(EnumStatus status)
//{
// #region Cache Header
// List<Term> terms = _cache["Get",status] as List<Term>;
// if (terms != null)
// return terms;
// #endregion
// try
// {
// terms = Service.Get(status);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(terms, "Get",status);
// #endregion
// return terms;
//}
//public static List<Term> GetBySlabTerm(EnumTermType slabType)
//{
// #region Cache Header
// List<Term> terms = _cache["Get",slabType] as List<Term>;
// if (terms != null)
// return terms;
// #endregion
// try
// {
// terms = Service.GetBySlabTerm(slabType);
// }
// catch (ServiceException e)
// {
// throw new Exception(e.Message, e);
// }
// #region Cache Footer
// _cache.Add(terms, "Get",slabType);
// #endregion
// return terms;
//}
//public ID Save()
//{
// this.SetAuditTrailProperties();
// return Term.Service.Save(this);
//}
//public void Delete(ID id)
//{
// Term.Service.Delete(id);
//}
//#endregion
}
#endregion
#region ITerm Service
public interface ITermService
{
Term Get(int id);
List<Term> Get(EnumStatus status, int payrolltypeid);
List<Term> GetBySlabTerm(EnumTermType slabType, int payrolltypeid);
int Save(Term item);
void Delete(int id);
List<Term> GetAllTerm(int payrollTypeID, EnumStatus status, string code, string name);
}
#endregion
}