CEL_Payroll/Payroll.Service/Discipline Action Management/DA/ComplainDA.cs

77 lines
1.8 KiB
C#
Raw 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 ComplainDA
internal class ComplainDA
{
#region Constructor
private ComplainDA() { }
#endregion
#region Insert function
internal static void Insert(TransactionContext tc, Complain item)
{
tc.ExecuteNonQuery("INSERT INTO Complain(ComplainID, code, Description)" +
" VALUES(%n, %s, %s)", item.ID.Integer, item.Code, item.Description);
}
#endregion
#region Update function
internal static void Update(TransactionContext tc, Complain item)
{
tc.ExecuteNonQuery("UPDATE Complain SET code=%s, Description=%s" +
" WHERE ComplainID=%n", item.Code, item.Description,item.ID.Integer);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc, EnumStatus status)
{
return tc.ExecuteReader("SELECT * FROM Complain");
}
internal static IDataReader Get(TransactionContext tc, ID nID)
{
return tc.ExecuteReader("SELECT * FROM Complain WHERE ComplainID=%n", nID.Integer);
}
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM Complain");
}
#endregion
#region Delete function
internal static void Delete(TransactionContext tc, ID nID)
{
tc.ExecuteNonQuery("DELETE FROM [Complain] WHERE ComplainID=%n", nID.Integer);
}
#endregion
}
#endregion
}