274 lines
6.6 KiB
C#
274 lines
6.6 KiB
C#
|
|
using Ease.Core.Model;
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region Grouping
|
|
public class Grouping : BasicBaseObject
|
|
{
|
|
|
|
#region Constructor
|
|
public Grouping()
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
|
|
public string Name { get; set; }
|
|
|
|
public string Description { get; set; }
|
|
|
|
public bool IsObjectGroup { get; set; }
|
|
|
|
public ObjectGrouping ObjectGrouping { get; set; }
|
|
|
|
public int ObjectGroupingID { get; set; }
|
|
|
|
//#region Functions
|
|
//public void Save()
|
|
//{
|
|
// try
|
|
// {
|
|
// Service.Save(this);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public void Delete()
|
|
//{
|
|
// try
|
|
// {
|
|
// Service.Delete(this.ID);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public void Delete(ID groupID)
|
|
//{
|
|
// try
|
|
// {
|
|
// Service.Delete(groupID);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
//}
|
|
|
|
//public Grouping Get(ID groupID)
|
|
//{
|
|
// Grouping item;
|
|
|
|
// #region CacheHeader
|
|
// item = (Grouping)_cache["Get", groupID];
|
|
// if (item != null)
|
|
// return item;
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// item = Service.Get(groupID);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
|
|
// #region CacheFooter
|
|
// _cache.Add(item, "Get", groupID);
|
|
// #endregion
|
|
|
|
// return item;
|
|
//}
|
|
//public Grouping Get()
|
|
//{
|
|
// Grouping item;
|
|
|
|
// #region CacheHeader
|
|
// item = (Grouping)_cache["Get", this.ID];
|
|
// if (item != null)
|
|
// return item;
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// item = Service.Get(this.ID);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
|
|
// #region CacheFooter
|
|
// _cache.Add(item, "Get", this.ID);
|
|
// #endregion
|
|
|
|
// return item;
|
|
//}
|
|
//#endregion
|
|
|
|
//#region Service Factory IGroupService : IGroupService
|
|
//internal static IGroupService Service
|
|
//{
|
|
// get { return (IGroupService)LocalFactory.Facory.CreateService(typeof(IGroupService)); }
|
|
//}
|
|
//#endregion
|
|
}
|
|
#endregion
|
|
|
|
#region Grouping Column
|
|
|
|
public class GroupingCollection : BasicBaseObject
|
|
{
|
|
|
|
#region Constructor
|
|
public GroupingCollection()
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
|
|
//#region Inherited Functions
|
|
//public void Add(Grouping item)
|
|
//{
|
|
// base.AddItem(item);
|
|
//}
|
|
|
|
//public Grouping this[ID id]
|
|
//{
|
|
// get { return (Grouping)base.GetItem(id); }
|
|
//}
|
|
|
|
//public Grouping this[Grouping item]
|
|
//{
|
|
// get { return (Grouping)base.GetItem(item); }
|
|
//}
|
|
|
|
//public Grouping this[int index]
|
|
//{
|
|
// get
|
|
// {
|
|
// return (Grouping)base.InnerList[index];
|
|
// }
|
|
//}
|
|
|
|
//public int GetItemIndex(ID id)
|
|
//{
|
|
// return base.GetIndex(id);
|
|
//}
|
|
|
|
//public int GetItemIndex(Grouping item)
|
|
//{
|
|
// return base.GetIndex(item.ID);
|
|
//}
|
|
|
|
//public void Remove(Grouping item)
|
|
//{
|
|
// base.RemoveItem(item);
|
|
//}
|
|
//#endregion
|
|
|
|
//#region Functions
|
|
//public static GroupingCollection Get()
|
|
//{
|
|
// GroupingCollection items;
|
|
|
|
// #region CacheHeader
|
|
// items = (GroupingCollection)_cache["Get"];
|
|
// if (items != null)
|
|
// return items;
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// items = Grouping.Service.Get();
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
|
|
// #region CacheFooter
|
|
// _cache.Add(items, "Get");
|
|
// #endregion
|
|
|
|
// return items;
|
|
//}
|
|
//public static GroupingCollection Get(bool isObjectGroup)
|
|
//{
|
|
// GroupingCollection items;
|
|
|
|
// #region CacheHeader
|
|
// items = (GroupingCollection)_cache["Get", isObjectGroup];
|
|
// if (items != null)
|
|
// return items;
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// items = Grouping.Service.Get(isObjectGroup);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
|
|
// #region CacheFooter
|
|
// _cache.Add(items, "Get", isObjectGroup);
|
|
// #endregion
|
|
|
|
// return items;
|
|
//}
|
|
|
|
//public static GroupingCollection GetByParent(ID parentID, bool isObjectGroup)
|
|
//{
|
|
// GroupingCollection items;
|
|
|
|
// #region CacheHeader
|
|
// items = (GroupingCollection)_cache["Get", parentID, isObjectGroup];
|
|
// if (items != null)
|
|
// return items;
|
|
// #endregion
|
|
|
|
// try
|
|
// {
|
|
// items = Grouping.Service.GetByParent(parentID, isObjectGroup);
|
|
// }
|
|
// catch (ServiceException e)
|
|
// {
|
|
// throw new ServiceException(e.Message, e);
|
|
// }
|
|
|
|
// #region CacheFooter
|
|
// _cache.Add(items, "Get", parentID, isObjectGroup);
|
|
// #endregion
|
|
|
|
// return items;
|
|
//}
|
|
//#endregion
|
|
}
|
|
#endregion
|
|
|
|
//#region Interface
|
|
//public interface IGroupService
|
|
//{
|
|
// void Save(Grouping group);
|
|
// void Delete(ID groupID);
|
|
// Grouping Get(ID groupID);
|
|
// GroupingCollection Get();
|
|
// GroupingCollection Get(bool isObjectGroup);
|
|
// GroupingCollection GetByParent(ID parentID, bool isObjectGroup);
|
|
//}
|
|
//#endregion
|
|
}
|