176 lines
6.0 KiB
C#
176 lines
6.0 KiB
C#
//using System;
|
|
//using System.Data;
|
|
//using System.Linq;
|
|
//using Ease.CoreV35;
|
|
//using Ease.CoreV35.Model;
|
|
//using Ease.CoreV35.DataAccess;
|
|
//using System.Collections.Generic;
|
|
//using Payroll.BO;
|
|
//using Ease.CoreV35.Caching;
|
|
|
|
//namespace Payroll.Service
|
|
//{
|
|
|
|
// #region OrganogramAuthority Service
|
|
|
|
// [Serializable]
|
|
// public class OrganogramAuthorityService : ServiceTemplate, IOrganogramAuthorityService
|
|
// {
|
|
|
|
// #region Private functions and declaration
|
|
// Cache _cache = new Cache(typeof(OrganogramAuthority));
|
|
|
|
// #endregion
|
|
|
|
// public OrganogramAuthorityService()
|
|
// { }
|
|
|
|
// private void MapObject(OrganogramAuthority oOrganAuthority, DataReader oReader)
|
|
// {
|
|
// base.SetObjectID(oOrganAuthority, oReader.GetID("OrganogramAuthorityID"));
|
|
// oOrganAuthority.NodeID = oReader.GetID("NodeID");
|
|
// oOrganAuthority.AuthorityType = (EnumAuthorityType)oReader.GetInt32("AuthorityType").Value;
|
|
// oOrganAuthority.ChildNodeID = oReader.GetID("ChildNodeID");
|
|
// oOrganAuthority.ModifiedBy = oReader.GetID("ModifiedBy");
|
|
// oOrganAuthority.ModifiedDate = oReader.GetDateTime("ModifiedDate");
|
|
// this.SetObjectState(oOrganAuthority, Ease.CoreV35.ObjectState.Saved);
|
|
// }
|
|
|
|
// protected override T CreateObject<T>(DataReader oReader)
|
|
// {
|
|
// OrganogramAuthority oOrganAuthority = new OrganogramAuthority();
|
|
// MapObject(oOrganAuthority, oReader);
|
|
// return oOrganAuthority as T;
|
|
// }
|
|
|
|
// protected OrganogramAuthority CreateObject(DataReader oReader)
|
|
// {
|
|
// OrganogramAuthority oOrganAuthority = new OrganogramAuthority();
|
|
// MapObject(oOrganAuthority, oReader);
|
|
// return oOrganAuthority;
|
|
// }
|
|
|
|
// #region Service implementation
|
|
|
|
// public ID Save(OrganogramAuthority oOrganAuthority)
|
|
// {
|
|
// TransactionContext tc = null;
|
|
// try
|
|
// {
|
|
// tc = TransactionContext.Begin(true);
|
|
// if (oOrganAuthority.IsNew)
|
|
// {
|
|
// int id = tc.GenerateID("OrganogramAuthority", "OrganogramAuthorityID");
|
|
// base.SetObjectID(oOrganAuthority, ID.FromInteger(id));
|
|
// OrganogramAuthorityDA.Insert(tc, oOrganAuthority);
|
|
// }
|
|
// else
|
|
// {
|
|
// OrganogramAuthorityDA.Update(tc, oOrganAuthority);
|
|
// }
|
|
// tc.End();
|
|
|
|
// return oOrganAuthority.ID;
|
|
// }
|
|
// catch (Exception e)
|
|
// {
|
|
// #region Handle Exception
|
|
// if (tc != null)
|
|
// tc.HandleError();
|
|
// ExceptionLog.Write(e);
|
|
// throw new ServiceException(e.Message, e);
|
|
// #endregion
|
|
// }
|
|
// }
|
|
|
|
// public void Delete(ID id)
|
|
// {
|
|
// TransactionContext tc = null;
|
|
// try
|
|
// {
|
|
// tc = TransactionContext.Begin(true);
|
|
// OrganogramAuthorityDA.Delete(tc, id);
|
|
// tc.End();
|
|
// }
|
|
// catch (Exception e)
|
|
// {
|
|
// #region Handle Exception
|
|
// if (tc != null)
|
|
// tc.HandleError();
|
|
// ExceptionLog.Write(e);
|
|
// throw new ServiceException(e.Message, e);
|
|
// #endregion
|
|
// }
|
|
// }
|
|
|
|
// public OrganogramAuthority Get(ID id)
|
|
// {
|
|
// OrganogramAuthority oOrganAuthority = new OrganogramAuthority();
|
|
// #region Cache Header
|
|
// oOrganAuthority = _cache["Get", id] as OrganogramAuthority;
|
|
// if (oOrganAuthority != null)
|
|
// return oOrganAuthority;
|
|
// #endregion
|
|
// TransactionContext tc = null;
|
|
// try
|
|
// {
|
|
// tc = TransactionContext.Begin();
|
|
// DataReader oreader = new DataReader(OrganogramAuthorityDA.Get(tc, id));
|
|
// if (oreader.Read())
|
|
// {
|
|
// oOrganAuthority = this.CreateObject<OrganogramAuthority>(oreader);
|
|
// }
|
|
// oreader.Close();
|
|
// tc.End();
|
|
// }
|
|
// catch (Exception e)
|
|
// {
|
|
// #region Handle Exception
|
|
// if (tc != null)
|
|
// tc.HandleError();
|
|
// ExceptionLog.Write(e);
|
|
// throw new ServiceException(e.Message, e);
|
|
// #endregion
|
|
// }
|
|
// #region Cache Footer
|
|
// _cache.Add(oOrganAuthority, "Get", id);
|
|
// #endregion
|
|
// return oOrganAuthority;
|
|
// }
|
|
|
|
// public ObjectsTemplate<OrganogramAuthority> Get()
|
|
// {
|
|
// #region Cache Header
|
|
// ObjectsTemplate<OrganogramAuthority> oOrganAuthority = _cache["Get"] as ObjectsTemplate<OrganogramAuthority>;
|
|
// if (oOrganAuthority != null)
|
|
// return oOrganAuthority;
|
|
// #endregion
|
|
// TransactionContext tc = null;
|
|
// try
|
|
// {
|
|
// tc = TransactionContext.Begin();
|
|
// DataReader dr = new DataReader(OrganogramAuthorityDA.Get(tc));
|
|
// oOrganAuthority = this.CreateObjects<OrganogramAuthority>(dr);
|
|
// dr.Close();
|
|
// tc.End();
|
|
// }
|
|
// catch (Exception e)
|
|
// {
|
|
// #region Handle Exception
|
|
// if (tc != null)
|
|
// tc.HandleError();
|
|
// ExceptionLog.Write(e);
|
|
// throw new ServiceException(e.Message, e);
|
|
// #endregion
|
|
// }
|
|
// #region Cache Footer
|
|
// _cache.Add(oOrganAuthority, "Get");
|
|
// #endregion
|
|
// return oOrganAuthority;
|
|
// }
|
|
|
|
// #endregion
|
|
// }
|
|
// #endregion
|
|
//}
|