EchoTex_Payroll/HRM.DA/DA/Budget/BudgetDepartmentDA.cs

66 lines
1.7 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
{
#region BudgetDepartmentDA
internal class BudgetDepartmentDA
{
#region Constructor
private BudgetDepartmentDA()
{
}
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, BudgetDepartment item)
{
tc.ExecuteNonQuery("INSERT INTO BudgetDepartment(BudgetDepartmentID, BudgetID, DepartmentID)" +
" VALUES(%n, %n, %n)", item.ID, item.BudgetudID, item.DepartmentID);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, BudgetDepartment item)
{
tc.ExecuteNonQuery("UPDATE BudgetDepartment SET BudgetID=%n, DepartmentID=%n" +
" WHERE BudgetDepartmentID=%n", item.BudgetudID, item.DepartmentID, item.ID);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM BudgetDepartment WHERE BudgetDepartmentID=%n", nID);
}
internal static IDataReader GetByBudgetId(TransactionContext tc, int nID)
{
return tc.ExecuteReader("SELECT * FROM BudgetDepartment WHERE BudgetID=%n", nID);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, int nID)
{
tc.ExecuteNonQuery("DELETE FROM BudgetDepartment WHERE BudgetDepartmentID=%n", nID);
}
#endregion
}
#endregion
}