using System; using Payroll.BO; using System.Data; using Ease.CoreV35.Model; using Ease.CoreV35.DataAccess; namespace Payroll.Service { #region class NatureOfTrainingDA internal class NatureOfTrainingDA { #region constructor public NatureOfTrainingDA() { } #endregion #region insert function internal static void Insert(TransactionContext tc, NatureOfTraining item) { tc.ExecuteNonQuery("INSERT INTO NATUREOFTRAINING(NATUREOFTRAININGID, CODE, NAME, SEQUENCENO, STATUS, CREATEDBY, CREATIONDATE)" + "VALUES(%n, %s, %s, %n, %n, %n, %d)", item.ID.Integer, item.Code, item.Name, item.Sequence, Convert.ToInt32(item.Status), item.CreatedBy.Integer, item.CreatedDate); } #endregion #region update function internal static void Update(TransactionContext tc, NatureOfTraining item) { tc.ExecuteNonQuery("UPDATE NATUREOFTRAINING SET code=%s, NAME=%s, sequencenO=%n, status=%n, modifiedby=%n, modifieddate=%d" + "WHERE NATUREOFTRAININGID=%n", item.Code, item.Name, item.Sequence, item.Status, item.ModifiedBy.Integer, item.ModifiedDate, item.ID.Integer); } #endregion #region get functions internal static IDataReader Get(TransactionContext tc) { return tc.ExecuteReader("SELECT * FROM NATUREOFTRAINING"); } internal static IDataReader Get(TransactionContext tc, EnumStatus status) { return tc.ExecuteReader("SELECT * FROM NATUREOFTRAINING Where Status=%n Order By SequenceNo", status); } internal static IDataReader Get(TransactionContext tc, ID nID) { return tc.ExecuteReader("SELECT * FROM NATUREOFTRAINING WHERE NATUREOFTRAININGID=%s", nID.Integer); } internal static IDataReader Get(TransactionContext tc, string sCode) { return tc.ExecuteReader("SELECT * NATUREOFTRAINING WHERE CODE=%s", sCode); } #endregion #region delete function internal static void Delete(TransactionContext tc, ID nID) { tc.ExecuteNonQuery("DELETE FROM [NATUREOFTRAINING] WHERE NATUREOFTRAININGID=%n", nID.Integer); } #endregion } #endregion }