EchoTex_Payroll/HRM.DA/DA/Budget/BudgetGradeDA.cs

45 lines
1.5 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
using HRM.BO;
using Ease.Core.DataAccess;
using System;
using System.Data;
namespace HRM.DA
{
internal static class BudgetGradeDA
{
public static IDataReader Get(TransactionContext tc, int nID)
{
return tc.ExecuteReader("Select * from BudgetGrade where BudgetGradeID=%n", nID);
}
public static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("Select * from BudgetGrade");
}
public static IDataReader GetByBudgetId(TransactionContext tc, int nID)
{
return tc.ExecuteReader("Select * from BudgetGrade where BudgetID=%n", nID);
}
public static void Insert(TransactionContext tc, BudgetGrade item)
{
tc.ExecuteNonQuery(
"Insert into BudgetGrade(BudgetGradeID,BudgetID,ChangedPercentage,FixedAmount,GradeID) Values" +
"(%n,%n,%n,%n,%n)", item.ID, item.BudgetID, item.ChangedPercentage, item.FixedAmount, item.GradeID);
}
public static void Update(TransactionContext tc, BudgetGrade item)
{
tc.ExecuteNonQuery("Update BudgetGrade SET BudgetID=%n,ChangedPercentage=%n,FixedAmount=%n,GradeID=%n" +
"Where BudgetGradeID=%n", item.BudgetID, item.ChangedPercentage, item.FixedAmount,
item.GradeID, item.ID);
}
public static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("Delete from BudgetGrade where BudgetGradeID=%n", nID);
}
}
}