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; using System.Net; namespace Payroll.Service { 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.Integer, item.UserID.Integer, 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,ID nUserID) { return tc.ExecuteReader("SELECT * FROM PasswordHistory where userid=%n",nUserID.Integer); } #endregion #region Delete Function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM PasswordHistory WHERE PasswordHistoryID = %n", nID.Integer); } #endregion } }