51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
using Ease.Core.DataAccess;
|
|
using System;
|
|
using System.Data;
|
|
using HRM.BO;
|
|
|
|
namespace HRM.DA
|
|
{
|
|
internal class BadLoginAttemptInfoDA
|
|
{
|
|
#region Constructor
|
|
|
|
private BadLoginAttemptInfoDA()
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Insert function
|
|
|
|
internal static void Insert(TransactionContext tc, BadLoginAttemptInfo item)
|
|
{
|
|
tc.ExecuteNonQuery("INSERT INTO BadLoginAttemptInfo(SlID, UserID, AttemptTime, PCNumber)" +
|
|
" VALUES(%n, %n, %D,%s)", item.ID, item.UserID, item.AttemptTime, item.PCNumber);
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
#region Get Function
|
|
|
|
internal static IDataReader Get(TransactionContext tc)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM BadLoginAttemptInfo Order By SequenceNO");
|
|
}
|
|
|
|
internal static IDataReader Get(TransactionContext tc, int ID)
|
|
{
|
|
return tc.ExecuteReader("SELECT * FROM BadLoginAttemptInfo Where BadLoginAttemptInfoID=%n", ID);
|
|
}
|
|
|
|
internal static IDataReader Get(TransactionContext tc, DateTime dtFrom, DateTime dtTo)
|
|
{
|
|
DateTime dtf = new DateTime(dtFrom.Year, dtFrom.Month, dtFrom.Day, 1, 0, 0);
|
|
DateTime dtt = new DateTime(dtTo.Year, dtTo.Month, dtTo.Day, 23, 59, 59);
|
|
return tc.ExecuteReader(
|
|
"select * from BadLoginAttemptInfo where AttemptTime between %D AND %D order by AttemptTime", dtf, dtt);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |