using System.Data; using Ease.Core.DataAccess; using HRM.BO; namespace HRM.DA { #region class TrainingScStatusDA internal class TrainingScStatusDA { #region Insert Function(s) public static void Insert(TransactionContext tc, TrainingScheduleStatus item) { tc.ExecuteNonQuery( "INSERT INTO TRAININGSCHEDULESTATUS(TRAININGSCHEDULESTATUSID,Name, SEQUENCENO, STATUS, CREATEDBY, CREATIONDATE)" + " VALUES(%n, %s, %n, %n, %n, %d)", item.ID, item.Name, item.Sequence, item.Status, item.CreatedBy, item.CreatedDate); } #endregion #region Update Function(s) public static void Update(TransactionContext tc, TrainingScheduleStatus item) { tc.ExecuteNonQuery( "UPDATE TRAININGSCHEDULESTATUS SET Name=%s, SEQUENCENO=%n, status=%n, MODIFIEDBY=%n, MODIFIEDDATE=%d" + " WHERE TRAININGSCHEDULESTATUSID=%n", item.Name, item.Sequence, item.Status, item.ModifiedBy, item.ModifiedDate, item.ID); } #endregion #region Delete Function(s) public static void Delete(TransactionContext tc, int id) { tc.ExecuteNonQuery("DELETE FROM TRAININGSCHEDULESTATUS WHERE TRAININGSCHEDULESTATUSID=%n", id); } #endregion #region Get Function(s) public static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM TRAININGSCHEDULESTATUS"); } public static IDataReader Get(TransactionContext tc, int id) { return tc.ExecuteReader("SELECT * FROM TRAININGSCHEDULESTATUS WHERE TRAININGSCHEDULESTATUSID=%n", id); } public static IDataReader Get(TransactionContext tc, EnumStatus status) { return tc.ExecuteReader("SELECT * FROM TRAININGSCHEDULESTATUS Where Status=%n Order By SequenceNo", status); } #endregion } #endregion }