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

45 lines
1.2 KiB
C#

using System;
using System.Data;
using Ease.Core.DataAccess;
using HRM.BO;
namespace HRM.DA
{
internal class PasswordHistoryDA
{
#region Insert Function
internal static void Insert(TransactionContext tc, PasswordHistory item)
{
item.CreatedDate = DateTime.Now;
tc.ExecuteNonQuery(
"INSERT INTO PasswordHistory(PasswordHistoryID, UserID, UserPassword, CreationDate) VALUES(%n, %n, %s, %D)",
item.ID, item.UserID, item.UserPassword, item.CreatedDate);
}
#endregion
#region Get Function
internal static IDataReader Get(TransactionContext tc)
{
return tc.ExecuteReader("SELECT * FROM PasswordHistory order by PasswordHistoryID");
}
internal static IDataReader Get(TransactionContext tc, int UserID)
{
return tc.ExecuteReader("SELECT * FROM PasswordHistory where userid=%n", UserID);
}
#endregion
#region Delete Function
internal static void Delete(TransactionContext tc, int ID)
{
tc.ExecuteNonQuery("DELETE FROM PasswordHistory WHERE PasswordHistoryID = %n", ID);
}
#endregion
}
}