EchoTex_Payroll/HRM.DA/DA/HRBasic/NatureOfTrainingDA.cs
2024-10-14 10:01:49 +06:00

79 lines
2.3 KiB
C#

using System;
using System.Data;
using Ease.Core.DataAccess;
using HRM.BO;
namespace HRM.DA
{
#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, item.Code, item.Name, item.Sequence,
Convert.ToInt32(item.Status), item.CreatedBy, 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, item.ModifiedDate, item.ID);
}
#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, int nID)
{
return tc.ExecuteReader("SELECT * FROM NATUREOFTRAINING WHERE NATUREOFTRAININGID=%s", nID);
}
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, int nID)
{
tc.ExecuteNonQuery("DELETE FROM NATUREOFTRAINING WHERE NATUREOFTRAININGID=%n", nID);
}
#endregion
}
#endregion
}