CEL_Payroll/Payroll.Service/Budget/DA/BudgetDepartmentDA.cs

70 lines
1.8 KiB
C#
Raw Permalink Normal View History

2024-09-17 14:30:13 +06:00
using System;
using Payroll.BO;
using System.Data;
using System.Linq;
using Ease.CoreV35.Model;
using System.Data.SqlClient;
using Ease.CoreV35.DataAccess;
using System.Collections.Generic;
using Ease.CoreV35.DataAccess.SQL;
namespace Payroll.Service
{
#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.Integer, item.BudgetudID.Integer, item.DepartmentID.Integer);
}
#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.Integer);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc, ID nID)
{
return tc.ExecuteReader("SELECT * FROM BudgetDepartment WHERE BudgetDepartmentID=%n", nID.Integer);
}
internal static IDataReader Get(TransactionContext tc,int nID)
{
return tc.ExecuteReader("SELECT * FROM BudgetDepartment WHERE BudgetID=%n",nID);
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, ID nID)
{
tc.ExecuteNonQuery("DELETE FROM [BudgetDepartment] WHERE BudgetDepartmentID=%n", nID.Integer);
}
#endregion
}
#endregion
}