62 lines
2.5 KiB
C#
62 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Ease.CoreV35.DataAccess;
|
|
using Payroll.BO;
|
|
using Ease.CoreV35.Model;
|
|
using System.Data;
|
|
|
|
namespace Payroll.Service
|
|
{
|
|
internal class GrossDefinationDA
|
|
{
|
|
#region Save Methods
|
|
internal static void Save(TransactionContext tc, GrossDefination oItem)
|
|
{
|
|
string strSQL = SQLParser.MakeSQL("INSERT INTO GrossDefination(GrossDefinationID, SalaryComponentType," +
|
|
" ComponentID, CreatedBy, CreatedDate, Quantity, BenefitDefinationType, Description)" +
|
|
" VALUES(%n ,%n, %n, %n, %d, %n, %n, %s)", oItem.ID.Integer, oItem.SalaryComponentType, oItem.ComponentID.Integer,
|
|
oItem.CreatedBy.Integer, oItem.CreatedDate, oItem.Quantity, oItem.BenefitDefinationType, oItem.Description);
|
|
tc.ExecuteNonQuery(strSQL);
|
|
}
|
|
#endregion Save Methods
|
|
|
|
#region Update Methods
|
|
|
|
internal static bool Update(TransactionContext tc, GrossDefination item)
|
|
{
|
|
string strSql = SQLParser.MakeSQL("UPDATE GrossDefination SET SalaryComponentType=%n, ComponentID=%d, ModifiedBy=%n, ModifiedDate=%D, Quantity=%n, BenefitDefinationType=%n, Description=%s"
|
|
+ "WHERE GrossDefinationID=%n", item.SalaryComponentType, item.ComponentID.Integer, item.ModifiedBy.Integer, item.ModifiedDate, item.Quantity, item.BenefitDefinationType, item.Description, item.ID.Integer);
|
|
tc.ExecuteNonQuery(strSql);
|
|
return true;
|
|
}
|
|
#endregion Update Methods
|
|
|
|
|
|
#region Get Methods
|
|
internal static IDataReader Get(TransactionContext tc, ID grossDefinationID)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM GrossDefination WHERE GrossDefinationID=%n", grossDefinationID.Integer);
|
|
}
|
|
|
|
internal static IDataReader Get(TransactionContext tc, EnumBenefitDefinationType type)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM GrossDefination WHERE BENEFITDEFINATIONTYPE=%n", type);
|
|
}
|
|
|
|
internal static IDataReader Get(TransactionContext tc)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM GrossDefination");
|
|
}
|
|
#endregion Get Methods
|
|
|
|
#region Delete Methods
|
|
internal static void Delete(TransactionContext tc, ID grossDefinationID)
|
|
{
|
|
tc.ExecuteNonQuery("DELETE FROM GrossDefination WHERE GrossDefinationID=%n", grossDefinationID.Integer);
|
|
}
|
|
#endregion Delete Methods
|
|
}
|
|
}
|