157 lines
4.1 KiB
C#
157 lines
4.1 KiB
C#
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region Class TrainingType
|
|
public class TrainingType : BasicBaseObject
|
|
{
|
|
#region constructor
|
|
public TrainingType()
|
|
{
|
|
Code = string.Empty;
|
|
Name = string.Empty;
|
|
Status = EnumStatus.Active;
|
|
}
|
|
|
|
#endregion
|
|
|
|
public string Code { get; set; }
|
|
public string Name { get; set; }
|
|
|
|
//#region Service Factory ITrainingTypeService : ITrainingTypeService
|
|
|
|
//internal static ITrainingTypeService Service
|
|
//{
|
|
// get { return Services.Factory.CreateService<ITrainingTypeService>(typeof(ITrainingTypeService)); }
|
|
//}
|
|
|
|
//#endregion
|
|
|
|
#endregion
|
|
|
|
//#region functions
|
|
//public static TrainingType Get(ID nID)
|
|
//{
|
|
// TrainingType oTrainingType = null;
|
|
// #region Cache Header
|
|
// oTrainingType = (TrainingType)_cache["Get", nID];
|
|
// if (oTrainingType != null)
|
|
// return oTrainingType;
|
|
// #endregion
|
|
// oTrainingType = TrainingType.Service.Get(nID);
|
|
// #region Cache Footer
|
|
// _cache.Add(oTrainingType, "Get", nID);
|
|
// #endregion
|
|
// return oTrainingType;
|
|
//}
|
|
|
|
//public static TrainingType Get(string sCode)
|
|
//{
|
|
// TrainingType oTrainingType = null;
|
|
// #region cache header
|
|
// oTrainingType = (TrainingType)_cache["Get", sCode];
|
|
// if (oTrainingType != null)
|
|
// return oTrainingType;
|
|
// #endregion
|
|
// oTrainingType = TrainingType.Service.Get(sCode);
|
|
|
|
// #region cache footer
|
|
// _cache.Add(oTrainingType,"Get", sCode);
|
|
// #endregion
|
|
// return oTrainingType;
|
|
//}
|
|
|
|
//public static List<TrainingType> Get()
|
|
//{
|
|
// #region cache header
|
|
// List<TrainingType> trainingTypes = _cache["Get"] as List<TrainingType>;
|
|
// if (trainingTypes != null)
|
|
// return trainingTypes;
|
|
// #endregion
|
|
// try
|
|
// {
|
|
// trainingTypes = Service.Get();
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region cache footer
|
|
// _cache.Add(trainingTypes, "Get");
|
|
// #endregion
|
|
|
|
// return trainingTypes;
|
|
//}
|
|
|
|
//public static List<TrainingType> Get(EnumStatus status)
|
|
//{
|
|
// #region Cache Header
|
|
|
|
// List<TrainingType> trainingTypes = _cache["Get", status] as List<TrainingType>;
|
|
// if (trainingTypes != null)
|
|
// return trainingTypes;
|
|
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// if (status == EnumStatus.Regardless)
|
|
// trainingTypes = Service.Get();
|
|
|
|
// else
|
|
// trainingTypes = Service.Get(status);
|
|
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new Exception(e.Message, e);
|
|
// }
|
|
|
|
// #region Cache Footer
|
|
|
|
// _cache.Add(trainingTypes, "Get", status);
|
|
|
|
// #endregion
|
|
|
|
// return trainingTypes;
|
|
//}
|
|
|
|
|
|
|
|
//public ID Save()
|
|
//{
|
|
// this.SetAuditTrailProperties();
|
|
// return TrainingType.Service.Save(this);
|
|
|
|
//}
|
|
|
|
//public void Delete(ID id)
|
|
//{
|
|
// TrainingType.Service.Delete(id);
|
|
|
|
//}
|
|
|
|
//#endregion
|
|
}
|
|
|
|
|
|
#region ITrainingType Service
|
|
public interface ITrainingTypeService
|
|
{
|
|
TrainingType Get(int id);
|
|
TrainingType Get(string sCode);
|
|
List<TrainingType> Get();
|
|
List<TrainingType> Get(EnumStatus status);
|
|
int Save(TrainingType item);
|
|
void Delete(int id);
|
|
|
|
}
|
|
#endregion
|
|
|
|
}
|