EchoTex_Payroll/HRM.DA/DA/Budget/BudgetCostCenterDA.cs
2024-10-14 10:01:49 +06:00

46 lines
1.6 KiB
C#

using HRM.BO;
using Ease.Core.DataAccess;
using System;
using System.Data;
namespace HRM.DA
{
internal static class BudgetCostCenterDA
{
public static IDataReader Get(TransactionContext tc, int nID)
{
return tc.ExecuteReader("Select * from BudgetCostCenter where BudgetCostCenterID=%n", nID);
}
public static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("Select * from BudgetCostCenter");
}
public static IDataReader GetByBudgetId(TransactionContext tc, int nID)
{
return tc.ExecuteReader("Select * from BudgetCostCenter where BudgetID=%n", nID);
}
public static void Insert(TransactionContext tc, BudgetCostCenter item)
{
tc.ExecuteNonQuery(
"Insert into BudgetCostCenter(BudgetCostCenterID,CostCenterID,EmployeeID,FromMonth,Percentage,BudgetID) Values" +
"(%n,%n,%n,%d,%n,%n)", item.ID, item.CostCenterID, item.EmployeeID, item.FromMonth, item.Percentage,
item.BudgetID);
}
public static void Update(TransactionContext tc, BudgetCostCenter item)
{
tc.ExecuteNonQuery("Update BudgetCostCenter SET CostCenterID=%n,EmployeeID=%n,FromMonth=%d,Percentage=%n" +
"Where BudgetCostCenterID=%n", item.CostCenterID, item.EmployeeID, item.FromMonth,
item.Percentage, item.ID);
}
public static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("Delete from BudgetCostCenter where BudgetCostCenterID=%n", nID);
}
}
}