using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Ease.CoreV35.DataAccess;
using Ease.Core.DataAccess;
using HRM.BO;

namespace HRM.DA
{
    internal class PMSExceptionDA
    {
        #region Constructor

        private PMSExceptionDA()
        {
        }

        #endregion


        #region Insert

        internal static void Insert(TransactionContext tc, PMSException oPMSException)
        {
            tc.ExecuteNonQuery(
                "INSERT INTO PMSException(PMSExceptionID, PMPYearID, EmployeeID, TierID,CreatedBy, CreationDate)" +
                " VALUES(%n, %n, %n,%n,%n, %d)",
                oPMSException.ID, oPMSException.PMPYearID, oPMSException.EmployeeID, oPMSException.TireID,
                oPMSException.CreatedBy, oPMSException.CreatedDate);
        }

        #endregion

        #region Update

        internal static void Update(TransactionContext tc, PMSException oPMSException)
        {
            tc.ExecuteNonQuery(
                "UPDATE PMSException SET PMPYearID=%n, EmployeeID=%n, TierID = %n,ModifiedBy=%n, ModifiedDate=%d WHERE PMSExceptionID=%n)"
                , oPMSException.PMPYearID, oPMSException.EmployeeID, oPMSException.TireID, oPMSException.ModifiedBy,
                oPMSException.ModifiedDate, oPMSException.ID);
        }

        #endregion

        #region Delete

        internal static void Delete(TransactionContext tc, int id)
        {
            tc.ExecuteNonQuery("DELETE FROM PMSException Where PMSExceptionID=%n", id);
        }

        #endregion

        #region Get

        internal static IDataReader Get(TransactionContext tc, int nPMPYearID)
        {
            return tc.ExecuteReader("SELECT * FROM PMSException where PMPYearID=%n", nPMPYearID);
        }

        internal static IDataReader Get(TransactionContext tc, int nPMPYearID, int nEmpID)
        {
            return tc.ExecuteReader("SELECT * FROM PMSException where PMPYearID=%n And EmployeeID = %n", nPMPYearID,
                nEmpID);
        }

        #endregion
    }
}