175 lines
6.4 KiB
C#
175 lines
6.4 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 OrganogramResponsibility Service
|
|||
|
|
|||
|
// [Serializable]
|
|||
|
// public class OrganogramResponsibilityService : ServiceTemplate,IOrganogramResponsibility
|
|||
|
// {
|
|||
|
// #region Private functions and declaration
|
|||
|
// Cache _cache = new Cache(typeof(OrganogramResponsibility));
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// public OrganogramResponsibilityService()
|
|||
|
// { }
|
|||
|
|
|||
|
// private void MapObject(OrganogramResponsibility oOrganogramResponsibility, DataReader oReader)
|
|||
|
// {
|
|||
|
// base.SetObjectID(oOrganogramResponsibility, oReader.GetID("OrganogramResponsibilityID"));
|
|||
|
// oOrganogramResponsibility.NodeID = oReader.GetID("NodeID");
|
|||
|
// oOrganogramResponsibility.Responsibility = oReader.GetString("Responsibility");
|
|||
|
// oOrganogramResponsibility.IsPrimary = oReader.GetBoolean("IsPrimary").Value;
|
|||
|
// oOrganogramResponsibility.ModifiedBy = oReader.GetID("ModifiedBy");
|
|||
|
// oOrganogramResponsibility.ModifiedDate = oReader.GetDateTime("ModifiedDate");
|
|||
|
// this.SetObjectState(oOrganogramResponsibility, Ease.CoreV35.ObjectState.Saved);
|
|||
|
// }
|
|||
|
|
|||
|
// protected override T CreateObject<T>(DataReader oReader)
|
|||
|
// {
|
|||
|
// OrganogramResponsibility oOrganogramResponsibility = new OrganogramResponsibility();
|
|||
|
// MapObject(oOrganogramResponsibility, oReader);
|
|||
|
// return oOrganogramResponsibility as T;
|
|||
|
// }
|
|||
|
|
|||
|
// protected OrganogramResponsibility CreateObject(DataReader oReader)
|
|||
|
// {
|
|||
|
// OrganogramResponsibility oOrganogramResponsibility = new OrganogramResponsibility();
|
|||
|
// MapObject(oOrganogramResponsibility, oReader);
|
|||
|
// return oOrganogramResponsibility;
|
|||
|
// }
|
|||
|
|
|||
|
// #region Service implementation
|
|||
|
|
|||
|
// public ID Save(OrganogramResponsibility oOrganogramResponsibility)
|
|||
|
// {
|
|||
|
// TransactionContext tc = null;
|
|||
|
// try
|
|||
|
// {
|
|||
|
// tc = TransactionContext.Begin(true);
|
|||
|
// if (oOrganogramResponsibility.IsNew)
|
|||
|
// {
|
|||
|
// int id = tc.GenerateID("OrganogramResponsibility", "OrganogramResponsibilityID");
|
|||
|
// base.SetObjectID(oOrganogramResponsibility, ID.FromInteger(id));
|
|||
|
// OrganogramResponsibilityDA.Insert(tc, oOrganogramResponsibility);
|
|||
|
// }
|
|||
|
// else
|
|||
|
// {
|
|||
|
// OrganogramResponsibilityDA.Update(tc, oOrganogramResponsibility);
|
|||
|
// }
|
|||
|
// tc.End();
|
|||
|
|
|||
|
// return oOrganogramResponsibility.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);
|
|||
|
// OrganogramResponsibilityDA.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 OrganogramResponsibility Get(ID id)
|
|||
|
// {
|
|||
|
// OrganogramResponsibility oOrganogramResponsibility = new OrganogramResponsibility();
|
|||
|
// #region Cache Header
|
|||
|
// oOrganogramResponsibility = _cache["Get", id] as OrganogramResponsibility;
|
|||
|
// if (oOrganogramResponsibility != null)
|
|||
|
// return oOrganogramResponsibility;
|
|||
|
// #endregion
|
|||
|
// TransactionContext tc = null;
|
|||
|
// try
|
|||
|
// {
|
|||
|
// tc = TransactionContext.Begin();
|
|||
|
// DataReader oreader = new DataReader(OrganogramResponsibilityDA.Get(tc, id));
|
|||
|
// if (oreader.Read())
|
|||
|
// {
|
|||
|
// oOrganogramResponsibility = this.CreateObject<OrganogramResponsibility>(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(oOrganogramResponsibility, "Get", id);
|
|||
|
// #endregion
|
|||
|
// return oOrganogramResponsibility;
|
|||
|
// }
|
|||
|
|
|||
|
// public ObjectsTemplate<OrganogramResponsibility> Get()
|
|||
|
// {
|
|||
|
// #region Cache Header
|
|||
|
// ObjectsTemplate<OrganogramResponsibility> oOrganogramResponsibility = _cache["Get"] as ObjectsTemplate<OrganogramResponsibility>;
|
|||
|
// if (oOrganogramResponsibility != null)
|
|||
|
// return oOrganogramResponsibility;
|
|||
|
// #endregion
|
|||
|
// TransactionContext tc = null;
|
|||
|
// try
|
|||
|
// {
|
|||
|
// tc = TransactionContext.Begin();
|
|||
|
// DataReader dr = new DataReader(OrganogramResponsibilityDA.Get(tc));
|
|||
|
// oOrganogramResponsibility = this.CreateObjects<OrganogramResponsibility>(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(oOrganogramResponsibility, "Get");
|
|||
|
// #endregion
|
|||
|
// return oOrganogramResponsibility;
|
|||
|
// }
|
|||
|
|
|||
|
// #endregion
|
|||
|
|
|||
|
// }
|
|||
|
// #endregion
|
|||
|
//}
|