181 lines
6.4 KiB
C#
181 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 SalaryMonthlyDetail Service
|
|
// [Serializable]
|
|
// public class SalaryMonthlyDetailService : ServiceTemplate, ISalaryMonthlyDetailService
|
|
// {
|
|
// #region Private functions and declaration
|
|
// Cache _cache = new Cache(typeof(SalaryMonthlyDetail));
|
|
|
|
// #endregion
|
|
// public SalaryMonthlyDetailService() { }
|
|
|
|
// private void MapObject(SalaryMonthlyDetail oSalaryMonthlyDetail, DataReader oReader)
|
|
// {
|
|
// base.SetObjectID(oSalaryMonthlyDetail, oReader.GetID("SalaryMonthlyDetailID"));
|
|
// oSalaryMonthlyDetail.SalaryMonthlyID = oReader.GetID("SalaryMonthlyID");
|
|
// oSalaryMonthlyDetail.ItemID = oReader.GetID("ItemID");
|
|
// oSalaryMonthlyDetail.SupportID = oReader.GetID("SupportID");
|
|
// oSalaryMonthlyDetail.Description = oReader.GetString("Description");
|
|
// oSalaryMonthlyDetail.Position = oReader.GetInt32("Position").Value;
|
|
// oSalaryMonthlyDetail.CalculatedAmount = oReader.GetDouble("CalculatedAmount").Value;
|
|
// oSalaryMonthlyDetail.ChangedAmount = oReader.GetDouble("ChangedAmount").Value;
|
|
// oSalaryMonthlyDetail.ItemCode = (EnumSalaryItemCode)oReader.GetInt32("ItemCode").Value;
|
|
// this.SetObjectState(oSalaryMonthlyDetail, Ease.CoreV35.ObjectState.Saved);
|
|
// }
|
|
// protected override T CreateObject<T>(DataReader oReader)
|
|
// {
|
|
// SalaryMonthlyDetail oSalaryMonthlyDetail = new SalaryMonthlyDetail();
|
|
// MapObject(oSalaryMonthlyDetail, oReader);
|
|
// return oSalaryMonthlyDetail as T;
|
|
// }
|
|
// protected SalaryMonthlyDetail CreateObject(DataReader oReader)
|
|
// {
|
|
// SalaryMonthlyDetail oSalaryMonthlyDetail = new SalaryMonthlyDetail();
|
|
// MapObject(oSalaryMonthlyDetail, oReader);
|
|
// return oSalaryMonthlyDetail;
|
|
// }
|
|
// #region Service implementation
|
|
// public SalaryMonthlyDetail Get(ID id)
|
|
// {
|
|
// SalaryMonthlyDetail oSalaryMonthlyDetail = new SalaryMonthlyDetail();
|
|
// #region Cache Header
|
|
// oSalaryMonthlyDetail = _cache["Get", id] as SalaryMonthlyDetail;
|
|
// if (oSalaryMonthlyDetail != null)
|
|
// return oSalaryMonthlyDetail;
|
|
// #endregion
|
|
// TransactionContext tc = null;
|
|
// try
|
|
// {
|
|
// tc = TransactionContext.Begin();
|
|
// DataReader oreader = new DataReader(SalaryMonthlyDetailDA.Get(tc, id));
|
|
// if (oreader.Read())
|
|
// {
|
|
// oSalaryMonthlyDetail = this.CreateObject<SalaryMonthlyDetail>(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(oSalaryMonthlyDetail, "Get", id);
|
|
// #endregion
|
|
// return oSalaryMonthlyDetail;
|
|
// }
|
|
|
|
// public ObjectsTemplate<SalaryMonthlyDetail> Get()
|
|
// {
|
|
// #region Cache Header
|
|
|
|
// ObjectsTemplate<SalaryMonthlyDetail> salaryMonthlyDetails = _cache["Get"] as ObjectsTemplate<SalaryMonthlyDetail>;
|
|
// if (salaryMonthlyDetails != null)
|
|
// return salaryMonthlyDetails;
|
|
|
|
// #endregion
|
|
|
|
// TransactionContext tc = null;
|
|
// try
|
|
// {
|
|
// tc = TransactionContext.Begin();
|
|
|
|
// DataReader dr = new DataReader(SalaryMonthlyDA.Get(tc));
|
|
// salaryMonthlyDetails = this.CreateObjects<SalaryMonthlyDetail>(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(salaryMonthlyDetails, "Get");
|
|
|
|
// #endregion
|
|
|
|
// return salaryMonthlyDetails;
|
|
// }
|
|
|
|
|
|
// public ID Save(SalaryMonthlyDetail oSalaryMonthlyDetail)
|
|
// {
|
|
// TransactionContext tc = null;
|
|
// try
|
|
// {
|
|
// tc = TransactionContext.Begin(true);
|
|
// if (oSalaryMonthlyDetail.IsNew)
|
|
// {
|
|
// int id = tc.GenerateID("SalaryMonthlyDetail", "SalaryMonthlyDetailID");
|
|
// base.SetObjectID(oSalaryMonthlyDetail, ID.FromInteger(id));
|
|
// SalaryMonthlyDetailDA.Insert(tc, oSalaryMonthlyDetail);
|
|
// }
|
|
// else
|
|
// {
|
|
// SalaryMonthlyDetailDA.Update(tc, oSalaryMonthlyDetail);
|
|
// }
|
|
// tc.End();
|
|
// return oSalaryMonthlyDetail.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);
|
|
// SalaryMonthlyDetailDA.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
|
|
// }
|
|
// }
|
|
// #endregion
|
|
// }
|
|
// #endregion
|
|
//}
|