using System; using System.Data; using System.Linq; using System.Data.SqlClient; using System.Collections.Generic; using HRM.BO; using Ease.Core.DataAccess; namespace HRM.DA { internal class RemainderDA { #region Insert function internal static void Insert(TransactionContext tc, Reminder item) { string sql = SQLParser.MakeSQL("INSERT INTO Reminders(ReminderId, EmployeeId, Description, CreatedBy, CreationDate, ReminderStatus, Time)" + " VALUES(%n, %n, %s, %n, %d, %n, %D)", item.ID, item.EmployeeId, item.Description, item.CreatedBy, item.CreatedDate, item.ReminderStatus, item.Time); tc.ExecuteNonQuery(sql); } #endregion #region Update function internal static void Update(TransactionContext tc, Reminder item) { tc.ExecuteNonQuery( "UPDATE Reminders SET EmployeeId=%n, Description=%s, ModifiedBy=%n, ModifiedDate=%d, ReminderStatus=%n, Time=%D " + "WHERE ReminderId=%n", item.EmployeeId, item.Description, item.ModifiedBy, item.ModifiedDate, item.ReminderStatus, item.Time, item.ID); } #endregion #region Get Function internal static IDataReader Get(TransactionContext tc, int nID) { return tc.ExecuteReader("SELECT * FROM Reminders Where EmployeeId=%n", nID); } #endregion #region Delete function internal static void Delete(TransactionContext tc, int nID) { tc.ExecuteNonQuery("DELETE FROM Reminders Where ReminderId=%n", nID); } #endregion } }