EchoTex_Payroll/HRM.DA/DA/RewardStatement/RewardStatementParameterIndividualDA.cs

90 lines
2.9 KiB
C#
Raw Normal View History

2024-10-14 10:01:49 +06:00
using HRM.BO;
using Ease.Core.DataAccess;
using Ease.Core.Model;
using System;
using System.Collections.Generic;
using System.Data;
namespace HRM.DA
{
#region RewardStatementParameterIndividualDA
public class RewardStatementParameterIndividualDA
{
#region Constructor
public RewardStatementParameterIndividualDA()
{
}
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, RewardStatementParameterIndividual oItem)
{
string strSQL = SQLParser.MakeSQL(
@"INSERT INTO RSParameterIndividual (RSParameterIndividualID, RewardStatementParameterID, EmployeeId, BasicAmount, FlatAmount, GCAmount) VALUES(%n, %n, %n, %n, %n, %n)",
oItem.ID, oItem.RewardStatementParameterID, oItem.EmployeeID, oItem.BasicAmount, oItem.FlatAmount,
oItem.GCAmount);
tc.ExecuteNonQuery(strSQL);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, RewardStatementParameterIndividual oItem)
{
tc.ExecuteNonQuery(
@"UPDATE RSParameterIndividual SET RSParameterIndividualID=%n, EmployeeId=%n, BasicAmount=%n, FlatAmount=%n, GCAmount=%n, WHERE RSParameterIndividualID=%n",
oItem.RewardStatementParameterID, oItem.EmployeeID, oItem.BasicAmount, oItem.FlatAmount, oItem.GCAmount,
oItem.ID);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM RSParameterIndividual");
}
internal static IDataReader Get(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM RSParameterIndividual WHERE RSParameterIndividualID =%n", nID);
}
internal static IDataReader Get(TransactionContext tc, int paramid, int employeeid)
{
return tc.ExecuteReader(
"SELECT TOP 1 * FROM RSParameterIndividual WHERE RewardStatementParameterID =%n AND EmployeeId=%n order by FromDate DESC",
paramid, employeeid);
}
internal static IDataReader GetByParameterID(TransactionContext tc, int nParameterID)
{
return tc.ExecuteReader("SELECT * FROM RSParameterIndividual WHERE RewardStatementParameterID =%n",
nParameterID);
}
#endregion
#region Delete function
internal static void DeletebyParamId(TransactionContext tc, int nParamID)
{
tc.ExecuteNonQuery("DELETE FROM RSParameterIndividual WHERE RewardStatementParameterID=%n", nParamID);
}
internal static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM RSParameterIndividual WHERE RewardStatementParameterIndividualID=%n", nID);
}
#endregion
}
#endregion
}