224 lines
5.6 KiB
C#
224 lines
5.6 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
|
|
{
|
|
|
|
public enum EnumOpiAvgPayType
|
|
{
|
|
NONE = 0,
|
|
OT = 1,
|
|
Allowance = 2,
|
|
Deduction = 3
|
|
}
|
|
|
|
#region OpiItem
|
|
|
|
public class OpiItem : BasicBaseObject
|
|
{
|
|
|
|
#region Constructor
|
|
public OpiItem()
|
|
{
|
|
//_code = string.Empty;
|
|
//_name = string.Empty;
|
|
//_opiType = EnumOpiType.Provision;
|
|
Status = EnumStatus.Active;
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
public string Code { get; set; }
|
|
|
|
public string Name { get; set; }
|
|
|
|
public EnumOpiType OpiType { get; set; }
|
|
public int PayrolltypeID { get; set; }
|
|
|
|
//#region Service Factory IOpiItemService : IOpiItemService
|
|
//internal static IOpiItemService Service
|
|
//{
|
|
// get
|
|
// {
|
|
// return Services.Factory.CreateService<IOpiItemService>(typeof(IOpiItemService));
|
|
// }
|
|
//}
|
|
|
|
//#endregion
|
|
|
|
#endregion
|
|
|
|
#region Functions
|
|
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;
|
|
}
|
|
//public static OpiItem Get(ID nOpiItemID)
|
|
//{
|
|
// OpiItem oOpiItem = null;
|
|
// #region Cache Header
|
|
// oOpiItem = (OpiItem)_cache["Get", nOpiItemID];
|
|
// if (oOpiItem != null)
|
|
// return oOpiItem;
|
|
// #endregion
|
|
// oOpiItem = OpiItem.Service.Get(nOpiItemID);
|
|
// #region Cache Footer
|
|
// _cache.Add(oOpiItem, "Get", nOpiItemID);
|
|
// #endregion
|
|
// return oOpiItem;
|
|
//}
|
|
//internal static List<OpiItem> Get(string opiID)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<OpiItem> opiitems = _cache["Get", opiID] as List<OpiItem>;
|
|
// if (opiitems != null)
|
|
// return opiitems;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// opiitems = Service.Get(opiID);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(opiitems, "Get", opiID);
|
|
|
|
// #endregion
|
|
|
|
// return opiitems;
|
|
//}
|
|
//public static List<OpiItem> Get()
|
|
//{
|
|
// #region Cache Header
|
|
// List<OpiItem> opiItems = _cache["Get"] as List<OpiItem>;
|
|
// if (opiItems != null)
|
|
// return opiItems;
|
|
// #endregion
|
|
// try
|
|
// {
|
|
// opiItems = Service.Get();
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
// #region Cache Footer
|
|
// _cache.Add(opiItems, "Get");
|
|
// #endregion
|
|
// return opiItems;
|
|
//}
|
|
//public static List<OpiItem> Get(EnumStatus status)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<OpiItem> opiitems = _cache["Get", status] as List<OpiItem>;
|
|
// if (opiitems != null)
|
|
// return opiitems;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// opiitems = Service.Get(status);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(opiitems, "Get", status);
|
|
|
|
// #endregion
|
|
|
|
// return opiitems;
|
|
//}
|
|
//public static List<OpiItem> Get(EnumOpiType opiType, EnumStatus status)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<OpiItem> opiitems = _cache["Get", opiType, status] as List<OpiItem>;
|
|
// if (opiitems != null)
|
|
// return opiitems;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// opiitems = Service.Get(opiType, status);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(opiitems, "Get", opiType, status);
|
|
|
|
// #endregion
|
|
|
|
// return opiitems;
|
|
//}
|
|
//public ID Save()
|
|
//{
|
|
// this.SetAuditTrailProperties();
|
|
// return OpiItem.Service.Save(this);
|
|
//}
|
|
//public void Delete(ID id)
|
|
//{
|
|
// OpiItem.Service.Delete(id);
|
|
//}
|
|
#endregion
|
|
}
|
|
#endregion
|
|
|
|
#region IOpiItem Service
|
|
public interface IOpiItemService
|
|
{
|
|
OpiItem Get(int id);
|
|
//List<OpiItem> Get(string opiID);
|
|
List<OpiItem> Get(EnumStatus status, int payrolltypeid);
|
|
|
|
//List<OpiItem> Get();
|
|
//List<OpiItem> Get(EnumStatus status);
|
|
//List<OpiItem> Get(EnumOpiType opiType, EnumStatus status);
|
|
int Save(OpiItem item);
|
|
void Delete(int id);
|
|
}
|
|
#endregion
|
|
}
|