181 lines
4.8 KiB
C#
181 lines
4.8 KiB
C#
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region OGPositionType
|
|
public class OGPositionType : BasicBaseObject
|
|
{
|
|
#region Constructor
|
|
|
|
public OGPositionType()
|
|
{
|
|
//_globalID = string.Empty;
|
|
Value = string.Empty;
|
|
Code = string.Empty;
|
|
Name = string.Empty;
|
|
IsUniquePosition = false;
|
|
PositionType = EnumOGPositionType.Others;
|
|
this.Status = EnumStatus.Active;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Properties
|
|
|
|
|
|
public string Value { get; set; }
|
|
public string Code { get; set; }
|
|
public string Name { get; set; }
|
|
public bool IsUniquePosition { get; set; }
|
|
public EnumOGPositionType PositionType { get; set; }
|
|
|
|
|
|
//#region Service Factory IOGPositionTypeService : IOGPositionTypeService
|
|
|
|
//internal static IOGPositionTypeService Service
|
|
//{
|
|
// get { return Services.Factory.CreateService<IOGPositionTypeService>(typeof(IOGPositionTypeService)); }
|
|
//}
|
|
|
|
//#endregion
|
|
|
|
#endregion
|
|
|
|
//#region Functions
|
|
|
|
//public ID Save()
|
|
//{
|
|
// try
|
|
// {
|
|
// if (this.IsNew)
|
|
// {
|
|
// if (IsExists(this.Code))
|
|
// {
|
|
// throw new ServiceException("Code already exists");
|
|
// }
|
|
// }
|
|
// base.SetAuditTrailProperties();
|
|
// return OGPositionType.Service.Save(this);
|
|
// }
|
|
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public void Delete(ID id)
|
|
//{
|
|
// OGPositionType.Service.Delete(id);
|
|
//}
|
|
|
|
//public static OGPositionType Get(ID nID)
|
|
//{
|
|
// OGPositionType oPositionType = null;
|
|
// #region Cache Header
|
|
// oPositionType = (OGPositionType)_cache["Get", nID];
|
|
// if (oPositionType != null)
|
|
// return oPositionType;
|
|
// #endregion
|
|
// oPositionType = OGPositionType.Service.Get(nID);
|
|
// #region Cache Footer
|
|
// _cache.Add(oPositionType, "Get", nID);
|
|
// #endregion
|
|
// return oPositionType;
|
|
//}
|
|
|
|
//public static List<OGPositionType> Get()
|
|
//{
|
|
// #region Cache Header
|
|
// List<OGPositionType> oPositionTypes = _cache["Get"] as List<OGPositionType>;
|
|
// if (oPositionTypes != null)
|
|
// return oPositionTypes;
|
|
// #endregion
|
|
// try
|
|
// {
|
|
// oPositionTypes = Service.Get();
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
// #region Cache Footer
|
|
// _cache.Add(oPositionTypes, "Get");
|
|
// #endregion
|
|
// return oPositionTypes;
|
|
//}
|
|
|
|
//public static List<OGPositionType> Get(EnumStatus status)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<OGPositionType> oGPositionTypes = _cache["Get", status] as List<OGPositionType>;
|
|
// if (oGPositionTypes != null)
|
|
// return oGPositionTypes;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// oGPositionTypes = Service.Get(status);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(oGPositionTypes, "Get", status);
|
|
|
|
// #endregion
|
|
|
|
// return oGPositionTypes;
|
|
//}
|
|
|
|
//private bool IsExists(string Code)
|
|
//{
|
|
// try
|
|
// {
|
|
// bool isExists = false;
|
|
// if (this.Code != null && this.Value.ToUpper() != Code.ToUpper())
|
|
// {
|
|
// isExists = OGPositionType.Service.IsExists(Code);
|
|
// }
|
|
// return isExists;
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
|
|
//#endregion
|
|
}
|
|
#endregion
|
|
|
|
#region IOGPositionType Service
|
|
|
|
public interface IOGPositionTypeService
|
|
{
|
|
int Save(OGPositionType item);
|
|
void Delete(int id);
|
|
OGPositionType Get(int id);
|
|
List<OGPositionType> Get();
|
|
List<OGPositionType> Get(EnumStatus status);
|
|
bool IsExists(string Code);
|
|
string GetNextCode();
|
|
List<OGPositionType> Get(EnumStatus status,int payrollTypeID);
|
|
List<OGPositionType> Get(EnumOGPositionType positionType);
|
|
}
|
|
|
|
#endregion
|
|
}
|